This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const paragraph = document.querySelector('p'); | |
paragraph.addEventListener('click', (event) => { | |
// First, we select the element we want to animate and confirm we are grabbing the right one. | |
const element = event.target; // In this scenario, the target is paragraph itself. | |
console.log(element); // note: this should be removed once the right element has been confirmed. | |
// Then, we perform the animation we want to occur when the click event is triggered. | |
element.style.color = 'red' // Add here your favorite color hehe that red one is dis.gus.ting. Don't say I didn't warn you π | |
element.style.fontSize = '10px' // You can pass any CSS property here. Just make sure to change the property from mid-snake-case to lowerCamelCase. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const paragraph = document.querySelector('p'); | |
paragraph.addEventListener('click', animation); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const paragraph = document.querySelector('p'); | |
paragraph.addEventListener(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head>...</head> | |
<body> | |
....the entire body of your site.... | |
<script src="index.js"></script> /* this should be the last element in your body */ | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let paragraph = document.querySelector('p'); | |
console.log(paragraph); | |
// => <p>Hello World!</p> | |
paragraph = document.querySelector('#bio'); | |
console.log(paragraph); | |
// => <p id="bio">Hello World!</p> | |
paragraph = document.querySelector('.text'); | |
console.log(paragraph); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (min-width: 600px) { | |
.section { | |
width: 80% | |
} | |
.social-media-list li a { | |
color: pink | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.flex { | |
display: flex; | |
justify-content: space-between; | |
flex-wrap: wrap | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hobbies section"> | |
<ul class="flex"> | |
<li class="flex-item"> | |
<img src="images/code.gif" alt=""> | |
<h4>Code</h4> | |
<p>I like it bc I'm geeky.</p> | |
</li> | |
<li class="flex-item"> | |
<img src="images/writing.gif" alt=""> | |
<h4>Write</h4> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.flex { | |
display: flex; | |
justify-content: space-between; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hobbies section"> | |
<ul class="flex"> | |
<li class="flex-item"> | |
<img src="images/code.gif" alt=""> | |
<h4>Code</h4> | |
<p>I like it bc I'm geeky.</p> | |
</li> | |
<li class="flex-item"> | |
<img src="images/writing.gif" alt=""> | |
<h4>Write</h4> |
NewerOlder