Krixter/junk / index (2).html
Krixter's picture
download
raw
7.37 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NobleLibrary - Live Sort</title>
<style>
:root {
--bg: #f8fafc; --text: #0f172a; --card-bg: #ffffff;
--header-bg: rgba(255, 255, 255, 0.85);
--accent: #6366f1; --border: #e2e8f0;
--accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}
body.dark-mode {
--bg: #0f172a; --text: #f1f5f9; --card-bg: #1e293b;
--header-bg: rgba(15, 23, 42, 0.85); --border: #334155;
}
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; transition: 0.3s; padding-bottom: 50px; }
header { position: sticky; top: 0; backdrop-filter: blur(12px); background: var(--header-bg); border-bottom: 1px solid var(--border); padding: 12px 20px; z-index: 100; display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 1.2rem; margin: 0; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.controls { display: flex; gap: 8px; }
.btn { background: var(--card-bg); border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 10px; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.nav-categories { background: var(--card-bg); border-bottom: 1px solid var(--border); padding: 10px 20px; display: flex; gap: 10px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; position: sticky; top: 57px; z-index: 90; }
.nav-categories::-webkit-scrollbar { display: none; }
.nav-categories a { text-decoration: none; color: var(--text); font-size: 0.8rem; font-weight: 600; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); }
.container { max-width: 900px; margin: 0 auto; padding: 15px; }
.category-section { margin-bottom: 40px; display: none; }
.category-section.has-books { display: block; }
.section-title { font-size: 1.3rem; margin-bottom: 15px; padding-left: 10px; border-left: 4px solid var(--accent); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.book-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; padding: 15px; text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 160px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); position: relative; }
.book-title { font-weight: 700; font-size: 0.95rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
/* Manage Mode UI */
.manage-ui { display: none; margin-top: 10px; }
body.manage-mode .manage-ui { display: block; }
body.manage-mode .open-btn { display: none; }
.cat-select { width: 100%; padding: 5px; border-radius: 5px; background: var(--bg); color: var(--text); border: 1px solid var(--border); font-size: 0.75rem; }
.open-btn { margin-top: auto; background: var(--accent-gradient); color: white; text-align: center; padding: 8px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; }
</style>
</head>
<body>
<header>
<h1>NobleLibrary</h1>
<div class="controls">
<button id="theme-toggle" class="btn">🌙</button>
<button id="manage-toggle" class="btn">⚙️ Manage</button>
</div>
</header>
<div class="nav-categories" id="nav-cats"></div>
<div class="container" id="main-content"></div>
<script>
// 1. DATA & CONFIG
const initialBooks = [{'filename': 'Return_to_the_Fishing_Village_of_85,_Abandons_His_Ex_wife_to_Marry_WebBook.html', 'title': 'Return to the Fishing Village of 85, Abandons His Ex wife to Marry', 'defaultCat': 'FUTA'}];
const categories = ['FUTA', 'INCEST', 'FANTASY', 'GIRLFRIEND', 'NTR', 'GENDER BENDER', '18+'];
// 2. LOAD SAVED PREFERENCES
let userMapping = JSON.parse(localStorage.getItem('noble-library-map')) || {};
// 3. RENDER ENGINE
const render = () => {
const content = document.getElementById('main-content');
const nav = document.getElementById('nav-cats');
content.innerHTML = '';
nav.innerHTML = '';
// Group books by category
const groups = {};
categories.forEach(c => groups[c] = []);
initialBooks.forEach(book => {
const currentCat = userMapping[book.filename] || book.defaultCat;
if(groups[currentCat]) groups[currentCat].push(book);
else groups[categories[0]].push(book); // Fallback
});
categories.forEach(cat => {
const catId = cat.replace(/\s+/g, '-').toLowerCase();
// Build Nav
const link = document.createElement('a');
link.href = `#${catId}`;
link.innerText = cat;
nav.appendChild(link);
// Build Section
const section = document.createElement('div');
section.className = `category-section ${groups[cat].length > 0 ? 'has-books' : ''}`;
section.id = catId;
section.innerHTML = `<h2 class="section-title">${cat}</h2>`;
const grid = document.createElement('div');
grid.className = 'library-grid';
groups[cat].forEach(book => {
const card = document.createElement('div');
card.className = 'book-card';
card.innerHTML = `
<div class="book-title">${book.title}</div>
<div class="manage-ui">
<label style="font-size:0.65rem; opacity:0.7">Move to:</label>
<select class="cat-select" onchange="moveBook('${book.filename}', this.value)">
${categories.map(c => `<option value="${c}" ${c === cat ? 'selected' : ''}>${c}</option>`).join('')}
</select>
</div>
<a href="${book.filename}" class="open-btn">Open Book</a>
`;
grid.appendChild(card);
});
section.appendChild(grid);
content.appendChild(section);
});
};
// 4. ACTIONS
window.moveBook = (filename, newCat) => {
userMapping[filename] = newCat;
localStorage.setItem('noble-library-map', JSON.stringify(userMapping));
render(); // Re-sort immediately
};
document.getElementById('manage-toggle').onclick = (e) => {
document.body.classList.toggle('manage-mode');
e.target.classList.toggle('active');
};
document.getElementById('theme-toggle').onclick = () => {
document.body.classList.toggle('dark-mode');
localStorage.setItem('lib-theme', document.body.classList.contains('dark-mode') ? 'dark' : 'light');
};
if(localStorage.getItem('lib-theme') === 'dark') document.body.classList.add('dark-mode');
render();
</script>
</body>
</html>

Xet Storage Details

Size:
7.37 kB
·
Xet hash:
ea2301dd639f62c27f4d763804284bd8969306090cd0c0f94d8f9021c53e78f5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.