small fixes

This commit is contained in:
Klemek
2025-02-21 22:42:10 +01:00
parent 38864aeac5
commit 360145d1bf
2 changed files with 9 additions and 7 deletions
+3 -3
View File
@@ -3,7 +3,6 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>Meeting Roulette</title> <title>Meeting Roulette</title>
<link rel="stylesheet" href="style.css" />
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script type="text/javascript" src="main.js"></script> <script type="text/javascript" src="main.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -19,6 +18,7 @@
type="text/css" type="text/css"
/> />
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script>
<link rel="stylesheet" href="style.css" />
<!-- card related --> <!-- card related -->
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta property="og:title" content="Meeting Roulette" /> <meta property="og:title" content="Meeting Roulette" />
@@ -41,7 +41,7 @@
</div> </div>
<div <div
class="p-3 rounded-box text-center" class="p-3 rounded-box text-center"
:class="overtime() ? 'text-error bg-error-content' : 'bg-base-200'" :class="overtime() ? 'text-error-content bg-error' : 'bg-base-200'"
> >
<span class="countdown font-mono text-5xl"> <span class="countdown font-mono text-5xl">
{{ timerParts(0) }} {{ timerParts(0) }}
@@ -263,7 +263,7 @@
<div class="flex flex-col min-w-64 h-full gap-6"> <div class="flex flex-col min-w-64 h-full gap-6">
<textarea <textarea
v-model="rawData" v-model="rawData"
class="grow w-full bg-base-200 textarea rounded-box resize-none" class="grow w-full bg-base-200 min-h-64 textarea rounded-box resize-none"
placeholder="Meeting point 1: 5min" placeholder="Meeting point 1: 5min"
></textarea> ></textarea>
<div class="p-3 bg-base-200 rounded-box"> <div class="p-3 bg-base-200 rounded-box">
+6 -4
View File
@@ -174,14 +174,16 @@ let app = {
this.sound.play(); this.sound.play();
}, },
timeText(minutes, padHours = 0) { timeText(minutes, padHours = 0) {
const prefix = minutes >= 0 ? '' : '-';
minutes = Math.abs(minutes);
if (minutes >= 60 || padHours > 0) { if (minutes >= 60 || padHours > 0) {
return `${Math.floor(minutes / 60) return `${prefix}${Math.floor(minutes / 60)
.toFixed(0) .toFixed(0)
.padStart(padHours, "0")}h${(minutes % 60) .padStart(padHours, "0")}h${(minutes % 60)
.toFixed(0) .toFixed(0)
.padStart(2, "0")}`; .padStart(2, "0")}`;
} else { } else {
return `${(minutes % 60).toFixed(0).padStart(2, "0")}min`; return `${prefix}${(minutes % 60).toFixed(0).padStart(2, "0")}min`;
} }
}, },
spin() { spin() {
@@ -207,8 +209,8 @@ let app = {
}, 5000); }, 5000);
}, },
getSelected() { getSelected() {
if (this.svgData.length <= 1) { if (this.svgData.length === 1) {
return 0; return this.svgData[0].id;
} }
const angle = 360 - (this.wheelPosition % 360); const angle = 360 - (this.wheelPosition % 360);
for (let index = 0; index < this.svgData.length; index++) { for (let index = 0; index < this.svgData.length; index++) {