Skip to content

Commit 1c4c5e7

Browse files
committed
Photo, Video, Voice and Gallery buttons, stub functions
1 parent 8ee54d0 commit 1c4c5e7

File tree

1 file changed

+98
-54
lines changed

1 file changed

+98
-54
lines changed

src/components/Control.vue

Lines changed: 98 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,107 @@
77
<v-spacer></v-spacer>
88
<v-toolbar-items>
99
<template v-if="status == 200">
10-
<v-btn @click="dialog = true" icon >
11-
<v-icon>check_circle</v-icon>
12-
</v-btn>
13-
10+
<v-btn @click="dialog = true" icon>
11+
<v-icon>check_circle</v-icon>
12+
</v-btn>
1413
</template>
1514
<template v-else>
16-
<v-btn flat>
15+
<v-btn flat>
1716
<v-progress-circular :size="30" :width="2" indeterminate></v-progress-circular>
1817
</v-btn>
19-
<v-btn @click="dialog = true" icon>
20-
<v-icon>error</v-icon>
21-
</v-btn>
18+
<v-btn @click="dialog = true" icon>
19+
<v-icon>error</v-icon>
20+
</v-btn>
2221
</template>
2322
</v-toolbar-items>
2423
</v-toolbar>
2524
<v-content>
2625
<template v-if="status == 200">
27-
<div>
28-
<v-container grid-list-md text-xs-center>
29-
<v-layout row wrap>
30-
<v-flex xs12 lg6>
31-
<img :src="webcamStream"/>
26+
<div>
27+
<v-container grid-list-md text-xs-center>
28+
<v-layout row wrap>
29+
<v-flex xs12 lg6>
30+
<img :src="webcamStream"/>
3231

3332
</v-flex>
34-
<v-flex xs12 lg6>
35-
<v-layout row wrap>
36-
<v-flex xs12 sm12>
37-
<v-btn-toggle>
38-
<v-btn flat v-on:mousedown="move(0)" v-on:mouseup="stop()">
39-
<v-icon>keyboard_arrow_up</v-icon>
40-
</v-btn>
41-
</v-btn-toggle>
42-
</v-flex>
43-
<v-flex xs12 sm12>
44-
<v-btn-toggle>
45-
<v-btn flat v-on:mousedown="move(1)" v-on:mouseup="stop()">
46-
<v-icon>keyboard_arrow_left</v-icon>
47-
</v-btn>
48-
<v-btn flat v-on:mousedown="move(2)" v-on:mouseup="stop()">
49-
<v-icon>keyboard_arrow_right</v-icon>
50-
</v-btn>
51-
</v-btn-toggle>
52-
</v-flex>
53-
<v-flex xs12 sm12>
54-
<v-btn-toggle>
55-
<v-btn flat v-on:mousedown="move(3)" v-on:mouseup="stop()">
56-
<v-icon>keyboard_arrow_down</v-icon>
57-
</v-btn>
58-
</v-btn-toggle>
59-
</v-flex>
60-
</v-layout>
61-
</v-flex>
62-
</v-layout>
63-
</v-container>
64-
</div>
65-
</template>
66-
<template v-else>
67-
<br>
68-
In attesa che CoderBot torni online...<br>
69-
<v-icon large>signal_wifi_off</v-icon>
70-
</template>
33+
<v-flex xs12 lg6>
34+
<br>
35+
<v-layout row wrap>
36+
<v-flex xs12 sm12>
37+
<v-btn-toggle>
38+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:mousedown="move(0)" v-on:mouseup="stop()">
39+
<v-icon dark>keyboard_arrow_up</v-icon>
40+
</v-btn>
41+
</v-btn-toggle>
42+
</v-flex>
43+
<v-flex xs12 sm12>
44+
<v-btn-toggle>
45+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:mousedown="move(1)" v-on:mouseup="stop()">
46+
<v-icon dark>keyboard_arrow_left</v-icon>
47+
</v-btn>
48+
<span style="background-color: #fafafa;width: 64px" > </span>
49+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:mousedown="move(2)" v-on:mouseup="stop()">
50+
<v-icon dark>keyboard_arrow_right</v-icon>
51+
</v-btn>
52+
</v-btn-toggle>
53+
</v-flex>
54+
<v-flex xs12 sm12>
55+
<v-btn-toggle>
56+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:mousedown="move(3)" v-on:mouseup="stop()">
57+
<v-icon dark>keyboard_arrow_down</v-icon>
58+
</v-btn>
59+
</v-btn-toggle>
60+
</v-flex>
61+
<v-flex xs12 sm12>
62+
<br><br><br>
63+
<v-btn-toggle>
64+
65+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:click="say()">
66+
Pronuncia
67+
<v-icon dark>chat_bubble_outline</v-icon>
68+
</v-btn>
69+
</v-btn-toggle>
70+
</v-flex>
71+
<v-flex xs12 sm12>
72+
73+
<v-btn-toggle>
74+
75+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:click="takePhoto()">
76+
Scatta foto
77+
<v-icon dark>camera_alt</v-icon>
78+
</v-btn>
79+
</v-btn-toggle>
80+
</v-flex>
81+
82+
<v-flex xs12 sm12>
83+
<v-btn-toggle>
84+
85+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:click="recordVideo()">
86+
Registra video
87+
<v-icon dark>videocam</v-icon>
88+
</v-btn>
89+
</v-btn-toggle>
90+
</v-flex>
91+
<v-flex xs12 sm12>
92+
<v-btn-toggle>
93+
94+
<v-btn large color="blue-grey darken-4" class="white--text" v-on:click="showGallery()">
95+
Galleria
96+
<v-icon dark>photo_library</v-icon>
97+
</v-btn>
98+
</v-btn-toggle>
99+
</v-flex>
100+
</v-layout>
101+
</v-flex>
102+
</v-layout>
103+
</v-container>
104+
</div>
105+
</template>
106+
<template v-else>
107+
<br>
108+
In attesa che CoderBot torni online...<br>
109+
<v-icon large>signal_wifi_off</v-icon>
110+
</template>
71111
</v-content>
72112
<v-snackbar v-model="snackbar">
73113
{{ snackText }}
@@ -84,6 +124,10 @@ export default {
84124
components: { sidebar },
85125
name: 'HelloWorld',
86126
methods: {
127+
say(){},
128+
takePhoto(){},
129+
recordVideo(){},
130+
showGallery(){},
87131
pollStatus() {
88132
let axios = this.$axios
89133
let CB = this.$data.CB
@@ -170,15 +214,15 @@ export default {
170214
let minTreshold = 500
171215
let delay = minTreshold - pressDuration
172216
console.log("Pressed for", pressDuration, "ms")
173-
if (pressDuration < 500){
174-
console.log("Too fast, postponing it by", delay ,"ms..")
175-
setTimeout(function () {
217+
if (pressDuration < 500) {
218+
console.log("Too fast, postponing it by", delay, "ms..")
219+
setTimeout(function() {
176220
axios.post(CB + '/stop').then(function(response) {
177221
console.log(response)
178222
}).catch(function(error) {
179223
console.log(error)
180224
})
181-
}, delay );
225+
}, delay);
182226
} else {
183227
axios.post(CB + '/stop').then(function(response) {
184228
console.log(response)

0 commit comments

Comments
 (0)