Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 24 additions & 31 deletions gengar.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
<!DOCTYPE html>
<html>

<body>

<head>
<title>Gengars!</title>
<style>
body {
background-image: url("https://upload.wikimedia.org/wikipedia/en/b/bf/Pok%C3%A9mon_Gengar_art.png");
}
input {
display: block;
margin: 10px;
}
</style>

<script>
var r = 255;
var g = 255;
var b = 255;
function buttonPress(){
document.body.style.backgroundColor="rgb(255,0,0)";
}

function sliderChange(){
document.body.style.backgroundColor=("rgb("+r+","+g+","+b+")")
document.getElementById('colors').innerText="R: " + r + " G: " + g + " B: " + b

function buttonPress(){
document.body.style.backgroundColor="rgb(255,0,0)";
}

}
colorList = [255, 255, 255]
function sliderChange(){
document.body.style.backgroundColor=("rgb("+ colorList[0] + "," + colorList[1] + "," + colorList[2] + ")")
document.getElementById('colors').innerText=("R: " + colorList[0] + " G: " + colorList[1] + " B: " + colorList[2])
}

function sliderChangeR(val){
r = val;
sliderChange();
}
function sliderChangeG(val){
g = val;
sliderChange();
}
function sliderChangeB(val){
b = val;
sliderChange();
}
function newValue(val, color){
colorList[color] = val;
sliderChange()
}
</script>

</head>
<body>

<b> All About Gengars </b>

<h1> Links: </h1>
Expand All @@ -47,9 +40,9 @@ <h1> Links: </h1>

<button onclick="buttonPress()">Please don't feed the Gengars After Midnight</button> <br>
<p id="colors">R: 255 G: 255 B: 255</p> <br>
<input type="range" id="slider" min="0" max="255" onchange="sliderChangeR(this.value)"/> <br>
<input type="range" id="slider" min="0" max="255" onchange="sliderChangeG(this.value)"/> <br>
<input type="range" id="slider" min="0" max="255" onchange="sliderChangeB(this.value)"/> <br>
<input type="range" id="slider" min="0" max="255" onchange="newValue(this.value, 0)" value = "255"/> <br>
<input type="range" id="slider" min="0" max="255" onchange="newValue(this.value, 1)" value = "255"/> <br>
<input type="range" id="slider" min="0" max="255" onchange="newValue(this.value, 2)" value = "255"/> <br>

</p>

Expand Down