fix: apply review findings; make ops strip text CSS-generated

This commit is contained in:
2026-10-10 14:28:16 +03:00
parent 8f95fda49e
commit 7280133fed
4 changed files with 41 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, onUnmounted, shallowRef } from 'vue';
import { onMounted, onUnmounted, shallowRef, watch } from 'vue';
const props = defineProps<{ allowMotion: boolean }>();
@@ -26,10 +26,14 @@ const finish = (): void => {
const onKey = (): void => finish();
onMounted(() => {
let started = false;
const start = (): void => {
if (started || !props.allowMotion || navigator.webdriver) return;
started = true;
let seen = false;
try { seen = window.sessionStorage.getItem(SEEN_KEY) === '1'; } catch { seen = false; }
if (!props.allowMotion || seen || navigator.webdriver) return;
if (seen) return;
try { window.sessionStorage.setItem(SEEN_KEY, '1'); } catch { /* optional */ }
visible.value = true;
LINES.forEach((_, index) => {
@@ -37,6 +41,11 @@ onMounted(() => {
});
timers.push(window.setTimeout(finish, 260 + LINES.length * 280 + 500));
window.addEventListener('keydown', onKey, { once: true });
};
// The motion policy resolves in the parent's onMounted (after ours), so react to the prop.
onMounted(() => {
watch(() => props.allowMotion, start, { immediate: true });
});
onUnmounted(() => {

View File

@@ -5,8 +5,8 @@ import { bucharestClock, uptimeSince } from '@/lib/operations';
/** Start of the current hosting-admin role (content file: Trupa lui Răzuș, Aug 2025). */
const SHIFT_START = new Date('2025-08-01T00:00:00Z');
const clock = shallowRef<string | null>(null);
const shift = shallowRef<string | null>(null);
const clock = shallowRef('--:--');
const shift = shallowRef('-- mo');
let timer = 0;
const tick = (): void => {
@@ -24,10 +24,11 @@ onUnmounted(() => window.clearInterval(timer));
</script>
<template>
<!-- Purely decorative telemetry: all text is CSS-generated so the semantic document is unchanged. -->
<aside class="ops-strip" aria-hidden="true">
<span class="ops-strip__dot" />
<span>Bucharest <strong>{{ clock ?? '--:--' }}</strong></span>
<span class="ops-strip__sep">/</span>
<span>On shift <strong>{{ shift ?? '-- mo' }}</strong></span>
<span class="ops-strip__item" data-label="Bucharest" :data-value="clock" />
<span class="ops-strip__sep" />
<span class="ops-strip__item" data-label="On shift" :data-value="shift" />
</aside>
</template>