Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add files via upload
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<html> | ||
<body> | ||
<p>Color Picker</p> | ||
|
||
<form id="color-picker"> | ||
<input type="color" id="page" name="page"> | ||
</form> | ||
<script> | ||
|
||
let picker = document.getElementById('page'); | ||
let body = document.querySelector('body'); | ||
const colorPicker = 'color-picker'; | ||
let allItems = JSON.parse( localStorage.getItem(colorPicker) ); | ||
|
||
|
||
|
||
|
||
picker.addEventListener('change', function(event) { | ||
let.hex = this.value; | ||
}) | ||
|
||
function updateFirst(event) { | ||
var body = document.querySelector("body"); | ||
|
||
if (body) { | ||
body.style.color = event.target.value; | ||
} | ||
} | ||
|
||
function updateAll(event) { | ||
document.querySelectorAll("body").forEach(function(body) { | ||
body.style.color = event.target.value; | ||
}); | ||
|
||
} | ||
function storeColor() { | ||
localStorage.setItem(colorPicker); | ||
} | ||
|
||
|
||
</script> | ||
</body> | ||
</html> |