Credit App using CSS FlexBox,Javascript, and HTML!
Design comparison
Solution retrospective
This project took me about a week. I've been coding for just a little over 3 months now and I would definitely say this tested my current knowledge. This let me know what kind of things I need to be studying more. 1.Media querys- I just could not for the life of me get this to work perfectly. 2.Javascript and CSS refactoring. This was another big one. I got overwhelmed at times just trying to find out the best practice for each other these. 3.Using Javascript more efficiently. What I mean this is that i'm sure there are best practices that im not using when i comes to the way i wrote my Javascript. I'm also pretty sure my code looks a little messy. any feedback to any of these points or if you see something else please let me know. Oh I also used ID's for the DOM because for some reason .getbyElementclass was not working?? If you made it this far thank you for your time! cheers!
Community feedback
- Account deleted
For me your JavaScript Code is not totally messy because you add some comments and you maintain the Dry principle (Don't Repeat Yourself) which is big plus for that and for not giving up to the challenge.
I recommend learn the modules in a JavaScript. Basically you will create another new JS file so that the file you created will be included in the JS main file if you imported that file to the main.
if you learn modules. the getElementById with variables name you declared in a main JS file you can create a new JS file for that ex
// Another File const obj = { cardName: document.getElementById("card-name"), cardNum: document.getElementById("card-num"), } export default obj; //main file JS import obj from path; // you can use the selectors even though // not declared in the main but in the other file obj.cardName obj.cardNum
it makes your main file more readable and not look messy if you did this because what if the project becomes more big and you add some features because of that the main file will be bloated and hard to read but you will figured out by yourself when to used module if you learn modules in JavaScript
.getByElementClass just ignored that kind of syntax in a real-world we never used that selector we always used getElementById , .querySelector and querySelectorAll
Marked as helpful1@MikeProducePosted about 2 years ago@okayda Hey jhon thanks for your feedback I had no idea that you could import one JS file to another one! so thank you for that I will definitely be including that next time.
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