-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stuffed all the css into styles.css, will clean up later
- Loading branch information
Showing
7 changed files
with
173 additions
and
232 deletions.
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
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,56 @@ | ||
|
||
let counterDisplayElem = document.querySelector('.counter-display'); | ||
let counterPlusElem = document.querySelector('.h'); | ||
|
||
let count = 0; | ||
|
||
counterPlusElem.addEventListener("click",()=>{ | ||
count++; | ||
updateDisplay(); | ||
document.cookie = "value=" + count; | ||
}); | ||
|
||
function updateDisplay(){ | ||
counterDisplayElem.innerHTML = count; | ||
}; | ||
|
||
function getCookie(cname) { | ||
var name = cname + "="; | ||
var decodedCookie = decodeURIComponent(document.cookie); | ||
var ca = decodedCookie.split(';'); | ||
for(var i = 0; i <ca.length; i++) { | ||
var c = ca[i]; | ||
while (c.charAt(0) == ' ') { | ||
c = c.substring(1); | ||
} | ||
if (c.indexOf(name) == 0) { | ||
return c.substring(name.length, c.length); | ||
} | ||
} | ||
return ""; | ||
} | ||
if (getCookie("value") === undefined || getCookie("value") === null) { | ||
|
||
} | ||
else { | ||
document.querySelector(".counter-display").innerHTML = getCookie("value"); | ||
} | ||
|
||
|
||
|
||
function getCookie(cname) { | ||
var name = cname + "="; | ||
var decodedCookie = decodeURIComponent(document.cookie); | ||
var ca = decodedCookie.split(';'); | ||
for(var i = 0; i <ca.length; i++) { | ||
var c = ca[i]; | ||
while (c.charAt(0) == ' ') { | ||
c = c.substring(1); | ||
} | ||
if (c.indexOf(name) == 0) { | ||
return c.substring(name.length, c.length); | ||
} | ||
} | ||
return ""; | ||
} | ||
console.log(getCookie("value")); |
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
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,16 @@ | ||
#rick:link { | ||
color: #e60073; | ||
text-decoration: none; | ||
} | ||
#rick:visited { | ||
color: #e60073; | ||
text-decoration: none; | ||
} | ||
#rick:hover { | ||
color: #e60073; | ||
text-decoration: underline; | ||
} | ||
#rick:active { | ||
color: #e60073; | ||
text-decoration: underline; | ||
} |
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
Oops, something went wrong.