atagen

malice

public
Star0
Watch0
e72926bcca9a49b5dce29970ae99748c32cac9f5
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';
a4555a7eae2datagen2026-10-25 09:18 UTC16
  import KeywordSettings from './KeywordSettings.svelte';
db4e552594cbatagen2026-10-26 04:43 UTC17
  import NotificationSettings from './NotificationSettings.svelte';
df3c0f2b3da4atagen2026-10-22 13:07 UTC18
  import type { ImagePack, QuickReaction } from './types';
df3c0f2b3da4atagen2026-10-22 13:07 UTC19
df3c0f2b3da4atagen2026-10-22 13:07 UTC20
  export let quick: QuickReaction[];
df3c0f2b3da4atagen2026-10-22 13:07 UTC21
  export let packs: ImagePack[] = [];
df3c0f2b3da4atagen2026-10-22 13:07 UTC22
  export let onQuickChange: (list: QuickReaction[]) => void;
df3c0f2b3da4atagen2026-10-22 13:07 UTC23
d095131eec0eatagen2026-10-24 08:39 UTC24
  const dispatch = createEventDispatcher<{ close: void; packs: void }>();
df3c0f2b3da4atagen2026-10-22 13:07 UTC25
df3c0f2b3da4atagen2026-10-22 13:07 UTC26
  $: quickIsDefault =
df3c0f2b3da4atagen2026-10-22 13:07 UTC27
    quick.length === DEFAULT_QUICK_REACTIONS.length && quick.every((r, i) => r.key === DEFAULT_QUICK_REACTIONS[i].key);
df3c0f2b3da4atagen2026-10-22 13:07 UTC28
df3c0f2b3da4atagen2026-10-22 13:07 UTC29
</script>
df3c0f2b3da4atagen2026-10-22 13:07 UTC30
df3c0f2b3da4atagen2026-10-22 13:07 UTC31
<div class="modal settings" role="dialog" aria-modal="true" aria-label="Settings">
df3c0f2b3da4atagen2026-10-22 13:07 UTC32
  <div class="modal-tabs" role="tablist" aria-label="Settings">
df3c0f2b3da4atagen2026-10-22 13:07 UTC33
    <button type="button" role="tab" aria-selected="true" class="active">Settings</button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC34
    <button type="button" class="icon-btn modal-x" aria-label="Close settings" on:click={() => dispatch('close')}>
df3c0f2b3da4atagen2026-10-22 13:07 UTC35
      <span aria-hidden="true">✕</span>
df3c0f2b3da4atagen2026-10-22 13:07 UTC36
    </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC37
  </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC38
c122e088beceatagen2026-10-25 02:37 UTC39
  <ThemeSettings />
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
db4e552594cbatagen2026-10-26 04:43 UTC84
  <NotificationSettings />
db4e552594cbatagen2026-10-26 04:43 UTC85
a4555a7eae2datagen2026-10-25 09:18 UTC86
  <KeywordSettings />
a4555a7eae2datagen2026-10-25 09:18 UTC87
df3c0f2b3da4atagen2026-10-22 13:07 UTC88
  <section aria-label="Quick reactions">
df3c0f2b3da4atagen2026-10-22 13:07 UTC89
    <div class="sec-head">
df3c0f2b3da4atagen2026-10-22 13:07 UTC90
      <h3 class="sec-h">Quick reactions</h3>
df3c0f2b3da4atagen2026-10-22 13:07 UTC91
      <button type="button" class="ghost-btn" disabled={quickIsDefault} on:click={() => onQuickChange(DEFAULT_QUICK_REACTIONS)}>
df3c0f2b3da4atagen2026-10-22 13:07 UTC92
        Reset
df3c0f2b3da4atagen2026-10-22 13:07 UTC93
      </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC94
    </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC95
    <ReactionPicker embedded {quick} {packs} {onQuickChange} onPick={() => {}} onClose={() => dispatch('close')} />
df3c0f2b3da4atagen2026-10-22 13:07 UTC96
  </section>
d095131eec0eatagen2026-10-24 08:39 UTC97
d095131eec0eatagen2026-10-24 08:39 UTC98
  <section aria-label="Packs">
d095131eec0eatagen2026-10-24 08:39 UTC99
    <div class="sec-head">
d095131eec0eatagen2026-10-24 08:39 UTC100
      <h3 class="sec-h">Sticker and emoji packs</h3>
d095131eec0eatagen2026-10-24 08:39 UTC101
      <button type="button" class="ghost-btn" on:click={() => dispatch('packs')}>Manage</button>
d095131eec0eatagen2026-10-24 08:39 UTC102
    </div>
d095131eec0eatagen2026-10-24 08:39 UTC103
  </section>
df3c0f2b3da4atagen2026-10-22 13:07 UTC104
</div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC105
df3c0f2b3da4atagen2026-10-22 13:07 UTC106
<style>
df3c0f2b3da4atagen2026-10-22 13:07 UTC107
  .settings { max-height: calc(100dvh - 32px); overflow-y: auto; }
c122e088beceatagen2026-10-25 02:37 UTC108
  section { margin-top: 18px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC109
  .sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC110
  .sec-head .sec-h { margin: 0; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC111
  .sec-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC112
  .range + .sec-h { margin-top: 12px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC113
  .range { display: flex; align-items: center; gap: 10px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC114
  .range input[type='range'] { flex: 1; accent-color: var(--accent); }
df3c0f2b3da4atagen2026-10-22 13:07 UTC115
  .value { font-size: 13px; min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC116
</style>