atagen

malice

public
Star0
Watch0
ebd21444da0f089f9ef6137a717fbf9ce17d58a6
2
ssh://brewery@pls.lobotomise.me:33/atagen/malice.git

Blame: web/src/lib/SettingsPanel.svelte

df3c0f2b3da4atagen2026-10-22 13:07 UTC1
<script lang="ts">
df3c0f2b3da4atagen2026-10-22 13:07 UTC2
  import { createEventDispatcher } from 'svelte';
df3c0f2b3da4atagen2026-10-22 13:07 UTC3
  import {
df3c0f2b3da4atagen2026-10-22 13:07 UTC4
    LINE_HEIGHT_DEFAULT,
df3c0f2b3da4atagen2026-10-22 13:07 UTC5
    LINE_HEIGHT_MAX,
df3c0f2b3da4atagen2026-10-22 13:07 UTC6
    LINE_HEIGHT_MIN,
df3c0f2b3da4atagen2026-10-22 13:07 UTC7
    MESSAGE_SPACING_DEFAULT,
df3c0f2b3da4atagen2026-10-22 13:07 UTC8
    MESSAGE_SPACING_MAX,
df3c0f2b3da4atagen2026-10-22 13:07 UTC9
    MESSAGE_SPACING_MIN,
df3c0f2b3da4atagen2026-10-22 13:07 UTC10
    lineHeight,
c122e088beceatagen2026-10-25 02:37 UTC11
    messageSpacing
df3c0f2b3da4atagen2026-10-22 13:07 UTC12
  } from './appearance';
df3c0f2b3da4atagen2026-10-22 13:07 UTC13
  import { DEFAULT_QUICK_REACTIONS } from './quick-reactions';
df3c0f2b3da4atagen2026-10-22 13:07 UTC14
  import ReactionPicker from './ReactionPicker.svelte';
c122e088beceatagen2026-10-25 02:37 UTC15
  import ThemeSettings from './ThemeSettings.svelte';
9f996e377406atagen2026-10-25 03:32 UTC16
  import HistoryRepairSettings from './HistoryRepairSettings.svelte';
df3c0f2b3da4atagen2026-10-22 13:07 UTC17
  import type { ImagePack, QuickReaction } from './types';
df3c0f2b3da4atagen2026-10-22 13:07 UTC18
df3c0f2b3da4atagen2026-10-22 13:07 UTC19
  export let quick: QuickReaction[];
df3c0f2b3da4atagen2026-10-22 13:07 UTC20
  export let packs: ImagePack[] = [];
df3c0f2b3da4atagen2026-10-22 13:07 UTC21
  export let onQuickChange: (list: QuickReaction[]) => void;
df3c0f2b3da4atagen2026-10-22 13:07 UTC22
d095131eec0eatagen2026-10-24 08:39 UTC23
  const dispatch = createEventDispatcher<{ close: void; packs: void }>();
df3c0f2b3da4atagen2026-10-22 13:07 UTC24
df3c0f2b3da4atagen2026-10-22 13:07 UTC25
  $: quickIsDefault =
df3c0f2b3da4atagen2026-10-22 13:07 UTC26
    quick.length === DEFAULT_QUICK_REACTIONS.length && quick.every((r, i) => r.key === DEFAULT_QUICK_REACTIONS[i].key);
df3c0f2b3da4atagen2026-10-22 13:07 UTC27
df3c0f2b3da4atagen2026-10-22 13:07 UTC28
</script>
df3c0f2b3da4atagen2026-10-22 13:07 UTC29
df3c0f2b3da4atagen2026-10-22 13:07 UTC30
<div class="modal settings" role="dialog" aria-modal="true" aria-label="Settings">
df3c0f2b3da4atagen2026-10-22 13:07 UTC31
  <div class="modal-tabs" role="tablist" aria-label="Settings">
df3c0f2b3da4atagen2026-10-22 13:07 UTC32
    <button type="button" role="tab" aria-selected="true" class="active">Settings</button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC33
    <button type="button" class="icon-btn modal-x" aria-label="Close settings" on:click={() => dispatch('close')}>
df3c0f2b3da4atagen2026-10-22 13:07 UTC34
      <span aria-hidden="true">✕</span>
df3c0f2b3da4atagen2026-10-22 13:07 UTC35
    </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC36
  </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC37
c122e088beceatagen2026-10-25 02:37 UTC38
  <ThemeSettings />
9f996e377406atagen2026-10-25 03:32 UTC39
  <HistoryRepairSettings />
df3c0f2b3da4atagen2026-10-22 13:07 UTC40
df3c0f2b3da4atagen2026-10-22 13:07 UTC41
  <section aria-label="Message spacing">
df3c0f2b3da4atagen2026-10-22 13:07 UTC42
    <h3 class="sec-h">Space between messages</h3>
df3c0f2b3da4atagen2026-10-22 13:07 UTC43
    <div class="range">
df3c0f2b3da4atagen2026-10-22 13:07 UTC44
      <input
df3c0f2b3da4atagen2026-10-22 13:07 UTC45
        type="range"
df3c0f2b3da4atagen2026-10-22 13:07 UTC46
        min={MESSAGE_SPACING_MIN}
df3c0f2b3da4atagen2026-10-22 13:07 UTC47
        max={MESSAGE_SPACING_MAX}
df3c0f2b3da4atagen2026-10-22 13:07 UTC48
        step="1"
df3c0f2b3da4atagen2026-10-22 13:07 UTC49
        bind:value={$messageSpacing}
df3c0f2b3da4atagen2026-10-22 13:07 UTC50
        aria-label="Space between messages in pixels"
