diff --git a/frontend/src/components/InfoTab.vue b/frontend/src/components/InfoTab.vue index a2706cf..b8f1282 100644 --- a/frontend/src/components/InfoTab.vue +++ b/frontend/src/components/InfoTab.vue @@ -2,7 +2,7 @@ // Ein Markdown-Text, mehr nicht: PayPal, IBAN, Regeln, was man wissen // muss. Der Host schreibt ihn hier direkt; bis dahin steht die Vorlage // mit den Punkteregeln. -import { computed, onMounted, onUnmounted, ref } from 'vue' +import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { abonnieren } from '../live' import { rendern } from '../markdown' import MarkdownFeld from './MarkdownFeld.vue' @@ -77,6 +77,7 @@ function neuAnsetzen(e) { el.style.animationName = 'none' void el.offsetHeight el.style.animationName = '' + mischen() } function euro(betrag) { @@ -94,16 +95,20 @@ async function standSetzen() { standEntwurf.value = '' } -// Im Abspann stehen die Namen jedes Mal in anderer Reihenfolge — niemand -// steht immer oben -const gemischt = computed(() => { +// Im Abspann stehen die Namen bei jedem Durchlauf in anderer Reihenfolge — +// niemand steht immer oben +const gemischt = ref([]) + +function mischen() { const liste = [...blaetter.value] for (let i = liste.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)) ;[liste[i], liste[j]] = [liste[j], liste[i]] } - return liste -}) + gemischt.value = liste +} + +watch(blaetter, mischen) // Wer noch kein Blatt hat const ohneBlatt = computed(() =>