From c1c97a14e82468e52b8b8b44bcd06df8c96f0324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0krab=C3=A1nek?= Date: Wed, 1 Mar 2023 11:27:10 +0000 Subject: [PATCH] add js style --- 05/app.js | 32 ++++++++++++++++++++++++++++++++ 05/index.html | 39 +++++++++++++++++++++++++++++++++++++++ 05/style.css | 3 +++ 3 files changed, 74 insertions(+) create mode 100644 05/app.js create mode 100644 05/index.html create mode 100644 05/style.css diff --git a/05/app.js b/05/app.js new file mode 100644 index 0000000..c122cb3 --- /dev/null +++ b/05/app.js @@ -0,0 +1,32 @@ + + +function dyncolor() { + let color = document.getElementById("tcolor").value; + console.log(color); + document.getElementById("ltext").style.color = color; +} + +function bgcolor() { + let color = document.getElementById("bcolor").value; + console.log(color); + document.getElementById("ltext").style.backgroundColor = color; +} + + +function changeScolor() { + let colorList = document.getElementById("scolor"); //načteme seznam barev + let selectColor = colorList.selectedIndex; //načteme vybraný index (pořadí) + let futureColor = colorList.options[selectColor].value; //načteme hodnotu vybraného indexu + + document.getElementById("ltext").style.color = futureColor; + +} + +function changeFont() { + let fontList = document.getElementById("sfont"); //načteme seznam fontů + let selectFont = fontList.selectedIndex; //načteme vybraný index (pořadí) + let futureFont = fontList.options[selectFont].value; //načteme hodnotu vybraného indexu + + document.getElementById("ltext").style.fontFamily = futureFont; + +} \ No newline at end of file diff --git a/05/index.html b/05/index.html new file mode 100644 index 0000000..93096ff --- /dev/null +++ b/05/index.html @@ -0,0 +1,39 @@ + + + + + + + JS DOM stylizace + + + + + +

JS DOM Stylizace

+

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Hic error unde quas repellat sunt sapiente quos facilis quia recusandae dolores sequi, saepe nostrum corrupti earum dolorem esse doloribus nemo cum!

+
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/05/style.css b/05/style.css new file mode 100644 index 0000000..9ddb116 --- /dev/null +++ b/05/style.css @@ -0,0 +1,3 @@ +.domblue { + color: red; +} \ No newline at end of file