-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathnavbar.vue
128 lines (126 loc) · 3.13 KB
/
navbar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<template>
<div class="navbar d-flex justify-content-between">
<!-- logo -->
<div class="d-flex align-items-center">
<img
class="logo"
src="https://raw.githubusercontent.com/rlottie/rlottie.github.io/master/.res/rlottie_player.png"
alt="logo"
>
</div>
<!-- button group -->
<div class="d-flex">
<!-- import dialog -->
<v-dialog
v-model="importDialog"
max-width="500"
>
<template v-slot:activator="{ on, attrs }">
<button
class="btn accent mx-2"
:class="{ 'text-white': $vuetify.theme.dark }"
depressed
v-bind="attrs"
v-on="on"
>
Import
<em class="fas fa-file-import ml-2"></em>
</button>
</template>
<v-card>
<v-card-title class="headline mb-4">
Import New Lottie File
</v-card-title>
<v-card-text class="pt-3">
<div class="filebox d-flex justify-center">
<input
class="upload-hidden"
id="fileSelector"
type="file"
accept=".json"
placeholder="New Lottie"
hidden
@click="clickFileUpload"
@change="clickImportDialogClose"
>
<v-btn
class="py-7"
outlined
color="upload"
width="100%"
@click="clickNewLottie"
>
<v-icon class="mr-2">mdi-paperclip</v-icon>
Upload Lottie File
</v-btn>
</div>
<h5 class="my-3 text-center">or</h5>
<div class="d-flex align-items-center">
<v-text-field
v-model="lottieURL"
outlined
placeholder="Lottie File URL"
hide-details
color="icon"
></v-text-field>
<v-btn
class="ml-4"
large
color="accent"
@click="enterLottieURL"
>
Import
</v-btn>
</div>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
text
@click="clickImportDialogClose"
>
Close
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</div>
</template>
<script>
module.exports = {
name: 'navbar',
data() {
return {
importDialog: false,
lottieURL: ""
}
},
methods: {
clickImportDialogClose() {
this.importDialog = false
},
clickFileUpload() {
addImportListener()
},
clickNewLottie() {
var fileInput = document.getElementById('fileSelector')
fileInput.click()
},
enterLottieURL() {
getLottieFromUrl(this.lottieURL)
this.clickImportDialogClose()
}
}
}
</script>
<style scoped>
.navbar {
height: 8vh;
padding-left: 1vw;
padding-right: 1vw;
}
.logo {
height: 5vh;
}
</style>