Skip to content

Commit

Permalink
Update W16
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasx committed Jan 26, 2025
1 parent e2c3043 commit 8877516
Show file tree
Hide file tree
Showing 15 changed files with 583 additions and 27 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions curriculum/week16/assets/code/Anna.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
console.log("Anna");

export const film = Object.freeze({
name: "Intimacy",
director: "Verónica Fernández",
releaseDate: 2022,
genre: ["Crime", "Drama"]
})
26 changes: 26 additions & 0 deletions curriculum/week16/assets/code/abed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use strict";


let products = [
{
name: "macbook pro",
category: "laptop",
price: 1200,
brand: "Apple",
image: ""
},
{
name: "iPhone 13 Pro Max",
category: "smartphone",
price: 1000,
brand: "Apple",
image: "https://external.webstorage.gr/mmimages/image/51/65/7/93/1641088-264x264-800x800-96x96-560x560.jpg"
},
{
name: "Logitech MX Keys",
category: "gadget",
price: 120,
brand: "Logitech",
image:"https://resource.logitech.com/w_692,c_lpad,ar_4:3,q_auto,f_auto,dpr_1.0/d_transparent.gif/content/dam/logitech/en/products/keyboards/mx-keys-s/product-gallery/graphite/mx-keys-s-keyboard-top-view-graphite-us-intl.png?v=1"
}]

57 changes: 57 additions & 0 deletions curriculum/week16/assets/code/alex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// //console.log ("Alex");
// //console.log ("======================");
// const str = "Hello World";
// const str2 = str;
// const num = 99;
// const num2 = num;

// //console.log(str,str2);
// //console.log(num,num2);

// const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
// const arr2 = arr.unshift(0);

// //console.log(arr, arr2);

// const obj = {
// valuex: 1,
// valuey: 2,
// valuez: 3,
// }

// const obj2 = obj;
// obj2.valuex = 0;

// const test = function (obj, obj2) {
// //console.log(obj.valuex, obj2.valuex);
// }

// const test2 = test;

// test(obj, obj2);
// test2(obj, obj2);

//console.log ("======================");

const howOldHelper = function () {
const currentYear = new Date().getFullYear();
return currentYear - this.releaseDate;
}

export const film = Object.freeze( {
name: "The Matrix",
director: "Wachowski",
releaseDate: 1999,
genre: ["Sci-Fi"],
howOld: howOldhelper,
})

const film2 = Object.freeze( {
name: "",
director: "Wachowski 2",
releaseDate: 2003,
genre: ["Action", "Sci-Fi"],
})

consol.log(film.howOld());
consol.log(film2.howOld());
16 changes: 16 additions & 0 deletions curriculum/week16/assets/code/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>02.02.2024.Objects</title>


</head>
<body>
<!-- partial:index.partial.html -->

<!-- partial -->
<script src="./script.js"></script>

</body>
</html>
59 changes: 59 additions & 0 deletions curriculum/week16/assets/code/kostas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"use strict";
// @ts-check
// console.log("kostas!");
const person = {
name: "",
age: 0
}

const john = person;
john.name = "john";
john.age = 42;

const defaultOptions = {
color: "black",
bg: "white"
}

const appOptions = { ...defaultOptions }
appOptions.color = "white";
appOptions.bg = "black";

function howOldHelper(){
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
return currentYear - this.releaseDate;
}

export const film = {
name: "Poor Things",
director: "Yorgos Lanthimos",
releaseDate: 2024,
genre: ["Drama"],
// Once we are inside a method (an object property that has a function as a value) AND the method is declared using the 'function' keyword, (rule #2) then 'this' refers to the object containing the method.
howOld: howOldHelper
}
const th = {
name: "The Holdovers",
director: "Alexander Payne",
releaseDate: 1985,
genre: ["Comedy","Drama"],
howOld: howOldHelper
}
console.log( film.howOld() )
console.log( th.howOld() )

// const films = [ pt, th ]
// Film Function Creator:
function Film(name,director,releaseData,genre){
// Return a frozen version?
return {
name,
director,
releaseDate,
genre,
howOld: howOldHelper
}
}
const tm = Film("The Matrix", "Wachowski", 1999, ["Sci-fi"]);
console.log(tm.name, tm.howOld());
34 changes: 34 additions & 0 deletions curriculum/week16/assets/code/leon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const coder = "Leon the couch coder 😂";
const magicccccoder = coder;

