This content originally appeared on DEV Community and was authored by poland silvia
css/style.css
body {
margin: 0;
font-family: 'Roboto', sans-serif;
background-color: #e0e0e0;
color: #222;
}
header {
background-color: #3a6ee7;
color: white;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
header img {
width: 150px;
}
aside ul li a.active {
font-weight: bold;
color: #dbff3b;
}
header h1 {
margin-left: 20px;
font-size: 24px;
font-weight: 700;
color: white;
}
aside {
background-color: #fff;
color: white;
padding: 15px;
width: 212px;
float: left;
}
main {
margin-left: 20%;
padding: 15px;
background-color: #fff;
min-height: 400px;
}
footer {
background-color: #3a6ee7;
color: white;
text-align: center;
padding: 10px;
position: relative;
clear: both;
}
footer a {
color: #ff3b3b;
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
color: aquamarine;
}
nav {
display: flex;
gap: 20px;
}
nav ul {
list-style-type: none;
padding: 0;
margin: 0;
display: flex;
gap: 20px;
}
nav ul li {
display: inline-block;
}
nav ul li a {
text-decoration: none;
color: #fff;
font-size: 18px;
}
nav ul li a:hover {
color: #ff0000;
}
GALERIA folder a obrazok
aside.php
<aside>
<h2>Galéria</h2>
<ul>
<?php
$galleryDir = 'GALERIA';
$currentFolder = $_GET['folder'] ?? ''; // Aktuálne vybraná galéria
if (is_dir($galleryDir)) {
$folders = array_diff(scandir($galleryDir), array('.', '..'));
foreach ($folders as $folder) {
$activeClass = ($folder === $currentFolder) ? 'class="active"' : '';
echo "<li><a href='index.php?page=galeria&folder=$folder' $activeClass>$folder</a></li>";
}
}
?>
</ul>
</aside>
footer.php
<footer>
<p>© 2024 KB S.R.O. | <a href="mailto:k.balaz@iclod.com">k.balaz@iclod.com</a></p>
</footer>
header.php
<!DOCTYPE html>
<html lang="sk">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stránka</title>
<link rel="stylesheet" href="css/style.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<header>
<img src="logo.png" alt="Logo stránky" width="150px">
<h1>Kristian Balaz</h1>
<nav>
<ul>
<li><a href="#domov"><i class="fas fa-home"></i> Domov</a></li>
<li><a href="#o-nas"><i class="fas fa-info-circle"></i> O nás</a></li>
<li><a href="#kontakt"><i class="fas fa-envelope"></i> Kontakt</a></li>
<li><a href="index.php?page=galeria"><i class="fas fa-image"></i> Galéria</a></li>
</ul>
</nav>
</header>
index.php
<?php include 'header.php'; ?>
<div class="container">
<?php include 'aside.php'; ?>
<main>
<?php
$directory = 'galeria';
$folder = $_GET['folder'] ?? null;
if ($folder) {
$folder_path = "$directory/$folder";
if (is_dir($folder_path)) {
echo "<h2>Galéria: $folder</h2>";
$images = glob("$folder_path/*.{jpg,jpeg,png,gif}", GLOB_BRACE);
if ($images) {
foreach ($images as $image) {
echo "<img src='$image' alt='' style='max-width: 200px; margin: 10px;'>";
}
} else {
echo "<p>bez obrazka</p>";
}
} else {
echo "<p>galeria neexistuje.</p>";
}
} else {
echo "<h2>Galérie</h2><p>Vyberte si galériu:</p>";
$subdirs = glob("$directory/*", GLOB_ONLYDIR);
if ($subdirs) {
foreach ($subdirs as $subdir) {
$name = basename($subdir);
echo "<a href='?page=galeria&folder=$name'>$name</a><br>";
}
} else {
echo "<p>galeria neexistuje.</p>";
}
}
?>
</main>
</div>
<?php include 'footer.php'; ?>
</body>
</html>
logo.png
This content originally appeared on DEV Community and was authored by poland silvia
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.

APA
MLA
poland silvia | Sciencx (2025-04-13T22:37:34+00:00) web3. Retrieved from https://www.scien.cx/2025/04/13/web3/
" » web3." poland silvia | Sciencx - Sunday April 13, 2025, https://www.scien.cx/2025/04/13/web3/
HARVARDpoland silvia | Sciencx Sunday April 13, 2025 » web3., viewed ,<https://www.scien.cx/2025/04/13/web3/>
VANCOUVERpoland silvia | Sciencx - » web3. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/04/13/web3/
CHICAGO" » web3." poland silvia | Sciencx - Accessed . https://www.scien.cx/2025/04/13/web3/
IEEE" » web3." poland silvia | Sciencx [Online]. Available: https://www.scien.cx/2025/04/13/web3/. [Accessed: ]
rf:citation » web3 | poland silvia | Sciencx | https://www.scien.cx/2025/04/13/web3/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.