-
Notifications
You must be signed in to change notification settings - Fork 128
/
SiteLogo.vue
executable file
·65 lines (65 loc) · 1.1 KB
/
SiteLogo.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
<template>
<div class="logo-wrapper">
<div
:class="{
'logo-inner': true,
blink: blinking
}"
>
<img
v-for="x in frames"
:key="x"
:src="`/logo-frames/logo-f${x - 1}.svg`"
/>
<img
v-for="x in frames"
:key="`${x}-r`"
:src="`/logo-frames/logo-f${frames - x}.svg`"
/>
</div>
</div>
</template>
<script>
export default {
name: 'SiteLogo',
data() {
return {
frames: 5,
currentFrame: 1,
blinking: true
}
},
mounted() {
setInterval(() => {
const rand = Math.ceil(Math.random() * 10)
this.blinking = rand % 2
}, 1000)
}
}
</script>
<style lang="scss">
@keyframes logoBlink {
100% {
transform: translateY(-360px);
}
}
.logo-wrapper {
position: relative;
height: 50px;
overflow: hidden;
width: 200px;
.logo-inner {
position: absolute;
height: 500px;
img {
display: block;
height: 40px;
margin: 5px;
max-height: initial;
}
&.blink {
animation: logoBlink 0.2s steps(8, end) alternate;
}
}
}
</style>