This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bc906c
commit 3fd9a51
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#cookie-notice { | ||
display: none; | ||
bottom: 0; | ||
position: fixed; | ||
width: 100%; | ||
background: white; | ||
z-index: 1000000; | ||
height: auto; | ||
text-align: center; | ||
} | ||
.cookie-button { | ||
border: none; | ||
display: inline-block; | ||
justify-content: center; | ||
height: 48px; | ||
font-size: 16px; | ||
font-weight: 600; | ||
border-radius: 4px; | ||
background: rgb(41, 128, 185); | ||
box-shadow: 0 5px 14px 0 rgba(29,30,36,0.19); | ||
color: #fff; | ||
cursor: pointer; | ||
padding-top: 12px; | ||
padding-bottom: 12px; | ||
padding-left: 42px; | ||
padding-right: 42px; | ||
margin: 1em; | ||
margin-left: 2em; | ||
white-space: nowrap; | ||
vertical-align: middle; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const send_ga = () => { | ||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | ||
|
||
ga('create', 'UA-124167090-6', 'auto'); | ||
ga('send', 'pageview'); | ||
} | ||
|
||
let cookieAccepted = localStorage.cookieAccepted; | ||
if (cookieAccepted == undefined) { | ||
$(document).ready(function () { | ||
var cookieDiv = document.createElement('div') | ||
cookieDiv.id = 'cookie-notice' | ||
cookieDiv.innerHTML = "<p style='margin: 1em'>Privacy and Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, see our <a style='color:#4c71c6; text-decoration: underline;' href='https://cloud.dwavesys.com/leap/legal/privacy_policy/' target='_blank'>Privacy Policy</a>.<button id='cookie-accept' class='cookie-button'>Close and Accept</button></p>" | ||
|
||
$('body').append(cookieDiv).ready(() => { | ||
$('#cookie-notice').fadeIn('slow'); | ||
$("#cookie-accept").click(function () { | ||
localStorage.setItem("cookieAccepted", true) | ||
$('#cookie-notice').fadeOut('slow'); | ||
send_ga() | ||
}); | ||
}) | ||
}) | ||
} else if (cookieAccepted == "true") { | ||
send_ga() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters