Skip to content

Commit

Permalink
introduced cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
selma-lindfors committed Aug 1, 2019
1 parent 54072bd commit c91e0fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
const contentBox = document.getElementById("content-box");
const home = document.getElementById("home");
const d = new Date();
const cookieString = `about=seen; expires=${d.setTime(
d.getTime() + 365 * 24 * 60 * 60 * 1000
)}`;
const cookie = document.cookie || "";

let questions = [];
if (!cookie) {
document.cookie = cookieString;
window.location.assign("about.html");
}
d3.csv(
"https://docs.google.com/spreadsheets/d/e/2PACX-1vSfBk-rwrIauBPn7iuoLXBxP2sSYOXRYCbJ2GflzSK6wxGVGDr_fAqORJ0JWPdajFLxnGegmrlI26HB/pub?output=csv"
).then(data => {
Expand Down

0 comments on commit c91e0fd

Please sign in to comment.