div1.vue
5.67 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
<div class="bg">
<!-- <svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" fill="transparent" width="400" height="300"
class="bgColor">
<polygon :fill="bgColor" points="10, 27 10, 273 13, 276 13, 279 24, 289
38, 289 41, 292 73, 292 75, 290 81, 290
85, 294 315, 294 319, 290 325, 290
327, 292 359, 292 362, 289
376, 289 387, 279 387, 276
390, 273 390, 27 387, 25 387, 21
376, 11 362, 11 359, 8 327, 8 325, 10
319, 10 315, 6 85, 6 81, 10 75, 10 73, 8 41, 8 38, 11 24, 11 13, 21 13, 24"></polygon>
</svg> -->
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="150px" height="150px"
class="top-left">
<polygon
points="6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[0]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8" :fill="secondaryColor">
<animate attributeName="fill" :value="valuesArr[1]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[2]" dur="1s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
</svg>
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="150px" height="150px"
class="top-right">
<polygon
points="6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[0]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8" :fill="secondaryColor">
<animate attributeName="fill" :value="valuesArr[1]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[2]" dur="1s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
</svg>
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="150px" height="150px"
class="bottom-left">
<polygon
points="6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[0]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8" :fill="secondaryColor">
<animate attributeName="fill" :value="valuesArr[1]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[2]" dur="1s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
</svg>
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="150px" height="150px"
class="bottom-right">
<polygon
points="6,66 6,18 12,12 18,12 24,6 27,6 30,9 36,9 39,6 84,6 81,9 75,9 73.2,7 40.8,7 37.8,10.2 24,10.2 12,21 12,24 9,27 9,51 7.8,54 7.8,63"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[0]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="27.599999999999998,4.8 38.4,4.8 35.4,7.8 30.599999999999998,7.8" :fill="secondaryColor">
<animate attributeName="fill" :value="valuesArr[1]" dur="0.5s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
<polygon points="9,54 9,63 7.199999999999999,66 7.199999999999999,75 7.8,78 7.8,110 8.4,110 8.4,66 9.6,66 9.6,54"
:fill="mainColor">
<animate attributeName="fill" :value="valuesArr[2]" dur="1s" begin="0s" repeatCount="indefinite">
</animate>
</polygon>
</svg>
</div>
</template>
<script>
export default {
name: 'widget-div-1',
props: {
mainColor: {
type: String,
default: "#83bff6",
},
secondaryColor: {
type: String,
default: "#00CED1",
},
// bgColor: {
// type: String,
// default: "transparent",
// },
},
computed: {
valuesArr() {
return [`${this.mainColor};${this.secondaryColor};${this.mainColor};`,
`${this.secondaryColor};${this.mainColor};${this.secondaryColor};`,
`${this.mainColor};${this.secondaryColor};transparent;`];
}
}
};
</script>
<style lang="scss" scoped>
.bg {
width: 100%;
height: 100%;
position: relative;
svg {
position: absolute;
width: 6em;
height: 6em;
}
.bgColor {
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.top-left {
top: 0;
left: 0;
}
.top-right {
top: 0;
right: 0;
transform: rotateY(180deg);
}
.bottom-left {
left: 0;
bottom: 0;
transform: rotateX(180deg);
}
.bottom-right {
bottom: 0;
right: 0;
transform: rotateX(180deg) rotateY(180deg);
}
}
</style>