Back to Proof of Work is dead
SOURCE / PINNED RELEASE

Made of little things.

Proof of Work is dead

Release
89cac09188df…
Author-recorded commit
8ef34170172d…
License
LICENSE
Author’s source reference
nostr://npub1eg5pfnws6tg6rtp33tugpppqtv5u05crmf983qp438cdycwzngys0gxzcs/wss%3A%2F%2Fgit.napplet.soy%2F/n-abb751b60a6

Archive hash verified: 2e3eb06f34235090…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/styles.css
/*
  Visual direction (see README): a furnace that cools into a ring.
  Flat poster colour fields, one melting display face, one grotesque for
  everything else. App-owned palette; the host theme is not followed.
*/

:root {
  --furnace: #ff5a1f;
  --furnace-hot: #e0260b;
  --soot: #1c0b05;
  --violet: #4a1fe0;
  --violet-deep: #2c0e9c;
  --lemon: #e6ff4f;
  --bone: #fff4e6;
  --pink: #ff4d8d;

  --text-font: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --display-font: "Climate Crisis", Impact, "Arial Black", sans-serif;

  --step-0: clamp(0.94rem, 0.78rem + 0.75vw, 1.55rem);
  --step-1: clamp(1.1rem, 0.85rem + 1.2vw, 2.1rem);
  /* Headlines follow the width, and stay under a tenth of the height in a low frame. */
  --step-3: clamp(1.7rem, min(0.9rem + 3.9vw, 10vh), 5.6rem);
  --pad-x: clamp(14px, 5vw, 72px);
  --pad-y: clamp(18px, 6vh, 64px);
  /* The page buttons, and the strip at the bottom of every page that they stand in. */
  --pager-size: clamp(30px, 11vmin, 46px);
  --pager-inset: clamp(6px, 2.4vmin, 18px);
  --pager-room: calc(var(--pager-size) + var(--pager-inset) + 10px);

  --napplet-text-selection: none;
  color-scheme: only light;
  font: 400 16px/1.42 var(--text-font);
  font-optical-sizing: auto;
}

* {
  box-sizing: border-box;
}

:where(html, body, body *) {
  -webkit-user-select: var(--napplet-text-selection, none);
  user-select: var(--napplet-text-selection, none);
}

:where(input, textarea, select, [contenteditable], [data-napplet-select="text"], [data-napplet-select="text"] *) {
  -webkit-user-select: text;
  user-select: text;
}

[hidden] {
  display: none !important;
}

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  background: var(--furnace);
  color: var(--soot);
  font-size: var(--step-0);
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

.app {
  overflow-x: hidden;
  overflow-y: auto;
  /* A deck, not a scroll: every gesture ends on a page. The buttons stand in for the scrollbar. */
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-width: none;
}

.app::-webkit-scrollbar {
  display: none;
}

.beat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 2.6vh, 28px);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--pad-y) var(--pad-x) max(var(--pad-y), var(--pager-room));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* A beat set over several pages: the script places every paragraph, so nothing centres. */
.beat.paged {
  justify-content: flex-start;
  align-content: start;
}

.ring.paged {
  align-items: start;
}

/* The further pages of a beat that is taller than the frame; placed by the script. */
.stop {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* --------------------------------------------------------------- the pager */

.pager {
  position: fixed;
  right: var(--pager-inset);
  bottom: var(--pager-inset);
  z-index: 2;
  display: flex;
  gap: clamp(4px, 1.4vmin, 8px);
}

.pager button {
  display: grid;
  place-items: center;
  width: var(--pager-size);
  height: var(--pager-size);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--soot);
  /* A bone edge, so the button also reads on the soot page. */
  box-shadow: 0 0 0 2px var(--bone);
  color: var(--bone);
  cursor: pointer;
  touch-action: manipulation;
}

.pager svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: square;
}

.pager button:disabled {
  visibility: hidden;
}

.pager button:active:not(:disabled) {
  background: var(--lemon);
  color: var(--soot);
}

.pager button:focus-visible {
  outline: 3px solid var(--lemon);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--soot);
}

/* On the first page the way on is the thing to find. */
.pager[data-first="true"] #pageDown {
  background: var(--lemon);
  color: var(--soot);
  box-shadow: 0 0 0 2px var(--soot);
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(18%);
  }
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h2 {
  max-width: 17em;
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 75%;
  line-height: 0.96;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h3 {
  font-size: var(--step-1);
  font-weight: 800;
  font-stretch: 82%;
  line-height: 1.05;
  text-wrap: balance;
}

.lead {
  max-width: 30em;
  font-size: var(--step-1);
  font-weight: 600;
  font-stretch: 88%;
  line-height: 1.22;
  text-wrap: pretty;
}

.body {
  max-width: 36em;
  text-wrap: pretty;
}

.fine {
  max-width: 40em;
  font-size: max(0.78em, 12px);
  line-height: 1.35;
  opacity: 0.82;
}

/* ------------------------------------------------------------- the furnace */

.furnace {
  --heat: 0;
  background: color-mix(in oklab, var(--furnace-hot) calc(var(--heat) * 100%), var(--furnace));
  justify-content: space-between;
  /* Not `hidden`: that would make the furnace a scroller, and the page markers inside it would snap to it. */
  overflow: clip;
}

.melt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--display-font);
  font-size: 12vw; /* replaced by the fitted size once the font is in */
  font-weight: 400;
  font-variation-settings: "YEAR" var(--year, 1979);
  line-height: 0.9;
  white-space: nowrap;
  visibility: hidden;
}

