step: removing unused parts

This commit is contained in:
Jakob Gegeniger committed 2026-10-16 23:24:01 +02:00
1 parent 91ff390180
commit 84fa3ee3b4
12 files changed
+138 -523

No files matched your search

-14
View File
@@ -2,26 +2,12 @@
<main class="app">
<nav class="nav">
<router-link to="/" class="nav-link">Home</router-link>
<router-link to="/players" class="nav-link" :class="{ active: route.path === '/players' }">
Page 1: Players</router-link>
<router-link to="/start" class="nav-link" :class="{ active: route.path === '/start' }">
Page 2: Start</router-link>
<router-link to="/text" class="nav-link" :class="{ active: route.path === '/text' }">
Page 3: Text</router-link>
</nav>
<section class="page-content">
<Players v-if="route.path === '/players'" />
<Start v-else-if="route.path === '/start'" />
<Text v-else-if="route.path === '/text'" />
</section>
</main>
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router'
import Players from './Players.vue'
import Start from './Start.vue'
import Text from './Text.vue'
const route = useRoute()
</script>
+1 -9
View File
@@ -7,7 +7,7 @@
<div class="info-section">
<div class="info-box">
<h3>Version</h3>
<p id="version-number">0.8.0</p>
<p id="version-number">0.9.0</p>
</div>
<div class="info-box">
<h3>Service Hotline</h3>
@@ -27,14 +27,6 @@
</div>
</div>
<div class="status-container">
<span class="status-label">Game</span>
<div class="status-frame setup-frame">
<router-link to="/players" class="nav-button">Players</router-link>
<router-link to="/start" class="nav-button">Start</router-link>
<router-link to="/text" class="nav-button">Text</router-link>
</div>
</div>
</div>
</section>
</main>
+7 -134
View File
@@ -28,8 +28,8 @@
<h3>Outputs</h3>
<div class="status-frame">
<div class="control-buttons">
<button @click="handleLock" class="btn-lock">Lock</button>
<button @click="handleUnlock" class="btn-unlock">Unlock</button>
<button @click="handleLock" class="btn-primary">Lock</button>
<button @click="handleUnlock" class="btn-secondary">Unlock</button>
</div>
</div>
@@ -42,17 +42,17 @@
</div>
<div class="status-frame">
<div class="control-buttons">
<button @click="handleMute" class="btn-lock">Mute</button>
<button @click="handleUnMute" class="btn-unlock">Un-Mute</button>
<button @click="handleMute" class="btn-primary">Mute</button>
<button @click="handleUnMute" class="btn-secondary">Un-Mute</button>
</div>
</div>
<h3>Sounds</h3>
<div class="status-frame">
<div class="control-buttons">
<button @click="handlePlayX(1)" class="btn-unlock">Play sound 1</button>
<button @click="handlePlayX(2)" class="btn-unlock">Play sound 2</button>
<button @click="handlePlayX(3)" class="btn-unlock">Play sound 3</button>
<button @click="handlePlayX(1)" class="btn-secondary">Play sound 1</button>
<button @click="handlePlayX(2)" class="btn-secondary">Play sound 2</button>
<button @click="handlePlayX(3)" class="btn-secondary">Play sound 3</button>
</div>
</div>
@@ -86,19 +86,6 @@
</div>
</div>
</div>
<h2>Game Views</h2>
<nav class="nav">
<router-link to="/maintenance/players" class="nav-link" :class="{ active: isActive('/maintenance/players') }">Page
1: Players</router-link>
<router-link to="/maintenance/start" class="nav-link" :class="{ active: isActive('/maintenance/start') }">Page 2:
Start</router-link>
<router-link to="/maintenance/text" class="nav-link" :class="{ active: isActive('/maintenance/text') }">Page 3:
Text</router-link>
</nav>
<section class="page-content">
<router-view></router-view>
</section>
</main>
</template>
@@ -204,119 +191,5 @@ onUnmounted(() => {
</script>
<style scoped>
.status-container {
margin-bottom: 20px;
}
.status-frame {
border: 2px solid #d1d5db;
border-radius: 8px;
padding: 16px;
background: #f9fafb;
margin-bottom: 16px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 12px;
}
.setup-frame {
grid-template-columns: 1fr;
gap: 20px;
}
.slider-item {
display: flex;
flex-direction: column;
gap: 8px;
}
.slider-header {
display: flex;
justify-content: space-between;
align-items: baseline;
}
.slider-label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #6b7280;
}
.slider-value {
font-size: 18px;
font-weight: 600;
color: #111827;
}
.slider-input {
width: 100%;
cursor: pointer;
}
.status-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 12px;
border-radius: 6px;
background: #e5e7eb;
color: #6b7280;
transition: background 0.3s, color 0.3s;
font-weight: 500;
}
.status-item.active {
background: #10b981;
color: #ffffff;
}
.status-label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
opacity: 0.8;
}
.status-value {
font-size: 20px;
font-weight: 600;
margin-top: 4px;
}
.control-buttons {
display: flex;
gap: 12px;
margin-bottom: 20px;
}
.btn-lock,
.btn-unlock {
padding: 10px 20px;
border: none;
border-radius: 6px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-lock {
background: #111827;
color: #ffffff;
}
.btn-lock:hover {
background: #1f2937;
}
.btn-unlock {
background: #e5e7eb;
color: #111827;
border: 1px solid #d1d5db;
}
.btn-unlock:hover {
background: #d1d5db;
}
</style>
-51
View File
@@ -1,51 +0,0 @@
<template>
<div>
<h2>Add players</h2>
<div class="row">
<input v-model="playerInput" type="text" placeholder="Enter player name" @keydown.enter="addPlayer" />
<button @click="addPlayer" type="button">Add</button>
</div>
<ul class="player-list">
<li v-for="(player, index) in playersStore.players" :key="index" class="player-item">
<span class="player-name">{{ player }}</span>
<button class="delete-btn" @click="deletePlayer(index)" title="Delete player">
<svg class="trash-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-9l-1 1H5v2h14V4z"
fill="currentColor" />
</svg>
</button>
</li>
</ul>
<div class="players-actions">
<button @click="clearAll" type="button" class="btn-secondary">Clear All</button>
<button @click="finished" type="button" class="btn-primary">Finished</button>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { usePlayersStore } from '../stores/players'
const playerInput = ref<string>('')
const playersStore = usePlayersStore()
function addPlayer(): void {
playersStore.addPlayer(playerInput.value)
playerInput.value = ''
}
function deletePlayer(index: number): void {
playersStore.deletePlayer(index)
}
function clearAll(): void {
if (confirm('Are you sure you want to delete all players?')) {
playersStore.clearAllPlayers()
}
}
function finished(): void {
router.push('/start')
}
</script>
+20 -134
View File
@@ -23,20 +23,20 @@
</div>
</div>
</div>
<h2>Sound</h2>
<div class="status-frame">
<div class="status-item" :class="{ active: soundStatus === 1 }">
<span class="status-label">Sound Active:</span>
<span class="status-value">{{ soundStatus }}</span>
</div>
<h2>Sound</h2>
<div class="status-frame">
<div class="status-item" :class="{ active: soundStatus === 1 }">
<span class="status-label">Sound Active:</span>
<span class="status-value">{{ soundStatus }}</span>
</div>
<div class="status-frame">
<div class="control-buttons">
<button @click="handleMute" class="btn-lock">Mute</button>
<button @click="handleUnMute" class="btn-unlock">Un-Mute</button>
</div>
</div>
<div class="status-frame">
<div class="control-buttons">
<button @click="handleMute" class="btn-primary">Mute</button>
<button @click="handleUnMute" class="btn-secondary">Un-Mute</button>
</div>
</div>
<h2>Sword Status</h2>
<div class="status-container">
@@ -118,15 +118,15 @@ function handlePlayX(sound: number): void {
onMounted(() => {
mqttClient = enterMaintananceMode(
(sound, endSens, startSens, pullSens, lock, vol, delay) => {
endSensStatus.value = endSens
startSensStatus.value = startSens
pullSensStatus.value = pullSens
lockStatus.value = lock
soundStatus.value = sound
volume.value = vol
promoDelay.value = delay
endSensStatus.value = endSens
startSensStatus.value = startSens
pullSensStatus.value = pullSens
lockStatus.value = lock
soundStatus.value = sound
volume.value = vol
promoDelay.value = delay
},
(ver) => {})
(ver) => { })
window.addEventListener('beforeunload', cleanup)
if (mqttClient) {
publishCmd(mqttClient, `promoDelay:${promoDelay.value}`)
@@ -141,119 +141,5 @@ onUnmounted(() => {
</script>
<style scoped>
.status-container {
margin-bottom: 20px;
}
.status-frame {
border: 2px solid #d1d5db;
border-radius: 8px;
padding: 16px;
background: #f9fafb;
margin-bottom: 16px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 12px;
}
.setup-frame {
grid-template-columns: 1fr;
gap: 20px;
}
.slider-item {
display: flex;
flex-direction: column;
gap: 8px;
}
.slider-header {
display: flex;
justify-content: space-between;
align-items: baseline;
}
.slider-label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #6b7280;
}
.slider-value {
font-size: 18px;
font-weight: 600;
color: #111827;
}
.slider-input {
width: 100%;
cursor: pointer;
}
.status-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 12px;
border-radius: 6px;
background: #e5e7eb;
color: #6b7280;
transition: background 0.3s, color 0.3s;
font-weight: 500;
}
.status-item.active {
background: #10b981;
color: #ffffff;
}
.status-label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
opacity: 0.8;
}
.status-value {
font-size: 20px;
font-weight: 600;
margin-top: 4px;
}
.control-buttons {
display: flex;
gap: 12px;
margin-bottom: 20px;
}
.btn-lock,
.btn-unlock {
padding: 10px 20px;
border: none;
border-radius: 6px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, color 0.2s;
}
.btn-lock {
background: #111827;
color: #ffffff;
}
.btn-lock:hover {
background: #1f2937;
}
.btn-unlock {
background: #e5e7eb;
color: #111827;
border: 1px solid #d1d5db;
}
.btn-unlock:hover {
background: #d1d5db;
}
</style>
-19
View File
@@ -1,19 +0,0 @@
<template>
<div>
<h2>Start</h2>
<button @click="startGame" id="start-btn" type="button">Start</button>
<p id="selected-name">{{ playersStore.currentName || 'No name selected yet' }}</p>
</div>
</template>
<script setup lang="ts">
import { usePlayersStore } from '../stores/players'
import { publishStartHit } from '../services/mqtt'
const playersStore = usePlayersStore()
function startGame(): void {
publishStartHit()
playersStore.selectRandomPlayer()
}
</script>
-9
View File
@@ -1,9 +0,0 @@
<template>
<div>
<h2>Some text</h2>
<p>This is the third page with static text.</p>
</div>
</template>
<script setup lang="ts">
</script>