hlassiege/darylpublic Fork
⑂ 931d2cb
Commits
⬇ Clone ▾
git clone https://git.rickub.com/hlassiege/daryl.git
git clone ssh://git@rickub.com/hlassiege/daryl.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

feat(derush): add -1 s / +1 s buttons under the preview

hlassiege committed 2026-10-12T10:43:46+02:00 Browse files
931d2cb parent: 23a0a14
modified web/src/i18n/locales/en/derush.ts +2 -0
@@ -41,6 +41,8 @@ export default {
4141 player: {
4242 restart: "Back to start",
4343 playPause: "Play / pause",
44+ back1: "−1 s (Shift+←)",
45+ fwd1: "+1 s (Shift+→)",
4446 },
4547 legend: {
4648 speech: "Speech",
@@ -41,6 +41,8 @@ export default {
41 player: {41 player: {
42 restart: "Back to start",42 restart: "Back to start",
43 playPause: "Play / pause",43 playPause: "Play / pause",
44+ back1: "−1 s (Shift+←)",
45+ fwd1: "+1 s (Shift+→)",
44 },46 },
45 legend: {47 legend: {
46 speech: "Speech",48 speech: "Speech",
modified web/src/i18n/locales/fr/derush.ts +2 -0
@@ -41,6 +41,8 @@ export default {
4141 player: {
4242 restart: "Revenir au début",
4343 playPause: "Lecture / pause",
44+ back1: "−1 s (Maj+←)",
45+ fwd1: "+1 s (Maj+→)",
4446 },
4547 legend: {
4648 speech: "Parole",
@@ -41,6 +41,8 @@ export default {
41 player: {41 player: {
42 restart: "Revenir au début",42 restart: "Revenir au début",
43 playPause: "Lecture / pause",43 playPause: "Lecture / pause",
44+ back1: "−1 s (Maj+←)",
45+ fwd1: "+1 s (Maj+→)",
44 },46 },
45 legend: {47 legend: {
46 speech: "Parole",48 speech: "Parole",
modified web/src/project/steps/derush/PlayerFrame.vue +5 -1
@@ -1,5 +1,5 @@
11 <script setup lang="ts">
2-/** Le lecteur sombre : vidéo 16/9, sous-titre de la phrase en cours, début / lecture / temps. */
2+/** Le lecteur sombre : vidéo 16/9, sous-titre de la phrase en cours, début / ±1 s / lecture / temps. */
33 import { onBeforeUnmount, onMounted, ref } from "vue";
44 import { useI18n } from "vue-i18n";
55 import { mmss } from "../../../lib/format";
@@ -11,6 +11,7 @@ const props = defineProps<{ player: Playlist; height: number; caption?: string }
1111 const el = ref<HTMLVideoElement | null>(null);
1212 onMounted(() => { props.player.video.value = el.value; });
1313 onBeforeUnmount(() => { props.player.video.value = null; });
14+const step = (s: number) => props.player.seek(Math.max(0, Math.min(props.player.t.value + s, props.player.rawTotal.value)));
1415 </script>
1516
1617 <template>
@@ -23,7 +24,9 @@ onBeforeUnmount(() => { props.player.video.value = null; });
2324 </div>
2425 <div class="bar">
2526 <button class="ctl" :title="t('derush.player.restart')" @click="player.restart()">⏮</button>
27+ <button class="ctl wide" :title="t('derush.player.back1')" @click="step(-1)">−1 s</button>
2628 <button class="ctl play" :title="t('derush.player.playPause')" @click="player.toggle()">{{ player.playing.value ? "❚❚" : "▶" }}</button>
29+ <button class="ctl wide" :title="t('derush.player.fwd1')" @click="step(1)">+1 s</button>
2730 <span class="time now">{{ mmss(player.elapsed.value) }}</span>
2831 <span class="time dim">/ {{ mmss(player.total.value) }}</span>
2932 <div class="spacer" />
@@ -54,6 +57,7 @@ video { width: 100%; height: 100%; object-fit: contain; display: block; cursor:
5457 color: #fff; font-size: 13px; cursor: pointer;
5558 }
5659 .ctl:hover { background: var(--ink-2); }
60+.ctl.wide { width: auto; padding: 0 8px; font-family: var(--mono); font-size: 12px; }
5761 .ctl.play { width: 42px; background: #fff; color: var(--ink); }
5862 .time { font-family: var(--mono); font-size: 13px; color: #fff; }
5963 .time.now { padding-left: 6px; }
@@ -1,5 +1,5 @@
1 <script setup lang="ts">1 <script setup lang="ts">
2-/** Le lecteur sombre : vidéo 16/9, sous-titre de la phrase en cours, début / lecture / temps. */2+/** Le lecteur sombre : vidéo 16/9, sous-titre de la phrase en cours, début / ±1 s / lecture / temps. */
3 import { onBeforeUnmount, onMounted, ref } from "vue";3 import { onBeforeUnmount, onMounted, ref } from "vue";
4 import { useI18n } from "vue-i18n";4 import { useI18n } from "vue-i18n";
5 import { mmss } from "../../../lib/format";5 import { mmss } from "../../../lib/format";
@@ -11,6 +11,7 @@ const props = defineProps<{ player: Playlist; height: number; caption?: string }
11 const el = ref<HTMLVideoElement | null>(null);11 const el = ref<HTMLVideoElement | null>(null);
12 onMounted(() => { props.player.video.value = el.value; });12 onMounted(() => { props.player.video.value = el.value; });
13 onBeforeUnmount(() => { props.player.video.value = null; });13 onBeforeUnmount(() => { props.player.video.value = null; });
14+const step = (s: number) => props.player.seek(Math.max(0, Math.min(props.player.t.value + s, props.player.rawTotal.value)));
14 </script>15 </script>
15 16
16 <template>17 <template>
@@ -23,7 +24,9 @@ onBeforeUnmount(() => { props.player.video.value = null; });
23 </div>24 </div>
24 <div class="bar">25 <div class="bar">
25 <button class="ctl" :title="t('derush.player.restart')" @click="player.restart()">⏮</button>26 <button class="ctl" :title="t('derush.player.restart')" @click="player.restart()">⏮</button>
27+ <button class="ctl wide" :title="t('derush.player.back1')" @click="step(-1)">−1 s</button>
26 <button class="ctl play" :title="t('derush.player.playPause')" @click="player.toggle()">{{ player.playing.value ? "❚❚" : "▶" }}</button>28 <button class="ctl play" :title="t('derush.player.playPause')" @click="player.toggle()">{{ player.playing.value ? "❚❚" : "▶" }}</button>
29+ <button class="ctl wide" :title="t('derush.player.fwd1')" @click="step(1)">+1 s</button>
27 <span class="time now">{{ mmss(player.elapsed.value) }}</span>30 <span class="time now">{{ mmss(player.elapsed.value) }}</span>
28 <span class="time dim">/ {{ mmss(player.total.value) }}</span>31 <span class="time dim">/ {{ mmss(player.total.value) }}</span>
29 <div class="spacer" />32 <div class="spacer" />
@@ -54,6 +57,7 @@ video { width: 100%; height: 100%; object-fit: contain; display: block; cursor:
54 color: #fff; font-size: 13px; cursor: pointer;57 color: #fff; font-size: 13px; cursor: pointer;
55 }58 }
56 .ctl:hover { background: var(--ink-2); }59 .ctl:hover { background: var(--ink-2); }
60+.ctl.wide { width: auto; padding: 0 8px; font-family: var(--mono); font-size: 12px; }
57 .ctl.play { width: 42px; background: #fff; color: var(--ink); }61 .ctl.play { width: 42px; background: #fff; color: var(--ink); }
58 .time { font-family: var(--mono); font-size: 13px; color: #fff; }62 .time { font-family: var(--mono); font-size: 13px; color: #fff; }
59 .time.now { padding-left: 6px; }63 .time.now { padding-left: 6px; }