Skip to content

Add a Flip Clock style, and show style names in the picker - #40

Open
edward-mcnair wants to merge 1 commit into
kemalandic:mainfrom
edward-mcnair:flip-clock
Open

edward-mcnair wants to merge 1 commit into
kemalandic:mainfrom
edward-mcnair:flip-clock

Conversation

@edward-mcnair

Copy link
Copy Markdown

What does this PR do?

Flip Clock: a split-flap clock style in the manner of flipclock.us, drawn natively in SwiftUI.

  • Each digit is its own card, split across the middle, with colons between hours, minutes and seconds.
  • When a digit changes, the old top half folds down and the new bottom half drops into place (rotation3DEffect with perspective, two 0.18 s phases).
  • In 12-hour mode, a single-digit hour gets a blank card in front, and a small AM/PM card sits beside the digits.
  • It follows the widget's Show Seconds, 24-Hour Format and Show Date settings, and the cards size themselves to fill the tile.

Picker labels: ConfigSchemaEntry gains an optional optionLabels.

  • The Clock's Style picker shows its styles' real names ("Flip Clock", "Dot Matrix", "LCD Retro").
  • The editor's special cases for "Daybar" and "Dotmatrix" are no longer needed.
  • Other pickers are unchanged.

Tests: FlipClockLayoutTests:

  • the cards fit tiles from 2×1 to 8×4, with and without seconds, AM/PM and the date
  • every clock style has a display name

Screenshots

Can be added after opening, if you'd like them.

Checklist

  • Tested on macOS 14+ (macOS 27)
  • No third-party dependencies added
  • Follows existing code style (swift-format lint clean)

🤖 Generated with Claude Code

Flip Clock is a split-flap clock in the manner of flipclock.us, drawn
natively:
- Each digit is its own card, split across the middle, with colons between
  hours, minutes and seconds. When a digit changes, the old top half folds
  down and the new bottom half drops into place (rotation3DEffect with
  perspective, two 0.18 s phases).
- In 12-hour mode a single-digit hour gets a blank card in front and a small
  AM/PM card sits beside the digits.
- It follows the widget's Show Seconds, 24-Hour Format and Show Date
  settings, and the cards size themselves to fill the tile.

Picker settings can now give their options display names
(ConfigSchemaEntry.optionLabels). The Clock's Style picker uses its styles'
names ("Flip Clock", "Dot Matrix", "LCD Retro"); the editor's special cases
for "Daybar" and "Dotmatrix" are no longer needed. Other pickers are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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