boussole-pluss/frontend/components/QuizProgress.vue

44 lines
702 B
Vue
Raw Permalink Normal View History

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