COOKIEPOLITIK.5V.PL - FAJNY SKRYPT COOKIE!

Siema wam, sprezentuję wam dziś fajny skrypcik powiadomienia o ciasteczkach (cookies).

A więc wprowadź niniejszy kodzik na GÓRZE STRONY (możesz skopiować) i gotowe!

<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Roboto&display=swap');
body
{
font-family: 'Roboto', sans-serif;
color: #ffffff;
}
.notification {
z-index:99;
position:fixed;
bottom:10px;
float:none;
min-width:98%;
background: #3af;
padding: 10px 15px;
margin: 5px auto;
border-radius: 5px;
box-shadow: 0px 0px 5px #999999;
}
.notification-error {
background: #ff1010;
color: #ffffff;
}
.notification-alert {
background: #3af;
color: #000000;
}
.notification-info {
background: #a4beff;
color: #000000;
}
.close{
text-decoration:none;
float:right;
}
#tresc
{
background-color: white;
width: 400px;
padding: 50px;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
-webkit-box-shadow: 0px 3px 13px -4px rgba(255,255,255,1);
-moz-box-shadow: 0px 3px 13px -4px rgba(255,255,255,1);
box-shadow: 0px 3px 13px -4px rgba(255,255,255,1);
}
a:link
{
color: #00ffee;
text-decoration: none;
}
.alert {
padding: 20px;
opacity: 1;
transition: opacity 0.6s;
margin-bottom: 15px;
}
a:active
{
color: #0055ff;
}
#costam {
font-family: 'Source Sans Pro', sans-serif;
}
.pudelko {
font-family: 'Source Sans Pro', sans-serif;
width: 75px;
height: 75px;
background-color: white;
color: black;
font-size: 50px;
text-align: center;
}
a:hover
{
color: #00ffee;
}
</style>
<script src="https:\\code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https:\\code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script>
function CD(d,o,t,x){return[x=~~(t=(d-o)/864e5),x=~~(t=(t-x)*24), x=~~(t=(t-x)*60),~~((t-x)*60)]}
function R(t){t=CD(new Date(2021,04,03),new Date());document.getElementById('costam').innerHTML='<div class="pudelko" style="margin-left: 0px;">'+t[0]+"</div><span style='margin-left: 20px; margin-top: -100px;'> dni </span> <div class='pudelko' style='margin-left: 105px; margin-top: -100px;'>"+t[1]+"</div><span style='margin-left: 120px; margin-top: -100px;'> godz.</span> <div class='pudelko' style='margin-left: 215px; margin-top: -97px;'>"+t[2]+"</div><span style='margin-left: 235px; margin-top: -100px;'> min.</span> <div class='pudelko' style='margin-left: 325px; margin-top: -100px;'>"+t[3]+"</div><span style='margin-left: 345px; margin-top: -100px;'> sek.</span>";setTimeout('R()',1e3);}
onload=function(){R();}
</script>
<noscript><div class="alert success" style="background-color: #ff3700;">Twoja przeglądarka nie obsługuje JavaScript, bądź w jej ustawieniach wyłączono jego obsługę. Strona może działać niepoprawnie!</div></noscript>
<style>
.cookie-popup {
font-size: 0.875rem;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
position: fixed;
bottom: -6.25rem;
left: 1.25rem;
right: 1.25rem;
padding: 0.625rem 0.9375rem;
box-shadow: 0 0 0.625rem 0 rgba(0,0,0, .15);
line-height: 150%;
transition: opacity .5s;
opacity: 0;
}
.cookie-popup--short {
right: none;
width: 21.875rem;
}
.cookie-popup--dark {
background: #000;
color: #fff;
}
.cookie-popup--not-accepted {
opacity: 1;
animation: cookie-popup-in .5s ease forwards;
}
.cookie-popup--accepted {
opacity: 0;
}
.cookie-popup a {
color: skyblue;
}
.cookie-popup a:visited {
color: skyblue;
text-decoration: none;
}
.cookie-popup-actions {
flex: 1;
text-align: right;
}
.cookie-popup-actions button {
color: orange;
border: none;
background: none;
font-family: inherit;
font-style: inherit;
font-size: inherit;
font-weight: bold;
text-transform: uppercase;
font-size: 0.75rem;
padding: 0;
cursor: pointer;
}
.cookie-popup-actions button:hover {
text-decoration: underline;
}
@keyframes cookie-popup-in {
from { bottom: -6.25rem; }
to { bottom: 1.25rem; }
}
</style>
<div class="cookie-popup cookie-popup--short cookie-popup--dark">
<div>
Ta strona korzysta z plików cookies, aby zapewnić ciągłość jej działania. <a href ="https://wszystkoociasteczkach.pl/po-co-sa-ciasteczka/" target="_blank">Dowiedz się więcej!</a>
</div>
<div class="cookie-popup-actions">
<button>OK</button>
</div>
</div>
</div>
<script>
function el(selector) { return document.querySelector(selector) }
function els(selector) { return document.querySelectorAll(selector) }
function on(selector, event, action) { els(selector).forEach(e => e.addEventListener(event, action)) }
function cookie(name) {
let c = document.cookie.split('; ').find(cookie => cookie && cookie.startsWith(name+'='))
return c ? c.split('=')[1] : false;
}
on('.cookie-popup button', 'click', () => {
el('.cookie-popup').classList.add('cookie-popup--accepted');
document.cookie = `cookie-accepted=true`
});
if (cookie('cookie-accepted') !== "true") {
el('.cookie-popup').classList.add('cookie-popup--not-accepted');
}
</script>