Repository navigation
sundial stays the site's number; live finds you; every number provable - #1
Merged
Merged
Conversation
shadowBearing() chased the stylised down-page shadow component, so the number drifted through the day (149 in the morning, 189 at night). the whole point of the sundial is that you set the phone down once: the model draws for an equator-facing viewer, so the one fixed alignment is top edge due south (180) in the northern hemisphere, due north (0) in the southern, flipped by facing. dx is the light's east-west lean exactly, so held there the on-screen lean tracks the real shadow all day, sun or moon. tests swap the round-trip closure for what the sundial promises: the bearing never moves across a year in either hemisphere, and the lean genuinely matches over 500 random places and moments. also: the demo's live button now actually follows the clock. it was snapshotting new Date() into a frozen `now` with a 16.7-hour interval, so "live" froze at the click. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UrxmMfh2Fp6S2mBV6UF9Xd
the sundial reverts to exactly what zayd.wtf computes: the per-place, per-moment bearing (azimuth + 180) - atan2(dx, -dy). the number moving through the day is the point, not drift - the on-screen vertical is stylised, so the rotation that reconciles screen and sky changes as the light swings. the readme now says so, and a new "every number, one line" table gives the formula behind each reported value so all of them can be checked by hand. demo readout grows a "real shadow" row - the real-life compass bearing the shadow under your coffee cup points (azimuth + 180) - so the two moving numbers explain each other on screen. the live button now means YOUR sky: a keyless ip lookup (ipwho.is, then ipapi.co, 6s timeouts - the same providers zayd.wtf uses) gives a city-level guess, and when the network says no, the browser's reported timezone pins the longitude band, with obviously-southern zone prefixes flipping hemisphere. it also actually follows the clock now - it used to freeze a snapshot of new Date() behind a 16.7-hour refresh interval. the library itself still never looks anything up; location stays bring-your-own, this is the demo bringing its own. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UrxmMfh2Fp6S2mBV6UF9Xd
zaydiscold
marked this pull request as ready for review
August 1, 2026 11:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what this pr does now
(earlier commits on this branch briefly pinned the sundial to a constant bearing; that's reverted — the sundial is exactly zayd.wtf's number, and the library API is unchanged from 1.1.0.)
the sundial, settled
shadowBearing()keeps the formula the site itself uses insky-almanac.js:(azimuth + 180) − atan2(dx, −dy), per place, per moment. The number moving through the day is the point, not drift — the on-screen vertical is stylised (always down the page), so the rotation that reconciles screen and sky changes as the light swings. The README's sundial section now says this out loud so nobody reads the motion as a bug again.every number, one line
New README section: a table with the formula behind each reported value (caster alt/az, sky, length, offset x/y, opacity, blur, moon intensity, sundial) and which test proves it — so any number on the screen or in
npx real-shadowscan be checked by hand.demo: "real shadow" row
The readout gains the real-life bearing — which way the shadow under your coffee cup points,
azimuth + 180— beside the sundial, so the two moving numbers explain each other.demo: live means your sky
The live button now resolves your rough location the same way zayd.wtf does: keyless IP lookup (ipwho.is → ipapi.co, 6s timeouts, cached for the tab), and when the network says no, the browser's reported timezone pins the longitude band (obviously-southern zone prefixes flip hemisphere). It also actually follows the clock now — it used to freeze a snapshot of
new Date()behind a 16.7-hour refresh interval. The library still never looks anything up; location stays bring-your-own.verified
note:
assets/demo.gifpredates the new readout rows; the behavior it shows is correct.🤖 Generated with Claude Code
https://claude.ai/code/session_01UrxmMfh2Fp6S2mBV6UF9Xd