Skip to content

Commit

Permalink
Build for a2c0252
Browse files Browse the repository at this point in the history
  • Loading branch information
9551-Dev committed Mar 13, 2024
0 parents commit ce723d5
Show file tree
Hide file tree
Showing 157 changed files with 4,646 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pictures/lab/storage_2024_03_07/.tmp/*
pictures/radioburza/leden_2024/.tmp/*

!.gitignore
!.nojekyll
!.github
1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zap.devvie.cc
102 changes: 102 additions & 0 deletions assets/index_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{header}}</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
padding: 0;
background-color: #222;
color: #ddd;
font-size: 18px;
}
h1 {
margin-bottom: 20px;
font-size: 28px;
}
ul {
list-style-type: none;
padding: 0;
margin: 0;
}
li {
margin-bottom: 10px;
background-color: #333;
border-radius: 5px;
transition: background-color 0.3s ease;
cursor: pointer;
font-size: 20px;
}
li:hover {
background-color: #555;
}
li a {
display: block;
padding: 8px;
text-decoration: none;
color: #007bff;
font-size: 20px;
}
li a:hover {
text-decoration: underline;
}

.index_self {
background-color: #444;
color: #999;
}
.index_directory {
background-color: rgb(67, 135, 198);
color: #ffffff;
}
.index_file {
background-color: #008b7b;
color: #fff;
}

button {
background-color: transparent;
color: #007bff;
border: 1px solid #007bff;
padding: 12px 24px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
font-size: 20px;
}

button:hover {
background-color: #007bff;
color: #fff;
}

/* Mobile Styles */
@media screen and (max-width: 600px) {
body {
font-size: 8px;
}
h1 {
font-size: 18px;
}
li,
li a {
font-size: 12px;
}
button {
font-size: 12px;
padding: 6px 12px;
}
}
</style>
</head>
<body>
<h1>{{title}}</h1>
<ul>
{{directory_list}}
</ul>
{{comment_start}}<button onclick="location.href='..';">.. (zap.devvie.cc{{parent}})</button>{{comment_end}}
</body>
</html>
96 changes: 96 additions & 0 deletions assets/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
var current_image_index = 0;
var image_paths = [
{{image_paths}}
];

function open_image_viewer(image_path) {
current_image_index = image_paths.indexOf(image_path);
update_image_viewer();
document.querySelector(".image-viewer").style.display = "flex";
document.body.style.overflow = "hidden";

document.addEventListener("keydown", handle_keypress);

// Add event listener for mouse wheel
document.querySelector(".gallery").addEventListener("wheel", function(event) {
if (event.deltaY < 0) {
// Scrolling up
navigate_image(event, -1);
} else {
// Scrolling down
navigate_image(event, 1);
}
});
}

function close_image_viewer() {
var img = document.getElementById("viewer-image");
img.style.transform = "scale(1)";
document.querySelector(".image-viewer").style.display = "none";
document.body.style.overflow = "auto";

document.removeEventListener("keydown", handle_keypress);
document.querySelector(".gallery").removeEventListener("wheel", handle_wheel);
}

function navigate_image(event, direction) {
var img = document.getElementById("viewer-image");
img.style.transform = "scale(1)";
event.stopPropagation();
current_image_index += direction;
if (current_image_index < 0) {
current_image_index = image_paths.length - 1;
} else if (current_image_index >= image_paths.length) {
current_image_index = 0;
}
update_image_viewer();
}

function update_image_viewer() {
document.getElementById("viewer-image").src = image_paths[current_image_index];
}

function toggle_dark_mode() {
var body = document.body;
body.classList.toggle("dark-mode");
}

function zoom_image(event) {
var img = document.getElementById("viewer-image");
var bounding_rect = img.getBoundingClientRect();

var x = (event.clientX - bounding_rect.left) / bounding_rect.width;
var y = (event.clientY - bounding_rect.top) / bounding_rect.height;

img.style.transformOrigin = `${x * 100}% ${y * 100}%`;
img.style.transform = img.style.transform === "scale(2)" ? "scale(1)" : "scale(2)";

event.stopPropagation();
}

function handle_keypress(event) {
if (document.querySelector(".image-viewer").style.display === "flex") {
switch(event.key) {
case "ArrowLeft":
navigate_image(event, -1);
break;
case "ArrowRight":
navigate_image(event, 1);
break;
case "Escape":
close_image_viewer();
break;
}
}
}

window.addEventListener("scroll", function () {
var body = document.body;
var scroll_position = window.scrollY;

if (scroll_position > 0) {
body.classList.add("scrolled");
} else {
body.classList.remove("scrolled");
}
});
Loading

0 comments on commit ce723d5

Please sign in to comment.