frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I built a space travel calculator using Vanilla JavaScript

https://cosmic-odometer.vercel.app/
37•captainnemo729•2h ago
I built this because measuring my age in years felt boring—I wanted to see the kilometers.

The first version only used Earth's orbital speed (~30km/s), but the number moved too slowly. To get the "existential dread" feeling, I switched to using the Milky Way's velocity relative to the CMB (~600km/s). The math takes some liberties (using scalar sum instead of vector) to make the speed feel "fast," but it gets the point across.

Under the hood, it's a single HTML file with zero dependencies. No React, no build step. The main challenge was the canvas starfield—I had to pre-allocate the star objects to stop the garbage collector from causing stutters on mobile.

Let me know if the physics makes you angry or if the stars run smooth on your device.

Comments

widforss•1h ago
Nice job!

It's interesting to see how little effect the orbit and rotation had on the straight line. A proposal is to align the numbers for the different movement categories so that it's easier to see the magnitudes of them.

It took me a couple of seconds to understand the concept, from the title I though it was going to be a planner to show gravity assists etc.

captainnemo729•1h ago
Yeah the scale difference is crazy. Once you add the Galaxy/CMB velocity, the earth's rotation basically becomes a rounding error.

Good call on the number alignment. I'm using a variable-width font which makes comparing them messy. I'll switch to monospace or tabular-nums in the next push so the magnitudes scan better.

And fair point on the title-'calculator' implies mission planning. Maybe 'travel visualizer' would have been safer!

reconnecting•1h ago
It's really odd that we're stuck in this fish tank with zero idea where we're flying now, or where we were before. I believe this is vital information for every journey.

Life looks much easier when realising that we're all flying at least ~30 km/s through dark space every second of our lives.

Thank you so much! I was just thinking about how to create something similar a month ago for my birthday, but didn't succeed like you did.

captainnemo729•1h ago
The fish tank analogy is perfect. It feels illegal that we're moving this fast without a dashboard.

And definitely give yours another shot. Since this is just vanilla JS, feel free to view source on mine to see how I handled the frame loop if you get stuck.

reconnecting•1h ago
STARFIELD is nice. Reminds me of DOS screensavers.
captainnemo729•55m ago
thanks. i love those old screensavers because they were so efficient. tried to keep this one lightweight too just a simple canvas loop so it doesn't spin up the fans.
arendtio•1h ago
So, how much does the galaxy's travel affect the speed of time?
captainnemo729•1h ago
I actually ran the numbers on time dilation! At 600km/s (0.2%), the effect is surprisingly small. We basically 'save' about 63 seconds a year compared to a stationary observer relative to the CMB. Not enough to live forever, but enough to be late for a meeting.
anileated•1h ago
Even if you remember the times of iPod, you can safely say you're less than one light year old.
captainnemo729•50m ago
yeah it's actually depressing. based on the odometer's math (~850km/s), you hit the 1 Light Year mark around your 353rd birthday.
netsharc•43m ago
You're measuring time using a unit of distance...
captainnemo729•24m ago
fair point. i'm taking some poetic license with spacetime.

treating 'distance traveled' as a proxy for age since we're all stuck on the same rock moving at the same speed.

croisillon•55m ago
it's cool but i was expecting some kind of visualization, how do my 1.2 trillion km look on a map?

also there are some cursors with question marks but they don't espatially ;) call the FAQ, do they? firefox on win10

captainnemo729•46m ago
valid point on the visualization. i tried to map it initially, but the depressing reality is that even at 1.2 trillion km, we're basically a stationary dot on a galactic scale. a map just looked like a blank screen, so i went with the starfield to try and convey speed instead.

re: the cursors that's definitely my bad UX. they are just hover tooltips (standard title attributes), but setting the cursor to help (?) makes them look like clickable buttons. i'll swap that out so it's less confusing. thanks for the firefox check.

DaveJorg•40m ago
Did you consider representing on a logarithmic scale?
captainnemo729•33m ago
that's a really interesting angle.

i thought about it, but i was worried a log scale might abstract away the 'feeling' of the distance (making a light year look deceptively close to a kilometer). i want the user to feel small, and log scales tend to make things look manageable.

but you're right it's probably the only way to fit the solar loops and galactic arc on the same screen visually. might be worth a prototype for v2.

netsharc•46m ago
Geez, gotta love that you have to reach the bottom of the page and read the small print to realize that the date input on the top is supposed to be for your birthday... and then to figure out that the site is a calculator of "this is how far you've travelled relative to [the center of the universe?] since birth"...
captainnemo729•42m ago
fair point. classic case of 'dev blindness'—i've tested it so many times i forgot it's not obvious to a new user.

pushing a label fix now so it's not a guessing game. thanks.