.fonts-ready .melt {
  visibility: visible;
}

.melt > span {
  display: block;
}

/* A tall frame gets one word per line, so the letters can be as big as the width allows. */
@media (max-aspect-ratio: 4/5) {
  .melt .word {
    display: block;
  }
}

.meter {
  display: grid;
  gap: clamp(4px, 1vh, 10px);
}

.meter-count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5em;
  font-weight: 600;
  font-stretch: 88%;
  line-height: 1.1;
}

.meter-number {
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.meter-line {
  max-width: 34em;
  min-height: 2.9em;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.aside {
  font-size: max(0.82em, 12px);
  font-weight: 600;
}

/* ----------------------------------------------------------------- the ash */

.ash {
  background: var(--soot);
  color: var(--bone);
}

.ash h2 {
  color: var(--furnace);
}

.race {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: clamp(2px, 0.8vh, 8px) clamp(10px, 2vw, 24px);
  max-width: 60em;
}

.race-who {
  font-weight: 700;
  font-stretch: 85%;
}

.race-track {
  height: clamp(14px, 3.6vh, 30px);
  background: color-mix(in srgb, var(--bone) 9%, transparent);
}

.race-bar {
  display: block;
  height: 100%;
}

.race-bar-you {
  /* True to scale this would be a few hundredths of a pixel. One device
     pixel is the least a screen can show; the caption gives the real width. */
  width: 1px;
  background: var(--bone);
}

.race-bar-gpu {
  width: 100%;
  background: var(--furnace);
}

.race-rate {
  grid-column: 2;
  margin-bottom: clamp(4px, 1.4vh, 14px);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* A narrow frame has no room for names beside the bars. */
@media (max-width: 560px) {
  .race {
    grid-template-columns: minmax(0, 1fr);
  }

  .race-rate {
    grid-column: 1;
  }
}

/* ---------------------------------------------------------------- the ring */

.ring {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: clamp(12px, 3vh, 32px) clamp(16px, 4vw, 56px);
  background: var(--violet);
  color: var(--bone);
}

.ring-stage {
  position: relative;
  justify-self: center;
  width: min(100%, max(33vh, 150px), 680px);
  aspect-ratio: 1;
  container-type: inline-size;
}

.ring-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ring-core {
  position: absolute;
  inset: 24%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  text-align: center;
  pointer-events: none;
}

.ring-core strong {
  font-size: clamp(1.15rem, 17cqw, 6rem);
  font-weight: 800;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.ring-core span {
  font-size: clamp(10px, 4.6cqw, 1.3rem);
  font-weight: 600;
  line-height: 1.1;
}

.ring-core[data-state="closed"] strong {
  color: var(--lemon);
}

.ring-side {
  display: grid;
  gap: clamp(8px, 2vh, 20px);
  min-width: 0;
}

.ring > h2 {
  max-width: none;
  color: var(--lemon);
}

.ring.has-result :where(#ringStory, #ringNote, .note-form) {
  display: none;
}

.note-form {
  display: grid;
  gap: 6px;
  max-width: 34em;
}

.note-form label {
  font-size: max(0.82em, 12px);
  font-weight: 700;
}

.note-form textarea {
  width: 100%;
  min-height: 3.4em;
  padding: 0.5em 0.65em;
  border: 2px solid var(--bone);
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font: inherit;
  font-weight: 500;
  line-height: 1.25;
  resize: none;
}

.act {
  justify-self: start;
  align-self: flex-start;
  min-height: 44px;
  padding: 0.55em 1em;
  border: 0;
  border-radius: 0;
  background: var(--lemon);
  box-shadow: 4px 4px 0 var(--soot);
  color: var(--soot);
  font: inherit;
  font-size: var(--step-1);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.05;
  text-align: left;
  cursor: pointer;
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}

.act:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--soot);
}

.act:disabled {
  background: color-mix(in srgb, var(--bone) 55%, var(--violet));
  box-shadow: none;
  cursor: progress;
}

.act-quiet {
  background: var(--bone);
  font-size: var(--step-0);
}

.act-dark {
  background: var(--soot);
  box-shadow: 4px 4px 0 var(--violet);
  color: var(--lemon);
}

:where(button, textarea):focus-visible {
  outline: 3px solid var(--lemon);
  outline-offset: 3px;
}

.call :where(button):focus-visible {
  outline-color: var(--violet);
}

.result {
  display: grid;
  gap: clamp(8px, 1.6vh, 14px);
  max-width: 34em;
}

.note {
  display: grid;
  gap: 0.35em;
  padding: 0.75em 0.9em;
  border-left: 6px solid var(--lemon);
  background: var(--violet-deep);
}

.note-from {
  color: var(--lemon);
  font-weight: 800;
  font-stretch: 85%;
}

.note-text {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.note-proof {
  font-size: max(0.8em, 12px);
  line-height: 1.3;
  opacity: 0.86;
}

.note[data-state="failed"] {
  border-left-color: var(--pink);
}

.note[data-state="failed"] .note-from {
  color: var(--pink);
}

/* Two questions, each with its answer: who can check, who can tell. */
.who {
  display: grid;
  gap: clamp(8px, 1.8vh, 16px);
  margin: 0;
}

.who-item {
  display: grid;
  gap: 0.2em;
  padding-top: 0.5em;
  border-top: 3px solid var(--lemon);
}

.who dt {
  color: var(--lemon);
  font-size: var(--step-1);
  font-weight: 800;
  font-stretch: 82%;
  line-height: 1.05;
  text-wrap: balance;
}

.who dd {
  margin: 0;
  font-size: max(0.9em, 12px);
  line-height: 1.32;
  text-wrap: pretty;
}

/* ------------------------------------------------------------- the unlocks */

.unlocks {
  background: var(--violet-deep);
  color: var(--bone);
}

.unlocks h2 {
  color: var(--lemon);
}

.unlock-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(12px, 3vh, 30px) clamp(20px, 5vw, 64px);
  max-width: 72em;
  padding: 0;
  list-style: none;
}

.unlock-list li {
  display: grid;
  align-content: start;
  gap: 0.4em;
  padding-top: 0.7em;
  border-top: 3px solid var(--lemon);
}

.unlock-list p {
  max-width: 32em;
  text-wrap: pretty;
}

/* --------------------------------------------------------------- the paper */

.paper {
  background: var(--bone);
  color: var(--soot);
}

.fineprint {
  justify-content: flex-start;
}

.steps {
  display: grid;
  gap: clamp(8px, 2vh, 18px);
  max-width: 46em;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: clamp(2.2rem, 7vw, 4.4rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(8px, 2vw, 20px);
}

.step-number {
  color: var(--violet);
  font-family: var(--display-font);
  font-size: clamp(1.8rem, 6vw, 3.8rem);
  line-height: 0.95;
}

.steps p {
  padding-top: 0.2em;
  text-wrap: pretty;
}

.fine-title {
  font-size: var(--step-1);
  font-stretch: 82%;
  letter-spacing: 0;
}

.fine-list {
  display: grid;
  gap: 0.55em;
  max-width: 44em;
  padding-left: 1.1em;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- the call */

.call {
  background: var(--lemon);
  color: var(--soot);
}

.call-title {
  max-width: none;
  color: var(--violet);
  font-family: var(--display-font);
  font-size: clamp(1.4rem, 12.4vw, 11rem);
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
  line-height: 0.9;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ layout */

@media (min-width: 700px) and (min-aspect-ratio: 1/1) {
  .ring {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  }

  .ring > h2 {
    grid-column: 1 / -1;
  }

  /* The way back to the form stands under the ring, where the frame has room to spare. */
  .ring-side {
    grid-column: 2;
    grid-row: 2 / span 2;
  }

  .ring > .act {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
    align-self: start;
  }

  /* As big as the column allows, and never so tall that the button under it leaves the page:
     the frame less its padding, one line of headline, two gaps and that button. */
  .ring-stage {
    width: min(
      100%,
      680px,
      100vh - var(--pad-y) - max(var(--pad-y), var(--pager-room)) - var(--step-3) - 2 * clamp(12px, 3vh, 32px) - 3.6rem
    );
  }

  .unlock-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A low, wide frame: one line of headline, and a ring that leaves the page to the text. */
@media (max-height: 480px) and (min-aspect-ratio: 1/1) {
  h2 {
    max-width: none;
  }

  .ring-stage {
    width: min(100%, max(46vh, 110px));
  }
}

/* A small upright frame: the ring gives way so that the note field and its button share its page. */
@media (max-height: 700px) and (max-aspect-ratio: 1/1) {
  .ring-stage {
    width: min(100%, max(26vh, 150px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .app {
    scroll-behavior: auto;
  }

  .pager[data-first="true"] #pageDown {
    animation: none;
  }

  .act {
    transition: none;
  }
}