CI/CD test
Some checks failed
Build and Deploy Nuxt / build (push) Has been cancelled

This commit is contained in:
2026-05-02 16:15:36 +02:00
parent 139e7d0ef5
commit 3fdced84bf
7 changed files with 315 additions and 31 deletions

View File

@@ -0,0 +1,59 @@
<script setup>
const props = defineProps(['content']);
import { parse } from '~/services/widgets/DiceParser';
import { AddSound } from '~/services/Sound';
const container = ref(null);
const resultText = ref("");
const rollDice = () => {
console.log(props.content);
const result = parse(props.content);
console.log(result);
resultText.value = result.total;
};
onMounted(() => {
AddSound(container.value);
});
</script>
<template>
<div class="roll-widget" ref="container">
<div class="roll-widget-body">
<button class="btn-primary btn-inline sound-click" @click="rollDice">
<span class="dice-content">
<!-- Dice icon (SVG) -->
<img class="icon" src="/icons/iconoir/regular/dice-three.svg" draggable="false">
<!-- Result text -->
<span class="result-text">
{{ resultText || props.content }}
</span>
</span>
</button>
</div>
</div>
</template>
<style scoped>
.roll-widget {
display: inline-flex; /* or inline-block */
vertical-align: middle; /* keeps it aligned nicely with text */
}
.btn-inline {
padding: 2px 6px;
}
.dice-content {
display: inline-flex;
align-items: center;
gap: 6px;
}
.result-text {
font-weight: 500;
}
</style>