-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
236 lines (215 loc) · 12.6 KB
/
example.html
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Omacookies Markup Example</title>
<link rel="stylesheet" type="text/css" href="dist/css/omacookies.css">
<style>
main {
box-sizing: border-box;
padding: 0;
margin: 0;
text-align: center;
}
main .container {
box-sizing: border-box;
margin: 0 auto;
padding: 16px;
text-align: left;
width: 100%;
max-width: 920px;
}
</style>
</head>
<body>
<main>
<div class="container">
<div class="omac-iframe-youtube">
<div class="omac-iframe-youtube-content">
<svg class="omac-icon-cookie"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 224 222.2"
xml:space="preserve">
<path d="M222,61.1c-2.3-0.8-5.3-2.2-6.9-1.3c-1.9,1-4,4.4-3.7,6.4c0.3,2.1,3.5,5.3,5.3,5.2c2.5-0.2,4.9-2.9,7.3-4.5c0-1,0-2,0-3
C223.3,62.8,222.9,61.4,222,61.1z M213.3,96.9c-13,6.2-18.4,5.1-27.2-6.4c-2.2-2.9-4.6-3.3-7.8-2.7c-4,0.9-8.1,1.8-12.2,2.2
c-15.4,1.6-29.2-8.3-32.5-23.2c-1.7-7.8-0.9-15.5,1.4-23.1c1.2-4.1,0.3-6.9-3.9-8.8c-6.6-2.9-9.6-8.4-9.6-15.5
c0-3.9,0.5-7.9,1.2-11.8c1.1-5.4-0.5-8-6.1-7.8c-8.4,0.4-16.9,0.5-25.2,2C33.2,12.6-7.1,68.4,1,126.6c7.7,55,54.7,95.7,103.5,95.6
c23.9,0.1,40-3.7,55.3-11.1c41.1-20.1,66-63.8,62.2-108.9C221.5,96.6,218.2,94.6,213.3,96.9z M118.6,211.8
C59.5,216.3,9.3,169.1,10.3,110.3c1.1-62,54.8-100.8,101-99.9c0,4.2-0.2,8,0,11.7c0.6,7.8,3.9,14.4,10.1,19.2
c2.1,1.6,2.4,2.8,2.3,5.6c-0.4,7.8-1.1,16,0.6,23.6c4.4,19.4,22,31.8,41.8,29.8c8-0.8,14.7-1.3,21,5.7c5.3,5.8,13.4,5.8,21,4.3
c1-0.2,1.9-0.4,2.9-0.6c0.1,0,0.3,0.1,0.5,0.1C214.2,153.9,179.4,207.1,118.6,211.8z M178.2,21.7c5.7,0,10.3-4.7,10.3-10.5
c-0.1-5.8-4.2-10-10-10.2C172.4,0.9,168,5.1,168,11.1C168,17,172.5,21.7,178.2,21.7z M170.5,60.9c5.5,0,9.8-4.2,9.7-9.7
c0-5.4-3.9-9.4-9.3-9.5c-5.7-0.1-9.8,3.8-9.9,9.3C161,56.6,165,60.8,170.5,60.9z M73.7,100.7c0-8.8-7.1-15.8-15.8-15.7
c-8.6,0.2-15.3,7-15.3,15.6c0,8.9,6.8,16,15.5,15.9C66.7,116.5,73.8,109.4,73.7,100.7z M140,146.8c-8-0.1-14.6,6.3-14.6,14.3
c-0.1,8.1,6.2,14.5,14.3,14.5c8.1,0.1,14.6-6.3,14.7-14.2C154.4,153.4,148,146.9,140,146.8z M68.7,142.9
c-6.3-0.2-11.1,4.4-11.1,10.7c0,6.4,4.4,10.9,10.8,11c6.1,0.1,11.2-5,11.1-10.9C79.4,148,74.5,143.1,68.7,142.9z M108.1,105.4
c-5.4,0-9,3.6-8.9,9c0.1,4.9,4,8.9,8.7,8.9c4.7,0,8.8-4,9-8.7C117.1,109.3,113.4,105.5,108.1,105.4z M92,57.7
c-4.6,0.2-8.5,4.3-8.2,8.8c0.2,4.6,4.2,8.3,8.8,8.3c4.9-0.1,8.3-3.6,8.3-8.6C100.8,61,97.1,57.5,92,57.7z"/>
</svg>
<h3 class="omac-title">... Oops!</h3>
<p class="omac-text">Este contenido ha sido bloqueado debido a tu configuración de cookies.</p>
<button id="omacookies-iframe-btn" class="omac-btn-secondary">Personalizar cookies</button>
</div>
</div>
</div>
</main>
<div id="omacookies" class="omacookies">
<button id="omacookies-quick-link" class="omac-quick-link bottom-right omac-hide" aria-labelledby="omacookies-selection-box">
<svg class="omac-icon-cookie"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 224 222.2"
xml:space="preserve">
<path d="M222,61.1c-2.3-0.8-5.3-2.2-6.9-1.3c-1.9,1-4,4.4-3.7,6.4c0.3,2.1,3.5,5.3,5.3,5.2c2.5-0.2,4.9-2.9,7.3-4.5c0-1,0-2,0-3
C223.3,62.8,222.9,61.4,222,61.1z M213.3,96.9c-13,6.2-18.4,5.1-27.2-6.4c-2.2-2.9-4.6-3.3-7.8-2.7c-4,0.9-8.1,1.8-12.2,2.2
c-15.4,1.6-29.2-8.3-32.5-23.2c-1.7-7.8-0.9-15.5,1.4-23.1c1.2-4.1,0.3-6.9-3.9-8.8c-6.6-2.9-9.6-8.4-9.6-15.5
c0-3.9,0.5-7.9,1.2-11.8c1.1-5.4-0.5-8-6.1-7.8c-8.4,0.4-16.9,0.5-25.2,2C33.2,12.6-7.1,68.4,1,126.6c7.7,55,54.7,95.7,103.5,95.6
c23.9,0.1,40-3.7,55.3-11.1c41.1-20.1,66-63.8,62.2-108.9C221.5,96.6,218.2,94.6,213.3,96.9z M118.6,211.8
C59.5,216.3,9.3,169.1,10.3,110.3c1.1-62,54.8-100.8,101-99.9c0,4.2-0.2,8,0,11.7c0.6,7.8,3.9,14.4,10.1,19.2
c2.1,1.6,2.4,2.8,2.3,5.6c-0.4,7.8-1.1,16,0.6,23.6c4.4,19.4,22,31.8,41.8,29.8c8-0.8,14.7-1.3,21,5.7c5.3,5.8,13.4,5.8,21,4.3
c1-0.2,1.9-0.4,2.9-0.6c0.1,0,0.3,0.1,0.5,0.1C214.2,153.9,179.4,207.1,118.6,211.8z M178.2,21.7c5.7,0,10.3-4.7,10.3-10.5
c-0.1-5.8-4.2-10-10-10.2C172.4,0.9,168,5.1,168,11.1C168,17,172.5,21.7,178.2,21.7z M170.5,60.9c5.5,0,9.8-4.2,9.7-9.7
c0-5.4-3.9-9.4-9.3-9.5c-5.7-0.1-9.8,3.8-9.9,9.3C161,56.6,165,60.8,170.5,60.9z M73.7,100.7c0-8.8-7.1-15.8-15.8-15.7
c-8.6,0.2-15.3,7-15.3,15.6c0,8.9,6.8,16,15.5,15.9C66.7,116.5,73.8,109.4,73.7,100.7z M140,146.8c-8-0.1-14.6,6.3-14.6,14.3
c-0.1,8.1,6.2,14.5,14.3,14.5c8.1,0.1,14.6-6.3,14.7-14.2C154.4,153.4,148,146.9,140,146.8z M68.7,142.9
c-6.3-0.2-11.1,4.4-11.1,10.7c0,6.4,4.4,10.9,10.8,11c6.1,0.1,11.2-5,11.1-10.9C79.4,148,74.5,143.1,68.7,142.9z M108.1,105.4
c-5.4,0-9,3.6-8.9,9c0.1,4.9,4,8.9,8.7,8.9c4.7,0,8.8-4,9-8.7C117.1,109.3,113.4,105.5,108.1,105.4z M92,57.7
c-4.6,0.2-8.5,4.3-8.2,8.8c0.2,4.6,4.2,8.3,8.8,8.3c4.9-0.1,8.3-3.6,8.3-8.6C100.8,61,97.1,57.5,92,57.7z"/>
</svg>
</button>
<div class="omac-backdrop fade-in" id="omacookies-notice-box">
<div class="omac-notice omac-box omac-banner"> <!-- omac-modal or omac-banner -->
<header class="omac-box-header">
<h3 class="omac-title">Esta página web usa cookies</h3>
</header>
<div class="omac-box-body">
<p class="omac-text">Las cookies de este sitio web se usan para personalizar el contenido y los anuncios, ofrecer funciones de redes sociales y analizar el tráfico. Además, compartimos información sobre el uso que haga del sitio web con nuestros partners de redes sociales, publicidad y análisis web, quienes pueden combinarla con otra información que les haya proporcionado o que hayan recopilado a partir del uso que haya hecho de sus servicios.</p>
<a href="" class="omac-read-more" aria-label="Leer más acerca de las cookies de esta página">Leer más</a>
</div>
<footer class="omac-box-footer">
<button id="omacookies-selection-btn" class="omac-btn-secondary" aria-label="Personalizar las cookies" aria-labelledby="omacookies-selection">Personalizar</button>
<button id="omacookies-accept-all-btn" class="omac-btn-primary">Aceptar todas</button>
</footer>
<button id="omacookies-close-notice" class="omac-close" aria-labelledby="omacookies-consent" disabled>
<span class="omac-visually-hidden">Cerrar</span>
</button>
</div>
</div>
<div class="omac-backdrop omac-hide" id="omacookies-selection-box">
<form class="omac-selection omac-box omac-modal" id="omacookies-selection-form">
<header class="omac-box-header">
<h3 class="omac-title">Personalizar Cookies</h3>
</header>
<div class="omac-box-body">
<p class="omac-text">Ahora puede personalizar las cookies activas para este sitio.</p>
<a href="" class="omac-read-more" aria-label="Leer más acerca de las cookies de esta página">Leer más</a>
<div class="omac-switch-list">
<label class="omac-switch-group" for="switch-preferencies">
<span class="omac-switch-text">Cookies obligatorias</span>
<input id="switch-preferencies" type="checkbox" value="preferences" checked disabled />
<span class="omac-switch"></span>
</label>
<label class="omac-switch-group" for="switch-statistics">
<span class="omac-switch-text">Cookies de análisis</span>
<input id="switch-statistics" type="checkbox" value="statistics" />
<span class="omac-switch"></span>
</label>
<label class="omac-switch-group" for="switch-marketing">
<span class="omac-switch-text">Cookies de publicidad</span>
<input id="switch-marketing" type="checkbox" value="marketing" />
<span class="omac-switch"></span>
</label>
</div>
</div>
<footer class="omac-box-footer">
<button id="omacookies-select-all-btn" class="omac-btn-secondary">Seleccionar todas</button>
<button id="omacookies-accept-selection-btn" class="omac-btn-primary">Aceptar selección</button>
</footer>
<button id="omacookies-close-selection" class="omac-close" aria-labelledby="omacookies-selection-box" disabled>
<span class="omac-visually-hidden">Cerrar</span>
</button>
</form>
</div>
</div>
</body>
<script type="text/javascript">
let quicklink = document.getElementById('omacookies-quick-link');
let notice = document.getElementById('omacookies-notice-box');
let selectionBtn = document.getElementById('omacookies-selection-btn');
let acceptAllBtn = document.getElementById('omacookies-accept-all-btn');
let closeNotice = document.getElementById('omacookies-close-notice');
let selection = document.getElementById('omacookies-selection-box');
let selectAllBtn = document.getElementById('omacookies-select-all-btn');
let acceptSelectionBtn = document.getElementById('omacookies-accept-selection-btn');
let closeSelection = document.getElementById('omacookies-close-selection');
let form = document.getElementById('omacookies-selection-form');
let checkboxes = form.getElementsByTagName('input');
let iframeBtn = document.getElementById('omacookies-iframe-btn');
let backdrops = document.getElementsByClassName('omac-backdrop');
function show(el) {
el.classList.remove('omac-hide');
el.classList.add('fade-in');
}
function hide(el) {
el.classList.add('omac-hide');
el.classList.remove('fade-in');
}
function enableCloseModals() {
closeNotice.disabled = false;
closeSelection.disabled = false;
for(let i = 0; i < backdrops.length; i++) {
backdrops[i].addEventListener('click', (e) => {
if(e.target.classList.contains('omac-backdrop')) {
hide(e.target);
show(quicklink);
}
})
}
}
acceptAllBtn.addEventListener('click', () => {
hide(notice);
show(quicklink);
enableCloseModals();
})
closeNotice.addEventListener('click', () => {
hide(notice);
show(quicklink);
})
selectionBtn.addEventListener('click', () => {
hide(notice);
show(selection);
});
selectAllBtn.addEventListener('click', (e) => {
e.preventDefault();
for(let i = 0; i < checkboxes.length; i++) {
if(!checkboxes[i].checked) {
checkboxes[i].checked = true;
}
}
});
closeSelection.addEventListener('click', (e) => {
e.preventDefault();
hide(selection);
show(quicklink);
})
acceptSelectionBtn.addEventListener('click', (e) => {
e.preventDefault();
hide(selection);
show(quicklink);
enableCloseModals();
})
iframeBtn.addEventListener('click', () => {
hide(quicklink);
show(selection);
});
quicklink.addEventListener('click', () => {
hide(quicklink);
show(selection);
});
form.addEventListener('submit', (e) => {
e.preventDefault();
});
</script>
</html>