summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErich Eckner <erich.eckner.ext@bestsecret.com>2023-02-03 15:08:58 +0100
committerErich Eckner <erich.eckner.ext@bestsecret.com>2023-02-03 15:08:58 +0100
commitf285137bf8ea216a3587a5a250e7e25af520e469 (patch)
tree9b15aff19a013599923decc26a06071c02a4a2a0 /src
parentec794c923fba838456437014f8e907e6e30759dc (diff)
downloadwordle-frontend-f285137bf8ea216a3587a5a250e7e25af520e469.tar.xz
colorize trials
Diffstat (limited to 'src')
-rw-r--r--src/components/Trial.vue16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/components/Trial.vue b/src/components/Trial.vue
index 28d7a0e..b400797 100644
--- a/src/components/Trial.vue
+++ b/src/components/Trial.vue
@@ -1,13 +1,14 @@
<template>
<td v-for="i in length" :key="i">
- <div>
+ <div class="letter" v-bind:class="{
+ correct: colors[i-1]===2,
+ wrongPosition: colors[i-1]===1
+ }">
{{ trial[i - 1] ? trial[i - 1] : "&nbsp;" }}
</div>
</td>
</template>
-// TODO: colorize according to props.colors
-
<script setup lang="ts">
defineProps<{
length: number;
@@ -17,4 +18,11 @@ defineProps<{
}>();
</script>
-<style scoped></style>
+<style scoped>
+.letter.correct {
+ background-color: #008000;
+}
+.letter.wrongPosition {
+ background-color: #808000;
+}
+</style>