|
10 | 10 | import { selectionStore } from '$lib/state/selection.svelte.js'; |
11 | 11 | import { lineIsLinkTargetWhilePending } from '$lib/domain/lines-helpers.js'; |
12 | 12 | import { resolveLineFontCss } from '$lib/fonts/visualization-font.js'; |
| 13 | + import { ALIGNER_SITE_HOST, ALIGNER_SITE_URL } from '$lib/brand.js'; |
13 | 14 | import { MAX_LINES } from '$lib/serialization/schema.js'; |
14 | 15 |
|
15 | 16 | let { |
|
25 | 26 | let rootEl = $state<HTMLElement | null>(null); |
26 | 27 |
|
27 | 28 | const bg = $derived(settingsStore.settings.background); |
| 29 | + const hideChrome = $derived(settingsStore.settings.previewHideChrome); |
| 30 | + const chromeHiddenLayer = 'invisible pointer-events-none select-none'; |
28 | 31 | const connections = $derived(projectStore.connections); |
29 | 32 | const lineIds = $derived(projectStore.lines.map((l) => l.id)); |
30 | 33 | </script> |
|
46 | 49 | <div class="preview-frame__image-overlay"></div> |
47 | 50 | {/if} |
48 | 51 | <div class="preview-stack"> |
49 | | - <div class="mb-1 flex justify-center"> |
| 52 | + <div |
| 53 | + class="mb-1 flex justify-center {hideChrome ? chromeHiddenLayer : ''}" |
| 54 | + aria-hidden={hideChrome ? true : undefined} |
| 55 | + > |
50 | 56 | <button |
51 | 57 | type="button" |
52 | 58 | class="rounded-none border border-dashed border-gray-400 px-2 py-0.5 text-xs font-medium text-gray-600 hover:border-primary-500 hover:text-primary-700 disabled:opacity-40 dark:border-gray-600 dark:text-gray-400 dark:hover:border-primary-400 dark:hover:text-primary-300" |
|
67 | 73 | class:opacity-[0.34]={rowDimmed} |
68 | 74 | style:font-family={resolveLineFontCss(line)} |
69 | 75 | > |
70 | | - <LineReorderButtons {line} index={li} total={projectStore.lines.length} /> |
| 76 | + <div |
| 77 | + class="shrink-0 {hideChrome ? chromeHiddenLayer : ''}" |
| 78 | + aria-hidden={hideChrome ? true : undefined} |
| 79 | + > |
| 80 | + <LineReorderButtons {line} index={li} total={projectStore.lines.length} /> |
| 81 | + </div> |
71 | 82 | <div class="preview-gloss-wrap min-w-0 flex-1"> |
72 | 83 | <TokenRow |
73 | 84 | tokens={projectStore.tokensOnLine(line.id)} |
|
78 | 89 | interactive={true} |
79 | 90 | /> |
80 | 91 | </div> |
81 | | - <LineTrailingActions |
82 | | - {line} |
83 | | - index={li} |
84 | | - total={projectStore.lines.length} |
85 | | - {gearDomId} |
86 | | - triggeredBy={`#${gearDomId}`} |
87 | | - /> |
| 92 | + <div |
| 93 | + class="shrink-0 {hideChrome ? chromeHiddenLayer : ''}" |
| 94 | + aria-hidden={hideChrome ? true : undefined} |
| 95 | + > |
| 96 | + <LineTrailingActions |
| 97 | + {line} |
| 98 | + index={li} |
| 99 | + total={projectStore.lines.length} |
| 100 | + {gearDomId} |
| 101 | + triggeredBy={`#${gearDomId}`} |
| 102 | + /> |
| 103 | + </div> |
88 | 104 | </div> |
89 | 105 | {#if li < projectStore.lines.length - 1} |
90 | 106 | {@const lowerLine = projectStore.lines[li + 1]!} |
91 | | - <LinePairGapSlider upperLineId={line.id} lowerLineId={lowerLine.id} /> |
| 107 | + <div |
| 108 | + class={hideChrome ? chromeHiddenLayer : ''} |
| 109 | + aria-hidden={hideChrome ? true : undefined} |
| 110 | + > |
| 111 | + <LinePairGapSlider upperLineId={line.id} lowerLineId={lowerLine.id} /> |
| 112 | + </div> |
92 | 113 | {/if} |
93 | 114 | {/each} |
94 | | - <div class="mt-1 flex justify-center"> |
| 115 | + <div |
| 116 | + class="mt-1 flex justify-center {hideChrome ? chromeHiddenLayer : ''}" |
| 117 | + aria-hidden={hideChrome ? true : undefined} |
| 118 | + > |
95 | 119 | <button |
96 | 120 | type="button" |
97 | 121 | class="rounded-none border border-dashed border-gray-400 px-2 py-0.5 text-xs font-medium text-gray-600 hover:border-primary-500 hover:text-primary-700 disabled:opacity-40 dark:border-gray-600 dark:text-gray-400 dark:hover:border-primary-400 dark:hover:text-primary-300" |
|
101 | 125 | + Add line |
102 | 126 | </button> |
103 | 127 | </div> |
| 128 | + {#if hideChrome} |
| 129 | + <p class="preview-frame__attribution"> |
| 130 | + Created with |
| 131 | + <button |
| 132 | + type="button" |
| 133 | + class="preview-frame__attribution-link inline cursor-pointer border-0 bg-transparent p-0 font-inherit underline" |
| 134 | + onclick={() => window.open(ALIGNER_SITE_URL, '_blank', 'noopener,noreferrer')} |
| 135 | + > |
| 136 | + {ALIGNER_SITE_HOST} |
| 137 | + </button> |
| 138 | + </p> |
| 139 | + {/if} |
104 | 140 | </div> |
105 | 141 | <AlignmentSvg {rootEl} {connections} {writesExportLayout} /> |
106 | 142 | </div> |
0 commit comments