Skip to main content

FO Terminal Solver

0 likes • Feb 16, 2022
HTML
Loading...
Download

More HTML Posts

Bootstrap NavBar HTML

CodeCatch
0 likes • Oct 15, 2022
HTML
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>

redToGreenSlider

ThiccDaddyLOAF
0 likes • Feb 14, 2022
HTML
<html>
<head></head>
<body>
<div id="bruh" style="width: 250px; height: 250px; background-color: rgb(169, 255, 0);"></div>
<input id="slider" type="range"></input><input id="colorblind" type="checkbox">Colorblind</input>
</body>
<script>
// Clamp number between two values with the following line:
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
//Max is the max value of the "health bar"
//Some people like 0 to 100, some people like 0.0 to 1.0 whatever
function redToGreen(value, max){
const maxColorValue = 256;
//Map the range slider value to 1.0 to 0
const valueMapped = value * (maxColorValue / max);
let red = clamp((maxColorValue*2)-(2.0*valueMapped), 0, maxColorValue);
let green = clamp((2.0*valueMapped), 0, maxColorValue);
const opacity = 1.0;
return "rgba(" + red + ", " + green + ", 0, " + opacity + ")";
}
//Does blue to red to green
function valueToHue(value, max){
console.log("hue");
const maxColorValue = 256;
//Map the range slider value to 1.0 to 0
const valueMapped = value * (maxColorValue / max);
let blue = clamp((maxColorValue*2)-(4.0*valueMapped), 0, maxColorValue);
let red = clamp(((value < (max / 2.0))?
(4.0*valueMapped) :
((maxColorValue*4.0) - (4.0*valueMapped))
), 0, maxColorValue);
let green = clamp((4.0*valueMapped) - (maxColorValue*2.0), 0, maxColorValue);
return "rgba(" + red + ", " + green + ", " + blue + ", " + maxColorValue + ")";
}
document.getElementById("slider").oninput = function(){
let newColor = redToGreen(this.value, 100);
console.log(newColor);
document.getElementById("bruh").style["background-color"] = newColor;
}
document.getElementById("colorblind").onchange = function(){
if(this.checked){
document.getElementById("slider").oninput = function(){
let newColor = valueToHue(this.value, 100);
console.log(newColor);
document.getElementById("bruh").style["background-color"] = newColor;
}
}else{
document.getElementById("slider").oninput = function(){
let newColor = redToGreen(this.value, 100);
console.log(newColor);
document.getElementById("bruh").style["background-color"] = newColor;
}
}
}
</script>
</html>

Post data to an iframe

CodeCatch
0 likes • Nov 19, 2022
HTML
<form action="iframe.php" target="my-iframe" method="post">
<label for="text">Some text:</label>
<input type="text" name="text" id="text">
<input type="submit" value="post">
</form>
<iframe name="my-iframe" src="iframe.php"></iframe>