df3c0f2b3da4atagen2026-10-22 13:07 UTC51
      />
df3c0f2b3da4atagen2026-10-22 13:07 UTC52
      <span class="value">{$messageSpacing}px</span>
df3c0f2b3da4atagen2026-10-22 13:07 UTC53
      <button
df3c0f2b3da4atagen2026-10-22 13:07 UTC54
        type="button"
df3c0f2b3da4atagen2026-10-22 13:07 UTC55
        class="ghost-btn"
df3c0f2b3da4atagen2026-10-22 13:07 UTC56
        disabled={$messageSpacing === MESSAGE_SPACING_DEFAULT}
df3c0f2b3da4atagen2026-10-22 13:07 UTC57
        on:click={() => messageSpacing.set(MESSAGE_SPACING_DEFAULT)}
df3c0f2b3da4atagen2026-10-22 13:07 UTC58
      >
df3c0f2b3da4atagen2026-10-22 13:07 UTC59
        Reset
df3c0f2b3da4atagen2026-10-22 13:07 UTC60
      </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC61
    </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC62
    <h3 class="sec-h">Line height</h3>
df3c0f2b3da4atagen2026-10-22 13:07 UTC63
    <div class="range">
df3c0f2b3da4atagen2026-10-22 13:07 UTC64
      <input
df3c0f2b3da4atagen2026-10-22 13:07 UTC65
        type="range"
df3c0f2b3da4atagen2026-10-22 13:07 UTC66
        min={LINE_HEIGHT_MIN}
df3c0f2b3da4atagen2026-10-22 13:07 UTC67
        max={LINE_HEIGHT_MAX}
df3c0f2b3da4atagen2026-10-22 13:07 UTC68
        step="0.05"
df3c0f2b3da4atagen2026-10-22 13:07 UTC69
        bind:value={$lineHeight}
df3c0f2b3da4atagen2026-10-22 13:07 UTC70
        aria-label="Line height within messages"
df3c0f2b3da4atagen2026-10-22 13:07 UTC71
      />
df3c0f2b3da4atagen2026-10-22 13:07 UTC72
      <span class="value">{$lineHeight.toFixed(2)}</span>
df3c0f2b3da4atagen2026-10-22 13:07 UTC73
      <button
df3c0f2b3da4atagen2026-10-22 13:07 UTC74
        type="button"
df3c0f2b3da4atagen2026-10-22 13:07 UTC75
        class="ghost-btn"
df3c0f2b3da4atagen2026-10-22 13:07 UTC76
        disabled={$lineHeight === LINE_HEIGHT_DEFAULT}
df3c0f2b3da4atagen2026-10-22 13:07 UTC77
        on:click={() => lineHeight.set(LINE_HEIGHT_DEFAULT)}
df3c0f2b3da4atagen2026-10-22 13:07 UTC78
      >
df3c0f2b3da4atagen2026-10-22 13:07 UTC79
        Reset
df3c0f2b3da4atagen2026-10-22 13:07 UTC80
      </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC81
    </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC82
  </section>
df3c0f2b3da4atagen2026-10-22 13:07 UTC83
df3c0f2b3da4atagen2026-10-22 13:07 UTC84
  <section aria-label="Quick reactions">
df3c0f2b3da4atagen2026-10-22 13:07 UTC85
    <div class="sec-head">
df3c0f2b3da4atagen2026-10-22 13:07 UTC86
      <h3 class="sec-h">Quick reactions</h3>
df3c0f2b3da4atagen2026-10-22 13:07 UTC87
      <button type="button" class="ghost-btn" disabled={quickIsDefault} on:click={() => onQuickChange(DEFAULT_QUICK_REACTIONS)}>
df3c0f2b3da4atagen2026-10-22 13:07 UTC88
        Reset
df3c0f2b3da4atagen2026-10-22 13:07 UTC89
      </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC90
    </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC91
    <ReactionPicker embedded {quick} {packs} {onQuickChange} onPick={() => {}} onClose={() => dispatch('close')} />
df3c0f2b3da4atagen2026-10-22 13:07 UTC92
  </section>
d095131eec0eatagen2026-10-24 08:39 UTC93
d095131eec0eatagen2026-10-24 08:39 UTC94
  <section aria-label="Packs">
d095131eec0eatagen2026-10-24 08:39 UTC95
    <div class="sec-head">
d095131eec0eatagen2026-10-24 08:39 UTC96
      <h3 class="sec-h">Sticker and emoji packs</h3>
d095131eec0eatagen2026-10-24 08:39 UTC97
      <button type="button" class="ghost-btn" on:click={() => dispatch('packs')}>Manage</button>
d095131eec0eatagen2026-10-24 08:39 UTC98
    </div>
d095131eec0eatagen2026-10-24 08:39 UTC99
  </section>
df3c0f2b3da4atagen2026-10-22 13:07 UTC100
</div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC101
df3c0f2b3da4atagen2026-10-22 13:07 UTC102
<style>
df3c0f2b3da4atagen2026-10-22 13:07 UTC103
  .settings { max-height: calc(100dvh - 32px); overflow-y: auto; }
c122e088beceatagen2026-10-25 02:37 UTC104
  section { margin-top: 18px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC105
  .sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC106
  .sec-head .sec-h { margin: 0; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC107
  .sec-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC108
  .range + .sec-h { margin-top: 12px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC109
  .range { display: flex; align-items: center; gap: 10px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC110
  .range input[type='range'] { flex: 1; accent-color: var(--accent); }
df3c0f2b3da4atagen2026-10-22 13:07 UTC111
  .value { font-size: 13px; min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC112
</style>