Back to Powder Tool
SOURCE / PINNED RELEASE

Made of little things.

Powder Tool

Release
242076e6da24…
Author-recorded commit
c4489f440f27…
License
LICENSE
Author’s source reference
nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-48e516e34e5

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

src/styles.css
:root {
  --bg: #15191d; --fg: #e6e9e8; --primary: #e8bc72;
  --surface: color-mix(in srgb, var(--bg) 95%, var(--fg));
  --raised: color-mix(in srgb, var(--bg) 89%, var(--fg));
  --line: color-mix(in srgb, var(--fg) 12%, transparent);
  --muted: color-mix(in srgb, var(--fg) 58%, var(--bg));
  --selected: color-mix(in srgb, var(--primary) 12%, var(--bg));
  --control-h: 28px; --napplet-text-selection: none;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; background: var(--bg); color: var(--fg); }
body { overflow: hidden; user-select: var(--napplet-text-selection); }
button, select, input { font: inherit; }
button, select { color: var(--fg); border: 1px solid var(--line); background: transparent; border-radius: 5px; min-height: var(--control-h); }
button { display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 3px 8px; cursor: pointer; }
button:hover:not(:disabled), select:hover { background: var(--raised); border-color: var(--muted); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
select { padding: 3px 24px 3px 8px; max-width: 100%; background: var(--surface); }
option { background: var(--bg); color: var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#app { display: flex; flex-direction: column; container-type: inline-size; }
.toolbar { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); flex-shrink: 0; z-index: 3; }
.primary { color: var(--primary); background: var(--selected); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.icon-button { width: var(--control-h); padding: 4px; flex-shrink: 0; }
.divider { width: 1px; align-self: stretch; margin: 3px 2px; background: var(--line); }
.toolbar-spacer { flex: 1; }
.live-state { display: flex; gap: 6px; align-items: center; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1px; margin-right: 8px; color: var(--muted); }
.live-state i { width: 5px; height: 5px; border-radius: 50%; background: #8ec59c; }
.live-state.is-paused i { background: var(--primary); }
.workbench { display: flex; flex: 1; min-height: 0; position: relative; }
#palette { width: clamp(172px, 20vw, 208px); flex-shrink: 0; overflow-y: auto; padding: 12px; border-right: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.section-label { display: flex; justify-content: space-between; color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1.3px; margin: 4px 0 8px; }
.section-label span { opacity: .5; letter-spacing: .2px; }
.material-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 18px; }
.material { justify-content: flex-start; padding: 8px; gap: 8px; min-height: 36px; font-size: 12px; border-color: transparent; background: color-mix(in srgb, var(--fg) 3%, transparent); }
.material[aria-pressed="true"], .tool-grid button[aria-pressed="true"], .canvas-tools button[aria-pressed="true"] { color: var(--primary); background: var(--selected); border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.swatch { width: 13px; height: 13px; background: var(--swatch); flex-shrink: 0; border-radius: 2px; box-shadow: inset 0 0 0 1px #ffffff18; position: relative; }
.swatch.sand { background: repeating-conic-gradient(#d9b36e 0% 25%, #b88b49 0% 50%) 50% / 5px 5px; }
.swatch.water { border-radius: 7px 7px 6px 2px; transform: rotate(-35deg); }
.swatch.fire, .swatch.lava { border-radius: 3px 8px 4px 8px; }
.swatch.box { background: #b99058; border: 2px solid #d4b17c; }
.swatch.box:after { content: ''; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 40%, #e0bb8388 42% 58%, transparent 60%); }
.swatch.stone { clip-path: polygon(25% 0,80% 10%,100% 60%,70% 100%,10% 80%,0 35%); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.tool-grid button { min-width: 0; font-size: 12px; }
.brush-control { margin-top: 18px; }
.gravity-control { margin-top: 14px; }
.brush-control label, .gravity-control label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
output { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
input[type="range"] { width: 100%; margin: 8px 0 0; accent-color: var(--primary); cursor: pointer; height: 15px; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.edit-controls { display: flex; gap: 6px; margin-top: 18px; }
.edit-controls button { flex: 1; font-size: 11px; }
.material-detail { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.material-detail > span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1px; }
.material-detail strong { display: block; font-size: 16px; font-weight: 500; margin: 6px 0; }
.material-detail p { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 0; }
.viewport { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; background: var(--bg); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.scene-badge { position: absolute; left: 16px; top: 14px; pointer-events: none; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; }
.scene-mode { padding-left: 12px; border-left: 1px solid var(--line); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1px; opacity: .7; }
.canvas-hint { position: absolute; top: 43px; left: 16px; color: var(--muted); font-size: 10px; pointer-events: none; opacity: .75; }
.canvas-hint span { margin: 0 4px; }
.telemetry { position: absolute; bottom: 12px; right: 14px; display: flex; gap: 16px; pointer-events: none; color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.telemetry b { font-weight: 400; color: var(--fg); }
.canvas-tools { display: flex; gap: 5px; position: absolute; bottom: 10px; left: 12px; }
.canvas-tools button { background: var(--surface); width: 30px; height: 30px; padding: 5px; }
#paused-badge { position: absolute; top: 12px; right: 12px; color: var(--primary); background: var(--surface); border: 1px solid var(--line); padding: 4px 8px; border-radius: 4px; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; pointer-events: none; }
#toast { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 8px 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; font-size: 12px; text-align: center; pointer-events: none; }
#palette-toggle, .drawer-actions { display: none; }
@media (min-width: 900px) { .material { min-height: 40px; } .material-grid { gap: 6px; } #palette { padding: 16px 12px; } }
@media (max-width: 599px) {
  #palette-toggle { display: inline-flex; }
  #palette { position: absolute; top: 0; left: 0; bottom: 0; z-index: 5; width: min(252px, 100%); display: none; border-bottom: 1px solid var(--line); }
  #app.palette-open #palette { display: block; }
  .toolbar { gap: 4px; padding: 6px; }
  .button-label, .live-state, .secondary-control, .divider { display: none; }
  .scene-field { flex: 1; min-width: 0; }
  .scene-field select { width: 100%; }
  .toolbar-spacer { display: none; }
  .scene-mode, .canvas-hint { display: none; }
  .scene-badge { left: 12px; top: 12px; }
  .telemetry { gap: 8px; bottom: 19px; }
  .fps { display: none; }
  .drawer-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
  .drawer-actions button { flex: 1 0 auto; font-size: 11px; }
}
@media (max-width: 239px) {
  .toolbar { padding: 4px; gap: 3px; }
  select { padding-left: 4px; font-size: 11px; }
  .scene-badge, .telemetry, .canvas-tools, #paused-badge { display: none !important; }
  #palette { width: 100%; padding: 8px; }
  .material-grid { margin-bottom: 10px; }
}
@media (max-height: 380px) {
  .canvas-hint, .scene-mode { display: none; }
  .scene-badge { top: 8px; }
  .toolbar { padding-top: 4px; padding-bottom: 4px; }
  .material-detail { display: none; }
}
@media (pointer: coarse) {
  :root { --control-h: 44px !important; }
  button, select { min-height: 44px; }
  button { min-width: 44px; }
  .icon-button { min-width: 44px; }
  .material { min-height: 44px; }
  input[type="range"] { height: 36px; margin-top: 0; }
  .canvas-tools button { width: 44px; height: 44px; }
  .telemetry { bottom: 25px; }
  .canvas-tools { bottom: max(8px, env(safe-area-inset-bottom)); }
  #palette { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { button:active:not(:disabled) { transform: none; } }

/* Source configuration stays in the same scrollable workbench as the palette. */
.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.tool-grid button { padding-inline: 3px; font-size: 11px; }
.material-grid { margin-bottom: 12px; }
.material { padding: 6px; gap: 6px; font-size: 11px; }
#emitter-editor { border-block: 1px solid var(--line); padding: 10px 0 12px; margin-bottom: 12px; }
#emitter-editor[hidden] { display: none; }
#emitter-editor > label, .resolution-control { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; margin-top: 8px; }
#emitter-editor > select, .resolution-control select { width: 100%; font-size: 11px; min-width: 0; }
#emitter-editor .emitter-enabled { justify-content: flex-start; align-items: center; min-height: var(--control-h); }
.emitter-enabled input { accent-color: var(--primary); }
.emitter-tip { font-size: 10px; color: var(--muted); margin: 10px 0; }
#emitter-place { width: 100%; }
.resolution-control { flex-direction: column; margin-top: 14px; }
.swatch.smoke, .swatch.steam, .swatch.helium, .swatch.hydrogen, .swatch.co2 { border-radius: 50%; opacity: .8; box-shadow: 3px -2px 0 -2px var(--swatch), -3px 3px 0 -2px var(--swatch); }
@media (max-width: 400px) { .telemetry > span:nth-child(2) { display: none; } }
@media (pointer: coarse) { .emitter-enabled { min-height: 44px; } }