new blog style kakoune
This commit is contained in:
216
assets/css/style.css
Normal file
216
assets/css/style.css
Normal file
@ -0,0 +1,216 @@
|
||||
* {
|
||||
margin: 0;
|
||||
|
||||
padding: 0;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
font-family: "Ubuntu", sans-serif;
|
||||
}
|
||||
|
||||
/*Header */
|
||||
|
||||
h1 {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.nav-p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-top: 25px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70px;
|
||||
flex-direction: row;
|
||||
/*position: fixed;*/
|
||||
}
|
||||
|
||||
.title {
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
/*width: 100px;*/
|
||||
height: 100px;
|
||||
padding-top: 15px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* navigation */
|
||||
nav {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
nav li {
|
||||
display: inline-block;
|
||||
list-style-type: none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
nav li a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* navigation icons */
|
||||
|
||||
.menu-icon {
|
||||
display: none;
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
/*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;
|
||||
}
|
||||
|
||||
/*Header small display*/
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
header {
|
||||
position: relative;
|
||||
}
|
||||
header nav {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
width: 100%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
display: block;
|
||||
font-size: 23px;
|
||||
}
|
||||
|
||||
header nav li {
|
||||
display: block !important;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
hr {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sekce */
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
padding-top: 115px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#install {
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
#node {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#plans {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
|
||||
#contact {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#other {
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
/*Code box*/
|
||||
.code-box {
|
||||
background-color: #353535;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
font-family: monospace;
|
||||
max-width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/*Picture settings*/
|
||||
|
||||
.sat {
|
||||
width: 175px;
|
||||
height: 175px;
|
||||
}
|
||||
|
||||
.photo {
|
||||
text-align: center;
|
||||
padding-top: 50px;
|
||||
}
|
||||
.photo img {
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
margin: 10px;
|
||||
transition: all 0.5s linear;
|
||||
}
|
||||
/*footer pevná pozice*/
|
||||
|
||||
footer {
|
||||
bottom: 0;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 25px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
footer a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
/* Styl pro ikonu */
|
||||
#scrollToTopBtn i {
|
||||
font-size: 34px;
|
||||
}
|
147
assets/js/script.js
Normal file
147
assets/js/script.js
Normal file
@ -0,0 +1,147 @@
|
||||
// Navbar menu
|
||||
const menuIcon = document.querySelector(".menu-icon");
|
||||
const menuList = document.querySelector("nav");
|
||||
const hamburgerIcon = document.querySelector(".fa-solid");
|
||||
|
||||
menuIcon.addEventListener("click", () => {
|
||||
if (hamburgerIcon.classList.contains("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";
|
||||
}
|
||||
});
|
||||
|
||||
// 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");
|
||||
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";
|
||||
}
|
||||
|
||||
// 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";
|
||||
});
|
||||
box.forEach((p) => {
|
||||
p.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 Dark
|
||||
setDraculaStyles();
|
||||
isDraculaMode = true;
|
||||
|
||||
// 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)";
|
||||
});
|
||||
|
||||
// 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
|
||||
}
|
Reference in New Issue
Block a user