Submitted about 2 years ago
Country API made with HTML, CSS, JS, SASS and Bootstrap
@francobernardii
Design comparison
SolutionDesign
Solution retrospective
Let me know what you think about this project, all feedbacks are welcomed :D
Community feedback
- @fazzaamiarsoPosted about 2 years ago
Hi Franco, Great work!
A tip from me for cleaner or more readable code is by breaking-up your createCard DOM creation into functions. for example
const createImageContainer = (image) => { let containerImage = document.createElement('div') containerImage.setAttribute('style',`background: url("${image}") center no-repeat;background-size: cover;`) let containerTitle = document.createElement('div') let containerDetail = document.createElement('div') } const createHeader = title => { let h1 = document.createElement('h1') let contentT = document.createTextNode(title) } //in createCard you just need to do this const createCard = (image,title,population,region,capital) => { createHeader(title); createImageContainer(image); //other codes }
I hope it helps! Cheers!
Marked as helpful1@francobernardiiPosted about 2 years ago@fazzaamiarso Thank you so much Fazza, I'll update my date with your recomendations.
Cheers!
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord