Make cookie notice animation work

This commit is contained in:
Matthew Grove
2018-11-17 18:10:52 +00:00
parent 3a412eb8cb
commit 5a8bd35e80
3 changed files with 8 additions and 7 deletions

View File

@@ -61,7 +61,7 @@ body {
background: --mdc-theme-primary; background: --mdc-theme-primary;
color: --mdc-theme-background; color: --mdc-theme-background;
text-align: center; text-align: center;
bottom: -100; bottom: -100px;
left: 0; left: 0;
z-index: 9999; z-index: 9999;
} }

View File

@@ -36,15 +36,13 @@ $(document).ready(function(){
if(Cookies.get("demo.matthew-grove.ml-cookies-accepted") != "true") { if(Cookies.get("demo.matthew-grove.ml-cookies-accepted") != "true") {
$("#cookies").load("/page-inserts/cookie-notice.html", function(){ $("#cookies").load("/page-inserts/cookie-notice.html", function(){
$("#cookies").show(); $("#cookies").show();
$("#cookies").animate({bottom: "+100px"}, 1000); $("#cookies").animate({bottom: "0px"}, 1000);
$(".source-code-link").animate({bottom: "+100px"}, 1000); $(".source-code-link").animate({bottom: "100px"}, 1000);
$("#close-cookies").click(function(){ $("#close-cookies").click(function(){
event.preventDefault(); event.preventDefault();
// $("#cookies").animate({bottom: "0px"}, 1000); $("#cookies").animate({bottom: "-100px"}, 1000);
$("#cookies").removeAttr("style");
$("#cookies").hide(); $("#cookies").hide();
$(".source-code-link").removeAttr("style"); $(".source-code-link").animate({bottom: "15px"}, 1000);
// $(".source-code-link").animate({bottom: "0px"}, 1000);
Cookies.set("demo.matthew-grove.ml-cookies-accepted", "true", {expires: 30}); Cookies.set("demo.matthew-grove.ml-cookies-accepted", "true", {expires: 30});
}); });
}); });

View File

@@ -1,5 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<script src="/assets/cookies.js"></script>
</head>
<script> <script>
Cookies.remove("demo.matthew-grove.ml-cookies-accepted"); Cookies.remove("demo.matthew-grove.ml-cookies-accepted");
</script> </script>