]> _ Git - cubist_cms-front.git/commitdiff
wait #2745
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Sep 2019 18:23:04 +0000 (20:23 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Sep 2019 18:23:04 +0000 (20:23 +0200)
resources/views/head/head.blade.php
resources/views/privacy/cookies-consent.blade.php [new file with mode: 0644]

index 9e238fad3195c6a4e9661577dbd0bf8e93e6bd04..49bafc5b352f07ef3e100f0d4557ea7035469437 100644 (file)
@@ -4,6 +4,7 @@
 @include('cubist::head.pwa')
 @favicon
 @stack('stylesheets')
+@stack('styles')
 @include('googletagmanager::head')
 @include('gtag::head')
 </head>
\ No newline at end of file
diff --git a/resources/views/privacy/cookies-consent.blade.php b/resources/views/privacy/cookies-consent.blade.php
new file mode 100644 (file)
index 0000000..3c19a77
--- /dev/null
@@ -0,0 +1,31 @@
+@if(!isset($_COOKIE['privacy-cookie-consent']) || $_COOKIE['privacy-cookie-consent']!='1')
+    <div id="cookie-consent">
+        @markdown($global->get('cookies_consent_text'))
+        <button>{{$global->cookies_consent_button}}</button>
+    </div>
+    <style type="text/css">
+        #cookie-consent {
+            position: fixed;
+            bottom: 0;
+            left: 0;
+            width: 100%;
+            transition: opacity 500ms;
+        }
+
+        #cookie-consent.hide {
+            opacity: 0;
+        }
+    </style>
+    <script>
+        document.addEventListener('DOMContentLoaded', function () {
+            document.querySelector('#cookie-consent button').addEventListener('click', function () {
+                document.getElementById('cookie-consent').classList.add('hide');
+
+                var expires = new Date();
+                expires.setFullYear(expires.getFullYear() + 1);
+
+                document.cookie = "privacy-cookie-consent=1; expires= " + expires.toUTCString() + "; path=/ "
+            });
+        })
+    </script>
+@endif
\ No newline at end of file