diff --git a/private/sass/style.scss b/private/sass/style.scss index 751b2ea..4c4e613 100644 --- a/private/sass/style.scss +++ b/private/sass/style.scss @@ -8,7 +8,6 @@ body { font-size: medium; color: $black; background-color: $white; - padding: $small; } h1 { diff --git a/public/css/style.css b/public/css/style.css index 23643d4..2f0e3a8 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -143,7 +143,6 @@ body { font-size: medium; color: #1d2425; background-color: #fbf6f1; - padding: 0.5rem; } h1 { diff --git a/public/css/style.css.map b/public/css/style.css.map index a6a5c8b..e70cc64 100644 --- a/public/css/style.css.map +++ b/public/css/style.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../../private/sass/_fonts.scss","../../private/sass/_reset.scss","../../private/sass/style.scss","../../private/sass/_colors.scss","../../private/sass/_sizes.scss"],"names":[],"mappings":"AAKQ;AALR;EACE;EACA;;ACFF;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAiFE;EACA;EACA;EACA;EACA;EACA;;;AAEF;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAWE;;;AAEF;EACE;;;AAEF;AAAA;EAEE;;;AAEF;AAAA;EAEE;;;AAEF;AAAA;AAAA;AAAA;EAIE;EACA;;;AAEF;EACE;EACA;;;AC1HF;EACE;EACA;EACA,OCKM;EDJN,kBCGM;EDFN,SETM;;;AFYR;EACE;EACA,WEVO;EFWP,eEdO;;;AFiBT;EACE,WEhBM;EFiBN;EACA,eEpBO;EFqBP,YErBO;;;AFwBT;EACE,WExBQ;EFyBR;EACA,eE3BO;;;AF8BT;EACE,eEhCM","file":"style.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../../private/sass/_fonts.scss","../../private/sass/_reset.scss","../../private/sass/style.scss","../../private/sass/_colors.scss","../../private/sass/_sizes.scss"],"names":[],"mappings":"AAKQ;AALR;EACE;EACA;;ACFF;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAiFE;EACA;EACA;EACA;EACA;EACA;;;AAEF;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAWE;;;AAEF;EACE;;;AAEF;AAAA;EAEE;;;AAEF;AAAA;EAEE;;;AAEF;AAAA;AAAA;AAAA;EAIE;EACA;;;AAEF;EACE;EACA;;;AC1HF;EACE;EACA;EACA,OCKM;EDJN,kBCGM;;;ADAR;EACE;EACA,WETO;EFUP,eEbO;;;AFgBT;EACE,WEfM;EFgBN;EACA,eEnBO;EFoBP,YEpBO;;;AFuBT;EACE,WEvBQ;EFwBR;EACA,eE1BO;;;AF6BT;EACE,eE/BM","file":"style.css"} \ No newline at end of file diff --git a/public/js/challenges.js b/public/js/challenges.js index 694e785..ac5b912 100644 --- a/public/js/challenges.js +++ b/public/js/challenges.js @@ -1,48 +1,41 @@ - -var challengePage = document.querySelector(".challenge-page"); -var url = window.location.href.split('/')[3]; -var h2id = document.querySelector(".h2-id"); - +let challengePage = document.querySelector(".challenge-page"); +let url = window.location.href.split("/")[3]; +let h2id = document.querySelector(".h2-id"); (function checkUrlandCreateForm(url) { - var f = document.createElement("form"); - var s = document.createElement("input"); //input element, Submit button - var id = document.createElement("input"); - var h1 = document.createElement("h1"); - - if (url === "new-challenges") { - f.setAttribute('method', "post"); - f.setAttribute('action', "/challenge/accepted"); - s.setAttribute('class', "acceptBtn"); - s.setAttribute('type', "submit"); - s.setAttribute('value', "accept challenge"); - id.setAttribute('name', "challenge_id"); - id.setAttribute('type', "hidden"); - id.setAttribute('value', h2id.innerHTML); - h1.innerHTML = "Accept Challenge"; - f.appendChild(h1); - f.appendChild(s); - f.appendChild(id); - challengePage.appendChild(f); - } - - else if (url === "acc-challenges") { - f.setAttribute('method', "post"); - f.setAttribute('action', "/challenge/completed"); - s.setAttribute('class', "complBtn"); - s.setAttribute('type', "submit"); - s.setAttribute('value', "complete challenge"); - id.setAttribute('name', "challenge_id"); - id.setAttribute('type', "hidden"); - id.setAttribute('value', h2id.innerHTML); - h1.innerHTML = "Complete Challenge"; - f.appendChild(h1); - f.appendChild(s); - f.appendChild(id); - challengePage.appendChild(f); - } - // statement for completed challenges to be deleted or reset - -})(url) - - + let f = document.createElement("form"); + let s = document.createElement("input"); //input element, Submit button + let id = document.createElement("input"); + let h2 = document.createElement("h2"); + + if (url === "new-challenges") { + f.setAttribute("method", "post"); + f.setAttribute("action", "/challenge/accepted"); + s.setAttribute("class", "acceptBtn"); + s.setAttribute("type", "submit"); + s.setAttribute("value", "accept challenge"); + id.setAttribute("name", "challenge_id"); + id.setAttribute("type", "hidden"); + id.setAttribute("value", h2id.innerHTML); + h2.innerHTML = "Accept Challenge"; + f.appendChild(h2); + f.appendChild(s); + f.appendChild(id); + challengePage.appendChild(f); + } else if (url === "acc-challenges") { + f.setAttribute("method", "post"); + f.setAttribute("action", "/challenge/completed"); + s.setAttribute("class", "complBtn"); + s.setAttribute("type", "submit"); + s.setAttribute("value", "complete challenge"); + id.setAttribute("name", "challenge_id"); + id.setAttribute("type", "hidden"); + id.setAttribute("value", h2id.innerHTML); + h2.innerHTML = "Complete Challenge"; + f.appendChild(h2); + f.appendChild(s); + f.appendChild(id); + challengePage.appendChild(f); + } + // statement for completed challenges to be deleted or reset +})(url); diff --git a/public/js/dom.js b/public/js/dom.js index 2404029..21bb9e2 100644 --- a/public/js/dom.js +++ b/public/js/dom.js @@ -1 +1,27 @@ -// wooooo go dom \ No newline at end of file +// wooooo go dom + +function openCity(evt, cityName) { + // Declare all variables + + let i, tabcontent, tablinks; + + // Get all elements with class="tabcontent" and hide them + tabcontent = document.getElementsByClassName("tabcontent"); + for (i = 0; i < tabcontent.length; i++) { + tabcontent[i].style.display = "none"; + } + + // Get all elements with class="tablinks" and remove the class "active" + tablinks = document.getElementsByClassName("tablinks"); + for (i = 0; i < tablinks.length; i++) { + tablinks[i].className = tablinks[i].className.replace(" active", ""); + } + + // Show the current tab, and add an "active" class to the button that opened the tab + document.getElementById(cityName).style.display = "block"; + evt.currentTarget.className += " active"; +} +// To show first tab by default // + +document.getElementById("defaultOpen").click(); +// \ No newline at end of file diff --git a/src/views/challSelect.hbs b/src/views/challSelect.hbs index 8e7650f..6787195 100644 --- a/src/views/challSelect.hbs +++ b/src/views/challSelect.hbs @@ -1,5 +1,3 @@ -
Reward Points: {{this.reward_points}}
- {{/each}}Reward Points: {{this.reward_points}}
{{/each}}Reward Points: {{this.reward_points}}
diff --git a/src/views/helpers/getPoints.js b/src/views/helpers/getPoints.js new file mode 100644 index 0000000..ce1da07 --- /dev/null +++ b/src/views/helpers/getPoints.js @@ -0,0 +1,9 @@ +const queries = require("../model"); + +const getPoints = () =>{ + queries.getUserPoints(1).then(points => { + console.log(points) + }) +} + +module.exports = getPoints; diff --git a/src/views/inventory.hbs b/src/views/inventory.hbs index 2fdc48b..efb18c5 100644 --- a/src/views/inventory.hbs +++ b/src/views/inventory.hbs @@ -1,10 +1,6 @@ -Your step-by-step guide to start reducing + waste and set you on the way to + achieving a zero waste lifestyle. + + Tackle the challenges, save your city and + become a true Zero Hero!
+ + + + \ No newline at end of file diff --git a/src/views/layouts/content-selected.hbs b/src/views/layouts/content-selected.hbs index d17f058..ecc5bf7 100644 --- a/src/views/layouts/content-selected.hbs +++ b/src/views/layouts/content-selected.hbs @@ -8,7 +8,6 @@ {{> navbar}}