<html>
<style>
#text {
font-family: Calibri;
font-size: 15px;
font-weight: 200;
}
</style>
<body>
<p id="text">Some Text</p><br> <!--text to change size, weight, and kerning-->
Font Size: <input type="range" min="1" max="100" value="20" id="sliderSize"><br> <!-- type="range" is the slider, min="1" & max="100" is the minimum and maximum value of the slider, and value="20" is the default position of the slider -->
Font Weight: <input type="range" min="1" max="100" value="20" id="sliderWeight"><br>
Font Kerning: <input type="range" min="1" max="100" value="20" id="sliderKerning">
</body>
<script>
const sliderSize = document.getElementById("sliderSize");
const sliderWeight = document.getElementById("sliderWeight");
const sliderKerning = document.getElementById("sliderKerning");
const font = document.getElementById("text");
sliderSize.oninput = function() {
if (this.value > 95) {
font.style.fontSize = 55px;
}
else if (this.value > 85) {
font.style.fontSize = 50px;
}
else if (this.value > 75) {
font.style.fontSize = 45px;
}
else if (this.value > 65) {
font.style.fontSize = 40px;
}
else if (this.value > 55) {
font.style.fontSize = 35px;
}
else if (this.value > 45) {
font.style.fontSize = 30px;
}
else if (this.value > 35) {
font.style.fontSize = 25px;
}
else if (this.value > 25) {
font.style.fontSize = 20px;
}
else if (this.value > 15) {
font.style.fontSize = 15px;
}
else if (this.value > 5) {
font.style.fontSize = 10px;
}
else {
font.style.fontSize = 5px;
}
};
sliderWeight.oninput = function() { /*Calibri doesn't have many font weights, but you can try it with another font*/
if (this.value > 95) {
font.style.fontWeight = 1000;
}
else if (this.value > 85) {
font.style.fontWeight = 900;
}
else if (this.value > 75) {
font.style.fontWeight = 800;
}
else if (this.value > 65) {
font.style.fontWeight = 700;
}
else if (this.value > 55) {
font.style.fontWeight = 600;
}
else if (this.value > 45) {
font.style.fontWeight = 500;
}
else if (this.value > 35) {
font.style.fontWeight = 400;
}
else if (this.value > 25) {
font.style.fontWeight = 300;
}
else if (this.value > 15) {
font.style.fontWeight = 200;
}
else if (this.value > 5) {
font.style.fontWeight = 100;
}
else {
font.style.fontWeight = 0;
}
};
sliderKerning.oninput = function() { /*Calibri also doesn't have kerning data, but you can try it with another font*/
if (this.value > 95) {
font.style.fontKerning = 100;
}
else if (this.value > 85) {
font.style.fonKerningt = 90;
}
else if (this.value > 75) {
font.style.fontKerning = 80;
}
else if (this.value > 65) {
font.style.fontKerning = 70;
}
else if (this.value > 55) {
font.style.fontKerning = 60;
}
else if (this.value > 45) {
font.style.fontKerning = 50;
}
else if (this.value > 35) {
font.style.fontKerning = 40;
}
else if (this.value > 25) {
font.style.fontKerning = 30;
}
else if (this.value > 15) {
font.style.fontKerning = 20;
}
else if (this.value > 5) {
font.style.fontKerning = 10;
}
else {
font.style.fontKerning = 0;
}
}; /*I don't even know how to use kerning, but I guess this should work*/
</script>
</html>