I learned a little of DOM API as well as localStorage, then I build an app that I really need, It’s a bookmark
linkeep is a bookmark that will help me save some links to visit them later (blogs, StackOverflow questions, docs, etc…)
the purpose of building it is to practice what I have learned about localStorage and I want to practice working on the light/dark mode page.
I need your opinions about the UI, the CSS, and Javascript code (if there is a bug or a bad practice)
codepen: https://codepen.io/CH4R4F/full/BadKxya
live Demo: https://linkeep.netlify.app/ GitHub
Great job on this! It looks really good.
A bug I found is when you input a URL that does not start with https://, the resulting URL does not start with that, and it tries to take you to a different page on the site, not the site you inputted.
Hello, your work looks great. I only took a glimps to comment on your styling. There seem to be a small issue with accessibility. On large screen, some fonts appear to be a little too small, such as the placeholders for your input elements, or the saved links address text. I also find the placeholder text for the search input element to have a very low contrast to the element background. Maybe you developped the app on smaller screen so you couldnt estimate that behavior.
Looks great mate, one thing I noticed were that you are using ids that are not unique.
This is what I did added three elements (ids: 0, 1, 2 respectively), then deleted the first one (now I have ids: 1, 2) then added a new element (now I have ids: 1, 2, 2).
You could look into using uuid to generate ids, but perhaps you don’t even need to know/use ids (as the div that you are using the id has the delete icon as a child).
I used the id to be able to select the deleted element from the localStorage and delete it if it matches the same id
But yeah you’re right this may cause the problem and may be mor than that because I loop over the localStorage elements and I delete elements by id so i can delete two elements with one click just because they have the same id …
I’ll fix it thanks
wow I found a big problem
when you have elements with id(0; 1, 1)
and then you delete the last on it shows that it’s deleted from the dom BUT: in the local browser when I loop through the elements I delete the first element with the same id so if I did refresh the element I delete before is still (because I didn’t delete from the local storage ) and the element the I didn’t delete in the previous step disappear because it’s the one that was deleted from the local storage
what a bug