From 84bc9f3209a397598108f9ebbef7b659d5371af0 Mon Sep 17 00:00:00 2001
From: Ivan Pomykacz
Date: Wed, 13 Nov 2024 14:26:28 +0100
Subject: [PATCH] =?UTF-8?q?p=C5=99id=C3=A1no=20p=C5=99ep=C3=ADn=C3=A1n?=
=?UTF-8?q?=C3=AD=20mezi=20dark/light=20theme?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
css/dark.css | 6 ++++++
css/light.css | 2 ++
header.php | 4 ++--
index.php | 7 +++++++
paragraph.php | 8 ++++++--
test.php | 2 ++
6 files changed, 25 insertions(+), 4 deletions(-)
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 @@
-
+ .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