Skip to content

Commit c9842d7

Browse files
committed
reset state
1 parent 9d6169b commit c9842d7

File tree

2 files changed

+68
-30
lines changed

2 files changed

+68
-30
lines changed

website/layouts/default.vue

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
<template>
22
<v-app dark>
3-
<!-- :permanent="!$vuetify.breakpoint.xsOnly" -->
43
<v-navigation-drawer v-model="drawer" clipped fixed app width="320">
54
<Sidebar :cheatsheet-toc="cheatsheet.toc" />
65
</v-navigation-drawer>
7-
<v-navigation-drawer
8-
:color="rightDrawerColor"
9-
right
10-
width="320"
11-
clipped
12-
fixed
13-
app
14-
>
15-
</v-navigation-drawer>
166

177
<v-app-bar :color="appBarStyle" flat clipped-left clipped-right fixed app>
188
<v-app-bar-nav-icon @click.stop="drawer = !drawer" />
@@ -68,7 +58,6 @@ export default {
6858
data() {
6959
return {
7060
drawer: true,
71-
drawer2: true,
7261
darkTheme: false,
7362
}
7463
},

website/pages/random.vue

Lines changed: 68 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,68 @@
5959
</v-card>
6060
</v-dialog>
6161

62+
<!-- reset dialog -->
63+
<v-dialog v-model="resetDialog" width="500">
64+
<v-card>
65+
<v-card-title class="headline white--text red lighten-1">
66+
¿Estás seguro?
67+
</v-card-title>
68+
69+
<v-card-text class="pt-5">
70+
Se eliminarán los todos los resultados. Esta acción no se puede
71+
deshacer.
72+
</v-card-text>
73+
74+
<v-divider></v-divider>
75+
76+
<v-card-actions>
77+
<v-spacer></v-spacer>
78+
<v-btn color="grey" text @click="resetDialog = false">
79+
Cancelar
80+
</v-btn>
81+
<v-btn color="cyan darken-1" dark depressed @click="resetState">
82+
Aceptar
83+
</v-btn>
84+
</v-card-actions>
85+
</v-card>
86+
</v-dialog>
87+
6288
<!-- results -->
63-
<v-row class="fill-height" align="center" justify="center">
64-
<v-col v-if="results.length > 0" cols="12">
65-
<v-chip
66-
v-for="n in sortedResults"
67-
:key="n"
68-
:color="getResultColor(n)"
69-
label
70-
dark
71-
class="ma-2 font-weight-medium"
72-
:class="getNumberPadding(n)"
73-
@click="workDone(n)"
74-
>
75-
{{ n }}
76-
</v-chip>
77-
</v-col>
89+
<v-fade-transition>
90+
<v-row align="center" justify="center">
91+
<v-col v-if="results.length > 0" cols="12">
92+
<v-chip
93+
v-for="n in sortedResults"
94+
:key="n"
95+
:color="getResultColor(n)"
96+
label
97+
dark
98+
class="ma-2 font-weight-medium"
99+
:class="getNumberPadding(n)"
100+
@click="workDone(n)"
101+
>
102+
{{ n }}
103+
</v-chip>
78104

79-
<v-col v-else cols="12" class="mt-16">
80-
<v-img height="100%" src="/analytics.svg"></v-img>
81-
</v-col>
82-
</v-row>
105+
<v-btn
106+
color="error"
107+
class="mb-10"
108+
dark
109+
absolute
110+
bottom
111+
right
112+
fab
113+
@click="resetDialog = true"
114+
>
115+
<v-icon>mdi-delete-forever</v-icon>
116+
</v-btn>
117+
</v-col>
118+
119+
<v-col v-else cols="12" class="mt-16">
120+
<v-img height="100%" src="/analytics.svg"></v-img>
121+
</v-col>
122+
</v-row>
123+
</v-fade-transition>
83124
</div>
84125
</template>
85126

@@ -88,6 +129,7 @@ export default {
88129
data() {
89130
return {
90131
confirmDialog: false,
132+
resetDialog: false,
91133
total: null,
92134
randomNumbers: null,
93135
results: [],
@@ -136,6 +178,13 @@ export default {
136178
if (this.done.includes(n)) return 'red'
137179
return 'cyan lighten-3'
138180
},
181+
resetState() {
182+
this.resetDialog = false
183+
this.results = []
184+
this.done = []
185+
this.total = null
186+
this.randomNumbers = null
187+
},
139188
},
140189
}
141190
</script>

0 commit comments

Comments
 (0)