Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@
<link rel="stylesheet" href="style.css" />
</head>
<body>
<!-- <div class="card">
<p>
Otters have long, slim bodies and relatively short limbs. Their most
striking anatomical features are the powerful webbed feet used to swim,
and their seal-like abilities holding breath underwater.
</p>
<figure>
<img
alt="A cute otter in water"
src="https://picsum.photos/seed/picsum/200/300"
alt="A hallway with rainbow-coloured lighting"
src="/course-materials/wall-art.jpg"
style="width: 200px"
/>
<p>
More importantly, otters are glorious water dogs, playful and curious.
The otter, no other, is the best animal.
</p>
</div> -->
<figcaption>
Photo by Efe Kurnaz in Camp Nou, Barcelona, Spain. Found on Unsplash.
</figcaption>
</figure>

<script src="index.js"></script>
</body>
</html>
67 changes: 53 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,17 +849,56 @@ const books = [
// : "ownersEatTooLittle";
// console.log(eat, sarahDogs.recommendedFood, sarahDogs.curFood);

const Person = function (firstName, birthYear) {
this.firstName = firstName;
this.birthYear = birthYear;
};

Person.prototype.sayHi = function (greet) {
console.log(
`${greet}, nama saya ${this.firstName} saya lahir tahun ${this.birthYear}`
);
};

const rido = new Person("Rido", 2001);
rido.sayHi(`Halo ges`);
console.log(Object.getPrototypeOf("Person"));
// const Person = function (firstName, birthYear) {
// this.firstName = firstName;
// this.birthYear = birthYear;
// };

// Person.prototype.sayHi = function (greet) {
// console.log(
// `${greet}, nama saya ${this.firstName} saya lahir tahun ${this.birthYear}`
// );
// };

// const rido = new Person("Rido", 2001);
// rido.sayHi(`Halo ges`);
// console.log(Object.getPrototypeOf("Person"));

// const Car = function (make, speed) {
// this.make = make;
// this.speed = speed;
// };

// Car.prototype.accelerate = function () {
// console.log((this.speed += 10));
// console.log(`${this.make} going at ${this.speed} km/h`);
// };
// Car.prototype.brake = function () {
// console.log((this.speed -= 5));
// console.log(`${this.make} going at ${this.speed} km/h`);
// };

// const bmw = new Car("BMW", 120);
// const mercedes = new Car("Mercedes", 95);

// bmw.accelerate();
// bmw.accelerate();
// bmw.accelerate();
// bmw.brake();
// bmw.brake();

// class Car {
// constructor(make, speed) {
// this.make = make;
// this.speed = speed;
// }

// accelerate() {
// this.speed += 10;
// console.log(`${this.make} going on ${this.speed} km/h`);
// }
// }

// const bmw = new Car("BMW", 120);
// bmw.accelerate();
// bmw.accelerate();
23 changes: 9 additions & 14 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
body {
background: #222;
padding: 32px;
figure {
padding: 8px;
border: 1px solid;
margin-bottom: 32px;
}

.card {
background-color: white;
border-radius: 8px;
figure img {
margin-bottom: 8px;
}

img {
display: block;
width: 100%;
}

p,
img {
margin-bottom: 16px;
figcaption {
text-align: center;
color: #666666;
}