mirror of
https://github.com/zen-browser/astro-site-test.git
synced 2025-07-07 21:59:59 +02:00
feat(color-change): add input event listener for color updates and toggle visibility with Ctrl+C
This commit is contained in:
parent
0d36566ae0
commit
601ed154dc
1 changed files with 11 additions and 0 deletions
|
@ -62,6 +62,17 @@
|
|||
const color = (e.target as HTMLInputElement).value;
|
||||
document.documentElement.style.setProperty("--primary", color);
|
||||
});
|
||||
|
||||
colorInput?.addEventListener("input", (e) => {
|
||||
const color = (e.target as HTMLInputElement).value;
|
||||
document.documentElement.style.setProperty("--primary", color);
|
||||
});
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.ctrlKey && e.key === "c") {
|
||||
colorInput?.classList.toggle("hidden");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue