forked from cmda-minor-web-cases/cmda-mid-term-2122
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CardSwitch.vue
212 lines (188 loc) · 4.23 KB
/
CardSwitch.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!--
- Border img nog niet goed gexporteerd
- Content uit json halen -->
<template>
<section class="CardSwitch">
<h1>1.2 Competenties</h1>
<div class="CardCon" :class="[isChecked ? 'bgBlack' : 'bgYellow']">
<div>
<h4 style="margin-bottom:0;">Beroeps specifieke kerncompetentie</h4>
<p>Hebben betrekking op inhoudelijke geschiktheid in de beroepspraktijk en de situaties die zich daar voordoen
</p>
<h2>Principes</h2>
<h3 v-if="isChecked">Nieuw</h3>
<h3 v-else>Oud</h3>
<ul v-if="isChecked">
<li>Multidisciplinair samenwerken </li>
<li>Manifesteren en presenteren </li>
<li>Initiëren organiseren en regisseren</li>
<li>Ontwikkelen en reflecteren</li>
<li>Onderzoeken</li>
</ul>
<ul v-else>
<li>Multidisciplinair samenwerken </li>
<li>Manifesteren en presenteren </li>
<li>Initiëren organiseren en regisseren</li>
<li>Ontwikkelen en reflecteren</li>
<li>Onderzoeken</li>
</ul>
<label class="switch">
<input type="checkbox" @click="CardConColor">
<span class="slider" :class="[isChecked ? 'CBlack' : 'Cwhite']"></span>
</label>
</div>
<img
src="https://images.prismic.io/cmd-midterm/663bf539-c574-417c-97e6-7b35177b4144_CardCon-Border.png?auto=compress,format"
class="cardBorder" />
</div>
</section>
</template>
<script>
export default {
name: 'CardSwitch',
data() {
return {
isChecked: false
}
},
methods: {
CardConColor() {
this.isChecked = !this.isChecked
}
}
};
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap');
.CardCon {
font-family: 'Open Sans';
font-weight: 500;
height: 35em;
width: 30em;
margin-left: 2em;
margin-top: 3em;
}
.CardSwitch h1 {
margin-left: 1em;
font-family: 'Open Sans';
font-weight: 700;
font-size: 1.7em;
}
.cardBorder {
height: 36em;
width: 31.5em;
margin-left: -0.6em;
margin-top: -33.2em;
}
.bgYellow {
background-color: #FFF021;
border: 2px solid #000000;
-webkit-transition: .2s;
transition: .2s;
}
.bgBlack {
background-color: #000000;
color: #ffffff;
border: 2px solid #000000;
-webkit-transition: .2s;
transition: .2s;
}
.CBlack {
color: #000000;
}
.CardCon div {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
margin-left: 1em;
padding: 1em;
}
.CardCon h3 {
font-weight: 700;
font-size: 2rem;
margin: 0.2em 0 0.2em 0;
}
.Cardcon div h4 {
font-size: 1rem;
font-weight: 700;
}
.CardCon h2 {
font-weight: 400;
margin: 0;
margin-top: 0.5em;
}
.CardCon ul {
list-style: none;
padding: 0;
margin-bottom: 1.8em;
}
.CardCon ul li {
margin-bottom: 1em;
}
.CardCon ul li:before {
content: "";
float: left;
width: 0;
height: 0;
display: inline-block;
border: 9px solid transparent;
border-left-color: black;
}
.CBlack~.CardCon ul li:before {
border-left-color: #FFF021;
}
.switch {
position: relative;
display: inline-block;
width: 5.5em;
height: 2em;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgb(0, 0, 0);
-webkit-transition: .4s;
transition: .4s;
border-radius: 3px;
}
.slider:before {
position: absolute;
content: "Nieuw";
font-size: 0.8em;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 60%;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
border-radius: 2.5px;
}
input:checked+.slider {
background-color: #ffffff;
}
input:checked+.slider:before {
background-color: #FFF021;
}
input:checked+.CardCon {
background-color: #000000;
}
input:checked+.slider:before {
content: "Oud";
-webkit-transform: translateX(68%);
-ms-transform: translateX(68%);
transform: translateX(68%);
}
</style>