infobox
This commit is contained in:
parent
f9cfd3fc3b
commit
7b12be89c5
4 changed files with 377 additions and 58 deletions
BIN
isosilo
Executable file
BIN
isosilo
Executable file
Binary file not shown.
|
|
@ -1,24 +1,213 @@
|
|||
:root {
|
||||
--bg: #0f1117; --surface: #1a1d27; --border: #252836;
|
||||
--accent: #4f8ef7; --text: #e2e4ef; --muted: #6b7090; --radius: 8px;
|
||||
--bg: #0f1117;
|
||||
--surface: #1a1d27;
|
||||
--border: #252836;
|
||||
--accent: #4f8ef7;
|
||||
--text: #e2e4ef;
|
||||
--muted: #6b7090;
|
||||
--radius: 8px;
|
||||
}
|
||||
body {
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: system-ui;
|
||||
margin: 0;
|
||||
}
|
||||
header {
|
||||
background: #12151f;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 0 2rem;
|
||||
height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.logo {
|
||||
color: var(--accent);
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
font-family: monospace;
|
||||
}
|
||||
main {
|
||||
max-width: 1100px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
}
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 1.5rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: transform 0.1s;
|
||||
position: relative;
|
||||
}
|
||||
.card:hover {
|
||||
transform: translateY(-3px);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
.card-img {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
object-fit: cover;
|
||||
background: #000;
|
||||
}
|
||||
.folder-icon {
|
||||
height: 150px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 4rem;
|
||||
background: #1c202d;
|
||||
color: #f7c948;
|
||||
}
|
||||
.iso-icon {
|
||||
height: 150px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 4rem;
|
||||
background: #12151f;
|
||||
}
|
||||
.card-body {
|
||||
padding: 1rem;
|
||||
}
|
||||
.card-name {
|
||||
font-weight: bold;
|
||||
color: var(--accent);
|
||||
margin-bottom: 0.5rem;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.card-desc {
|
||||
font-size: 0.8rem;
|
||||
color: var(--muted);
|
||||
height: 3em;
|
||||
overflow: hidden;
|
||||
}
|
||||
.bc {
|
||||
background: var(--surface);
|
||||
padding: 0.6rem 1rem;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.bc a {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
.tbl {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background: var(--surface);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
}
|
||||
.tbl th {
|
||||
text-align: left;
|
||||
padding: 1rem;
|
||||
background: #1e2132;
|
||||
color: var(--muted);
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
.tbl td {
|
||||
padding: 1rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.dl-btn {
|
||||
border: 1px solid var(--accent);
|
||||
color: var(--accent);
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.7rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
.dl-btn:hover {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Modal styles */
|
||||
.modal-overlay {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 1000;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.modal-overlay.visible {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.modal-content {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
max-width: 600px;
|
||||
width: 90%;
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
.modal-header {
|
||||
padding: 1.5rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.modal-title {
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
color: var(--text);
|
||||
}
|
||||
.close-btn {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--muted);
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.close-btn:hover {
|
||||
color: var(--text);
|
||||
}
|
||||
.modal-body {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
.modal-image {
|
||||
width: 100%;
|
||||
max-height: 300px;
|
||||
object-fit: contain;
|
||||
background: #000;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 1rem;
|
||||
display: none;
|
||||
}
|
||||
.modal-description {
|
||||
color: var(--text);
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
body { background: var(--bg); color: var(--text); font-family: system-ui; margin: 0; }
|
||||
header { background: #12151f; border-bottom: 1px solid var(--border); padding: 0 2rem; height: 56px; display: flex; align-items: center; }
|
||||
.logo { color: var(--accent); font-weight: bold; text-decoration: none; font-family: monospace; }
|
||||
main { max-width: 1100px; margin: 0 auto; padding: 2rem; }
|
||||
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
|
||||
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.1s; position: relative;}
|
||||
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
|
||||
.card-img { width: 100%; height: 150px; object-fit: cover; background: #000; }
|
||||
.folder-icon { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 4rem; background: #1c202d; color: #f7c948; }
|
||||
.iso-icon { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 4rem; background: #12151f; }
|
||||
.card-body { padding: 1rem; }
|
||||
.card-name { font-weight: bold; color: var(--accent); margin-bottom: 0.5rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.card-desc { font-size: 0.8rem; color: var(--muted); height: 3em; overflow: hidden; }
|
||||
.bc { background: var(--surface); padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 1.5rem; font-size: 0.85rem; }
|
||||
.bc a { color: var(--accent); text-decoration: none; }
|
||||
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
|
||||
.tbl th { text-align: left; padding: 1rem; background: #1e2132; color: var(--muted); font-size: 0.75rem; }
|
||||
.tbl td { padding: 1rem; border-bottom: 1px solid var(--border); }
|
||||
.dl-btn { border: 1px solid var(--accent); color: var(--accent); padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; text-decoration: none; }
|
||||
.dl-btn:hover { background: var(--accent); color: #fff; }
|
||||
|
|
|
|||
71
static/js/modal.js
Normal file
71
static/js/modal.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
// Modal functionality for ISO info popups
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// Get modal elements
|
||||
const modal = document.getElementById("isoModal");
|
||||
const modalContent = document.getElementById("modalContent");
|
||||
const closeBtn = document.querySelector(".close-btn");
|
||||
const modalOverlay = document.querySelector(".modal-overlay");
|
||||
|
||||
// Function to open modal with ISO info
|
||||
function openModal(title, description, imageSrc) {
|
||||
document.getElementById("modalTitle").textContent = title;
|
||||
document.getElementById("modalDescription").textContent =
|
||||
description || "No description available";
|
||||
|
||||
const modalImage = document.getElementById("modalImage");
|
||||
if (imageSrc) {
|
||||
modalImage.src = imageSrc;
|
||||
modalImage.style.display = "block";
|
||||
} else {
|
||||
modalImage.style.display = "none";
|
||||
}
|
||||
|
||||
modal.classList.add("visible");
|
||||
document.body.style.overflow = "hidden";
|
||||
}
|
||||
|
||||
// Function to close modal
|
||||
function closeModal() {
|
||||
modal.classList.remove("visible");
|
||||
document.body.style.overflow = "";
|
||||
}
|
||||
|
||||
// Event listeners for close button and overlay
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener("click", closeModal);
|
||||
}
|
||||
|
||||
if (modalOverlay) {
|
||||
modalOverlay.addEventListener("click", function (e) {
|
||||
if (e.target === modalOverlay) {
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Close modal when Escape key is pressed
|
||||
document.addEventListener("keydown", function (e) {
|
||||
if (e.key === "Escape" && modal.style.display === "block") {
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
|
||||
// Add click handlers to all ISO info buttons
|
||||
const infoButtons = document.querySelectorAll(".info-btn");
|
||||
infoButtons.forEach((button) => {
|
||||
button.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const isoName = this.getAttribute("data-iso-name");
|
||||
const description = this.getAttribute("data-description");
|
||||
const imageSrc = this.getAttribute("data-image-src");
|
||||
|
||||
openModal(isoName, description, imageSrc);
|
||||
});
|
||||
});
|
||||
|
||||
// Expose functions to global scope for potential future use
|
||||
window.openISOModal = openModal;
|
||||
window.closeISOModal = closeModal;
|
||||
});
|
||||
|
|
@ -1,38 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head><title>{{.Title}}</title><link rel="stylesheet" href="/static/css/style.css"></head>
|
||||
<body>
|
||||
<header><a class="logo" href="/">💿 ISOSilo</a></header>
|
||||
<main>
|
||||
<nav class="bc">
|
||||
{{range $i, $c := .Breadcrumbs}}<a href="{{$c.URL}}">{{$c.Name}}</a> {{if lt (add1 $i) (len $.Breadcrumbs)}}/{{end}} {{end}}
|
||||
</nav>
|
||||
<head>
|
||||
<title>{{.Title}}</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css" />
|
||||
<script src="/static/js/modal.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header><a class="logo" href="/">💿 ISOSilo</a></header>
|
||||
<main>
|
||||
<!-- ISO Info Modal -->
|
||||
<div id="isoModal" class="modal-overlay">
|
||||
<div class="modal-content">
|
||||
<button class="close-btn" aria-label="Close">×</button>
|
||||
<div class="modal-header">
|
||||
<h2 id="modalTitle" class="modal-title">
|
||||
ISO Information
|
||||
</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<img
|
||||
id="modalImage"
|
||||
class="modal-image"
|
||||
alt="ISO cover"
|
||||
/>
|
||||
<p id="modalDescription" class="modal-description"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="bc">
|
||||
{{range $i, $c := .Breadcrumbs}}<a href="{{$c.URL}}"
|
||||
>{{$c.Name}}</a
|
||||
>
|
||||
{{if lt (add1 $i) (len $.Breadcrumbs)}}/{{end}} {{end}}
|
||||
</nav>
|
||||
|
||||
<div class="grid">
|
||||
{{range .Items}}
|
||||
{{if .IsDir}}
|
||||
<a href="/{{urlenc .RelativePath}}" class="card">
|
||||
<div class="folder-icon">📁</div>
|
||||
<div class="card-body"><span class="card-name">{{.Name}}</span></div>
|
||||
</a>
|
||||
{{else}}
|
||||
<div class="card">
|
||||
<a href="/browse/{{urlenc .RelativePath}}">
|
||||
{{if .HasImage}}<img src="/raw/{{urlenc (trimExt .RelativePath)}}{{.ImageExt}}" class="card-img">
|
||||
{{else}}<div class="iso-icon">💿</div>{{end}}
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<a href="/browse/{{urlenc .RelativePath}}" class="card-name">{{.Name}}</a>
|
||||
<p class="card-desc">{{if .Description}}{{.Description}}{{else}}ISO Disk Image{{end}}</p>
|
||||
<div style="margin-top:1rem; display:flex; gap:0.5rem;">
|
||||
<a href="/browse/{{urlenc .RelativePath}}" class="dl-btn">Browse</a>
|
||||
<a href="/raw/{{urlenc .RelativePath}}" class="dl-btn" download>ISO</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
<div class="grid">
|
||||
{{range .Items}} {{if .IsDir}}
|
||||
<a href="/{{urlenc .RelativePath}}" class="card">
|
||||
<div class="folder-icon">📁</div>
|
||||
<div class="card-body">
|
||||
<span class="card-name">{{.Name}}</span>
|
||||
</div>
|
||||
</a>
|
||||
{{else}}
|
||||
<div class="card">
|
||||
<a href="/browse/{{urlenc .RelativePath}}">
|
||||
{{if .HasImage}}<img
|
||||
src="/raw/{{urlenc (trimExt .RelativePath)}}{{.ImageExt}}"
|
||||
class="card-img"
|
||||
/>
|
||||
{{else}}
|
||||
<div class="iso-icon">💿</div>
|
||||
{{end}}
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<a
|
||||
href="/browse/{{urlenc .RelativePath}}"
|
||||
class="card-name"
|
||||
>{{.Name}}</a
|
||||
>
|
||||
<p class="card-desc">
|
||||
{{if .Description}}{{.Description}}{{else}}ISO Disk
|
||||
Image{{end}}
|
||||
</p>
|
||||
<div
|
||||
style="margin-top: 1rem; display: flex; gap: 0.5rem"
|
||||
>
|
||||
<button
|
||||
class="info-btn dl-btn"
|
||||
data-iso-name="{{.Name}}"
|
||||
data-description="{{if .Description}}{{.Description}}{{else}}No description available{{end}}"
|
||||
{{if
|
||||
.HasImage}}data-image-src="/raw/{{urlenc (trimExt .RelativePath)}}{{.ImageExt}}"
|
||||
{{end}}
|
||||
>
|
||||
Info
|
||||
</button>
|
||||
<a
|
||||
href="/browse/{{urlenc .RelativePath}}"
|
||||
class="dl-btn"
|
||||
>Browse</a
|
||||
>
|
||||
<a
|
||||
href="/raw/{{urlenc .RelativePath}}"
|
||||
class="dl-btn"
|
||||
download
|
||||
>ISO</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}} {{end}}
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue