Skip to content

Add sunrise/sunset solar orientation as a three-way toggle - #10

Open
beejsbj wants to merge 2 commits into
masterfrom
feat/orientation-three-way-toggle
Open

beejsbj wants to merge 2 commits into
masterfrom
feat/orientation-three-way-toggle

Conversation

@beejsbj

@beejsbj beejsbj commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Make the dial orientation toggle beside "Shape your day" cycle through three orientations:

  1. Noon on top (noon, default): Clock alignment with 12:00 at the top.
  2. Sun orientation (sun): Solar alignment with solar noon at the top, leveling the sunrise and sunset pins horizontally across the dial with sunrise on the left and sunset on the right.
  3. Now on top (now): Dynamic observer alignment with the current time pinned to the top bead.

Changes

  • src/solar.js: Added rotFor(orientation, t, sun) to calculate exact dial rotation in hours across orientations, placing solar noon at the top (24 - sun.noon) to level the sunrise/sunset chord horizontally.
  • src/store.js: Extended preference loading and saving to support orientation: "noon" | "sun" | "now" while keeping backward compatibility with legacy boolean nowOnTop flags.
  • src/main.js: Converted #nowTopBtn to cycle through noon, sun, and now states, updating icon (clock / sun / top), titles, ARIA attributes, and toasts accordingly. Exposed orientation on window.__dayshaper.
  • styles/app.css: Added accent styling for [data-orientation="sun"] and [data-orientation="now"].
  • Tests: Added unit tests in test/orientation.test.js verifying horizontal alignment of sunrise/sunset across dates/latitudes, preference persistence/migration, and updated browser smoke test to cycle through all three states.

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dayshaper Ready Ready Preview Sep 28, 2026 8:20am UTC

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant