prvni várka

This commit is contained in:
Kankys 2024-04-17 23:13:56 +02:00
commit 25ef045289
19 changed files with 433 additions and 0 deletions

20
Formulář/index.html Normal file
View File

@ -0,0 +1,20 @@
<!-- Registrační formulář -->
<div class="container">
<h2>Registrace</h2>
<form id="registrationForm" onsubmit="return validateForm()">
<div class="form-group">
<label for="username">Jméno:</label>
<input type="text" id="username" name="username" required />
</div>
<div class="form-group">
<label for="password1">Heslo:</label>
<input type="password" id="password1" name="password1" required />
</div>
<div class="form-group">
<label for="password2">Potvrďte heslo:</label>
<input type="password" id="password2" name="password2" required />
<span id="passwordMatch"></span>
</div>
<button class="log" type="submit">Registrovat</button>
</form>
</div>

14
Formulář/script.js Normal file
View File

@ -0,0 +1,14 @@
// Formulář
function validateForm() {
var password1 = document.getElementById("password1").value;
var password2 = document.getElementById("password2").value;
var passwordMatch = document.getElementById("passwordMatch");
if (password1 !== password2) {
passwordMatch.textContent = "Hesla se neshodují";
passwordMatch.style.color = "red";
return false;
} else {
return true;
}
}

34
Formulář/style.css Normal file
View File

@ -0,0 +1,34 @@
/*Formulář*/
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
font-weight: bold;
}
input {
width: 100%;
padding: 8px;
font-size: 16px;
}
button {
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}

11
Go-To-Up/index.html Normal file
View File

@ -0,0 +1,11 @@
<head>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
</head>
<body>
<button onclick="scrollToTop()" id="scrollToTopBtn" title="Go to top">
<i class="fas fa-arrow-up"></i>
</button>
</body>

19
Go-To-Up/script.js Normal file
View File

@ -0,0 +1,19 @@
// Tlačítko go to top
// Zobrazení tlačítka od rolovaní části stránky (víc logické než až na konci)
window.onscroll = function () {
scrollFunction();
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("scrollToTopBtn").style.display = "block";
} else {
document.getElementById("scrollToTopBtn").style.display = "none";
}
}
// Posunout nahoru, když uživatel klikne na tlačítko
function scrollToTop() {
document.body.scrollTop = 0; // Pro Safari
document.documentElement.scrollTop = 0; // Pro ostatní prohlížeče
}

14
Go-To-Up/style.css Normal file
View File

@ -0,0 +1,14 @@
/* Go to go */
#scrollToTopBtn {
display: none;
position: fixed;
bottom: 20px;
right: 20px;
/*butoon přes obsah*/
z-index: 99;
outline: none;
cursor: pointer;
padding: 15px;
border-radius: 50%;
background-color: transparent;
}

31
NavBar/index.html Normal file
View File

@ -0,0 +1,31 @@
<head>
<!-- Nav Bar -->
<script
src="https://kit.fontawesome.com/0a43c6cd1f.js"
crossorigin="anonymous"
></script>
</head>
<body>
<header>
<!-- Harry - logo (Harry Potter) -->
<div class="logo">
<img src="image/logo.png" alt="" />
</div>
<!-- Harry - navigation -->
<nav>
<ul>
<li><a href="">Domů</a></li>
<li><a href="">O nás</a></li>
<li><a href="">Kontakt</a></li>
</ul>
</nav>
<div class="menu-icon">
<!-- Ikona hamburger -->
<i class="fa-solid fa-bars"></i>
<!-- Ikona cross -->
<!-- <i class="fa-solid fa-xmark"></i> -->
</div>
</header>
</body>

15
NavBar/script.js Normal file
View File

