@massimo-cassandro/minimo 0.6.7 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/sf-macro/sf-macro.js +3 -2
- package/src/css/text.css +5 -0
- package/src/css/utilities.css +1 -0
- package/src/custom-properties-default.css +0 -7
- package/src/icons/caret-down-bold.svg +1 -0
- package/design-tokens-src/components/recaptcha.minimo.tokens.jsonc +0 -24
- package/design-tokens-src/components/toast.minimo.tokens.jsonc +0 -29
- package/src/components/alert-autoclose.js +0 -9
- package/src/components/auto-datatable/auto-datatable.css +0 -355
- package/src/components/auto-datatable/auto-datatable.js +0 -154
- package/src/components/create-blurhash-canvas.js +0 -47
- package/src/components/img-viewer-dom-builder.js +0 -196
- package/src/components/modal-alert/flash-alerts.js +0 -32
- package/src/components/modal-content/modal-content.js +0 -152
- package/src/components/modal-content/modal-content.module.css +0 -142
- package/src/components/popup-page/popup-page.css +0 -72
- package/src/components/popup-page/popup-page.js +0 -84
- package/src/components/print-icon.js +0 -51
- package/src/components/recaptcha/recaptcha.css +0 -73
- package/src/components/spinner/TODO spinner-circle.css +0 -54
- package/src/components/spinner/TODO spinner-three-dots.css +0 -14
- package/src/components/spinner/readme.md +0 -1
- package/src/components/spinner/spinner-trailing-dots.css +0 -51
- package/src/components/spinner/spinner-wrapper.css +0 -20
- package/src/components/spinner/spinner.js +0 -30
- package/src/components/toast/toast.js +0 -77
- package/src/components/toast/toast.module.css +0 -59
- package/src/components/vanilla-cookie-consent/cookie-consent.css +0 -20
- package/src/components/vanilla-cookie-consent/cookie-consent.js +0 -76
- package/src/components/vanilla-cookie-consent/render-cookie-list.js +0 -32
- package/src/components/vanilla-cookie-consent/src/cookie-list.js +0 -85
- package/src/components/vanilla-cookie-consent/src/it-translation.js +0 -38
- package/src/components/vanilla-cookie-consent/src/run-analytics.js +0 -54
- package/src/components/vanilla-cookie-consent/src/run-recaptcha.js +0 -71
- package/src/css/forms/select-indicator.svg +0 -3
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { domBuilder } from '@massimo-cassandro/js-utilities/index.js';
|
|
2
|
-
|
|
3
|
-
const icon_file = document.body.dataset.icons;
|
|
4
|
-
|
|
5
|
-
export function printIcon({iconId, className='icon', title= null, output = 'html'}) {
|
|
6
|
-
|
|
7
|
-
if(!['html', 'element', 'builderArray'].includes(output)) {
|
|
8
|
-
// eslint-disable-next-line no-console
|
|
9
|
-
console.error(`'printIcon': parametro output non corretto (${output}). `+
|
|
10
|
-
'Deve essere `html`, `element` o `builderArray`');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// accetta anche un solo argomento stringa (= iconId)
|
|
14
|
-
if(arguments.length === 1 && typeof arguments[0] === 'string') {
|
|
15
|
-
iconId = arguments[0];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const iconArray = [
|
|
20
|
-
{
|
|
21
|
-
tag: 'svg',
|
|
22
|
-
className: className,
|
|
23
|
-
children: [
|
|
24
|
-
{
|
|
25
|
-
tag: 'title',
|
|
26
|
-
content: title,
|
|
27
|
-
condition: title != null
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
tag: 'use',
|
|
31
|
-
attrs: {
|
|
32
|
-
href: `${icon_file}#${iconId}`
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
if(output === 'builderArray') {
|
|
40
|
-
return iconArray;
|
|
41
|
-
} else {
|
|
42
|
-
|
|
43
|
-
const iconElement = domBuilder(iconArray);
|
|
44
|
-
if(output === 'element') {
|
|
45
|
-
return iconElement;
|
|
46
|
-
} else {
|
|
47
|
-
return iconElement.outerHTML;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
{%- set chiave_recaptcha_client = '6Le75-AZAAAAAO1sEV1JChhNg3nYw1HBn9AjaVSN' -%}
|
|
4
|
-
<div class="recaptcha-form-wrapper disabled" data-key="{{ chiave_recaptcha_client }}">
|
|
5
|
-
|
|
6
|
-
<form id="form-xxx" action="" method="post">
|
|
7
|
-
..
|
|
8
|
-
</form>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<div class="recaptcha-alert">Per abilitare questo form è necessario attivare
|
|
12
|
-
i cookie per le funzionalità aggiuntive modificando le tue
|
|
13
|
-
<button class="btn btn-link" type="button" data-cc="show-preferencesModal" aria-haspopup="dialog">preferenze per i cookie</button></div>
|
|
14
|
-
|
|
15
|
-
<p class="text-xs">Questo modulo è protetto da Google reCAPTCHA.
|
|
16
|
-
Per info consulta la <a href="https://policies.google.com/privacy" target="_blank" rel="noopener noreferrer">Privacy Policy</a> di Google
|
|
17
|
-
e i <a href="https://policies.google.com/terms" target="_blank" rel="noopener noreferrer">termini di servizio</a>.</p>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
.recaptcha-form-wrapper {
|
|
23
|
-
|
|
24
|
-
.recaptcha-alert {
|
|
25
|
-
display: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.disabled {
|
|
29
|
-
position: relative;
|
|
30
|
-
|
|
31
|
-
.recaptcha-form-inner-wrapper {
|
|
32
|
-
filter: blur(2px);
|
|
33
|
-
|
|
34
|
-
&::after {
|
|
35
|
-
position: absolute;
|
|
36
|
-
inset: 0;
|
|
37
|
-
display: block;
|
|
38
|
-
content: '';
|
|
39
|
-
background-color: var(--recaptcha-alert-overlay-color, rgb(0 0 0 / .5));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
input, select, textarea {
|
|
43
|
-
pointer-events: none;
|
|
44
|
-
user-select: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.recaptcha-alert {
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 50%;
|
|
50
|
-
left: 50%;
|
|
51
|
-
display: block;
|
|
52
|
-
padding: var(--size-xs);
|
|
53
|
-
color: var(--recaptcha-alert-fg, #fff);
|
|
54
|
-
background-color: var(--recaptcha-alert-background-color, #000);
|
|
55
|
-
border: .5px solid currentColor;
|
|
56
|
-
border-radius: var(--radius-xs);
|
|
57
|
-
transform-origin: center;
|
|
58
|
-
translate: -50% -50%;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.grecaptcha-badge {
|
|
64
|
-
visibility: hidden;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.grecaptcha-info {
|
|
68
|
-
margin: 1rem 0 0;
|
|
69
|
-
font-size: .6rem;
|
|
70
|
-
font-style: italic;
|
|
71
|
-
font-weight: 300;
|
|
72
|
-
opacity: 75%;
|
|
73
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
https://lukehaas.me/projects/css-spinners/ (#2)
|
|
3
|
-
|
|
4
|
-
<div class="spinner-wrapper"><div class="spinner">Loading...</div></div>
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.spinner {
|
|
9
|
-
position: relative;
|
|
10
|
-
width: 10em;
|
|
11
|
-
height: 10em;
|
|
12
|
-
margin: 55px auto;
|
|
13
|
-
font-size: .7rem;
|
|
14
|
-
color: var(--_spinner-color);
|
|
15
|
-
text-indent: -99999em;
|
|
16
|
-
box-shadow: inset 0 0 0 1em;
|
|
17
|
-
transform: translateZ(0);
|
|
18
|
-
|
|
19
|
-
&, &::before, &::after {
|
|
20
|
-
border-radius: 50%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&::before, &::after {
|
|
24
|
-
position: absolute;
|
|
25
|
-
content: '';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.spinner::before {
|
|
30
|
-
top: -.1em;
|
|
31
|
-
left: -.1em;
|
|
32
|
-
width: 5.2em;
|
|
33
|
-
height: 10.2em;
|
|
34
|
-
border-radius: 10.2em 0 0 10.2em;
|
|
35
|
-
transform-origin: 5.1em 5.1em;
|
|
36
|
-
animation: spinner-load 2s infinite ease 1.5s;
|
|
37
|
-
}
|
|
38
|
-
.spinner::after {
|
|
39
|
-
top: -.1em;
|
|
40
|
-
left: 4.9em;
|
|
41
|
-
width: 5.2em;
|
|
42
|
-
height: 10.2em;
|
|
43
|
-
border-radius: 0 10.2em 10.2em 0;
|
|
44
|
-
transform-origin: 0.1em 5.1em;
|
|
45
|
-
animation: spinner-load 2s infinite ease;
|
|
46
|
-
}
|
|
47
|
-
@keyframes spinner-load {
|
|
48
|
-
0% {
|
|
49
|
-
transform: rotate(0deg);
|
|
50
|
-
}
|
|
51
|
-
100% {
|
|
52
|
-
transform: rotate(360deg);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* HTML: <div class="loader"></div> */
|
|
2
|
-
/* https://css-loaders.com/dots/ #1 */
|
|
3
|
-
.spinner {
|
|
4
|
-
width: 80px;
|
|
5
|
-
aspect-ratio: 6;
|
|
6
|
-
margin-top: 2rem;
|
|
7
|
-
clip-path: inset(0 100% 0 0);
|
|
8
|
-
background: radial-gradient(circle closest-side, var(--text-color) 90%, transparent) 0 / calc(100% / 3) 100% space;
|
|
9
|
-
animation: l1 1s steps(4) infinite;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@keyframes l1 { to { clip-path: inset(0 -34% 0 0); } }
|
|
13
|
-
|
|
14
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Gli spinner hanno tutti la stessa classe, presumendo che se ne usi solo una per volta...
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
https://projects.lukehaas.me/css-loaders/ (#6)
|
|
3
|
-
|
|
4
|
-
<div class="spinner-wrapper"><div class="spinner">Loading...</div></div>
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.spinner {
|
|
8
|
-
position: relative;
|
|
9
|
-
width: 1em;
|
|
10
|
-
height: 1em;
|
|
11
|
-
/* margin: 2rem auto; */
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
font-size: 3.5rem;
|
|
14
|
-
color: var(--text-color);
|
|
15
|
-
text-indent: -9999em;
|
|
16
|
-
border-radius: 50%;
|
|
17
|
-
transform: translateZ(0);
|
|
18
|
-
animation: loader 1.7s infinite ease, round 1.7s infinite ease;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@keyframes loader {
|
|
22
|
-
0% {
|
|
23
|
-
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
|
24
|
-
}
|
|
25
|
-
5%,
|
|
26
|
-
95% {
|
|
27
|
-
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
|
28
|
-
}
|
|
29
|
-
10%,
|
|
30
|
-
59% {
|
|
31
|
-
box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
|
|
32
|
-
}
|
|
33
|
-
20% {
|
|
34
|
-
box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
|
|
35
|
-
}
|
|
36
|
-
38% {
|
|
37
|
-
box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
|
|
38
|
-
}
|
|
39
|
-
100% {
|
|
40
|
-
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@keyframes round {
|
|
45
|
-
0% {
|
|
46
|
-
transform: rotate(0deg);
|
|
47
|
-
}
|
|
48
|
-
100% {
|
|
49
|
-
transform: rotate(360deg);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
.spinner-overlay {
|
|
2
|
-
position: absolute;
|
|
3
|
-
inset: 0;
|
|
4
|
-
z-index: var(--z-index-overlay);
|
|
5
|
-
display: grid;
|
|
6
|
-
place-content: center;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
background-color: var(--overlay-color);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.spinner-wrapper {
|
|
12
|
-
position: absolute;
|
|
13
|
-
top: 1rem;
|
|
14
|
-
left: 50%;
|
|
15
|
-
display: grid;
|
|
16
|
-
place-content: center;
|
|
17
|
-
width: 4rem;
|
|
18
|
-
aspect-ratio: 1;
|
|
19
|
-
translate: -50%;
|
|
20
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// import './spinner.css'; // incorporato nel css principale
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
uso
|
|
5
|
-
|
|
6
|
-
import { spinner } from '@minimo/spinner.js';
|
|
7
|
-
|
|
8
|
-
spinner({container: xxxx, withOverlay: false|true });
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
// TODO rifare con domBuilder
|
|
13
|
-
|
|
14
|
-
export function spinner({container, withOverlay = false }) {
|
|
15
|
-
const spinnerMarkup =
|
|
16
|
-
`<div class="${withOverlay? 'spinner-overlay' : 'spinner-wrapper'}"><div class="spinner">Loading...</div></div>`;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if(container != null) {
|
|
20
|
-
container.insertAdjacentHTML('beforeend', spinnerMarkup);
|
|
21
|
-
} else {
|
|
22
|
-
return spinnerMarkup;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function removeSpinner(container) {
|
|
27
|
-
container.querySelectorAll('.spinner-overlay, .spinner-wrapper')
|
|
28
|
-
.forEach(item => item.remove());
|
|
29
|
-
|
|
30
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// forked from https://github.com/argyleink/gui-challenges/tree/main/toast
|
|
2
|
-
// https://web.dev/articles/building/a-toast-component?hl=en
|
|
3
|
-
|
|
4
|
-
// TODO rivedere
|
|
5
|
-
|
|
6
|
-
import * as styles from './toast.module.css';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const init = () => {
|
|
10
|
-
const toastWrapper = document.createElement('section');
|
|
11
|
-
toastWrapper.classList.add(styles.toastWrapper);
|
|
12
|
-
|
|
13
|
-
// document.firstElementChild.insertBefore(toastWrapper, document.body);
|
|
14
|
-
document.body.append(toastWrapper);
|
|
15
|
-
return toastWrapper;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const createToast = text => {
|
|
19
|
-
const thisToast = document.createElement('output');
|
|
20
|
-
|
|
21
|
-
thisToast.innerHTML = text;
|
|
22
|
-
thisToast.classList.add(styles.toast);
|
|
23
|
-
thisToast.setAttribute('role', 'status');
|
|
24
|
-
thisToast.setAttribute('aria-live', 'polite');
|
|
25
|
-
|
|
26
|
-
return thisToast;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const addToast = toast => {
|
|
30
|
-
const { matches:motionOK } = window.matchMedia(
|
|
31
|
-
'(prefers-reduced-motion: no-preference)'
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
toastWrapper.children.length && motionOK
|
|
35
|
-
? flipToast(toast)
|
|
36
|
-
: toastWrapper.appendChild(toast);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const Toast = text => {
|
|
40
|
-
let toast = createToast(text);
|
|
41
|
-
addToast(toast);
|
|
42
|
-
|
|
43
|
-
return Promise.allSettled(
|
|
44
|
-
toast.getAnimations().map( animation => animation.finished )
|
|
45
|
-
).then(() => {
|
|
46
|
-
toastWrapper.removeChild(toast);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// https://aerotwist.com/blog/flip-your-animations/
|
|
51
|
-
const flipToast = toast => {
|
|
52
|
-
// FIRST
|
|
53
|
-
const first = toastWrapper.offsetHeight;
|
|
54
|
-
|
|
55
|
-
// add new child to change container size
|
|
56
|
-
toastWrapper.appendChild(toast);
|
|
57
|
-
|
|
58
|
-
// LAST
|
|
59
|
-
const last = toastWrapper.offsetHeight;
|
|
60
|
-
|
|
61
|
-
// INVERT
|
|
62
|
-
const invert = last - first;
|
|
63
|
-
|
|
64
|
-
// PLAY
|
|
65
|
-
const animation = toastWrapper.animate([
|
|
66
|
-
{ transform: `translateY(${invert}px)` },
|
|
67
|
-
{ transform: 'translateY(0)' }
|
|
68
|
-
], {
|
|
69
|
-
duration: 150,
|
|
70
|
-
easing: 'ease-out',
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
animation.startTime = document.timeline.currentTime;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const toastWrapper = init();
|
|
77
|
-
export { Toast };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* purgecss start ignore */
|
|
2
|
-
.toastWrapper {
|
|
3
|
-
position: fixed;
|
|
4
|
-
inset-block-end: 0;
|
|
5
|
-
inset-inline: 0;
|
|
6
|
-
z-index: 1;
|
|
7
|
-
|
|
8
|
-
display: grid;
|
|
9
|
-
gap: 1vh;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
justify-items: stretch;
|
|
12
|
-
padding-block-end: 5vh;
|
|
13
|
-
|
|
14
|
-
/* optimizations */
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.toast {
|
|
19
|
-
--_bg-lightness: 90%;
|
|
20
|
-
--_travel-distance: 0;
|
|
21
|
-
|
|
22
|
-
max-inline-size: min(25ch, 90vw);
|
|
23
|
-
padding-block: .5ch;
|
|
24
|
-
padding-inline: 1ch;
|
|
25
|
-
|
|
26
|
-
/* font-family: system-ui, sans-serif; */
|
|
27
|
-
font-size: var(--toast-font-size);
|
|
28
|
-
color: var(--toast-text-color);
|
|
29
|
-
background: hsl(0 0% var(--_bg-lightness) / 90%);
|
|
30
|
-
border-radius: var(--toast-border-radius);
|
|
31
|
-
animation:
|
|
32
|
-
fade-in .3s ease,
|
|
33
|
-
slide-in .3s ease,
|
|
34
|
-
fade-out .3s ease var(--toast-duration);
|
|
35
|
-
|
|
36
|
-
will-change: transform;
|
|
37
|
-
|
|
38
|
-
@media (--dark) {
|
|
39
|
-
/* color: white; */
|
|
40
|
-
--_bg-lightness: 20%;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@media (--motionOK) {
|
|
44
|
-
--_travel-distance: 5vh;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@keyframes fade-in {
|
|
49
|
-
from { opacity: 0; }
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@keyframes fade-out {
|
|
53
|
-
to { opacity: 0; }
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@keyframes slide-in {
|
|
57
|
-
from { transform: translateY(var(--_travel-distance, 10px)); }
|
|
58
|
-
}
|
|
59
|
-
/* purgecss end ignore */
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable selector-max-id */
|
|
2
|
-
@import 'vanilla-cookieconsent/dist/cookieconsent.css';
|
|
3
|
-
|
|
4
|
-
/* stylelint-disable declaration-no-important */
|
|
5
|
-
#cc-main {
|
|
6
|
-
h2 {
|
|
7
|
-
line-height: 1.3 !important;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.btn-link {
|
|
11
|
-
font-weight: var(--font-weight-semibold);
|
|
12
|
-
|
|
13
|
-
@media (hover: hover) {
|
|
14
|
-
&:hover {
|
|
15
|
-
text-decoration: underline;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/* stylelint-enable declaration-no-important */
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import './cookie-consent.css';
|
|
2
|
-
import * as CookieConsent from 'vanilla-cookieconsent';
|
|
3
|
-
import { it_translation } from './src/it-translation.js';
|
|
4
|
-
// import { run_analytics } from './src/run-analytics.js';
|
|
5
|
-
import { run_recaptcha, disableRecaptcha } from './src/run-recaptcha.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// https://cookieconsent.orestbida.com/essential/getting-started.html
|
|
9
|
-
CookieConsent.run({
|
|
10
|
-
hideFromBots: !(new URLSearchParams(document.location.search).get('cc-list-parser') !== null), // abilita il parsing dei cookie da cookies-list
|
|
11
|
-
categories: {
|
|
12
|
-
necessary: {
|
|
13
|
-
enabled: true,
|
|
14
|
-
readOnly: true
|
|
15
|
-
},
|
|
16
|
-
functionality: {
|
|
17
|
-
enabled: true,
|
|
18
|
-
},
|
|
19
|
-
analytics: {
|
|
20
|
-
enabled: true,
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
guiOptions: {
|
|
24
|
-
consentModal: {
|
|
25
|
-
layout: 'box',
|
|
26
|
-
position: 'bottom right',
|
|
27
|
-
flipButtons: false,
|
|
28
|
-
equalWeightButtons: false
|
|
29
|
-
},
|
|
30
|
-
preferencesModal: {
|
|
31
|
-
layout: 'box',
|
|
32
|
-
// position: 'left right',
|
|
33
|
-
flipButtons: false,
|
|
34
|
-
equalWeightButtons: true
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
language: {
|
|
38
|
-
default: 'it',
|
|
39
|
-
translations: it_translation
|
|
40
|
-
},
|
|
41
|
-
onConsent: ({cookie}) => {
|
|
42
|
-
// if(cookie.categories.indexOf('analytics') !== -1) {
|
|
43
|
-
// run_analytics();
|
|
44
|
-
// }
|
|
45
|
-
if(cookie.categories.indexOf('functionality') !== -1) {
|
|
46
|
-
run_recaptcha();
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
// https://cookieconsent.orestbida.com/reference/configuration-reference.html#onchange
|
|
50
|
-
onChange: ({/* cookie, */changedCategories/* , changedServices */}) => {
|
|
51
|
-
if(changedCategories.includes('functionality')){
|
|
52
|
-
|
|
53
|
-
// caso in cui si cambia l'intera categoria
|
|
54
|
-
if(CookieConsent.acceptedCategory('functionality')){
|
|
55
|
-
run_recaptcha();
|
|
56
|
-
} else {
|
|
57
|
-
disableRecaptcha();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// TODO caso in cui si cambia il solo recaptcha (se ce ne fossero anche altri)
|
|
61
|
-
// console.log(cookie);
|
|
62
|
-
// console.log(changedServices);
|
|
63
|
-
// console.log(CookieConsent.acceptedService('_GRECAPTCHA', 'functionality'));
|
|
64
|
-
|
|
65
|
-
// if(changedServices['functionality'].includes('Google Analytics')){
|
|
66
|
-
// if(CookieConsent.acceptedService('Google Analytics', 'analytics')){
|
|
67
|
-
// // Google Analytics was just enabled
|
|
68
|
-
// }else{
|
|
69
|
-
// // Google Analytics was just disabled
|
|
70
|
-
// }
|
|
71
|
-
// }
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// lista dei cookie per visualizzazione nella pagina della privacy policy
|
|
2
|
-
// questo file è importato direttamente nella pagina privacy policy
|
|
3
|
-
|
|
4
|
-
import { cookie_list } from './src/cookie-list';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function render_cookie_list(target) {
|
|
8
|
-
|
|
9
|
-
const list = document.createDocumentFragment()
|
|
10
|
-
.appendChild(document.createElement('ul'));
|
|
11
|
-
|
|
12
|
-
cookie_list
|
|
13
|
-
.filter(i => i.cookieTable !== undefined)
|
|
14
|
-
.forEach(tab => {
|
|
15
|
-
const section = list.appendChild(document.createElement('li'));
|
|
16
|
-
section.appendChild(document.createElement('span'));
|
|
17
|
-
section.querySelector(':scope > span').classList.add('cookie-list-section');
|
|
18
|
-
section.querySelector(':scope > span').appendChild(document.createTextNode(tab.title));
|
|
19
|
-
const sublist = section.appendChild(document.createElement('ul'));
|
|
20
|
-
|
|
21
|
-
tab.cookieTable.body.forEach(cookie => {
|
|
22
|
-
const li = sublist.appendChild(document.createElement('li'));
|
|
23
|
-
li.appendChild(document.createElement('strong'))
|
|
24
|
-
.appendChild(document.createTextNode(cookie.name + ': '));
|
|
25
|
-
li.appendChild(document.createTextNode(`${cookie.description} (dur. ${cookie.expiration})`));
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// console.log(list);
|
|
31
|
-
target.appendChild(list);
|
|
32
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// elenco da cookie nel formato utilizzato da cookie consent e da `render-cookie-list.js`
|
|
2
|
-
// per visualizzazione nella pagina privacy
|
|
3
|
-
|
|
4
|
-
// https://cookieconsent.orestbida.com/reference/configuration-reference.html
|
|
5
|
-
export const cookie_list = [
|
|
6
|
-
{
|
|
7
|
-
title: 'Cookie strettamente necessari',
|
|
8
|
-
description: 'I cookie necessari sono indispensabili per il corretto funzionamento del sito web. Questi cookie garantiscono le funzionalità di base e le caratteristiche di sicurezza del sito web, in modo anonimo.',
|
|
9
|
-
linkedCategory: 'necessary',
|
|
10
|
-
cookieTable: {
|
|
11
|
-
headers: {
|
|
12
|
-
name: 'Cookie',
|
|
13
|
-
domain: 'Impostato da',
|
|
14
|
-
description: 'Descrizione',
|
|
15
|
-
expiration: 'Durata',
|
|
16
|
-
},
|
|
17
|
-
body: [
|
|
18
|
-
{
|
|
19
|
-
name: 'cc_cookie',
|
|
20
|
-
domain: 'Questo sito',
|
|
21
|
-
description: 'Registra la tua scelta sui cookie',
|
|
22
|
-
expiration: '6 mesi'
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'PHPSESSID',
|
|
26
|
-
domain: 'Questo sito',
|
|
27
|
-
description: 'Identifica la sessione corrente in modo anonimo in modo di poter eseguire alcune azioni.',
|
|
28
|
-
expiration: 'sessione'
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
title: 'Cookie per funzionalità aggiuntive',
|
|
36
|
-
description: 'Questi cookie sono necessari per l’abilitazione di alcune funzionalità aggiuntive. In mancanza della loro attivazione, alcune funzionalità non saranno disponibili',
|
|
37
|
-
linkedCategory: 'functionality',
|
|
38
|
-
cookieTable: {
|
|
39
|
-
headers: {
|
|
40
|
-
name: 'Cookie',
|
|
41
|
-
domain: 'Impostato da',
|
|
42
|
-
description: 'Descrizione',
|
|
43
|
-
expiration: 'Durata',
|
|
44
|
-
},
|
|
45
|
-
body: [
|
|
46
|
-
{
|
|
47
|
-
name: '_GRECAPTCHA',
|
|
48
|
-
domain: 'google.com',
|
|
49
|
-
description: 'Questo cookie è impostato dal servizio recaptcha di Google per identificare i bot e proteggere il sito da attacchi di spam dannosi.<br>'+
|
|
50
|
-
'Se questa opzione viene disattivata non sarà possibile utilizzare il form di contatto a fondo pagina',
|
|
51
|
-
expiration: 'Circa 6 mesi'
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
// {
|
|
58
|
-
// title: 'Cookie analitici',
|
|
59
|
-
// description: 'I cookie analitici vengono utilizzati per capire come i visitatori interagiscono con il sito web. Questi cookie aiutano a fornire informazioni sulle metriche del numero di visitatori, frequenza di rimbalzo, fonte di traffico, ecc.',
|
|
60
|
-
// linkedCategory: 'analytics',
|
|
61
|
-
// cookieTable: {
|
|
62
|
-
// headers: {
|
|
63
|
-
// name: 'Cookie',
|
|
64
|
-
// domain: 'Impostato da',
|
|
65
|
-
// description: 'Descrizione',
|
|
66
|
-
// expiration: 'Durata',
|
|
67
|
-
// },
|
|
68
|
-
// body: [
|
|
69
|
-
// {
|
|
70
|
-
// name: '_ga',
|
|
71
|
-
// domain: 'Questo sito',
|
|
72
|
-
// description: 'Cookie utilizzato da Google Analytics',
|
|
73
|
-
// expiration: '2 anni'
|
|
74
|
-
// },
|
|
75
|
-
// {
|
|
76
|
-
// name: '_ga_NBCMZ18740',
|
|
77
|
-
// domain: 'Questo sito',
|
|
78
|
-
// description: 'Cookie utilizzato da Google Analytics',
|
|
79
|
-
// expiration: '1 minuto'
|
|
80
|
-
// },
|
|
81
|
-
|
|
82
|
-
// ]
|
|
83
|
-
// }
|
|
84
|
-
// }
|
|
85
|
-
];
|