diff --git a/css/dark.css b/css/dark.css index e69de29..aee4d4b 100644 --- a/css/dark.css +++ b/css/dark.css @@ -0,0 +1,6 @@ + +body { + font-family: Arial, Helvetica, sans-serif; + color: #f5f5f5; + background-color: #555; +} diff --git a/css/light.css b/css/light.css index dd1b8ec..97b6a48 100644 --- a/css/light.css +++ b/css/light.css @@ -1,4 +1,6 @@ body { font-family: Arial, Helvetica, sans-serif; + color: #555; + background-color: whitesmoke; } diff --git a/header.php b/header.php index ecfaa1f..d204534 100644 --- a/header.php +++ b/header.php @@ -4,9 +4,9 @@ <?php echo "$title"; ?> - + .css"> diff --git a/index.php b/index.php index 989a366..d1a5b2a 100644 --- a/index.php +++ b/index.php @@ -9,6 +9,13 @@ if (isset($_GET["cc"])) { $color = $_GET["cc"]; } +// změna theme stránky (dark/light) +$theme = "light"; +if (isset($_GET["theme"])) { + // porušení pravidla - nikdy nepřiřazuj hodnotu přímo z GET (POST) + $theme = $_GET["theme"]; +} + include "header.php"; include "test.php"; diff --git a/paragraph.php b/paragraph.php index 0aaf053..53d5c24 100644 --- a/paragraph.php +++ b/paragraph.php @@ -1,3 +1,7 @@ -

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate labore illum possimus consectetur tempora ipsa eos necessitatibus! Dolores eius qui officia ipsam dolorem iure voluptatum voluptas ut. Quas, qui recusandae! -

\ No newline at end of file +

+ +

+ Necessitatibus illum animi ipsam pariatur, iure debitis commodi. Voluptatum illo officia, qui eum hic, ab rem culpa voluptatibus itaque earum deserunt doloremque? +

diff --git a/test.php b/test.php index 347e12e..02f578b 100644 --- a/test.php +++ b/test.php @@ -5,4 +5,6 @@ stránka s obrázkem 2 stránka s chybnou hodnotou obrázku stránka s červeným textem + dark theme + light theme