@ -0,0 +1,15 @@
const menuIcon = document.querySelector(".menu-icon");
const menuList = document.querySelector("nav");
const hamburgerIcon = document.querySelector(".fa-solid");
menuIcon.addEventListener("click", () => {
if (hamburgerIcon.classList[1] === "fa-bars") {
hamburgerIcon.classList.add("fa-xmark");
hamburgerIcon.classList.remove("fa-bars");
menuList.style.display = "block";
} else {
hamburgerIcon.classList.add("fa-bars");
hamburgerIcon.classList.remove("fa-xmark");
menuList.style.display = "none";
}
});

68
NavBar/style.cs Normal file
View File

@ -0,0 +1,68 @@
header {
display: flex;
align-items: center;
background-color: #313131;
height: 70px;
flex-direction: row;
/*position: fixed;*/
}
.logo {
flex-grow: 1;
}
.logo img {
width: 150px;
margin-left: 40px;
}
/* EOS - navigation */
nav {
margin-right: 40px;
}
nav li {
display: inline-block;
list-style-type: none;
margin-right: 20px;
}
nav li a {
text-decoration: none;
color: #734f96;
/*border: 1px solid #734f96;*/
}
/* EOS - navigation icons */
.menu-icon {
display: none;
margin-right: 30px;
}
@media (max-width: 600px) {
header {
position: relative;
}
header nav {
position: absolute;
top: 70px;
background-color: #313131;
width: 100%;
display: none;
}
.menu-icon {
display: block;
color: var(--special-white);
font-size: 23px;
}
header nav li {
display: block !important;
text-align: center;
margin-top: 10px;
margin-bottom: 10px;
}
}

10
Switch theme/index.html Normal file
View File

@ -0,0 +1,10 @@
<head>
<!--icons dark, go to up-->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
</head>
<body>
<button id="toggleButton"><i class="fas fa-adjust"></i></button>
</body>

89
Switch theme/script.js Normal file
View File

@ -0,0 +1,89 @@
// Dark / Light Mode
const body = document.querySelector("body");
const head = document.querySelector("header");
const links = document.querySelectorAll("a");
const nav = document.querySelector(".navigation");
const h1 = document.querySelector("h1");
const nadpish2 = document.querySelectorAll("h2");
const p = document.querySelector("p");
const solid = document.querySelector(".fa-solid");
const solid1 = document.querySelector(".menu-icon");
const footer = document.querySelector("footer");
const gotop = document.querySelector("#scrollToTopBtn");
const theme = document.querySelector("#toggleButton");
const box = document.querySelectorAll(".code-box");
const form = document.querySelector(".log");
let isDraculaMode = false;
// Funkce pro nastavení stylů pro Dracula mód
function setDraculaStyles() {
body.style.backgroundColor = "#2a232b";
body.style.color = "#f8f8f2";
head.style.backgroundColor = "#2a232b";
theme.style.color = "#9fea8a";
gotop.style.color = "#9fea8a";
links.forEach((a) => {
a.style.color = "#f76b00";
});
nav.style.backgroundColor = "#2a232b";
h1.style.color = "#e54472";
nadpish2.forEach((h2) => {
h2.style.color = "#18f700";
});
solid.style.backgroundColor = "#2a232b";
solid.style.color = "#f76b00";
solid1.style.backgroundColor = "#2a232b";
footer.style.backgroundColor = "#2a232b";
//gotop.style.backgroundColor = "#18f700";
//theme.style.backgroundColor = "#18f700";
form.style.backgroundColor = "#18f700";
form.style.color = "black";
}
// Funkce pro nastavení stylů pro Light mód;
function setKakouneStyles() {
body.style.backgroundColor = "#9fea8a";
body.style.color = "#282a36";
h1.style.color = "#e84046";
theme.style.color = "#2a232b";
links.forEach((a) => {
a.style.color = "#ea3838";
});
gotop.style.color = "#2a232b";
head.style.backgroundColor = "#9fea8a";
nav.style.backgroundColor = "#9fea8a";
solid.style.backgroundColor = "#9fea8a";
solid1.style.backgroundColor = "#9fea8a";
footer.style.backgroundColor = "#9fea8a";
nadpish2.forEach((h2) => {
h2.style.color = "#1909f4";
});
//gotop.style.backgroundColor = "#a7e6ef";
//theme.style.backgroundColor = "#a7e6ef";
box.forEach((p) => {
p.style.color = "white";
});
form.style.backgroundColor = "#1909f4";
form.style.color = "white";
}
// Funkce pro přepnutí módu
function toggleMode() {
if (isDraculaMode) {
// Pokud je momentálně v Dracula modu, přepnout na Light mód
setKakouneStyles();
isDraculaMode = false;
} else {
// Pokud je momentálně v Light modu, přepnout na Dracula mód
setDraculaStyles();
isDraculaMode = true;
}
}
// Funkce na změnu stylů
document.getElementById("toggleButton").addEventListener("click", toggleMode);
// Nastavení - výchozí styl na Light(Kakoune)
setKakouneStyles();
isDraculaMode = true;

