0001-new-theme-isere-cd38-48886.patch
static/isere-cd38/_custom.scss | ||
---|---|---|
1 |
// |
|
2 |
// Typo |
|
3 |
// |
|
4 | ||
5 |
html { |
|
6 |
@media ($min-desktop-viewport) { |
|
7 |
font-size: 1.125em; |
|
8 |
} |
|
9 |
} |
|
10 |
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { |
|
11 |
font-family: $raleway; |
|
12 |
font-weight: bold; |
|
13 |
} |
|
14 |
h1, .h1 { font-size: $fz-h1; } |
|
15 |
h2, .h2 { font-size: $fz-h2; } |
|
16 |
h3, .h3 { font-size: $fz-h3; } |
|
17 |
h4, .h4 { font-size: $fz-h4; } |
|
18 | ||
19 | ||
20 |
.section-title { |
|
21 |
font-size: $fz-h2; |
|
22 |
font-family: $raleway; |
|
23 |
text-transform: uppercase; |
|
24 |
color: $cyan-dark; |
|
25 |
background: transparent; |
|
26 |
padding: 0; |
|
27 |
margin-top: 0; |
|
28 |
@media ($max-mobile-viewport) { |
|
29 |
font-weight: normal; |
|
30 |
font-size: $fz-h4; |
|
31 |
} |
|
32 |
} |
|
33 | ||
34 |
.underlined-title { |
|
35 |
text-transform: none; |
|
36 |
font-family: $raleway; |
|
37 |
font-size: $fz-h2; |
|
38 |
color: $cyan-dark; |
|
39 |
padding: 0; |
|
40 |
background: transparent; |
|
41 |
border-bottom: 2px solid $cyan-dark; |
|
42 |
padding-bottom: .33em; |
|
43 |
} |
|
44 | ||
45 |
.h2-txt { |
|
46 |
@extend .underlined-title; |
|
47 |
margin-bottom: 0.75em !important; |
|
48 |
@media (max-width: $very-small-limit) { |
|
49 |
font-size: $fz-h3; |
|
50 |
font-weight: normal; |
|
51 |
} |
|
52 |
} |
|
53 |
.h3-txt { |
|
54 |
color: $cyan-dark; |
|
55 |
border-bottom: none !important; |
|
56 |
@media (max-width: $very-small-limit) { |
|
57 |
font-weight: normal; |
|
58 |
} |
|
59 |
} |
|
60 | ||
61 |
// |
|
62 |
// Forms |
|
63 |
// |
|
64 |
%button { |
|
65 |
transition: all 0.2s ease; |
|
66 |
&:hover { |
|
67 |
transform: scale(1.01); |
|
68 |
} |
|
69 |
} |
|
70 |
%cancel-button { |
|
71 |
background-color: $gray-dark; |
|
72 |
&:hover { |
|
73 |
background-color: $gray-dark; |
|
74 |
} |
|
75 |
} |
|
76 | ||
77 |
// notifications |
|
78 |
@mixin custom-notif($color, $symbol, $bgcolor) { |
|
79 |
background: linear-gradient(to right, |
|
80 |
$color 3rem, |
|
81 |
$bgcolor 3.01em |
|
82 |
); |
|
83 |
color: black; |
|
84 |
&::before { |
|
85 |
display: block; |
|
86 |
width: 3rem; |
|
87 |
left: 0; |
|
88 |
text-align: center; |
|
89 |
content: $symbol; |
|
90 |
color: white; |
|
91 |
font-size: $fz-h2; |
|
92 |
font-family: $raleway; |
|
93 |
font-weight: 700; |
|
94 |
} |
|
95 |
} |
|
96 | ||
97 |
#messages li.error, |
|
98 |
.errornotice, |
|
99 |
.pk-error { |
|
100 |
@include custom-notif( |
|
101 |
$notification_error_color, |
|
102 |
"X", |
|
103 |
adjust-color($notification_error_color, $lightness: 52%, $saturation: -60%) |
|
104 |
); |
|
105 |
} |
|
106 | ||
107 |
#messages li.warning, |
|
108 |
.warningnotice, |
|
109 |
.pk-attention { |
|
110 |
@include custom-notif( |
|
111 |
$notification_warning_color, |
|
112 |
"!", |
|
113 |
adjust-color($notification_warning_color, $lightness: 35%, $saturation: -20%) |
|
114 |
); |
|
115 |
} |
|
116 | ||
117 |
#messages li.success, |
|
118 |
.successnotice |
|
119 |
#messages li.info, |
|
120 |
.infonotice, |
|
121 |
.pk-information { |
|
122 |
@include custom-notif( |
|
123 |
$notification_info_color, |
|
124 |
"i", |
|
125 |
adjust-color($notification_info_color, $lightness: 60%, $saturation: -20%) |
|
126 |
); |
|
127 |
} |
|
128 | ||
129 |
// |
|
130 |
// LAYOUT |
|
131 |
// |
|
132 |
// sidebar <-> columns gutter |
|
133 |
@media ($min-desktop-viewport) { |
|
134 |
.gru-content { |
|
135 |
#sidebar { |
|
136 |
div.cell { |
|
137 |
@if $sidebar-position == left { |
|
138 |
margin-right: $sidebar-columns-gutter; |
|
139 |
} @else { |
|
140 |
margin-left: $sidebar-columns-gutter; |
|
141 |
} |
|
142 |
} |
|
143 |
} |
|
144 |
} |
|
145 |
} |
|
146 |
// 3cols layout |
|
147 |
.theme-3cols-layout { |
|
148 |
@media ($min-desktop-viewport) { |
|
149 |
display: flex; |
|
150 |
margin-left: -#{$columns-gutter / 2}; |
|
151 |
margin-right: -#{$columns-gutter / 2}; |
|
152 |
> div { |
|
153 |
flex: 1 1 0; |
|
154 |
> .cell { |
|
155 |
margin-left: #{$columns-gutter / 2} !important; |
|
156 |
margin-right: #{$columns-gutter / 2} !important; |
|
157 |
} |
|
158 |
} |
|
159 |
} |
|
160 |
@media ($max-mobile-viewport) { |
|
161 |
#center div.cell { |
|
162 |
margin-left: 0; |
|
163 |
margin-right: 0; |
|
164 |
} |
|
165 |
} |
|
166 |
} |
|
167 |
// homepage |
|
168 |
.page-template-homepage { |
|
169 |
#content { |
|
170 |
flex-wrap: wrap; |
|
171 |
#columns-wrapper { |
|
172 |
flex: 1 0 calc(100% - #{$sidebar-max-width}); |
|
173 |
} |
|
174 |
.toutes-demarches { |
|
175 |
flex: 0 0 100%; |
|
176 |
order: 2; |
|
177 |
@media ($max-mobile-viewport) { |
|
178 |
padding-left: 1rem; |
|
179 |
padding-right: 1rem; |
|
180 |
} |
|
181 |
} |
|
182 |
} |
|
183 |
} |
|
184 | ||
185 | ||
186 |
// |
|
187 |
// HEADER |
|
188 |
// |
|
189 |
div#header { |
|
190 |
padding: 0; |
|
191 |
padding-left: 100px; // isère widget width; |
|
192 |
padding-right: $nav-menu-side + 0.5rem; |
|
193 |
@media (min-width: $nav-mobile-limit + 0.001) { |
|
194 |
padding-right: $yellow-border-mobile; |
|
195 |
} |
|
196 |
@media ($min-desktop-viewport) { |
|
197 |
padding-left: #{$yellow-border-desktop + $main-padding-desktop}; |
|
198 |
padding-right: $yellow-border-desktop; |
|
199 |
} |
|
200 |
} |
|
201 |
#top { |
|
202 |
display: flex; |
|
203 |
height: $header-height-mobile; |
|
204 |
@media (min-width: $nav-mobile-limit + 0.001) { |
|
205 |
height: $header-height-desktop; |
|
206 |
} |
|
207 |
} |
|
208 |
h1#logo.has-logo { |
|
209 |
flex-grow: 1; |
|
210 |
padding: 0; |
|
211 |
background: none; |
|
212 |
padding-top: 1rem; |
|
213 |
padding-bottom: 1rem; |
|
214 | ||
215 |
a { |
|
216 |
display: block; |
|
217 |
height: 100%; |
|
218 |
min-width: 80px; |
|
219 |
margin-right: 1rem; |
|
220 |
} |
|
221 |
} |
|
222 |
// user links |
|
223 |
#toplinks { |
|
224 |
position: static; |
|
225 |
border-radius: 0; |
|
226 |
box-shadow: none; |
|
227 |
border: none; |
|
228 |
padding: 0; |
|
229 |
font-family: $raleway; |
|
230 |
font-size: $fz-small; |
|
231 |
font-weight: bold; |
|
232 |
align-self: center; |
|
233 |
a { |
|
234 |
display: block; |
|
235 |
} |
|
236 |
@media (min-width: $nav-mobile-limit + 0.001) { |
|
237 |
align-self: flex-start; |
|
238 |
background-color: $gold; |
|
239 |
padding: 0 1em; |
|
240 |
font-size: 1rem; |
|
241 |
line-height: 2em; |
|
242 |
a { |
|
243 |
display: inline; |
|
244 |
color: black; |
|
245 |
} |
|
246 |
} |
|
247 |
} |
|
248 | ||
249 | ||
250 |
// |
|
251 |
// NAV |
|
252 |
// |
|
253 |
#nav { |
|
254 |
margin-top: 0; |
|
255 |
@media (min-width: $nav-mobile-limit + 0.001) { |
|
256 |
padding: 3px #{$yellow-border-mobile + $main-padding-mobile}; |
|
257 |
} |
|
258 |
@media ($min-desktop-viewport) { |
|
259 |
padding: 3px #{$yellow-border-desktop + $main-padding-desktop}; |
|
260 |
} |
|
261 |
} |
|
262 |
#nav-button .icon-bar { |
|
263 |
border-width: 2px; |
|
264 |
} |
|
265 |
.gru-nav > ul { |
|
266 |
margin: 0; |
|
267 |
font-size: $fz-h4; |
|
268 |
} |
|
269 |
// Nav mobile (hamburger in right) |
|
270 |
@media (max-width: $nav-mobile-limit) { |
|
271 |
div.gru-nav-wrapper { |
|
272 |
margin-top: 0; |
|
273 |
} |
|
274 |
div.gru-nav { |
|
275 |
position: relative; |
|
276 |
.gru-nav-button { |
|
277 |
margin-left: 0; |
|
278 |
// align button to toplinks |
|
279 |
position: absolute; |
|
280 |
top: calc( |
|
281 |
( (#{$header-height-mobile} - #{$nav-menu-side}) |
|
282 |
/ 2 + #{$nav-menu-side} |
|
283 |
) * -1 |
|
284 |
) ; |
|
285 |
right: 0; |
|
286 |
} |
|
287 |
ul li a { |
|
288 |
padding: 1rem !important; |
|
289 |
text-align: center; |
|
290 |
} |
|
291 |
} |
|
292 |
} |
|
293 | ||
294 |
// |
|
295 |
// Page picture |
|
296 |
// |
|
297 |
body.has-picture nav::after { |
|
298 |
@extend .h1; |
|
299 |
color: white; |
|
300 |
display: flex; |
|
301 |
align-items: center; |
|
302 |
justify-content: center; |
|
303 |
text-align: center; |
|
304 |
top: 0; |
|
305 |
padding: $yellow-border-desktop + $main-padding-desktop; |
|
306 |
white-space: pre-wrap; |
|
307 | ||
308 |
@media (max-width: $nav-mobile-limit) { |
|
309 |
content: none !important; |
|
310 |
} |
|
311 |
} |
|
312 | ||
313 | ||
314 |
// |
|
315 |
// MAIN |
|
316 |
// |
|
317 |
main { |
|
318 |
background-color: $gold; |
|
319 |
} |
|
320 |
div#main-content-wrapper { |
|
321 |
background-color: white; |
|
322 |
border: solid $gold; |
|
323 |
border-width: 0 $yellow-border-mobile; |
|
324 |
@media ($min-desktop-viewport) { |
|
325 |
border-width: 0 $yellow-border-desktop; |
|
326 |
padding: 3rem; |
|
327 |
} |
|
328 |
} |
|
329 |
// Sidebar |
|
330 |
.gru-content #sidebar { |
|
331 |
@media ($max-mobile-viewport) { |
|
332 |
order: 0; |
|
333 |
background-color: $gray-light; |
|
334 |
margin-left: -#{$yellow-border-mobile}; |
|
335 |
margin-right: -#{$yellow-border-mobile}; |
|
336 |
max-width: none; |
|
337 |
padding: #{$yellow-border-mobile + $main-padding-mobile}; |
|
338 |
} |
|
339 |
} |
|
340 |
// columns |
|
341 |
#columns-wrapper { |
|
342 |
@media ($max-mobile-viewport) { |
|
343 |
padding: $main-padding-mobile; |
|
344 |
} |
|
345 |
} |
|
346 | ||
347 |
// |
|
348 |
// CELLS |
|
349 |
// |
|
350 |
// sidebar cells |
|
351 |
#sidebar { |
|
352 |
div.cell { |
|
353 |
border: none; |
|
354 |
h2:first-child { |
|
355 |
@extend .section-title; |
|
356 |
& ~ * { |
|
357 |
padding: 0; |
|
358 |
} |
|
359 |
} |
|
360 |
} |
|
361 |
} |
|
362 |
// columns cells |
|
363 |
.gru-content .cell { |
|
364 |
&.wcs-forms-of-category-cell, &.link-list-cell { |
|
365 |
// cell picture to left of title |
|
366 |
&.has-asset-picture { |
|
367 |
$image-width: 3rem; |
|
368 |
> div { |
|
369 |
display: flex; |
|
370 |
flex-wrap: wrap; |
|
371 |
position: relative; |
|
372 |
> h2:first-child { |
|
373 |
flex: 1 0 calc(100% - #{$image-width}); |
|
374 |
margin-left: -#{$image-width}; |
|
375 |
padding-left: calc(#{$image-width} + .5rem); |
|
376 |
+ picture { |
|
377 |
display: block; |
|
378 |
order: -1; |
|
379 |
flex: 0 0 auto; |
|
380 |
align-self: center; |
|
381 |
z-index: 1; |
|
382 |
img { |
|
383 |
width: $image-width; |
|
384 |
} |
|
385 |
~ * { |
|
386 |
flex: 0 0 100%; |
|
387 |
} |
|
388 |
} |
|
389 |
} |
|
390 |
} |
|
391 |
} |
|
392 |
} |
|
393 |
&.foldable { |
|
394 |
> div > h2:first-child { |
|
395 |
&::after { |
|
396 |
content: "\f068"; // minus |
|
397 |
font-weight: normal; |
|
398 |
font-size: .6em; |
|
399 |
background-color: white; |
|
400 |
color: $cyan-dark; |
|
401 |
border-radius: 50%; |
|
402 |
width: 1em; |
|
403 |
height: 1em; |
|
404 |
line-height: 1em; |
|
405 |
text-align: center; |
|
406 |
box-sizing: content-box; |
|
407 |
padding: 0.3em; |
|
408 |
bottom: 0; |
|
409 |
top: 0; |
|
410 |
margin-top: auto; |
|
411 |
margin-bottom: auto; |
|
412 |
} |
|
413 |
} |
|
414 |
&.folded > div > h2:first-child { |
|
415 |
&::after { |
|
416 |
content: "\f067"; // plus |
|
417 |
} |
|
418 |
} |
|
419 |
} |
|
420 |
// Text cell |
|
421 |
&.text-cell { |
|
422 |
border: none; |
|
423 |
> div > h2:first-child { |
|
424 |
@extend .h2-txt; |
|
425 |
margin: 0.7rem 1rem; |
|
426 |
} |
|
427 |
h2 { |
|
428 |
@extend .h2-txt; |
|
429 |
margin: 0.7rem 1rem; |
|
430 |
} |
|
431 |
h3 { |
|
432 |
@extend .h3-txt; |
|
433 |
} |
|
434 |
} |
|
435 | ||
436 |
} |
|
437 |
// "A la une" form cell |
|
438 |
.cell.a-la-une.wcs-form-cell { |
|
439 |
border: none; |
|
440 |
> div { |
|
441 |
@media ($max-mobile-viewport) { |
|
442 |
display: flex; |
|
443 |
} |
|
444 |
picture { |
|
445 |
@media ($max-mobile-viewport) { |
|
446 |
flex: 0 0 50%; |
|
447 |
max-width: 250px; |
|
448 |
display: flex; |
|
449 |
} |
|
450 |
@media ($min-desktop-viewport) { |
|
451 |
display: block; |
|
452 |
} |
|
453 |
img { |
|
454 |
width: 100%; |
|
455 |
max-height: 200px; |
|
456 |
object-fit: cover; |
|
457 |
} |
|
458 |
} |
|
459 |
[class^="wcs-form-"] { |
|
460 |
flex: 1 1 auto; |
|
461 |
display: flex; |
|
462 |
a { |
|
463 |
width: 100%; |
|
464 |
padding: 1rem; |
|
465 |
&:hover { |
|
466 |
background-color: $cyan-xlight; |
|
467 |
color: black |
|
468 |
} |
|
469 |
@media ($max-mobile-viewport) { |
|
470 |
display: flex; |
|
471 |
align-items: center; |
|
472 |
} |
|
473 |
@media ($min-desktop-viewport) { |
|
474 |
text-align: center; |
|
475 |
} |
|
476 |
} |
|
477 |
} |
|
478 |
} |
|
479 |
} |
|
480 | ||
481 |
// |
|
482 |
// WCS |
|
483 |
// |
|
484 |
.wcs-steps { |
|
485 |
@media ($max-mobile-viewport) { |
|
486 |
border: 1px solid $cyan-dark; |
|
487 |
padding: $wcs-steps-spacing; |
|
488 |
} |
|
489 |
} |
|
490 |
div#rub_service { |
|
491 |
h2 { |
|
492 |
@extend .h2-txt; |
|
493 |
@media ($min-desktop-viewport) { |
|
494 |
margin-left: 0.5rem; |
|
495 |
margin-right: 0.5rem; |
|
496 |
} |
|
497 |
} |
|
498 |
h3 { |
|
499 |
@extend .h3-txt; |
|
500 |
} |
|
501 |
form.quixote { |
|
502 |
@media ($max-mobile-viewport) { |
|
503 |
padding: 0; |
|
504 |
} |
|
505 |
} |
|
506 |
.buttons { |
|
507 |
.SubmitWidget { |
|
508 |
flex-grow: 1; |
|
509 |
max-width: 12.5em; |
|
510 |
&:not(:first-child) { |
|
511 |
padding-left: 1.5rem; |
|
512 |
} |
|
513 |
@media (max-width: $very-small-limit) { |
|
514 |
flex: 1 1 50%; |
|
515 |
max-width: none; |
|
516 |
&.previous-button { |
|
517 |
padding-left: 0; |
|
518 |
} |
|
519 |
} |
|
520 |
> .content, button { |
|
521 |
display: block; |
|
522 |
width: 100%; |
|
523 |
margin: 0; |
|
524 |
} |
|
525 |
} |
|
526 |
.submit-button { |
|
527 |
flex-grow: 2; |
|
528 |
max-width: 25em; |
|
529 |
@media (max-width: $very-small-limit) { |
|
530 |
flex: 1 1 100%; |
|
531 |
max-width: none; |
|
532 |
} |
|
533 |
} |
|
534 |
} |
|
535 |
} |
|
536 | ||
537 | ||
538 | ||
539 |
// |
|
540 |
// FOOTER |
|
541 |
// |
|
542 |
#footer-wrapper { |
|
543 |
margin-top: 0; |
|
544 |
} |
|
545 | ||
546 | ||
547 |
// |
|
548 |
// Isere Widget |
|
549 |
// |
|
550 |
.isereMegaMenu { |
|
551 |
position: absolute; |
|
552 |
top: 0; |
|
553 |
left: 0; |
|
554 |
} |
static/isere-cd38/_vars.scss | ||
---|---|---|
1 |
// Colors |
|
2 |
$gold: #FECE15; |
|
3 |
$cyan-dark: hsl(184,43%,26%); |
|
4 |
$cyan-xlight: hsl(184,15%,90%); |
|
5 |
$gray-light: #F5F5F5; |
|
6 |
$gray-dark: #4D4D4D; |
|
7 | ||
8 |
// fonts |
|
9 |
$raleway: raleway, sans-serif; |
|
10 |
$source-sans: 'Source Sans Pro', sans-serif; |
|
11 |
$fz-h1: 2.75em; |
|
12 |
$fz-h2: 1.8em; |
|
13 |
$fz-h3: 1.3em; |
|
14 |
$fz-h4: 1.2em; |
|
15 |
$fz-small: 0.875em; |
|
16 | ||
17 |
// layout |
|
18 |
$header-height-desktop: 7.5rem; |
|
19 |
$header-height-mobile: 4.3rem; |
|
20 |
$yellow-border-desktop: 4.5rem; |
|
21 |
$yellow-border-mobile: 1rem; |
|
22 |
$main-padding-desktop: 3rem; |
|
23 |
$main-padding-mobile: 1rem; |
|
24 |
$sidebar-columns-gutter: $main-padding-desktop; |
|
25 | ||
26 |
// Core vars |
|
27 |
$primary-color: $cyan-dark; |
|
28 |
$link-color: $cyan-dark; |
|
29 | ||
30 |
$width: 1920px; |
|
31 |
$mobile-limit: 70em; |
|
32 |
$nav-mobile-limit: 50em; |
|
33 |
$very-small-limit: 560px; |
|
34 |
$font-family: $source-sans; |
|
35 |
$sidebar-position: right; |
|
36 |
$sidebar-max-width: 400px; |
|
37 |
$sidebar-width: 26%; |
|
38 |
$sidebar-min-width: 290px; |
|
39 | ||
40 |
$nav-background: $cyan-dark; |
|
41 |
$nav-full-width-background: true; |
|
42 |
$nav-color: white; |
|
43 |
$nav-active-color: white; |
|
44 |
$nav-item-selected-color: $cyan-dark; |
|
45 |
$nav-menu-side: 3rem; |
|
46 |
$nav-button-background: transparent; |
|
47 |
$nav-button-color: $gray-dark; |
|
48 |
$nav-mobile-menu-background: white; |
|
49 |
$nav-mobile-menu-item-color: $cyan-dark; |
|
50 |
$nav-mobile-menu-item-hover-background: $cyan-dark; |
|
51 |
$nav-mobile-menu-item-hover-color: white; |
|
52 | ||
53 |
$title-font-size: $fz-h3; |
|
54 |
$title-background: $cyan-dark; |
|
55 |
$title-color: white; |
|
56 |
$title-font-style: $raleway; |
|
57 |
$title-weight: bold; |
|
58 |
$title-transform: uppercase; |
|
59 | ||
60 |
$cell-border: 1px solid $cyan-dark; |
|
61 |
$cell-title-cover-border: false; |
|
62 |
$cell-background: transparent; |
|
63 |
$cell-entry-color: $gray-dark; |
|
64 |
$cell-entry-hover-color: black; |
|
65 |
$cell-entry-border-color: $cyan-dark; |
|
66 |
$cell-entry-hover-background: $cyan-xlight; |
|
67 | ||
68 |
$button-background: $cyan-dark; |
|
69 |
$buttons-order: submit, previous, cancel; |
|
70 | ||
71 |
$notification_error_color: #D40000; |
|
72 |
$notification_warning_color: #F9C92F; |
|
73 |
$notification_success_color: $cyan-dark; |
|
74 |
$notification_info_color: $cyan-dark; |
|
75 | ||
76 |
$footer-background: $cyan-dark; |
static/isere-cd38/config.json | ||
---|---|---|
1 |
{ |
|
2 |
"label": "Isère (CD38)", |
|
3 |
"variables": { |
|
4 |
"pwa_display": "standalone", |
|
5 |
"theme_color": "#FECE15", |
|
6 |
"email_header_asset": "emails:logo" |
|
7 |
}, |
|
8 |
"settings": { |
|
9 |
"combo": { |
|
10 |
"COMBO_ASSET_SLOTS.update": { |
|
11 |
"header:logo": {"label": "Têtière : logo" }, |
|
12 |
"footer:logo": {"label": "Pied de page : logo"}, |
|
13 |
"emails:logo": {"label": "Emails : logo"} |
|
14 |
}, |
|
15 |
"COMBO_CELL_ASSET_SLOTS.update": { |
|
16 |
"wcs_wcsformcell": { |
|
17 |
"picture": {"prefix": "Image"} |
|
18 |
} |
|
19 |
} |
|
20 |
} |
|
21 |
} |
|
22 |
} |
static/isere-cd38/crossmenu.json | ||
---|---|---|
1 |
{"data":{"title":"Les sites du d\u00e9partement","account":{"title":"Mon compte","link":"https:\/\/www.isere.fr\/espace-perso"},"menu":[{"title":"Le D\u00e9partement","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoDepartement_0.png","sub":[{"title":"isere.fr","path":"https:\/\/www.isere.fr","description":null},{"title":"Is\u00e8re Mag","path":"https:\/\/iseremag.fr\/","description":null},{"title":"Erecrute","path":"https:\/\/erecrute.cg38.fr\/,DanaInfo=erecrute-juniper.cg38.local,SSO=U+","description":null},{"title":"March\u00e9s publics","path":"https:\/\/www.isere.fr\/marches-publics","description":null},{"title":"Cartographies","path":"https:\/\/www.isere.fr\/cartographie","description":null}]},{"title":"Solidarit\u00e9 - Sant\u00e9","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoSolidarite.png","sub":[{"title":"Is\u00e8re B\u00e9n\u00e9volat","path":"https:\/\/iserebenevolat.fr\/","description":null},{"title":"Is\u00e8reAdom","path":"https:\/\/www.isereadom.fr\/","description":null},{"title":"MDA 38","path":"https:\/\/www.isere.fr\/mda38\/Pages\/default.aspx","description":null},{"title":"Stop HPV","path":"https:\/\/www.stophpv.fr\/","description":null}]},{"title":"Education - Sport - Jeunesse","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoEducation.png","sub":[{"title":"ENT","path":"https:\/\/www.colleges-isere.fr\/","description":null},{"title":"Cyclo Alpes","path":"https:\/\/www.cyclo-alpes.com\/","description":null},{"title":"Sport Is\u00e8re","path":"https:\/\/sport.isere.fr","description":"Site Sport Is\u00e8re"},{"title":"Is\u00e8re Outdoor","path":"https:\/\/www.isereoutdoor.fr\/accueil\/","description":null},{"title":"Course de la r\u00e9sistance","path":"https:\/\/coursedelaresistance.fr\/","description":null},{"title":"ODPE","path":"https:\/\/www.isere.fr\/odpe","description":"Observatoire d\u00e9partemental de la protection de l\u2019enfance de l\u2019Is\u00e8re"}]},{"title":"Mobilit\u00e9","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoMobilite.png","sub":[{"title":"Itinis\u00e8re","path":"https:\/\/www.itinisere.fr\/","description":null},{"title":"Transis\u00e8re","path":"https:\/\/www.transisere.fr\/","description":null},{"title":"Transaltitude","path":"https:\/\/www.transaltitude.fr\/fr\/","description":null},{"title":"Covoit.net","path":"https:\/\/covoit.net\/","description":null},{"title":"Mov\u0027Ici","path":"https:\/\/movici.auvergnerhonealpes.fr\/","description":null},{"title":"A\u00e9roport Grenoble Alpes Is\u00e8re","path":"https:\/\/www.grenoble-airport.com\/","description":null}]},{"title":"D\u00e9veloppement du territoire - Environnement","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoDeveloppement.png","sub":[{"title":"Is\u00e8re THD","path":"https:\/\/www.iserethd.fr\/","description":null},{"title":"SYMBHI","path":"https:\/\/symbhi.fr\/","description":null},{"title":"Observatoire de l\u0027eau","path":"https:\/\/www.isere.fr\/observatoire-eau\/Pages\/default.aspx","description":null},{"title":"Is\u00e8re Lombri","path":"https:\/\/www.isere-lombri.fr\/","description":null},{"title":"Biodiversit\u00e9","path":"https:\/\/biodiversite.isere.fr\/","description":null}]},{"title":"Culture - Ev\u00e9nements","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoCulture.png","sub":[{"title":"Culture Is\u00e8re","path":"https:\/\/culture.isere.fr\/","description":null},{"title":"Mus\u00e9es Is\u00e8re","path":"https:\/\/musees.isere.fr\/","description":"Acc\u00e8s aux mus\u00e9es Is\u00e9rois"},{"title":"Archives d\u00e9partementales","path":"https:\/\/archives.isere.fr\/","description":null},{"title":"M\u00e9diath\u00e8que d\u00e9partementale","path":"https:\/\/mediatheque-departementale.isere.fr\/","description":null},{"title":"Domaine de Vizille - Mus\u00e9e de la R\u00e9volution fran\u00e7aise","path":"https:\/\/musees.isere.fr\/musee\/domaine-de-vizille-musee-de-la-revolution-francaise","description":null},{"title":"Maison Berg\u00e8s","path":"https:\/\/musees.isere.fr\/musee\/maison-berges","description":null},{"title":"Mus\u00e9e de l\u2019Ancien \u00c9v\u00each\u00e9","path":"https:\/\/musees.isere.fr\/musee\/musee-de-lancien-eveche","description":null},{"title":"Mus\u00e9e Arcabas en Chartreuse","path":"https:\/\/musees.isere.fr\/musee\/musee-arcabas-en-chartreuse","description":null},{"title":"Mus\u00e9e arch\u00e9ologique Saint-Laurent","path":"https:\/\/musees.isere.fr\/musee\/musee-archeologique-saint-laurent","description":null},{"title":"Mus\u00e9e Champollion","path":"https:\/\/musees.isere.fr\/musee\/musee-champollion","description":null},{"title":"Mus\u00e9e dauphinois","path":"https:\/\/musees.isere.fr\/musee\/musee-dauphinois","description":null},{"title":"Mus\u00e9e H\u00e9bert","path":"https:\/\/musees.isere.fr\/musee\/musee-hebert","description":null},{"title":"Mus\u00e9e Hector-Berlioz","path":"https:\/\/musees.isere.fr\/musee\/musee-hector-berlioz","description":null},{"title":"Mus\u00e9e de la R\u00e9sistance et de la D\u00e9portation de l\u0027Is\u00e8re","path":"https:\/\/musees.isere.fr\/musee\/musee-de-la-resistance-et-de-la-deportation-de-lisere","description":null},{"title":"Mus\u00e9e de Saint-Antoine-l\u2019Abbaye","path":"https:\/\/musees.isere.fr\/musee\/musee-de-saint-antoine-labbaye","description":null},{"title":"PAYSAGE \u003E PAYSAGES","path":"https:\/\/www.paysage-paysages.fr\/","description":null},{"title":"Festival Berlioz","path":"https:\/\/www.festivalberlioz.com\/","description":null},{"title":"Les all\u00e9es chantent","path":"https:\/\/www.les-allees-chantent.fr\/","description":null},{"title":"AIDA 38","path":"https:\/\/www.aida38.fr\/","description":null}]},{"title":"Tourisme - Attractivit\u00e9","path":"","icon":"https:\/\/menutrans.isere.fr\/sites\/default\/files\/menu_icons\/icoSport_0.png","sub":[{"title":"Is\u00e8re Tourisme","path":"https:\/\/www.isere-tourisme.com\/","description":null},{"title":"Is\u00e8re Tourisme Pro","path":"https:\/\/pro.isere-tourisme.com\/","description":null},{"title":"Tous sur le web","path":"https:\/\/www.toussurleweb.com\/","description":null},{"title":"Is\u00e8re Outdoor","path":"https:\/\/carto.isere.fr\/isere-outdoor\/","description":null},{"title":"Cyclo Alpes","path":"https:\/\/www.cyclo-alpes.com\/","description":null},{"title":"Rencontres du Tourisme","path":"https:\/\/www.rencontres-tourisme-isere.com\/","description":null}]}],"social_network":[{"title":"Facebook","link":"https:\/\/www.facebook.com\/isere.le.departement\/"},{"title":"Instagram","link":"https:\/\/www.instagram.com\/isere.le.departement\/"},{"title":"Linkedin","link":"https:\/\/fr.linkedin.com\/company\/d%C3%A9partement-de-l-is%C3%A8re"},{"title":"Twitter","link":"https:\/\/twitter.com\/CDIsere"},{"title":"YouTube","link":"https:\/\/www.youtube.com\/channel\/UCtDk8_0fQyBMPyzUsy3Px-Q"}]},"method":"GET"} |
static/isere-cd38/extra.js | ||
---|---|---|
1 |
// |
|
2 |
// Script provisoire du widget Isère |
|
3 |
// Pour test d'intégration |
|
4 |
// À remplacer par <script src="https://menutrans.isere.fr/widgets/crossmenu.js"></script> quand les authorisations d'accès seront accordées |
|
5 |
// |
|
6 | ||
7 |
(function (funcName, baseObj) { |
|
8 |
// jQuery's $(document).ready() equivalent function |
|
9 | ||
10 |
funcName = funcName || "docReady"; |
|
11 |
baseObj = baseObj || window; |
|
12 |
var readyList = []; |
|
13 |
var readyFired = false; |
|
14 |
var readyEventHandlersInstalled = false; |
|
15 | ||
16 |
function ready() { |
|
17 |
if (!readyFired) { |
|
18 |
readyFired = true; |
|
19 |
for (var i = 0; i < readyList.length; i++) { |
|
20 | ||
21 |
readyList[i].fn.call(window, readyList[i].ctx); |
|
22 |
} |
|
23 | ||
24 |
readyList = []; |
|
25 |
} |
|
26 |
} |
|
27 | ||
28 |
function readyStateChange() { |
|
29 |
if (document.readyState === "complete") { |
|
30 |
ready(); |
|
31 |
} |
|
32 |
} |
|
33 | ||
34 |
baseObj[funcName] = function (callback, context) { |
|
35 |
if (typeof callback !== "function") { |
|
36 |
throw new TypeError("callback for docReady(fn) must be a function"); |
|
37 |
} |
|
38 |
if (readyFired) { |
|
39 |
setTimeout(function () { |
|
40 |
callback(context); |
|
41 |
}, 1); |
|
42 |
return; |
|
43 |
} else { |
|
44 |
readyList.push({fn: callback, ctx: context}); |
|
45 |
} |
|
46 |
if (document.readyState === "complete") { |
|
47 |
setTimeout(ready, 1); |
|
48 |
} else if (!readyEventHandlersInstalled) { |
|
49 |
if (document.addEventListener) { |
|
50 |
document.addEventListener("DOMContentLoaded", ready, false); |
|
51 |
window.addEventListener("load", ready, false); |
|
52 |
} else { |
|
53 |
document.attachEvent("onreadystatechange", readyStateChange); |
|
54 |
window.attachEvent("onload", ready); |
|
55 |
} |
|
56 |
readyEventHandlersInstalled = true; |
|
57 |
} |
|
58 |
} |
|
59 |
})("docReady", window); |
|
60 | ||
61 |
(function () { |
|
62 | ||
63 |
/* |
|
64 |
* ===== Documentation ====== |
|
65 |
* to activate this script put this tag in your HTML |
|
66 |
* <section id="js_isereMegaMenu"></section> |
|
67 |
* |
|
68 |
* == CSS confs |
|
69 |
* Add "isereMegaMenu--fixed" class to parent element to applay fixed styles |
|
70 |
* Add "isereMegaMenu--hideLogin" to hide login button |
|
71 |
* |
|
72 |
* === Switchers |
|
73 |
* if show_isereMegaMenu_state_in_html = true, a class 'js_isereMegaMenu--open' will be added to <html> element |
|
74 |
* if variable 'domainWidgetIsere' is not defined, a default value will be assined => 'https://menutrans.isere.fr' |
|
75 |
* |
|
76 |
* */ |
|
77 | ||
78 |
if (typeof jQuery == 'undefined') { |
|
79 |
docReady(main); |
|
80 |
} else { |
|
81 |
jQuery(document).ready(main()); |
|
82 |
} |
|
83 | ||
84 |
function main() { |
|
85 |
//Temporaire : pour surpasser le cache locale du navigateur |
|
86 |
let versionNum = Math.random().toString(36).substring(7); |
|
87 |
function _addClass(el, NewClass) { |
|
88 |
var lesClass = el.className.toString(); |
|
89 |
lesClass = lesClass + " " + NewClass; |
|
90 |
el.className = lesClass; |
|
91 |
return true; |
|
92 |
} |
|
93 | ||
94 |
function _removeClass(el, NewClass) { |
|
95 |
var regEx = new RegExp("\\b" + NewClass + "\\b"); |
|
96 | ||
97 |
el.className = el.className.toString().replace(regEx, ""); |
|
98 |
if (el.className == '') { |
|
99 |
el.removeAttribute('class'); |
|
100 |
} |
|
101 |
return true; |
|
102 |
} |
|
103 | ||
104 |
function _checkClass(el, NewClass) { |
|
105 |
let lesClass = el.className; |
|
106 |
return true; |
|
107 |
} |
|
108 | ||
109 |
function _toggleClass(el, classToToggle) { |
|
110 |
let lesClass = el.className.toString(); |
|
111 |
if (lesClass.indexOf(classToToggle) == -1) { |
|
112 |
_addClass(el, classToToggle); |
|
113 |
} else { |
|
114 |
_removeClass(el, classToToggle); |
|
115 |
} |
|
116 |
return true; |
|
117 |
} |
|
118 | ||
119 |
if (typeof domainWidgetIsere == 'undefined') { |
|
120 |
console.warn('Warning: The variable domainWidgetIsere was undifined: Default value is loaded.') |
|
121 |
var domainWidgetIsere = 'https://menutrans.isere.fr'; |
|
122 | ||
123 |
//pour les tests/debug en preprod |
|
124 |
// var domainWidgetIsere = "https://preprod-menutrans.isere.fr"; |
|
125 |
} |
|
126 | ||
127 | ||
128 |
//css stylesheet |
|
129 |
let css_link = document.createElement('link'); |
|
130 |
css_link.type = "text/css"; |
|
131 |
css_link.rel = "preload stylesheet"; |
|
132 |
css_link.as = "style"; |
|
133 |
css_link.href = domainWidgetIsere + "/widgets/css/crossmenu.style.css?=" + versionNum; |
|
134 |
document.head.appendChild(css_link); |
|
135 | ||
136 |
let jsonp_url = "/static/isere-cd38/crossmenu.json", |
|
137 |
request = new XMLHttpRequest(); |
|
138 | ||
139 |
request.open('GET', jsonp_url, true); |
|
140 |
request.withCredentials = true; |
|
141 | ||
142 |
request.onload = function () { |
|
143 |
console.log(this.responseText); |
|
144 |
if (this.status >= 200 && this.status < 400) { |
|
145 | ||
146 |
// solution temporaire des que tout les sites integrons les nouvelles modifications |
|
147 |
if (document.getElementById('js_isereMegaMenu')) { |
|
148 |
var isereMegaMenu = document.getElementById('js_isereMegaMenu') |
|
149 |
} else if (document.getElementById('containerWidget')){ |
|
150 |
var isereMegaMenu = document.getElementById('containerWidget'); |
|
151 |
} else { |
|
152 |
console.error('Error: cannot find the <section id="js_isereMegaMenu"></section> element, please add it to DOM'); |
|
153 |
} |
|
154 |
isereMegaMenu.classList.add('isereMegaMenu'); |
|
155 | ||
156 |
//Creates shade elemenet and inserts into wrapper element |
|
157 |
let shadeBlack = document.createElement('span'); |
|
158 |
shadeBlack.className = 'isereMegaMenu__shadow isereMegaMenu__shadow--fadeIn_start' |
|
159 |
shadeBlack.id = 'js_isereMegaMenu__shadow' |
|
160 |
isereMegaMenu.insertBefore(shadeBlack, isereMegaMenu.firstChild) |
|
161 | ||
162 |
// creates container |
|
163 |
let widgetLinks = document.createElement('div'); |
|
164 |
widgetLinks.className = 'isereMegaMenu__widgetLinks'; |
|
165 |
isereMegaMenu.appendChild(widgetLinks); |
|
166 | ||
167 | ||
168 |
//le div principal |
|
169 |
let menuWidget = document.createElement('div'); |
|
170 |
menuWidget.className = 'isereMegaMenu__menuWidget'; |
|
171 |
menuWidget.style.height = 0; |
|
172 |
menuWidget.style.visibility = 'hidden'; |
|
173 |
widgetLinks.appendChild(menuWidget); |
|
174 | ||
175 |
//le bouton du menu |
|
176 |
var buttonSVG = "<svg class ='isereMegaMenu__btnTgl__img' xmlns='http://www.w3.org/2000/svg' baseProfile='tiny' viewBox='0 0 140 93' height='42' width='65' overflow='scroll' xmlns:v='https://vecta.io/nano'><path fill='#f4f3f3' d='M0 0h139.75v93.188H0z'/><circle fill='#1b619d' cx='96.458' cy='17.292' r='9.208'/><path fill='#fcd312' d='M47.375 63.833v29.355h92.375V.738s-26 63.595-92.375 63.095z'/><path fill='#1b619d' d='M105.75 36.164S93 35.667 87.937 47.584c-.698 10.415 0 40.25 0 40.25h17.507l.306-51.67z'/><path fill='#505150' d='M22.76 59.664l-16.2-16.2a2 2 0 0 1 0-2.829l1.89-1.89a2 2 0 0 1 2.826-.003l12.9 12.838 12.9-12.838a2 2 0 0 1 2.826.003l1.89 1.89a2 2 0 0 1 0 2.829l-16.2 16.2a2 2 0 0 1-2.829 0h0z'/></svg>"; |
|
177 |
let menuButton = document.createElement('span'); |
|
178 |
menuButton.id = 'js_isereMegaMenu__btnTgl' |
|
179 |
menuButton.className = 'isereMegaMenu__btnTgl' |
|
180 |
menuButton.title = 'Menu Isere' |
|
181 |
menuButton.innerHTML = buttonSVG; |
|
182 |
menuButton.style.opacity = '0'; |
|
183 |
widgetLinks.appendChild(menuButton); |
|
184 | ||
185 | ||
186 |
//le Close Button |
|
187 |
let menuCloseButton = document.createElement('span'); |
|
188 |
menuCloseButton.id = 'js_isereMegaMenu__close'; |
|
189 |
menuCloseButton.className = 'isereMegaMenu__close'; |
|
190 |
menuCloseButton.innerText = 'Fermer'; |
|
191 |
menuWidget.appendChild(menuCloseButton); |
|
192 | ||
193 |
//le div header |
|
194 |
let divTop = document.createElement('div'); |
|
195 |
divTop.className = 'isereMegaMenu__header'; |
|
196 |
menuWidget.appendChild(divTop); |
|
197 | ||
198 |
let logoLink = document.createElement('a'); |
|
199 |
logoLink.href = 'https://www.isere.fr/'; |
|
200 |
logoLink.className = 'isereMegaMenu__header__logo'; |
|
201 |
logoLink.title = 'isere logo'; |
|
202 |
divTop.appendChild(logoLink); |
|
203 | ||
204 |
// Prepare JSON from menutrans |
|
205 |
let data = JSON.parse(this.response).data; |
|
206 | ||
207 | ||
208 |
if (data.title != '') { |
|
209 |
var spanTitle = document.createElement('span'); |
|
210 |
spanTitle.className = 'isereMegaMenu__header__title'; |
|
211 |
spanTitle.innerText = data.title; |
|
212 |
divTop.appendChild(spanTitle); |
|
213 |
} |
|
214 | ||
215 | ||
216 |
//Lien de connexion |
|
217 |
if (typeof data.account !== 'undefined' && data.account.link != '') { |
|
218 |
// login link |
|
219 |
var linkLogin = document.createElement('a'); |
|
220 |
linkLogin.target = "_blank"; |
|
221 |
linkLogin.className = 'isereMegaMenu__header__login'; |
|
222 |
linkLogin.href = data.account.link; |
|
223 |
linkLogin.title = data.account.title; |
|
224 |
divTop.appendChild(linkLogin); |
|
225 |
} |
|
226 | ||
227 |
// Big menu wrapper |
|
228 |
let divContent = document.createElement('nav'); |
|
229 |
menuWidget.appendChild(divContent); |
|
230 | ||
231 |
// Big menu |
|
232 |
let menu = document.createElement('ul'); |
|
233 |
menu.className = 'isereMegaMenu__menu'; |
|
234 |
divContent.appendChild(menu); |
|
235 | ||
236 | ||
237 |
data.menu.forEach(function (value) { |
|
238 |
//Menu item |
|
239 |
var menuItem = document.createElement('li'); |
|
240 |
menuItem.className = 'js_isereMegaMenu__menu__item isereMegaMenu__menu__item isereMegaMenu__menu__item--withChild '; |
|
241 | ||
242 |
//Menu item link |
|
243 |
var linkA = document.createElement('a'); |
|
244 |
linkA.className = 'isereMegaMenu__menu__item__link'; |
|
245 |
linkA.href = 'javascript:void(0)'; |
|
246 |
linkA.innerText = value.title; |
|
247 |
menuItem.appendChild(linkA); |
|
248 | ||
249 |
if (value.icon) { |
|
250 |
menuItem.classList.add('isereMegaMenu__menu__item--avecImage'); |
|
251 | ||
252 |
// Debug : on force le HTTPS sur les îcones pour éviter les bugs mixed content |
|
253 |
if (value.icon.substr(0, 5) !== 'https') { |
|
254 |
value.icon = value.icon.replace('http', 'https'); |
|
255 |
} |
|
256 | ||
257 |
switch (value.title) { |
|
258 |
case 'Le Département': |
|
259 |
menuItem.classList.add('isereMegaMenu__menu__item--departement'); |
|
260 |
break; |
|
261 |
case 'Solidarité - Santé': |
|
262 |
menuItem.classList.add('isereMegaMenu__menu__item--solidarite'); |
|
263 |
break; |
|
264 |
case 'Education - Sport - Jeunesse': |
|
265 |
menuItem.classList.add('isereMegaMenu__menu__item--education'); |
|
266 |
break; |
|
267 |
case 'Mobilité': |
|
268 |
menuItem.classList.add('isereMegaMenu__menu__item--developpement'); |
|
269 |
break; |
|
270 |
case 'Développement du territoire - Environnement': |
|
271 |
menuItem.classList.add('isereMegaMenu__menu__item--mobilite'); |
|
272 |
break; |
|
273 |
case 'Culture - Evénements': |
|
274 |
menuItem.classList.add('isereMegaMenu__menu__item--culture'); |
|
275 |
break; |
|
276 |
case 'Tourisme - Attractivité': |
|
277 |
menuItem.classList.add('isereMegaMenu__menu__item--sport'); |
|
278 |
break; |
|
279 |
default: |
|
280 |
menuItem.classList.add('isereMegaMenu__menu__item--departement'); |
|
281 |
} |
|
282 |
} |
|
283 | ||
284 |
if (value.color) { |
|
285 |
linkA.dataset.color = value.color; |
|
286 |
} |
|
287 | ||
288 |
//Sub menu |
|
289 |
if ("sub" in value) { |
|
290 | ||
291 |
// sub menu |
|
292 |
var subMenu = document.createElement('ul'); |
|
293 |
subMenu.className = "isereMegaMenu__menu__item__sub"; |
|
294 |
menuItem.appendChild(subMenu); |
|
295 | ||
296 |
// iteration sur les listed des sumenus |
|
297 |
value.sub.forEach(function (subValue) { |
|
298 |
// sub menu item |
|
299 |
let subMenuItem = document.createElement('li'); |
|
300 |
subMenuItem.className = 'isereMegaMenu__menu__item__sub__item'; |
|
301 |
subMenu.appendChild(subMenuItem); |
|
302 | ||
303 |
// sub menu item link |
|
304 |
let subLinkA = document.createElement('a'); |
|
305 |
subLinkA.className = 'isereMegaMenu__menu__item__sub__item__link'; |
|
306 |
subLinkA.href = subValue.path; |
|
307 |
if (subValue.description != null) { |
|
308 |
subLinkA.title = subValue.description; |
|
309 |
} |
|
310 |
subLinkA.innerText = subValue.title; |
|
311 |
subMenuItem.appendChild(subLinkA); |
|
312 | ||
313 |
if (value.color) { |
|
314 |
subLinkA.dataset.color = value.color; |
|
315 |
} |
|
316 |
}); |
|
317 | ||
318 | ||
319 |
} else { |
|
320 |
// Si pas de sub items |
|
321 |
menuItem = document.createElement('li') |
|
322 | ||
323 |
var linkA = document.createElement('a'); |
|
324 |
linkA.href = 'javascript:void(0)'; |
|
325 |
linkA.className = "lien"; |
|
326 |
linkA.innerText = value.title; |
|
327 | ||
328 |
if (value.color) { |
|
329 |
linkA.dataset.color = value.color; |
|
330 |
} |
|
331 | ||
332 |
menuItem.appendChild(linkA); |
|
333 |
} |
|
334 |
menu.appendChild(menuItem); |
|
335 |
}); |
|
336 | ||
337 | ||
338 |
// Footer social icons |
|
339 |
var socialNetwork = document.createElement('ul'); |
|
340 |
socialNetwork.className = 'isereMegaMenu__social'; |
|
341 | ||
342 |
data.social_network.forEach(function (value) { |
|
343 |
if (value.link != '') { |
|
344 |
//social icon item |
|
345 |
var menuItem = document.createElement('li'); |
|
346 |
menuItem.className = "isereMegaMenu__social__item isereMegaMenu__social__item--" + value.title.toLowerCase(); |
|
347 | ||
348 |
//social icon item link |
|
349 |
var menuItem__link = document.createElement('a'); |
|
350 |
menuItem__link.href = value.link; |
|
351 |
menuItem__link.className = 'isereMegaMenu__social__item__link'; |
|
352 |
menuItem__link.title = value.title; |
|
353 |
menuItem__link.setAttribute('aria-label', value.title); |
|
354 | ||
355 |
menuItem.appendChild(menuItem__link); |
|
356 |
} |
|
357 |
socialNetwork.appendChild(menuItem); |
|
358 | ||
359 |
}); |
|
360 | ||
361 |
menuWidget.appendChild(socialNetwork); |
|
362 | ||
363 |
function calcBigMenuHeight() { |
|
364 |
//get and store full height of the menu |
|
365 |
menuWidget.style.height = 'auto'; |
|
366 |
menuWidget.dataset.height = menuWidget.offsetHeight + 'px'; |
|
367 |
menuWidget.style.height = 0; |
|
368 |
} |
|
369 | ||
370 |
calcBigMenuHeight(); |
|
371 | ||
372 | ||
373 |
isereMegaMenu.addEventListener('click', function (event) { |
|
374 |
// loop parent nodes from the target to the delegation node |
|
375 |
for (var target = event.target; target && target != this; target = target.parentNode) { |
|
376 | ||
377 |
//TODO convert this to swith statement |
|
378 |
if (target.matches('.isereMegaMenu__menu__item__link')) { |
|
379 | ||
380 |
//open submenus |
|
381 |
var childSub = target.nextElementSibling; |
|
382 | ||
383 |
//checks if submenu is open |
|
384 |
if (target.parentNode.className.indexOf('--open') !== -1) { |
|
385 |
target.parentNode.classList.remove('isereMegaMenu__menu__item--open'); |
|
386 |
childSub.removeAttribute('style'); |
|
387 |
} else { |
|
388 |
target.parentNode.classList.add('isereMegaMenu__menu__item--open'); |
|
389 |
childSub.style.height = childSub.dataset.height; |
|
390 |
} |
|
391 | ||
392 | ||
393 |
break; |
|
394 |
} else if (target.matches('#js_isereMegaMenu__btnTgl')) { |
|
395 | ||
396 |
//big button menu OPEN |
|
397 |
event.preventDefault(); |
|
398 |
setTimeout(calcBigMenuHeight(), 300); |
|
399 | ||
400 |
isereMegaMenu.classList.add('isereMegaMenu--open') |
|
401 |
if (typeof show_isereMegaMenu_state_in_html != 'undefined') { |
|
402 |
document.getElementsByTagName('html')[0].classList.add('js_isereMegaMenu--open'); |
|
403 |
} |
|
404 | ||
405 |
menuWidget.style.visibility = 'visible'; |
|
406 | ||
407 |
//To wait for animation to be finished |
|
408 |
setTimeout(function () { |
|
409 |
menuWidget.style.height = menuWidget.dataset.height; |
|
410 |
setTimeout(function () { |
|
411 |
menuWidget.style.height = 'auto'; |
|
412 | ||
413 |
}, 500); |
|
414 |
setTimeout(function () { |
|
415 |
isereMegaMenu |
|
416 |
.querySelectorAll('.isereMegaMenu__menu__item__sub') |
|
417 |
.forEach(function (value) { |
|
418 |
var el = value, old = el.style.height; |
|
419 | ||
420 |
el.style.height = 'auto'; |
|
421 |
el.dataset.height = (el.offsetHeight + 10) + 'px'; |
|
422 |
el.style.height = old; |
|
423 |
}) |
|
424 |
}, 600); |
|
425 |
}, 100); |
|
426 | ||
427 |
//shade appear animation |
|
428 |
shadeBlack.classList.toggle('isereMegaMenu__shadow--show'); |
|
429 |
shadeBlack.classList.add('isereMegaMenu__shadow--fadeIn'); |
|
430 |
shadeBlack.classList.remove('isereMegaMenu__shadow--fadeIn_start'); |
|
431 |
shadeBlack.classList.remove('isereMegaMenu__shadow--fadeOut'); |
|
432 | ||
433 |
break; |
|
434 |
} else if (target.matches('#js_isereMegaMenu__close') || target.matches('#js_isereMegaMenu__shadow')) { |
|
435 | ||
436 |
//Close button/shade for menu CLOSE |
|
437 |
event.preventDefault(); |
|
438 |
isereMegaMenu.classList.remove('isereMegaMenu--open'); |
|
439 |
if (typeof show_isereMegaMenu_state_in_html != 'undefined') { |
|
440 |
document.getElementsByTagName('html')[0].classList.remove('js_isereMegaMenu--open'); |
|
441 |
} |
|
442 | ||
443 |
var nowHeight = menuWidget.offsetHeight + 'px' |
|
444 | ||
445 |
menuWidget.style.height = nowHeight; |
|
446 |
menuWidget.dataset.height = nowHeight; |
|
447 | ||
448 |
setTimeout(function () { |
|
449 |
menuWidget.style.height = 0; |
|
450 |
}, 100); |
|
451 | ||
452 |
//shade disappear animation |
|
453 |
shadeBlack.classList.remove('isereMegaMenu__shadow--show'); |
|
454 |
shadeBlack.classList.remove('isereMegaMenu__shadow--fadeIn'); |
|
455 |
shadeBlack.classList.add('isereMegaMenu__shadow--fadeOut'); |
|
456 |
} else if (target.matches('.isereMegaMenu__menu__item__sub__item__link')) { |
|
457 |
// control animation of selected link |
|
458 |
break; |
|
459 |
} else { |
|
460 |
} |
|
461 | ||
462 |
} |
|
463 |
}, false); |
|
464 | ||
465 |
} else { |
|
466 | ||
467 |
} |
|
468 |
}; |
|
469 |
request.onerror = function () { |
|
470 |
console.log(this); |
|
471 |
}; |
|
472 |
request.send(); |
|
473 |
} |
|
474 |
})(); |
|
475 |
static/isere-cd38/style.scss | ||
---|---|---|
1 |
@charset "UTF-8"; |
|
2 |
@import '../includes/fonts/source-sans-pro'; |
|
3 |
@import '../includes/fonts/raleway'; |
|
4 | ||
5 |
@import 'vars'; |
|
6 |
@import '../includes/publik'; |
|
7 |
@import 'custom'; |
templates/variants/isere-cd38/combo/cells/a-la-une/form.html | ||
---|---|---|
1 |
{% extends "combo/wcs/form.html" %} |
|
2 | ||
3 |
{% block cell-content %} |
|
4 |
{% include "combo/asset_picture_fragment.html" %} |
|
5 |
{{ block.super }} |
|
6 |
{% endblock %} |
templates/variants/isere-cd38/combo/page_template.html | ||
---|---|---|
1 |
{% extends "combo/page_template.html" %} |
|
2 | ||
3 |
{% block body-bottom %} |
|
4 |
<section id="js_isereMegaMenu" class="isereMegaMenu--hideLogin"></section> |
|
5 | ||
6 |
<!-- |
|
7 |
À activer une fois les authorisations d'accès et supprimer |
|
8 |
static/isere-cd38/extra.js |
|
9 |
static/isere-cd38/crossmenu.json |
|
10 |
<script src="https://menutrans.isere.fr/widgets/crossmenu.js"></script> |
|
11 |
--> |
|
12 |
{% endblock %} |
templates/variants/isere-cd38/combo/page_template_homepage.html | ||
---|---|---|
1 |
{% extends "combo/page_template_sidebar.html" %} |
|
2 |
{% load combo assets %} |
|
3 | ||
4 |
{% block extra_css %} |
|
5 |
<style> |
|
6 |
body.has-picture nav::after { |
|
7 |
content: "{% firstof titre_bandeau|safe "Vos démarches en ligne \A auprès du Département de l’isère" %}"; |
|
8 |
} |
|
9 |
</style> |
|
10 |
{% endblock %} |
|
11 | ||
12 |
{% block columns %} |
|
13 |
<h2 class="section-title">À la une</h2> |
|
14 |
{% placeholder "une" name="À la une" %} |
|
15 |
{% endblock %} |
|
16 | ||
17 |
{% block content-bottom %} |
|
18 |
<div class="toutes-demarches"> |
|
19 |
<h2 class="section-title">Toutes les démarches</h2> |
|
20 |
<div class="theme-3cols-layout"> |
|
21 |
<div class="column"> |
|
22 |
{% placeholder "left" name="Démarches colonne gauche" %} |
|
23 |
</div> |
|
24 |
<div class="column"> |
|
25 |
{% placeholder "content" name="Démarches colonne centrale" %} |
|
26 |
</div> |
|
27 |
<div class="column"> |
|
28 |
{% placeholder "right" name="Démarche colonne droite" %} |
|
29 |
</div> |
|
30 |
</div> |
|
31 |
</div> |
|
32 |
{% endblock %} |
|
0 |
- |