redmattred•38m ago
This is great, well done.
captainnemo729•28m ago
thanks! it was a fun weekend hack to put together. glad you liked it.
dalton_zk•17m ago
Awesome!!!
captainnemo729•14m ago
thanks! glad you liked it

Show HN: Coi – A language that compiles to WASM, beats React/Vue

72•io_eric•3d ago•28 comments

Show HN: Giving Claude Code "hands" to deliver local files (P2P, No Cloud)

https://github.com/nuwainfo/ffl-mcp
2•bear330•40m ago•1 comments

Show HN: I built a space travel calculator using Vanilla JavaScript

https://cosmic-odometer.vercel.app/
37•captainnemo729•2h ago•22 comments

Show HN: Whosthere: A LAN discovery tool with a modern TUI, written in Go

https://github.com/ramonvermeulen/whosthere
253•rvermeulen98•1d ago•85 comments

Show HN: Jar.tools – online Jar file opener

https://jar.tools/
3•Igor_Wiwi•2h ago•1 comments

Show HN: Zsweep – Play Minesweeper using only Vim motions

https://zsweep.com
76•oug-t•5d ago•32 comments

Show HN: isometric.nyc – giant isometric pixel art map of NYC

https://cannoneyed.com/isometric-nyc/
1282•cannoneyed•1d ago•232 comments

Show HN: A self-hosted collaborative viewer for pathology slides (Rust, WebGL2)

https://github.com/PABannier/PathCollab
3•el_pa_b•4h ago•0 comments

Show HN: Text-to-video model from scratch (2 brothers, 2 years, 2B params)

https://huggingface.co/collections/Linum-AI/linum-v2-2b-text-to-video
149•schopra909•1d ago•24 comments

Show HN: New 3D Mapping website - Create heli orbits and "playable" map tours.

https://www.easy3dmaps.com/gallery
29•dobodob•19h ago•15 comments

Show HN: S2-lite, an open source Stream Store

https://github.com/s2-streamstore/s2
74•shikhar•2d ago•18 comments

Show HN: BrowserOS – "Claude Cowork" in the browser

https://github.com/browseros-ai/BrowserOS
83•felarof•1d ago•34 comments

Show HN: I've been using AI to analyze every supplement on the market

https://pillser.com/
85•lilouartz•1d ago•46 comments

Show HN: Open-source Figma design to code

https://github.com/vibeflowing-inc/vibe_figma
5•alepeak•6h ago•0 comments

Show HN: Interactive physics simulations I built while teaching my daughter

https://www.projectlumen.app/
84•anticlickwise•5d ago•21 comments

Show HN: ZTerm, a GPU-accelerated terminal emulator built with Rust and GPUI

https://github.com/zerx-lab/zTerm
2•zero-lab•7h ago•1 comments

Show HN: Teemux – Zero-config log multiplexer with built-in MCP server

https://teemux.com/
10•gajus•20h ago•7 comments

Show HN: Sweep, Open-weights 1.5B model for next-edit autocomplete

https://huggingface.co/sweepai/sweep-next-edit-1.5B
526•williamzeng0•2d ago•150 comments

Show HN: Txt2plotter – True centerline vectors from Flux.2 for pen plotters

https://github.com/malvarezcastillo/txt2plotter
33•tsanummy•4d ago•8 comments

Show HN: Synesthesia, make noise music with a colorpicker

https://visualnoise.ca
37•tevans3•2d ago•13 comments

Show HN: Rails UI

https://railsui.com/
204•justalever•2d ago•110 comments

Show HN: Mastra 1.0, open-source JavaScript agent framework from the Gatsby devs

https://github.com/mastra-ai/mastra
213•calcsam•3d ago•69 comments

Show HN: Flux, A Python-like language in Rust to solve ML orchestration overhead

https://github.com/cmc-labo/flux
5•hpscript•10h ago•3 comments

Show HN: Obsidian Workflows with Gemini: Inbox Processing and Task Review

https://gist.github.com/juanpabloaj/59bc13fbed8a0f8e87791a3fb0360c19
14•juanpabloaj•18h ago•4 comments

Show HN: First Claude Code client for Ollama local models

https://github.com/21st-dev/1code
44•SerafimKorablev•1d ago•23 comments

Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

https://github.com/ChartGPU/ChartGPU
664•huntergemmer•2d ago•211 comments

Show HN: Bible translated using LLMs from source Greek and Hebrew

https://biblexica.com
52•epsteingpt•1d ago•66 comments

Show HN: 83 browser-use trajectories, visualized

https://trails-red.vercel.app/viewer
7•wayy•16h ago•1 comments

Show HN: yolo-cage – AI coding agents that can't exfiltrate secrets

https://github.com/borenstein/yolo-cage
59•borenstein•2d ago•74 comments

Show HN: CLI for working with Apple Core ML models

https://github.com/schappim/coreml-cli
47•schappim•1d ago•5 comments