17
Switch theme/style.css Normal file
View File

@ -0,0 +1,17 @@
/*Dark/Light mode button*/
#toggleButton {
float: right;
margin-right: 30px;
margin-top: 10px;
padding: 5px;
}
#toggleButton {
bottom: 20px;
right: 20px;
border: none;
outline: none;
background-color: transparent;
font-size: 34px;
cursor: pointer;
}

6
Ubuntu Fonts/index.html Normal file
View File

@ -0,0 +1,6 @@
<head>
<!--ubuntu fonts-->
<style>
@import url("https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");
</style>
</head>

5
Ubuntu Fonts/style.css Normal file
View File

@ -0,0 +1,5 @@
body {
max-width: 1000px;
margin: 0 auto;
font-family: "Ubuntu", sans-serif;
}

7
Zoom photo/index.html Normal file
View File

@ -0,0 +1,7 @@
<body>
<section class="photo">
<img class="picture" src="img/home.png" alt="Homescreen" />
<img class="picture1" src="img/config.png" alt="Zellij" />
<img class="picture2" src="img/command.png" alt="Command" />
</section>
</body>

30
Zoom photo/script.js Normal file
View File

@ -0,0 +1,30 @@
// Photo Gallery -> section (zoom)
const image1 = document.querySelector(".picture");
image1.addEventListener("mouseenter", () => {
image1.style.transform = "scale(2.2)";
});
image1.addEventListener("mouseleave", () => {
image1.style.transform = "scale(1)";
});
const image2 = document.querySelector(".picture1");
image2.addEventListener("mouseenter", () => {
image2.style.transform = "scale(2.2)";
});
image2.addEventListener("mouseleave", () => {
image2.style.transform = "scale(1)";
});
const image3 = document.querySelector(".picture2");
image3.addEventListener("mouseenter", () => {
image3.style.transform = "scale(2.2)";
});
image3.addEventListener("mouseleave", () => {
image3.style.transform = "scale(1)";
});

9
codebox/index.html Normal file
View File

@ -0,0 +1,9 @@
<body>
<div class="code-box">
<pre id="code-content">
Místo pro kód (s kódem je možné manipulovat a tak i zůstame)
</pre
>
<button id="copy-button">Kopírovat</button>
</div>
</body>

10
codebox/script.js Normal file
View File

@ -0,0 +1,10 @@
// Code-box
document.getElementById("copy-button").addEventListener("click", function () {
var codeContent = document.getElementById("code-content");
var range = document.createRange();
range.selectNode(codeContent);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().removeAllRanges();
});

24
codebox/style.css Normal file
View File

@ -0,0 +1,24 @@
/* CodeBox */
.code-box {
position: relative;
width: 500px;
height: auto;
border: 1px solid #734f96;
padding: 5px;
overflow: auto;
background-color: #313131;
color: yellowgreen;
margin: auto;
text-align: left;
}
#copy-button {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
color: whitesmoke;
background-color: transparent;
border: 1px solid #734f96;
}