Skip to content

Add the Settings gear to the header #27

Closed

Description

@craig-o-curtis

The GMT docs header has one Settings button (a gear). It opens a small panel with a "Dark theme" switch, a mute button, a volume fader and an Aura switch.

northguild.dev and the GMT docs share one origin and a view transition between pages, so the two bars should match. northguild.dev also gets sound: Huginn's flight, the aurora drawing in the page, the air of each sky, and a ping on every press.

What to do

The Settings gear

  • Add the gear last in the header, after GitHub and Discord, as on the docs bar. Give it the same gmt-icon-button look and the same popover panel with 45° bevelled corners.
  • Put only the mute button and the 11-notch volume fader in the panel. Leave out the theme switch, because the site stays dark for now. Leave out the Aura switch and track.
  • Read and write GMT's sound record, dox:sound ({ v: 1, level, muted, aura, track }), by GMT's rules. A choice made on one site then holds on the other. Change only level and muted, and keep the other fields as they are stored.
  • Sound is opt-in: every visitor starts muted. An inline script sets data-sound on <html> before first paint, so the speaker icon is right on the first frame.
  • The panel slides in and out like GMT's, and plays the Felt slide as it does. The mute button plays the Ice snap, and each fader notch the Glass tick.
  • Move the fader and panel styles from the GMT kit into @northguild/theme.

The sound engine

Copy a slim part of GMT's sound engine (cue, settings, engine, kit) and keep its rules:

  • No AudioContext while muted.
  • Audio starts on the reader's first press or key, or at load after a same-site navigation.
  • Every time is read from the audio clock.
  • A hidden tab suspends its audio.

Presses

  • Every link and button plays I, "Distant sonar": a soft ping heard from far off through water, almost all space.
  • The GMT docs move to the same ping in fix(dox): one soft Distant sonar ping for every press gmt#553.
  • A link that leaves the page in this tab waits for the ping (about 600 ms), as GMT's link hold does. It goes at once while sound is off.

Huginn's flight

The voices were picked from the audition in context/reference/huginn-sound-audition.html:

  • Wingbeat: I, "Heavy · Two wings"
  • Glide: D, "Faint hush"
  • Soar: B, "Open sky"
  • Roll: D, "Tuck breath"
  • Slow motion near the camera: B, "Slowed tape". The beats slow with his wings, and his sounds drop in pitch by the square root of the time scale.
  • Distance and direction: C, "Air in 3D". An HRTF panner sits at his position in the camera's frame, and the air dulls the high frequencies with distance.
  • His level falls 12 dB each time his distance doubles, and he is silent past 80 m.

Every wingbeat must play in time with the drawn wing:

  • As each beat starts, the worker posts its start time and the length of its downstroke.
  • About 15 times a second, it posts his position, speed, soaring, roll and time scale.
  • The page puts these on the audio clock with getOutputTimestamp.
  • The worker posts nothing for sound while sound is off.

The aurora draw-in

  • As each box's sweep runs (the header, title, intro and cards), it plays G, "Silk rustle", for the length of the sweep, panned to the box.
  • When the page paints everything at once (reduced motion, or no raven), it is silent.

The air of the place

A very light breeze plays under the sky, as the skies are gentle weather:

  • Ísafjörður: a light breeze off the water, with the sea lapping softly now and then.
  • Helsinki: a stiller breeze over the faint far murmur of the city.
  • Switching sky crossfades one into the other.
  • Nothing in it repeats on a cycle.

Done when

  • The gear is the same size and in the same place as on the docs bar.
  • A volume or mute set on one site still holds after moving to the other.
  • From the keyboard, Enter opens the panel, focus lands on the mute button, and Escape returns focus to the gear.
  • With sound on, each wingbeat is heard with the wing's downstroke, also in slow motion near the camera.
  • With sound on, Huginn sounds from where he is, and grows faint quickly as he goes away.
  • With sound on, a press on Docs or a card's GitHub link plays the ping before the page changes.
  • With sound off (the default), no AudioContext is created and the worker posts nothing for sound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions