This is the first time I have used vanilla JavaScript to add interactivity on my simple HTML and CSS project. Additionally, I was able to practice my HTML markup planning and expand my knowledge on both HTML elements and CSS properties.
What challenges did you encounter, and how did you overcome them?One challenge that I have encountered is how I can properly use JavaScript to add interactivity to my project. In my first approach, I added some styling directly in my JavaScript code when the button is clicked. I have found out that it was a bad approach when I read some of the feedbacks received by others in this challenge. Afterwards, I have refactored my JavaScript code, remove all the direct styling logic and just use .add, .remove and .toggle methods instead to apply the class names with styles to elements instead. My readings about JavaScript also helped me with the challenge.
What specific areas of your project would you like help with?Here are the things that I need help with:
- This project only comes with one card image as an asset that I can import. How do I make sure that my implementation on the image matches the design using only one image? Is it possible to match the design with one one image or do I need to export the images from figma that I need for each screen sizes? Currently, I haven't spent much time trying to align the image according to the design, I just have it displayed as a cover just like this piece of code:
&__img {
max-height: 12.5rem;
width: 100%;
object-fit: cover;
border-top-right-radius: inherit;
border-top-left-radius: inherit;
}
@media screen and (min-width: 48rem) {
display: grid;
grid-template-columns: 1fr 2fr;
&__img {
max-height: 100%;
height: 100%;
border-radius: 0;
border-top-left-radius: inherit;
border-bottom-left-radius: inherit;
}
-
What do you think about my html structure for the profile section below? Have I made my HTML structure and the CSS styling for the section correct? I have used a dialog for the share popup and a button to toggle the popup. I have used some absolute and relative positioning to position those elements correctly.
-
What do you think about my JavaScript code? This is my first time using vanilla JavaScript so I really wanted to get some feedback out of it.