This commit is contained in:
+13
-1
@@ -20,7 +20,19 @@
|
||||
<template>
|
||||
|
||||
<UApp>
|
||||
<UMain>
|
||||
<UHeader>
|
||||
<template #title>
|
||||
TLAdle
|
||||
</template>
|
||||
|
||||
|
||||
<template #right>
|
||||
<UColorModeButton />
|
||||
|
||||
|
||||
</template>
|
||||
</UHeader>
|
||||
<UMain class="main">
|
||||
<NuxtLayout>
|
||||
<router-view v-slot="{ Component,route }">
|
||||
<component :is="Component" />
|
||||
|
||||
@@ -1,16 +1,36 @@
|
||||
<template>
|
||||
<div class="gw-div">
|
||||
<div class="gw-div" :class="{ 'default': correctness==0, 'cw-cp': correctness==4, 'cw-ip': correctness==3, 'cf-cp': correctness==2, 'cf-ip': correctness==1 }">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
export default {
|
||||
props: {
|
||||
correctness: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.gw-div::first-letter {
|
||||
font-weight: bold;
|
||||
}
|
||||
.gw-div {
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
margin: 5px;
|
||||
justify-content: center;
|
||||
background-color: grey;
|
||||
color: white;
|
||||
}
|
||||
.default {
|
||||
background-color: red;
|
||||
}
|
||||
.cw-cp {
|
||||
background-color: rgb(0, 122, 2);
|
||||
|
||||
@@ -31,10 +31,11 @@
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(response.data);
|
||||
this.guesses = response.data.guesses;
|
||||
})
|
||||
},
|
||||
onkeyup() {
|
||||
this.words = this.guess.split(" ");
|
||||
this.words = this.guess.trim().split(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,19 +45,26 @@
|
||||
<template>
|
||||
<UCard>
|
||||
<template #header>
|
||||
<h1>Motto:</h1>
|
||||
{{ hint }}
|
||||
</template>
|
||||
|
||||
<template v-for="guess in guesses">
|
||||
{{ guess }}
|
||||
<div class="flex-container">
|
||||
<template v-for="i in 3">
|
||||
<GuessWord :correctness="Number(guess[i+2])">
|
||||
{{ guess[i-1] }}
|
||||
</GuessWord>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<template #footer>
|
||||
|
||||
<div style="display: flex; flex-direction: row;">
|
||||
<div class="flex-container">
|
||||
<template v-for="word in words">
|
||||
<GuessWord>
|
||||
<GuessWord :correctness="-1">
|
||||
{{ word }}
|
||||
</GuessWord>
|
||||
</template>
|
||||
@@ -67,4 +75,16 @@
|
||||
|
||||
</template>
|
||||
</UCard>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.flex-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
.hidden {
|
||||
color: transparent;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user