sphars / hn-clone Goto Github PK
View Code? Open in Web Editor NEWA Hacker News clone, written in vanilla JavaScript
Home Page: https://sphars.github.io/hn-clone/
A Hacker News clone, written in vanilla JavaScript
Home Page: https://sphars.github.io/hn-clone/
Currently, on load of the page, it fires getStories(TOPSTORIES)
and only loads the top endpoint. If a user browses to another navigation (e.g. Ask) and navigates away in the same tab and goes back in their browser, it'll default to Top. I think a cookie to store last navigation may help or changing behavior of getStories()
, or using query strings.
Story ids could be saved somewhere (local storage for now) and then saved stories and story comment thread could be saved for later.
If the submitter of a story replies to their own story, comments written by them should have an indication that they were written by them (like how Reddit does it).
Right now, only the first 50 stories are loaded per fetch. This is an arbitrary limit. I believe the API will load a max of 500, so ability to load the next 50 or so stories would help. Either by fetching all 500 and showing only 50, or fetch the next 50 and show them. May depend on the API.
On long comment threads and story lists, this would allow a user to scroll quickly to the top. Could also extend it to scroll to the top level comment in current comment thread.
Comments on a story should be moved to new pages, rather than in-line with story lists. Should help with navigation issues.
Everything is sorta hacked together. Fetching a story and comment are essentially the same thing to the API, but the code in the app is nearly identical yet in separate functions. Needs cleanup for sure.
May be as simple as attaching the click event to the story div. May also come in handy with #4 when that gets implemented. May also need some restructure in the creation of the story div.
Everyone loves a good dark theme. Seems to be the latest rage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.