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
body { | |
margin: 0; | |
font-family: system-ui, sans-serif; | |
font-size: 1.25rem; | |
line-height: 1.5; | |
background: var(--clr-body-bg); | |
color: var(--clr-text); | |
} | |
h1, |
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
<head> | |
<title>Theme Chooser CSS</title> | |
<link rel="stylesheet" href="themes.css"> | |
<link rel="stylesheet" href="main.css"> | |
<script src="themes.js" defer></script> | |
</head> | |
<body> | |
<form class="color-picker" action=""> | |
<fieldset> | |
<legend class="visually-hidden">Pick a color scheme</legend> |
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
//call fieldUpdate() as the handler for oninput on your form | |
function fieldUpdate(){ | |
const formData = {}; | |
const inputs = Array.of(...document.querySelectorAll("input")).filter(it => it.type !== "submit") | |
inputs.forEach(it => formData[it.id || it.name] = it.value) | |
window.localStorage.setItem("formData", JSON.stringify(formData)) | |
} | |
function load(){ | |
const formData = JSON.parse(window.localStorage.getItem("formData")) |
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
.responsive-container{ | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 30px; | |
height: 0; | |
overflow: hidden; | |
margin-bottom: 50px; | |
} | |
.responsive-container iframe{ |