@mixd-id/web-scaffold 0.1.230406001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/package.json +71 -0
- package/public/images/mixd-logo2.png +0 -0
- package/src/App.vue +17 -0
- package/src/components/Ahref.vue +34 -0
- package/src/components/Alert.vue +160 -0
- package/src/components/Button.vue +253 -0
- package/src/components/ButtonGroup.vue +101 -0
- package/src/components/Carousel.vue +293 -0
- package/src/components/ChatTyping.vue +69 -0
- package/src/components/Checkbox.vue +152 -0
- package/src/components/ContextMenu.vue +261 -0
- package/src/components/CopyToClipboard.vue +59 -0
- package/src/components/Countdown.vue +213 -0
- package/src/components/Datepicker.vue +312 -0
- package/src/components/Dropdown.vue +198 -0
- package/src/components/DynamicTemplate.vue +44 -0
- package/src/components/ErrorText.vue +36 -0
- package/src/components/Feed.vue +118 -0
- package/src/components/Gmaps.vue +227 -0
- package/src/components/Grid.vue +29 -0
- package/src/components/GridColumn.vue +31 -0
- package/src/components/HTMLEditor.vue +396 -0
- package/src/components/Image.vue +207 -0
- package/src/components/Image360.vue +140 -0
- package/src/components/ImageFullScreen.vue +101 -0
- package/src/components/ImagePreview.vue +71 -0
- package/src/components/ImportModal.vue +247 -0
- package/src/components/ListItem.vue +147 -0
- package/src/components/ListPage1.vue +1331 -0
- package/src/components/ListPage1Filter.vue +170 -0
- package/src/components/Modal.vue +253 -0
- package/src/components/OTPField.vue +126 -0
- package/src/components/Radio.vue +134 -0
- package/src/components/SearchButton.vue +57 -0
- package/src/components/Slider.vue +285 -0
- package/src/components/SplitPane.vue +129 -0
- package/src/components/Switch.vue +89 -0
- package/src/components/TabView.vue +106 -0
- package/src/components/TableView.vue +201 -0
- package/src/components/TableViewHead.vue +159 -0
- package/src/components/Tabs.vue +74 -0
- package/src/components/TextEditor.vue +85 -0
- package/src/components/Textarea.vue +184 -0
- package/src/components/Textbox.vue +200 -0
- package/src/components/Timepicker.vue +108 -0
- package/src/components/Toast.vue +93 -0
- package/src/components/VirtualScroll.vue +215 -0
- package/src/components/VirtualTable.vue +497 -0
- package/src/entry-client.js +27 -0
- package/src/entry-server.js +73 -0
- package/src/index.css +3 -0
- package/src/index.js +255 -0
- package/src/main.js +38 -0
- package/src/router.js +57 -0
- package/src/themes/default/index.js +200 -0
- package/src/utils/helpers.js +185 -0
- package/src/utils/helpers.mjs +197 -0
- package/src/utils/importer.js +156 -0
- package/src/utils/listpage1.js +1371 -0
- package/src/utils/selection.js +64 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="outerClass">
|
|
3
|
+
|
|
4
|
+
<slot v-if="$slots['empty'] && status === 0" name="empty" :instance="this"></slot>
|
|
5
|
+
<slot v-else-if="$slots['loading'] && status === 1" name="loading" :instance="this"></slot>
|
|
6
|
+
<div v-else-if="!$slots['loading'] && status === 1 && spinnerType === 'spinner'" :class="$style.loading">
|
|
7
|
+
<svg class="animate-spin aspect-square w-[15%] min-w-[14px] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
8
|
+
</div>
|
|
9
|
+
<slot v-else-if="$slots['error'] && status === 3" name="error" :instance="this"></slot>
|
|
10
|
+
<img v-else :class="computedClass" :src="actualSrc" ref="img" />
|
|
11
|
+
|
|
12
|
+
<slot :instance="this"></slot>
|
|
13
|
+
|
|
14
|
+
<input v-if="Boolean(editable)" class="hidden" type="file" accept="image/*" ref="file" @change="onChange"/>
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
|
|
21
|
+
const screens = {
|
|
22
|
+
0: 'all',
|
|
23
|
+
640: 'sm',
|
|
24
|
+
728: 'md',
|
|
25
|
+
1024: 'lg',
|
|
26
|
+
1280: 'xl',
|
|
27
|
+
1536: '2xl'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default{
|
|
31
|
+
|
|
32
|
+
emits: [ 'change' ],
|
|
33
|
+
|
|
34
|
+
props:{
|
|
35
|
+
|
|
36
|
+
class: String,
|
|
37
|
+
|
|
38
|
+
editable:{
|
|
39
|
+
type: [ Boolean, String ],
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
src:{
|
|
44
|
+
type: [ String, Object ]
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
defaultSrc: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMS4xNTkyIDIxLjA4MjhDMjEuNjc5OCAyMC41NDMyIDIyIDE5LjgwOSAyMiAxOVY1QzIyIDMuMzQzMTUgMjAuNjU2OSAyIDE5IDJINUMzLjM0MzE1IDIgMiAzLjM0MzE1IDIgNVYxOUMyIDIwLjY1NjkgMy4zNDMxNSAyMiA1IDIySDE5QzE5LjI5NjIgMjIgMTkuNTgyMyAyMS45NTcxIDE5Ljg1MjUgMjEuODc3MUMxOS44NjU4IDIxLjg3MzIgMTkuODc5IDIxLjg2OTIgMTkuODkyMSAyMS44NjUxQzIwLjI1ODYgMjEuNzUxMSAyMC41OTUgMjEuNTY4NyAyMC44ODYzIDIxLjMzMjlDMjAuODkzNyAyMS4zMjY5IDIwLjkwMSAyMS4zMjEgMjAuOTA4MyAyMS4zMTQ5QzIwLjk4MjQgMjEuMjUzOCAyMS4wNTM1IDIxLjE4OTIgMjEuMTIxMyAyMS4xMjEzQzIxLjEzNDEgMjEuMTA4NiAyMS4xNDY3IDIxLjA5NTcgMjEuMTU5MiAyMS4wODI4Wk0xOSAzLjVINUM0LjE3MTU3IDMuNSAzLjUgNC4xNzE1NyAzLjUgNVYxMi43TDYuMDUyOTIgOS42MzY0OUM3LjIxNTY2IDguMjQxMjEgOS4zNDE3NyA4LjE5MTAyIDEwLjU2OSA5LjUyOTg3TDIwLjE0MTggMTkuOTcyOEMyMC4zNjUyIDE5LjcxMDkgMjAuNSAxOS4zNzEyIDIwLjUgMTlWNUMyMC41IDQuMTcxNTcgMTkuODI4NCAzLjUgMTkgMy41Wk01IDIwLjVDNC4xNzE1NyAyMC41IDMuNSAxOS44Mjg0IDMuNSAxOVYxNS4wNDMxTDcuMjA1MjYgMTAuNTk2OEM3LjcxMzk1IDkuOTg2MzMgOC41OTE0NCA5Ljg5MDgxIDkuMjEzOTUgMTAuMzI0OUM5LjIxOTUxIDEwLjMyODggOS4yMjUwNSAxMC4zMzI3IDkuMjMwNTcgMTAuMzM2N0M5LjMxMzMyIDEwLjM5NjEgOS4zOTE0MSAxMC40NjUgOS40NjMzMiAxMC41NDM1TDE4LjU5MDEgMjAuNUg1WiIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iLjA4Ii8+CjxjaXJjbGUgY3g9IjE3IiBjeT0iNyIgcj0iMS4yNSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9Ii4wOCIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KPC9zdmc+Cg=="
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
spinnerType: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "shimmer" // spinner | shimmer
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
computed:{
|
|
60
|
+
|
|
61
|
+
outerClass(){
|
|
62
|
+
return [
|
|
63
|
+
this.$style.comp,
|
|
64
|
+
this.class,
|
|
65
|
+
this.status === 1 && this.spinnerType === 'shimmer' && !this.$slots['loading'] ?
|
|
66
|
+
this.$style.shimmer : ''
|
|
67
|
+
]
|
|
68
|
+
.join(' ')
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
computedClass(){
|
|
72
|
+
return [
|
|
73
|
+
this.$style.img,
|
|
74
|
+
this.class
|
|
75
|
+
]
|
|
76
|
+
.join(' ')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
data(){
|
|
82
|
+
return {
|
|
83
|
+
status: 0, // 0:empty, 1:loading, 2:image, 3:error
|
|
84
|
+
actualSrc: 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
mounted(){
|
|
89
|
+
this.$observe.once(this.$el, () => {
|
|
90
|
+
this.loadSrc()
|
|
91
|
+
})
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
methods:{
|
|
95
|
+
|
|
96
|
+
onChange(e){
|
|
97
|
+
if(e.target.files.length > 0){
|
|
98
|
+
var reader = new FileReader();
|
|
99
|
+
reader.addEventListener('load', () => {
|
|
100
|
+
this.$emit('change', reader.result, e.target.files[0])
|
|
101
|
+
}, false)
|
|
102
|
+
reader.readAsDataURL(e.target.files[0]);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
edit(){
|
|
107
|
+
if(this.$refs.file){
|
|
108
|
+
this.$refs.file.click()
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
async loadSrc(){
|
|
113
|
+
|
|
114
|
+
if(typeof this.src === 'string') {
|
|
115
|
+
if (this.src.startsWith('data:image')) {
|
|
116
|
+
this.actualSrc = this.src
|
|
117
|
+
this.status = 2
|
|
118
|
+
}
|
|
119
|
+
else{
|
|
120
|
+
const src = {}
|
|
121
|
+
this.src.split(',').forEach((text) => {
|
|
122
|
+
let [ prefix, ...args ] = text.split(':')
|
|
123
|
+
|
|
124
|
+
if(args.length > 0 && args[0].substring(0, 2) !== '//'){
|
|
125
|
+
src[prefix.trim()] = args.join(':').trim()
|
|
126
|
+
}
|
|
127
|
+
else{
|
|
128
|
+
src['all'] = text
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
for(const b in screens){
|
|
133
|
+
if(window.innerWidth > b && screens[b] in src){
|
|
134
|
+
var img = new Image()
|
|
135
|
+
img.addEventListener('load', () => {
|
|
136
|
+
this.status = 2
|
|
137
|
+
this.actualSrc = img.src
|
|
138
|
+
})
|
|
139
|
+
img.addEventListener('error', () => {
|
|
140
|
+
this.status = 3
|
|
141
|
+
this.actualSrc = this.defaultSrc
|
|
142
|
+
})
|
|
143
|
+
img.src = src[screens[b]]
|
|
144
|
+
this.status = 1
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else if(this.src instanceof File){
|
|
150
|
+
var reader = new FileReader();
|
|
151
|
+
|
|
152
|
+
reader.addEventListener('load', () => {
|
|
153
|
+
this.status = 2
|
|
154
|
+
this.actualSrc = reader.result
|
|
155
|
+
}, false)
|
|
156
|
+
|
|
157
|
+
reader.addEventListener('error', () => {
|
|
158
|
+
this.status = 3
|
|
159
|
+
this.actualSrc = this.defaultSrc
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
reader.readAsDataURL(this.src)
|
|
163
|
+
this.status = 1
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
watch:{
|
|
170
|
+
|
|
171
|
+
src(to){
|
|
172
|
+
this.loadSrc()
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
"isMobile.value"(to){
|
|
176
|
+
this.loadSrc()
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<style module>
|
|
185
|
+
|
|
186
|
+
.comp{
|
|
187
|
+
@apply relative;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.img{
|
|
191
|
+
@apply object-contain;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.editArea{
|
|
195
|
+
@apply absolute top-0 left-0 right-0 bottom-0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.loading{
|
|
199
|
+
@apply absolute top-0 left-0 right-0 bottom-0;
|
|
200
|
+
@apply flex items-center justify-center;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.shimmer{
|
|
204
|
+
@apply bg-text-200 animate-pulse;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
</style>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
|
|
4
|
+
<div class="absolute top-0 right-0 bg-black/50 rounded-lg flex flex-row gap-2 items-center m-1">
|
|
5
|
+
<button type="button" class="p-1" @click="prev">Prev</button>
|
|
6
|
+
<button type="button" class="p-1" @click="next">Next</button>
|
|
7
|
+
<button type="button" class="p-1" @click="toggleMode" :class="mode === 1 ? 'bg-red-500' : 'bg-green-500'">360</button>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<img v-if="mode === 1" :src="staticSrc" class="pointer-events-none" style="user-select: none" />
|
|
11
|
+
<div v-else-if="mode === 2 && status === 1">Loading...</div>
|
|
12
|
+
<div v-else-if="mode === 2 && status === 2">
|
|
13
|
+
<img v-for="(path, idx) in src" :src="path" :class="idx === index ? '' : 'hidden'"
|
|
14
|
+
class="pointer-events-none" style="user-select: none"/>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
|
|
21
|
+
export default{
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
|
|
25
|
+
src: Array,
|
|
26
|
+
|
|
27
|
+
staticSrc: String
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
data(){
|
|
32
|
+
return {
|
|
33
|
+
status: 0,
|
|
34
|
+
index: 0,
|
|
35
|
+
mode: 1,
|
|
36
|
+
startX: null
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
mounted(){
|
|
41
|
+
this.load()
|
|
42
|
+
|
|
43
|
+
this.$el.addEventListener('mousedown', this.onMouseDown)
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
methods: {
|
|
47
|
+
|
|
48
|
+
load(){
|
|
49
|
+
|
|
50
|
+
this.status = 1
|
|
51
|
+
let loadedCount = 0
|
|
52
|
+
|
|
53
|
+
const loadComplete = () => {
|
|
54
|
+
loadedCount++
|
|
55
|
+
|
|
56
|
+
if(loadedCount >= this.src.length){
|
|
57
|
+
this.status = 2
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
this.src.forEach((src) => {
|
|
62
|
+
var img = new Image()
|
|
63
|
+
img.addEventListener('load', () => {
|
|
64
|
+
loadComplete()
|
|
65
|
+
})
|
|
66
|
+
img.addEventListener('error', () => {
|
|
67
|
+
loadComplete()
|
|
68
|
+
})
|
|
69
|
+
img.src = src
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
prev(){
|
|
75
|
+
this.index--
|
|
76
|
+
if(this.index < 0)
|
|
77
|
+
this.index = this.src.length - 1
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
next(){
|
|
81
|
+
this.index++
|
|
82
|
+
if(this.index >= this.src.length)
|
|
83
|
+
this.index = 0
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
toggleMode(){
|
|
87
|
+
this.mode = this.mode === 1 ? 2 : 1
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
onMouseMove(e){
|
|
91
|
+
const curX = e.touches ? e.touches[0].clientX : e.clientX
|
|
92
|
+
const distance = curX - this.startX
|
|
93
|
+
if(distance > 5){
|
|
94
|
+
this.next()
|
|
95
|
+
this.startX = curX
|
|
96
|
+
}
|
|
97
|
+
else if(distance < -5){
|
|
98
|
+
this.prev()
|
|
99
|
+
this.startX = curX
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
onMouseUp(){
|
|
104
|
+
window.removeEventListener('mousemove', this.onMouseMove)
|
|
105
|
+
window.removeEventListener('mouseup', this.onMouseUp)
|
|
106
|
+
this.startX = null
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
onMouseDown(e){
|
|
110
|
+
|
|
111
|
+
if(this.mode !== 2) return
|
|
112
|
+
|
|
113
|
+
this.startX = e.touches ? e.touches[0].clientX : e.clientX
|
|
114
|
+
window.addEventListener('mousemove', this.onMouseMove)
|
|
115
|
+
window.addEventListener('mouseup', this.onMouseUp)
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
watch: {
|
|
122
|
+
|
|
123
|
+
src(to){
|
|
124
|
+
console.log('src', to)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
</script>
|
|
133
|
+
|
|
134
|
+
<style module>
|
|
135
|
+
|
|
136
|
+
.comp{
|
|
137
|
+
@apply relative;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="image-fs">
|
|
3
|
+
<div class="flex h-full w-full items-center justify-center relative">
|
|
4
|
+
<div>
|
|
5
|
+
<div class="p-5 top-0 right-0 absolute cursor-pointer" @click="$emit('close')">
|
|
6
|
+
<svg width="32" height="32" viewBox="0 0 24 24" class="fill-white/60" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
+
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
8
|
+
</svg>
|
|
9
|
+
</div>
|
|
10
|
+
<img :src="src" class="block w-full max-w-[80%] mx-auto" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
|
|
18
|
+
export default{
|
|
19
|
+
|
|
20
|
+
props: {
|
|
21
|
+
|
|
22
|
+
src:{ type:String },
|
|
23
|
+
|
|
24
|
+
state: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
emits:[
|
|
32
|
+
'close'
|
|
33
|
+
],
|
|
34
|
+
|
|
35
|
+
watch:{
|
|
36
|
+
|
|
37
|
+
state(to, from){
|
|
38
|
+
|
|
39
|
+
if(to){
|
|
40
|
+
this.show()
|
|
41
|
+
}
|
|
42
|
+
else{
|
|
43
|
+
this.hide()
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
methods: {
|
|
50
|
+
|
|
51
|
+
show(){
|
|
52
|
+
|
|
53
|
+
this.$el.classList.add('image-fs-on')
|
|
54
|
+
window.setTimeout(() => {
|
|
55
|
+
this.$el.classList.add('image-fs-active')
|
|
56
|
+
}, 100)
|
|
57
|
+
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
afterHide(){
|
|
61
|
+
this.$el.classList.remove('image-fs-on')
|
|
62
|
+
this.$el.removeEventListener('transitionend', this.afterHide)
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
hide(){
|
|
66
|
+
this.$el.addEventListener('transitionend', this.afterHide)
|
|
67
|
+
this.$el.classList.remove('image-fs-active')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style>
|
|
77
|
+
|
|
78
|
+
.image-fs{
|
|
79
|
+
position: fixed;
|
|
80
|
+
left: 0;
|
|
81
|
+
top: 0;
|
|
82
|
+
width: 100vw;
|
|
83
|
+
height: 100vh;
|
|
84
|
+
@apply bg-black/80;
|
|
85
|
+
z-index: 21;
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.image-fs-on{
|
|
90
|
+
display: block;
|
|
91
|
+
opacity: 0;
|
|
92
|
+
transition: all 200ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
93
|
+
transform: translate3d(0, 10%, 0) scale(.95);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.image-fs-active{
|
|
97
|
+
opacity: 1;
|
|
98
|
+
transform: translate3d(0, 0, 0) scale(1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Modal :state="isOpen" width="400" height="400" :class="$style.previewModal">
|
|
3
|
+
<div class="flex-1">
|
|
4
|
+
<div class="flex flex-row justify-end items-center p-3">
|
|
5
|
+
<a :href="imageUrl" download>
|
|
6
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="fill-text"><path class="primary" d="M15 15v-3a3 3 0 0 0-6 0v3H6a4 4 0 0 1-.99-7.88 5.5 5.5 0 0 1 10.86-.82A4.49 4.49 0 0 1 22 10.5a4.5 4.5 0 0 1-4.5 4.5H15z"/><path class="secondary" d="M11 18.59V12a1 1 0 0 1 2 0v6.59l1.3-1.3a1 1 0 0 1 1.4 1.42l-3 3a1 1 0 0 1-1.4 0l-3-3a1 1 0 0 1 1.4-1.42l1.3 1.3z"/></svg>
|
|
7
|
+
</a>
|
|
8
|
+
<button class="ml-3" @click="close">
|
|
9
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" viewBox="0 0 24 24" class="fill-text"><path class="secondary" fill-rule="evenodd" d="M15.78 14.36a1 1 0 0 1-1.42 1.42l-2.82-2.83-2.83 2.83a1 1 0 1 1-1.42-1.42l2.83-2.82L7.3 8.7a1 1 0 0 1 1.42-1.42l2.83 2.83 2.82-2.83a1 1 0 0 1 1.42 1.42l-2.83 2.83 2.83 2.82z"/></svg>
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="flex items-center justify-center">
|
|
13
|
+
<img :src="imageUrl" class="max-h-[85vh]"/>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</Modal>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
|
|
21
|
+
export default{
|
|
22
|
+
|
|
23
|
+
data(){
|
|
24
|
+
return {
|
|
25
|
+
isOpen: false,
|
|
26
|
+
imageUrl: null
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
methods: {
|
|
31
|
+
|
|
32
|
+
open(imageUrl){
|
|
33
|
+
this.imageUrl = imageUrl
|
|
34
|
+
this.isOpen = true
|
|
35
|
+
window.addEventListener('keyup', this.onKeyUp)
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
close(){
|
|
39
|
+
this.isOpen = false
|
|
40
|
+
this.imageUrl = null
|
|
41
|
+
window.removeEventListener('keyup', this.onKeyUp)
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
onKeyUp(e){
|
|
45
|
+
if(e.keyCode === 27){
|
|
46
|
+
e.preventDefault()
|
|
47
|
+
e.stopPropagation()
|
|
48
|
+
this.close()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style module>
|
|
59
|
+
|
|
60
|
+
.comp{
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.previewModal{
|
|
65
|
+
@apply !w-screen !h-screen !bg-base-300;
|
|
66
|
+
z-index: 21 !important;
|
|
67
|
+
max-width: unset !important;
|
|
68
|
+
max-height: unset !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
</style>
|