boussole-pluss/frontend/components/QuizProgress.vue

44 lines
702 B
Vue

<script lang="ts" setup>
const props = defineProps({
numberSteps: Number,
currentStep: Number,
color: String
});
const cssVars = computed(() => {
return {
'--color': props.color
}
});
</script>
<template>
<div :style="cssVars" class="progress">
<span v-for="step in numberSteps" :key="step" class="step" :class="{ active: step <= currentStep }"></span>
</div>
</template>
<style lang="scss" scoped>
@import "assets/css/color";
@import "assets/css/spacing";
.progress {
display: flex;
justify-content: center;
}
.step {
border-radius: 2px;
border: 6px solid $gray_2;
margin: $small $xxx_small;
width: 30px;
}
.active {
border-color: var(--color);
}
</style>