2026-10-28 18:04:20 +00:00
|
|
|
<script setup lang="ts">
|
2026-10-28 19:22:53 +00:00
|
|
|
// Tone names stay generic; they map onto the medieval palette.
|
2026-10-28 18:04:20 +00:00
|
|
|
const props = withDefaults(defineProps<{ value: number; tone?: 'amber' | 'emerald' | 'rose' | 'sky' }>(), {
|
|
|
|
|
tone: 'amber',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const fill = {
|
2026-10-28 19:22:53 +00:00
|
|
|
amber: 'bg-gold-500',
|
|
|
|
|
emerald: 'bg-moss-600',
|
|
|
|
|
rose: 'bg-blood-700',
|
|
|
|
|
sky: 'bg-iron-600',
|
2026-10-28 18:04:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const width = computed(() => `${Math.round(Math.min(1, Math.max(0, props.value)) * 100)}%`)
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-10-28 19:22:53 +00:00
|
|
|
<!-- A flat fill bar, 0..1, framed like a wooden gauge. -->
|
2026-10-28 18:04:20 +00:00
|
|
|
<template>
|
2026-10-28 19:22:53 +00:00
|
|
|
<div class="h-2 w-full overflow-hidden rounded-[2px] border border-wood-700/60 bg-parchment-200">
|
|
|
|
|
<div class="h-full transition-[width] duration-300" :class="fill[tone]" :style="{ width }" />
|
2026-10-28 18:04:20 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|