Skip to content

Instantly share code, notes, and snippets.

@bueltge
Created July 1, 2019 13:38
Show Gist options
  • Select an option

  • Save bueltge/e82f1d8266ccf0d8797e5905f7d1234d to your computer and use it in GitHub Desktop.

Select an option

Save bueltge/e82f1d8266ccf0d8797e5905f7d1234d to your computer and use it in GitHub Desktop.

Revisions

  1. bueltge created this gist Jul 1, 2019.
    5 changes: 5 additions & 0 deletions cookie.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <p id="cookie-notice">This website uses cookies to ensure you get the best experience on our website<br><button onclick="acceptCookie();">Got it!</button></p>

    <style>#cookie-notice{color:#fff;font-family:inherit;background:#596cd5;padding:20px;position:fixed;bottom:10px;left:10px;width:100%;max-width:300px;box-shadow:0 10px 20px rgba(0,0,0,.2);border-radius:5px;margin:0px;visibility:hidden;z-index:1000000}#cookie-notice button{color:inherit;background:#3842c7;border:0;padding:10px;margin-top:10px;width:100%;cursor:pointer}@media only screen and (max-width:600px){#cookie-notice{max-width:100%;bottom:0;left:0;border-radius:0}}</style>

    <script>function acceptCookie(){document.cookie="cookieaccepted=1; expires=Thu, 18 Dec 2030 12:00:00 UTC; path=/",document.getElementById("cookie-notice").style.visibility="hidden"} !document.cookie.indexOf("cookieaccepted")||(document.getElementById("cookie-notice").style.visibility="visible");</script>