console.log("coder:" + coder, "magicccccoder:" + magicccccoder);

const taekanamadara = () => {
return "taekanamadara";
}

const dentaekanamadara = taekanamadara();

console.log(taekanamadara(), dentaekanamadara)


const denkatalavainotipota = {
dentapairnei: "des ta xalia mou"
}

denkatalavainotipota.dentapairnei = JSON.stringify(denkatalavainotipota);

const katalavainei = denkatalavainotipota.dentapairnei;

console.log(denkatalavainotipota, katalavainei);




export const film = Object.freeze({
name: "Mitsotakis",
director: "Hell",
releaseDate: 1,
genre: ["foreverstupidness"]
})

26 changes: 26 additions & 0 deletions curriculum/week16/assets/code/mary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
console.log("Mary")
const firstName = "Mary";
const lastName = "Richelle";
const fullName = firstName + lastName;

const maryObj = {
livesIn: "Greece",
hobby: "coding",
does: ["eat","code","sleep","repeat"]
}
const myData = [firstName , lastName , fullName, maryObj.livesIn , maryObj.hobby]


const aboutMe = (livesIn)=>{
console.log(fullName + " lives in " + livesIn)

}
aboutMe(maryObj.livesIn)
myData.push(maryObj.does)

export const film = Object.freeze({
name: "Wish",
director: "Chris Buck",
releaseDate: 2024,
genre: ["Animation","Family","Fantasy","Adventure"]
})
16 changes: 16 additions & 0 deletions curriculum/week16/assets/code/ozgur.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// console.log("özgür")

// const obj = { name: "özgür", age: "33" }
// const arr = [12, 34, , 45, 2332, 5656]
// const arr2 = arr.pop();
// // Think about: what is the value of arr2 now?
// // What type?
// const arr3 = arr2.push("I don't quite understand what we should do")
// console.log(arr3)
export const film = {
name: "The 300 Spartans",
director: "Zack Snyder",
releaseDate: 2007,
genre: ["History", "Action"]
}
Object.freeze(film)
32 changes: 32 additions & 0 deletions curriculum/week16/assets/code/products.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
product list

<div class="products">
<!-- <div class="product">
<img src="https://cdn.shopify.com/s/files/1/0509/6095/7594/products/Brown_Bear_1200x1200.jpg?v=1612740879" alt="product 1" />
<h3>Product 1</h3>
<p>Description of product 1</p>
<button>Add to Cart</button>
</div> -->
</div>
<!-- <script src="script.js" type="module"></script> -->
<script src="products.js" type="module"></script>
<!--
<script src="mary.js" type="module"></script>
<script src="ozgur.js" type="module"></script>
<script src="alex.js" type="module"></script>
<script src="leon.js" type="module"></script>
<script src="Anna.js" type="module"></script> -->
</body>

</html>
38 changes: 38 additions & 0 deletions curriculum/week16/assets/code/products.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use strict";


let products = [
{
name: "macbook pro",
category: "laptop",
price: 1200,
brand: "Apple",
image: ""
},
{
name: "iPhone 13 Pro Max",
category: "smartphone",
price: 1000,
brand: "Apple",
image: "https://external.webstorage.gr/mmimages/image/51/65/7/93/1641088-264x264-800x800-96x96-560x560.jpg"
},
{
name: "Logitech MX Keys",
category: "gadget",
price: 120,
brand: "Logitech",
image: "https://resource.logitech.com/w_692,c_lpad,ar_4:3,q_auto,f_auto,dpr_1.0/d_transparent.gif/content/dam/logitech/en/products/keyboards/mx-keys-s/product-gallery/graphite/mx-keys-s-keyboard-top-view-graphite-us-intl.png?v=1"
}]


consol.log(document.getElementById("products"))
// document.getElementById("products").innerHTML = products.map(product => `

// <div class="product">

// <img src="${product.image}" alt="${product.name}">
// <h3>${product.name}</h3>
// <p>${product.category}</p>
// <p>${product.price}</p>
// <p>${product.brand}</p>
// `)
Loading

0 comments on commit 8877516

Please sign in to comment.