3 Commits

Author SHA1 Message Date
bdc4992d16 responsive design and better image handling 2025-11-24 20:59:50 +01:00
4d760c2ca4 Emulator navigation now shows on all pages 2025-11-24 12:49:24 -05:00
76492b492b Added in an emulator for coding extensions
no more exiting the instance just to constantly reupload your extension to see if it works.
write many times, test once. :)
2025-11-24 12:47:33 -05:00
13 changed files with 1176 additions and 129 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "waifu-board", "name": "waifu-board",
"version": "v1.6.2", "version": "v1.6.3",
"description": "An image board app to store and browse your favorite waifus!", "description": "An image board app to store and browse your favorite waifus!",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@@ -1,22 +1,48 @@
let masonryTimer = null;
function scheduleMasonryRelayout(grid) {
clearTimeout(masonryTimer);
masonryTimer = setTimeout(() => {
relayoutMasonry(grid);
}, 50);
}
export function createImageCard(id, tags, imageUrl, thumbnailUrl, type, options = {}) { export function createImageCard(id, tags, imageUrl, thumbnailUrl, type, options = {}) {
const { const {
showMessage, showMessage,
showTagModal, showTagModal,
favoriteIds = new Set() favoriteIds = new Set()
} = options; } = options;
const card = document.createElement('div'); const card = document.createElement('div');
card.className = 'image-entry'; card.className = 'image-entry loading newly-added';
card.dataset.id = id; card.dataset.id = id;
card.dataset.type = type; card.dataset.type = type;
card.title = tags.join(', '); card.title = tags.join(', ');
const img = document.createElement('img'); const img = document.createElement('img');
img.src = thumbnailUrl || imageUrl; img.src = thumbnailUrl || imageUrl;
img.loading = 'lazy'; img.loading = 'lazy';
img.alt = tags.join(' '); img.alt = tags.join(' ');
img.onload = () => img.classList.add('loaded');
img.onload = () => {
img.classList.add('loaded');
card.classList.remove('loading');
if (type !== 'book') {
setTimeout(() => resizeMasonryItem(card), 20);
scheduleMasonryRelayout(card.parentElement);
}
setTimeout(() => {
card.classList.remove('newly-added');
}, 400);
};
img.onerror = () => {
card.classList.remove('loading');
img.classList.add('loaded');
};
card.appendChild(img); card.appendChild(img);
if (type === 'book') { if (type === 'book') {
@@ -30,7 +56,6 @@ export function createImageCard(id, tags, imageUrl, thumbnailUrl, type, options
<span>Click To Read</span> <span>Click To Read</span>
`; `;
card.appendChild(readOverlay); card.appendChild(readOverlay);
return card; return card;
} }
@@ -40,12 +65,12 @@ export function createImageCard(id, tags, imageUrl, thumbnailUrl, type, options
const favBtn = document.createElement('button'); const favBtn = document.createElement('button');
favBtn.className = 'heart-button'; favBtn.className = 'heart-button';
favBtn.dataset.id = id; favBtn.dataset.id = id;
const isFavorited = favoriteIds.has(String(id)); const isFavorited = favoriteIds.has(String(id));
updateHeartIcon(favBtn, isFavorited); updateHeartIcon(favBtn, isFavorited);
favBtn.onclick = async (e) => { favBtn.onclick = async (e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
const currentlyFavorited = favoriteIds.has(String(id)); const currentlyFavorited = favoriteIds.has(String(id));
@@ -99,6 +124,32 @@ export function createImageCard(id, tags, imageUrl, thumbnailUrl, type, options
return card; return card;
} }
function resizeMasonryItem(item) {
if (item.dataset.type === 'book') return;
const grid = item.parentElement;
const rowHeight = parseInt(getComputedStyle(grid).gridAutoRows);
const rowGap = parseInt(getComputedStyle(grid).gap);
const img = item.querySelector("img");
if (!img) return;
if (!img.complete || img.naturalWidth === 0) {
return;
}
const width = img.clientWidth;
const imageHeight = (img.naturalHeight / img.naturalWidth) * width;
const extra = 2;
const totalHeight = imageHeight + extra;
const rowSpan = Math.ceil((totalHeight + rowGap) / (rowHeight + rowGap));
item.style.gridRowEnd = "span " + rowSpan;
item.style.height = totalHeight + "px";
}
function updateHeartIcon(btn, isFavorited) { function updateHeartIcon(btn, isFavorited) {
if (isFavorited) { if (isFavorited) {
btn.innerHTML = `<svg viewBox="0 0 24 24" fill="#ef4444" stroke="#ef4444" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>`; btn.innerHTML = `<svg viewBox="0 0 24 24" fill="#ef4444" stroke="#ef4444" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>`;
@@ -109,6 +160,11 @@ function updateHeartIcon(btn, isFavorited) {
} }
} }
function relayoutMasonry(grid) {
const items = grid.querySelectorAll('.image-entry:not([data-type="book"])');
items.forEach(item => resizeMasonryItem(item));
}
export function populateTagModal(container, tags) { export function populateTagModal(container, tags) {
container.innerHTML = ''; container.innerHTML = '';
if (!tags || tags.length === 0) { if (!tags || tags.length === 0) {

306
src/emulator/emulator.js Normal file
View File

@@ -0,0 +1,306 @@
const CheerioShim = {
load: (html) => {
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
const $ = (selector, context) => {
let elements;
if (selector && selector.nodeType) {
elements = [selector];
} else if (Array.isArray(selector)) {
elements = selector;
} else {
const root = (context && context[0]) ? context[0] : (context || doc);
elements = Array.from(root.querySelectorAll ? root.querySelectorAll(selector) : []);
}
return createWrapper(elements);
};
function createWrapper(elements) {
elements.forEach((el, i) => elements[i] = el);
elements.attr = (name) => {
if (elements.length === 0) return undefined;
return elements[0].getAttribute ? elements[0].getAttribute(name) : null;
};
elements.text = () => {
return elements.map(el => el.textContent).join('');
};
elements.find = (selector) => {
let found = [];
elements.forEach(el => {
if (el.querySelectorAll) {
found = found.concat(Array.from(el.querySelectorAll(selector)));
}
});
return createWrapper(found);
};
elements.each = (callback) => {
elements.forEach((el, i) => {
callback(i, el);
});
return elements;
};
elements.map = (callback) => {
const results = elements.map((el, i) => callback(i, el));
return createWrapper(results.filter(r => r !== null && r !== undefined));
};
elements.get = () => Array.from(elements);
elements.filter = (selectorOrFn) => {
if (typeof selectorOrFn === 'function') {
return createWrapper(elements.filter(selectorOrFn));
}
return createWrapper(elements.filter(el => el.matches && el.matches(selectorOrFn)));
};
elements.first = () => createWrapper(elements.length ? [elements[0]] : []);
elements.last = () => createWrapper(elements.length ? [elements[elements.length - 1]] : []);
elements.eq = (i) => createWrapper(elements.length > i ? [elements[i]] : []);
return elements;
}
return $;
}
};
window.require = (moduleName) => {
if (moduleName === 'cheerio') return CheerioShim;
if (moduleName === 'node-fetch' || moduleName === 'fetch') return window.fetch.bind(window);
return {};
};
window.module = { exports: {} };
class MockBrowser {
constructor() {
}
async scrape(url, pageFn, options = {}) {
emulatorLog(`[Browser] Scraping: ${url}`, 'info');
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const html = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
return await this.executePageFn(pageFn, doc);
} catch (error) {
emulatorLog(`[Browser] Error: ${error.message}`, 'error');
if (error.name === 'TypeError' && error.message.includes('Failed to fetch')) {
emulatorLog('Tip: This looks like a CORS error. Ensure you have a "Allow CORS" extension enabled in your browser for testing.', 'warn');
}
throw error;
}
}
async executePageFn(pageFn, virtualDoc) {
const fnString = pageFn.toString();
const wrapper = new Function("document", `return (${fnString})();`);
return wrapper(virtualDoc);
}
}
const codeInput = document.getElementById('code-input');
const runBtn = document.getElementById('run-btn');
const outputVisual = document.getElementById('visual-container');
const outputJson = document.getElementById('json-content');
const outputConsole = document.getElementById('console-content');
const originalConsoleLog = console.log;
const originalConsoleError = console.error;
const originalConsoleWarn = console.warn;
function captureLogs() {
console.log = (...args) => {
originalConsoleLog(...args);
emulatorLog(args.map(a => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' '), 'info');
};
console.error = (...args) => {
originalConsoleError(...args);
emulatorLog(args.map(a => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' '), 'error');
};
console.warn = (...args) => {
originalConsoleWarn(...args);
emulatorLog(args.map(a => typeof a === 'object' ? JSON.stringify(a) : String(a)).join(' '), 'warn');
};
}
function emulatorLog(msg, type = 'info') {
const div = document.createElement('div');
div.className = `log-entry log-${type}`;
div.textContent = `[${new Date().toLocaleTimeString()}] ${msg}`;
outputConsole.appendChild(div);
outputConsole.scrollTop = outputConsole.scrollHeight;
}
window.switchTab = (tabName) => {
['visual', 'json', 'console'].forEach(t => {
document.getElementById(`output-${t}`).classList.add('hidden');
});
document.getElementById(`output-${tabName}`).classList.remove('hidden');
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
if (event && event.target) event.target.classList.add('active');
};
runBtn.addEventListener('click', async () => {
outputVisual.innerHTML = '';
outputJson.textContent = '';
outputConsole.innerHTML = '';
window.module.exports = {};
captureLogs();
const code = codeInput.value;
const functionName = document.getElementById('func-select').value;
const argInput = document.getElementById('arg-input').value;
const pageInput = parseInt(document.getElementById('page-input').value) || 1;
if (!code.trim()) {
alert("Please paste extension code first.");
return;
}
emulatorLog("--- Starting Execution ---");
try {
try {
new Function(code)();
} catch (e) {
throw new Error(`Syntax/Runtime Error in Extension Code: ${e.message}`);
}
const exports = window.module.exports;
const keys = Object.keys(exports);
if (keys.length === 0) throw new Error("No class found in module.exports. Did you add 'module.exports = { ClassName };'?");
const ExtensionClass = exports[keys[0]];
emulatorLog(`Loaded Class: ${keys[0]}`, 'info');
const browserInstance = new MockBrowser();
const extension = new ExtensionClass('node-fetch', 'cheerio', browserInstance);
if (typeof extension[functionName] !== 'function') {
throw new Error(`Function '${functionName}' not found in class '${keys[0]}'.`);
}
emulatorLog(`Calling ${functionName}('${argInput}', ${pageInput})...`);
document.querySelector('.loading-state').classList.remove('hidden');
let result;
if (functionName === 'fetchSearchResult') {
result = await extension.fetchSearchResult(argInput, pageInput);
} else if (functionName === 'fetchInfo') {
result = await extension.fetchInfo(argInput);
} else if (functionName === 'findChapters') {
result = await extension.findChapters(argInput);
} else if (functionName === 'findChapterPages') {
result = await extension.findChapterPages(argInput);
}
document.querySelector('.loading-state').classList.add('hidden');
emulatorLog("Data received. Rendering...", 'info');
renderJson(result);
renderVisuals(result, functionName);
if (result) switchTab('visual');
} catch (err) {
document.querySelector('.loading-state').classList.add('hidden');
emulatorLog(err.message, 'error');
console.error(err);
}
});
function renderJson(data) {
outputJson.textContent = JSON.stringify(data, null, 2);
}
function renderVisuals(data, type) {
outputVisual.innerHTML = '';
if (!data) {
outputVisual.innerHTML = '<div style="padding:1rem; color: #a1a1aa;">No data returned (null/undefined). Check Console for errors.</div>';
return;
}
if (type === 'fetchSearchResult') {
if (data.results && Array.isArray(data.results) && data.results.length > 0) {
data.results.forEach(item => {
const card = document.createElement('div');
card.className = 'visual-card';
const imgSrc = item.image || item.cover || item.sampleImageUrl || '';
card.innerHTML = `
<img src="${imgSrc}" onerror="this.onerror=null;this.src='https://via.placeholder.com/150?text=Error';">
<div class="title" title="${item.title || item.id}">
${item.title || ('ID: ' + item.id)}
</div>
`;
outputVisual.appendChild(card);
});
} else {
outputVisual.innerHTML = '<div style="padding:1rem">No results found in "results" array.</div>';
}
}
else if (type === 'findChapters') {
if (data.chapters && Array.isArray(data.chapters)) {
const list = document.createElement('div');
list.style.cssText = 'display: flex; flex-direction: column; width: 100%; gap: 5px;';
data.chapters.forEach(chap => {
const row = document.createElement('div');
row.className = 'visual-chapter';
row.style.cssText = 'padding: 10px; background: var(--bg-surface); border-radius: 4px;';
row.innerHTML = `<span style="color: var(--accent);">Ch. ${chap.chapter}</span> - ${chap.title} <br><small style="color:#666">${chap.id}</small>`;
list.appendChild(row);
});
outputVisual.appendChild(list);
} else {
outputVisual.innerHTML = '<div>No chapters found. Check JSON.</div>';
}
}
else if (type === 'findChapterPages') {
if (Array.isArray(data)) {
data.forEach(page => {
if(page.type === 'text') {
const div = document.createElement('div');
div.innerHTML = page.content;
div.style.cssText = 'background: #fff; color: #000; padding: 20px; border-radius: 8px; margin-bottom: 20px;';
outputVisual.appendChild(div);
} else {
const img = document.createElement('img');
img.src = page.url;
img.style.cssText = 'max-width: 100%; margin-bottom: 10px; border-radius: 4px;';
outputVisual.appendChild(img);
}
});
} else {
outputVisual.innerHTML = '<div>No pages array returned.</div>';
}
}
else if (type === 'fetchInfo') {
const container = document.createElement('div');
container.style.padding = '1rem';
if (data.fullImage) {
container.innerHTML += `<img src="${data.fullImage}" style="max-height: 300px; display: block; margin-bottom: 1rem;">`;
}
container.innerHTML += `<pre>${JSON.stringify(data, null, 2)}</pre>`;
outputVisual.appendChild(container);
}
}

View File

@@ -1,6 +1,6 @@
const Gitea_OWNER = 'ItsSkaiya'; const Gitea_OWNER = 'ItsSkaiya';
const Gitea_REPO = 'WaifuBoard'; const Gitea_REPO = 'WaifuBoard';
const CURRENT_VERSION = 'v1.6.2'; const CURRENT_VERSION = 'v1.6.3';
const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000; const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000;
let currentVersionDisplay; let currentVersionDisplay;

View File

@@ -40,6 +40,10 @@
</nav> </nav>
<nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;"> <nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;">
<a href="emulator.html" class="nav-button" title="Emulator">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-xml-icon lucide-code-xml"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
<span>Emulator</span>
</a>
<a href="marketplace.html" class="nav-button" title="Marketplace"> <a href="marketplace.html" class="nav-button" title="Marketplace">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg>
<span>Marketplace</span> <span>Marketplace</span>

102
views/emulator.html Normal file
View File

@@ -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>WaifuBoard Extension Emulator</title>
<link rel="stylesheet" href="styles/home.css">
<link rel="stylesheet" href="styles/emulator.css">
</head>
<body>
<aside class="sidebar">
<a href="index.html" class="nav-button" title="Image Boards">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="7" height="7"></rect>
<rect x="14" y="3" width="7" height="7"></rect>
<rect x="14" y="14" width="7" height="7"></rect>
<rect x="3" y="14" width="7" height="7"></rect>
</svg>
<span>Back To Home</span>
</a>
<button class="nav-button active" title="Emulator">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-xml-icon lucide-code-xml"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
<span>Emulator</span>
</button>
<button class="nav-button" title="Reset" onclick="window.location.reload()">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash2-icon lucide-trash-2"><path d="M10 11v6"/><path d="M14 11v6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M3 6h18"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
<span>Reset</span>
</button>
</aside>
<div class="main-wrapper">
<header class="top-header">
<h3>Extension Emulator</h3>
</header>
<div class="emulator-container">
<div class="editor-pane">
<div class="control-bar" style="background: transparent; border: none; padding: 0;">
<h4 style="margin:0">Extension Code</h4>
<span style="font-size: 0.8rem; color: var(--text-tertiary); margin-left: auto;">Paste your .js file
here</span>
</div>
<textarea id="code-input" class="code-editor" spellcheck="false"
placeholder="// Paste your extension class here..."></textarea>
</div>
<div class="preview-pane">
<div class="control-bar">
<div class="control-group">
<label>Function</label>
<select id="func-select" class="control-input">
<option value="fetchSearchResult">fetchSearchResult (Search)</option>
<option value="fetchInfo">fetchInfo (Image Details)</option>
<option value="findChapters">findChapters (Manga/Novel)</option>
<option value="findChapterPages">findChapterPages (Read)</option>
</select>
</div>
<div class="control-group">
<label>Query / ID / URL</label>
<input type="text" id="arg-input" class="control-input" value=""
placeholder="Search query or ID">
</div>
<div class="control-group" style="max-width: 80px;">
<label>Page</label>
<input type="number" id="page-input" class="control-input" value="1" min="1">
</div>
<button class="btn-run" id="run-btn">Run</button>
</div>
<div style="display: flex; flex-direction: column; flex: 1; overflow: hidden; position: relative;">
<div class="tabs">
<button class="tab-btn active" onclick="switchTab('visual')">Visual</button>
<button class="tab-btn" onclick="switchTab('json')">JSON</button>
<button class="tab-btn" onclick="switchTab('console')">Console</button>
</div>
<div id="output-visual" class="output-area">
<div class="loading-state hidden">Loading...</div>
<div id="visual-container"></div>
</div>
<div id="output-json" class="output-area hidden">
<pre id="json-content"></pre>
</div>
<div id="output-console" class="output-area hidden">
<div id="console-content"></div>
</div>
</div>
</div>
</div>
</div>
<script src="../src/emulator/emulator.js"></script>
</body>
</html>

View File

@@ -39,6 +39,10 @@
</nav> </nav>
<nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;"> <nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;">
<a href="emulator.html" class="nav-button" title="Emulator">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-xml-icon lucide-code-xml"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
<span>Emulator</span>
</a>
<a href="marketplace.html" class="nav-button" title="Marketplace"> <a href="marketplace.html" class="nav-button" title="Marketplace">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg>
<span>Marketplace</span> <span>Marketplace</span>

View File

@@ -43,6 +43,10 @@
</nav> </nav>
<nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;"> <nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;">
<a href="emulator.html" class="nav-button" title="Emulator">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-xml-icon lucide-code-xml"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
<span>Emulator</span>
</a>
<a href="marketplace.html" class="nav-button" title="Marketplace"> <a href="marketplace.html" class="nav-button" title="Marketplace">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg>
<span>Marketplace</span> <span>Marketplace</span>

View File

@@ -40,6 +40,10 @@
</nav> </nav>
<nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;"> <nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;">
<a href="emulator.html" class="nav-button" title="Emulator">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-xml-icon lucide-code-xml"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
<span>Emulator</span>
</a>
<a href="marketplace.html" class="nav-button active" title="Marketplace"> <a href="marketplace.html" class="nav-button active" title="Marketplace">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg>
<span>Marketplace</span> <span>Marketplace</span>

View File

@@ -39,6 +39,10 @@
</nav> </nav>
<nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;"> <nav style="display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto;">
<a href="emulator.html" class="nav-button" title="Emulator">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code-xml-icon lucide-code-xml"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="m14.5 4-5 16"/></svg>
<span>Emulator</span>
</a>
<a href="marketplace.html" class="nav-button" title="Marketplace"> <a href="marketplace.html" class="nav-button" title="Marketplace">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-puzzle-icon lucide-puzzle"><path d="M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg>
<span>Marketplace</span> <span>Marketplace</span>

View File

@@ -27,46 +27,96 @@
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
border-radius: var(--radius-md); border-radius: var(--radius-md);
} }
.back-btn-large:hover { .back-btn-large:hover {
color: var(--text-primary); color: var(--text-primary);
background: var(--bg-surface-hover); background: var(--bg-surface-hover);
} }
@media (max-width: 767px) {
.back-btn-large {
font-size: 0.95rem;
gap: 0.5rem;
padding: 0.4rem 0.8rem;
}
}
.book-layout-grid { .book-layout-grid {
display: grid; display: grid;
grid-template-columns: 300px 1fr; grid-template-columns: 300px 1fr;
gap: 3rem; gap: 3rem;
align-items: start; align-items: start;
} }
@media (max-width: 1024px) {
.book-layout-grid {
grid-template-columns: 250px 1fr;
gap: 2rem;
}
}
@media (max-width: 767px) {
.book-layout-grid {
grid-template-columns: 1fr;
gap: 1.5rem;
}
}
.book-left-col { .book-left-col {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.5rem; gap: 1.5rem;
position: sticky; }
top: 20px;
@media (min-width: 768px) {
.book-left-col {
position: sticky;
top: 20px;
}
}
@media (max-width: 767px) {
.book-left-col {
flex-direction: row;
align-items: flex-start;
gap: 1rem;
}
} }
.book-poster-large { .book-poster-large {
width: 100%; width: 100%;
border-radius: var(--radius-lg); border-radius: var(--radius-lg);
box-shadow: 0 15px 40px rgba(0,0,0,0.6); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
aspect-ratio: 2/3; aspect-ratio: 2 / 3;
object-fit: cover; object-fit: cover;
border: 1px solid var(--border); border: 1px solid var(--border);
background: #111; background: #111;
}
@media (max-width: 767px) {
.book-poster-large {
width: 120px;
flex-shrink: 0;
}
} }
.book-title-sidebar { .book-title-sidebar {
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 700; font-weight: 700;
line-height: 1.3; line-height: 1.3;
margin: 0; margin: 0;
color: var(--text-primary); color: var(--text-primary);
text-align: center; text-align: center;
word-wrap: break-word; word-wrap: break-word;
} }
@media (max-width: 767px) {
.book-title-sidebar {
font-size: 1.2rem;
text-align: left;
}
}
.book-chapters-column { .book-chapters-column {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -90,11 +140,43 @@
cursor: pointer; cursor: pointer;
transition: background 0.2s; transition: background 0.2s;
} }
.chapter-row:last-child { border-bottom: none; }
.chapter-row:hover { background: var(--bg-surface-hover); }
.chapter-main-text { font-weight: 600; font-size: 1rem; color: var(--text-primary); } .chapter-row:last-child {
.chapter-sub-text { font-size: 0.9rem; color: var(--text-tertiary); } border-bottom: none;
}
.chapter-row:hover {
background: var(--bg-surface-hover);
}
@media (max-width: 767px) {
.chapter-row {
padding: 0.75rem 1rem;
flex-direction: column;
align-items: flex-start;
gap: 0.25rem;
}
}
.chapter-main-text {
font-weight: 600;
font-size: 1rem;
color: var(--text-primary);
}
.chapter-sub-text {
font-size: 0.9rem;
color: var(--text-tertiary);
}
@media (max-width: 767px) {
.chapter-main-text {
font-size: 0.9rem;
}
.chapter-sub-text {
font-size: 0.8rem;
}
}
.pagination-bar { .pagination-bar {
display: flex; display: flex;
@@ -103,7 +185,9 @@
gap: 1.5rem; gap: 1.5rem;
margin-top: 1rem; margin-top: 1rem;
padding-top: 1rem; padding-top: 1rem;
flex-wrap: wrap;
} }
.page-btn { .page-btn {
background: var(--bg-surface); background: var(--bg-surface);
border: 1px solid var(--border); border: 1px solid var(--border);
@@ -114,16 +198,46 @@
font-weight: 500; font-weight: 500;
transition: 0.2s; transition: 0.2s;
} }
.page-btn:hover:not(:disabled) { background: var(--bg-surface-hover); border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#reader-view { .page-btn:hover:not(:disabled) {
position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-surface-hover);
z-index: 200; background: #0d0d0d; overflow-y: auto; border-color: var(--accent);
display: flex; flex-direction: column; align-items: center; padding-top: 60px;
} }
.reader-page-img { max-width: 100%; width: auto; display: block; margin-bottom: 0; box-shadow: 0 0 20px rgba(0,0,0,0.5); } .page-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
@media (max-width: 767px) {
.page-btn {
padding: 0.4rem 1rem;
font-size: 0.9rem;
}
}
#reader-view {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 200;
background: #0d0d0d;
overflow-y: auto;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 60px;
}
.reader-page-img {
max-width: 100%;
width: auto;
display: block;
margin-bottom: 0;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
.reader-text-content { .reader-text-content {
max-width: 900px; max-width: 900px;
@@ -132,44 +246,68 @@
font-size: 1.1rem; font-size: 1.1rem;
line-height: 1.8; line-height: 1.8;
padding: 2rem; padding: 2rem;
background: #18181b; background: #18181b;
margin-bottom: 4rem; margin-bottom: 4rem;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 4px 20px rgba(0,0,0,0.5); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
} }
.reader-text-content p { .reader-text-content p {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }
@media (max-width: 767px) {
.reader-text-content {
font-size: 1rem;
line-height: 1.7;
padding: 1.5rem;
width: 100%;
border-radius: 0;
}
}
.reader-close-btn { .reader-close-btn {
position: fixed; top: 20px; left: 20px; z-index: 210; position: fixed;
background: rgba(0,0,0,0.8); color: white; border: 1px solid rgba(255,255,255,0.2); top: 20px;
padding: 10px 20px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; backdrop-filter: blur(4px); left: 20px;
} z-index: 210;
.reader-close-btn:hover { background: var(--accent); border-color: var(--accent); } background: rgba(0, 0, 0, 0.8);
color: white;
.loading-state { text-align: center; padding: 4rem; color: var(--text-tertiary); } border: 1px solid rgba(255, 255, 255, 0.2);
padding: 10px 20px;
.image-entry[data-type="book"] { border-radius: 8px;
aspect-ratio: 2/3;
background: #1a1a1a;
display: block;
position: relative;
cursor: pointer; cursor: pointer;
overflow: hidden; display: flex;
align-items: center;
gap: 8px;
font-weight: 600;
backdrop-filter: blur(4px);
} }
.image-entry[data-type="book"] img { .reader-close-btn:hover {
width: 100%; background: var(--accent);
height: 100%; border-color: var(--accent);
object-fit: cover;
object-position: center top;
transition: filter 0.3s ease, transform 0.3s ease;
} }
.image-entry[data-type="book"]:hover img { @media (max-width: 767px) {
filter: blur(4px) brightness(0.7); .reader-close-btn {
transform: scale(1.05); top: 10px;
left: 10px;
padding: 8px 16px;
font-size: 0.9rem;
}
}
.loading-state {
text-align: center;
padding: 4rem;
color: var(--text-tertiary);
}
@media (max-width: 767px) {
.loading-state {
padding: 2rem 1rem;
}
} }
.book-read-overlay { .book-read-overlay {
@@ -182,7 +320,7 @@
gap: 0.5rem; gap: 0.5rem;
opacity: 0; opacity: 0;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
pointer-events: none; pointer-events: none;
color: white; color: white;
z-index: 10; z-index: 10;
} }
@@ -196,11 +334,11 @@
font-size: 1.1rem; font-size: 1.1rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
text-shadow: 0 2px 4px rgba(0,0,0,0.8); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
} }
.book-read-overlay svg { .book-read-overlay svg {
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
color: var(--accent); color: var(--accent);
} }
@@ -208,7 +346,77 @@
content: ""; content: "";
position: absolute; position: absolute;
inset: 0; inset: 0;
border: 1px solid rgba(255,255,255,0.1); border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: inherit; border-radius: inherit;
pointer-events: none; pointer-events: none;
}
.gallery-masonry .image-entry[data-type="book"] {
grid-row-end: span 1 !important;
aspect-ratio: 2 / 3 !important;
position: relative !important;
contain: layout style !important;
}
.gallery-masonry .image-entry[data-type="book"]::before {
content: "";
display: block;
padding-top: 150% !important;
}
.gallery-masonry .image-entry[data-type="book"] img {
position: absolute !important;
inset: 0 !important;
width: 100% !important;
height: 100% !important;
object-fit: cover !important;
}
.gallery-masonry:has(.image-entry[data-type="book"]) {
grid-auto-rows: 1fr !important;
}
.gallery-masonry.books-only .image-entry[data-type="book"],
.gallery-masonry .image-entry[data-type="book"] {
aspect-ratio: 2 / 3;
height: auto;
grid-row-end: span 1 !important;
contain: layout style;
background: var(--bg-surface);
border-radius: var(--radius-md);
overflow: hidden;
position: relative;
cursor: pointer;
transition: transform 0.2s;
}
.gallery-masonry .image-entry[data-type="book"]::before {
content: "";
display: block;
padding-top: 150%;
}
.gallery-masonry .image-entry[data-type="book"] img {
position: absolute;
top: 0; left: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center top;
transition: all 0.3s ease;
}
.gallery-masonry .image-entry[data-type="book"] img:not(.loaded) {
background: linear-gradient(90deg, #18181b 0%, #27272a 50%, #18181b 100%);
background-size: 200% 100%;
animation: shimmer 1.8s infinite;
opacity: 1;
}
.gallery-masonry .image-entry[data-type="book"]:hover img {
filter: brightness(0.7) blur(2px);
transform: scale(1.08);
}
.gallery-masonry .image-entry[data-type="book"]:hover .book-read-overlay {
opacity: 1;
} }

196
views/styles/emulator.css Normal file
View File

@@ -0,0 +1,196 @@
.emulator-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
height: calc(100vh - var(--header-height));
padding: 1rem 2rem 2rem 2rem;
overflow: hidden;
}
.editor-pane,
.preview-pane {
display: flex;
flex-direction: column;
gap: 1rem;
height: 100%;
overflow: hidden;
}
.code-editor {
flex: 1;
background: var(--bg-sidebar);
border: 1px solid var(--border);
border-radius: var(--radius-md);
color: #d4d4d8;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 14px;
padding: 1rem;
resize: none;
line-height: 1.5;
tab-size: 4;
}
.code-editor:focus {
border-color: var(--accent);
box-shadow: 0 0 0 1px var(--accent-glow);
}
.control-bar {
display: flex;
gap: 0.5rem;
background: var(--bg-surface);
padding: 1rem;
border-radius: var(--radius-md);
border: 1px solid var(--border);
align-items: center;
flex-wrap: wrap;
}
.control-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
flex: 1;
}
.control-group label {
font-size: 0.75rem;
color: var(--text-secondary);
border: none;
padding: 0;
margin: 0;
}
.control-input {
background: var(--bg-base);
border: 1px solid var(--border);
color: var(--text-primary);
padding: 0.5rem;
border-radius: var(--radius-md);
font-size: 0.9rem;
width: 100%;
}
.btn-run {
background: var(--accent);
color: white;
border: none;
padding: 0.6rem 1.5rem;
border-radius: var(--radius-md);
font-weight: 600;
cursor: pointer;
height: 40px;
align-self: flex-end;
transition: 0.2s;
}
.btn-run:hover {
opacity: 0.9;
transform: translateY(-1px);
}
.tabs {
display: flex;
gap: 0.5rem;
border-bottom: 1px solid var(--border);
margin-bottom: 0.5rem;
}
.tab-btn {
background: transparent;
border: none;
color: var(--text-secondary);
padding: 0.5rem 1rem;
cursor: pointer;
border-bottom: 2px solid transparent;
font-weight: 500;
}
.tab-btn.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
.output-area {
flex: 1;
background: var(--bg-sidebar);
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: auto;
padding: 1rem;
position: relative;
}
pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
color: #a5b4fc;
}
.visual-card {
display: inline-flex;
flex-direction: column;
width: 150px;
margin: 0.5rem;
background: var(--bg-surface);
border-radius: var(--radius-md);
overflow: hidden;
border: 1px solid var(--border);
vertical-align: top;
}
.visual-card img {
width: 100%;
height: 200px;
object-fit: cover;
background: #27272a;
}
.visual-card .title {
padding: 0.5rem;
font-size: 0.8rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.visual-chapter {
padding: 0.5rem;
border-bottom: 1px solid var(--border);
cursor: pointer;
}
.visual-chapter:hover {
background: var(--bg-surface-hover);
}
.log-entry {
font-family: monospace;
border-bottom: 1px solid var(--border);
padding: 2px 0;
}
.log-info {
color: #60a5fa;
}
.log-warn {
color: #facc15;
}
.log-error {
color: #f87171;
}
.loading-state {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--text-secondary);
}
.loading-state.hidden {
display: none;
}

View File

@@ -1,28 +1,19 @@
:root { :root {
--bg-base: #09090b; --bg-base: #09090b;
--bg-sidebar: #101012; --bg-sidebar: #101012;
--bg-surface: #18181b; --bg-surface: #18181b;
--bg-surface-hover: #27272a; --bg-surface-hover: #27272a;
--accent: #8b5cf6; --accent: #8b5cf6;
--accent-glow: rgba(139, 92, 246, 0.3); --accent-glow: rgba(139, 92, 246, 0.3);
--accent-gradient: linear-gradient(135deg, #8b5cf6, #6366f1); --accent-gradient: linear-gradient(135deg, #8b5cf6, #6366f1);
--text-primary: #f4f4f5; --text-primary: #f4f4f5;
--text-secondary: #a1a1aa; --text-secondary: #a1a1aa;
--text-tertiary: #52525b; --text-tertiary: #52525b;
--border: #27272a; --border: #27272a;
--border-hover: #3f3f46; --border-hover: #3f3f46;
--radius-md: 8px; --radius-md: 8px;
--radius-lg: 16px; --radius-lg: 16px;
--radius-full: 9999px; --radius-full: 9999px;
--sidebar-width-collapsed: 72px; --sidebar-width-collapsed: 72px;
--sidebar-width-expanded: 240px; --sidebar-width-expanded: 240px;
--header-height: 70px; --header-height: 70px;
@@ -40,13 +31,12 @@ body {
padding: 0; padding: 0;
background-color: var(--bg-base); background-color: var(--bg-base);
color: var(--text-primary); color: var(--text-primary);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
height: 100vh; height: 100vh;
display: flex; display: flex;
overflow: hidden; overflow: hidden;
} }
.sidebar { .sidebar {
width: var(--sidebar-width-collapsed); width: var(--sidebar-width-collapsed);
background: var(--bg-sidebar); background: var(--bg-sidebar);
@@ -64,15 +54,22 @@ body {
width: var(--sidebar-width-expanded); width: var(--sidebar-width-expanded);
} }
@media (max-width: 767px) {
.sidebar {
width: 60px;
padding: 1rem 0.5rem;
}
}
.main-wrapper { .main-wrapper {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
position: relative; position: relative;
min-width: 0;
} }
.brand-logo { .brand-logo {
height: 48px; height: 48px;
display: flex; display: flex;
@@ -102,7 +99,6 @@ body {
} }
.nav-button { .nav-button {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0.85rem; padding: 0.85rem;
@@ -128,7 +124,6 @@ body {
color: var(--accent); color: var(--accent);
} }
.nav-button svg { .nav-button svg {
min-width: 24px; min-width: 24px;
width: 24px; width: 24px;
@@ -136,7 +131,22 @@ body {
margin-right: 1rem; margin-right: 1rem;
} }
a, a:visited, a:hover, a:active { @media (max-width: 767px) {
.nav-button {
padding: 0.7rem;
}
.nav-button svg {
min-width: 20px;
width: 20px;
height: 20px;
margin-right: 0;
}
}
a,
a:visited,
a:hover,
a:active {
text-decoration: none; text-decoration: none;
} }
@@ -151,7 +161,6 @@ a, a:visited, a:hover, a:active {
transform: translateX(0); transform: translateX(0);
} }
.top-header { .top-header {
height: var(--header-height); height: var(--header-height);
display: flex; display: flex;
@@ -163,12 +172,17 @@ a, a:visited, a:hover, a:active {
z-index: 40; z-index: 40;
} }
@media (max-width: 767px) {
.top-header {
height: 60px;
padding: 0 1rem;
}
}
.search-box { .search-box {
display: contents; display: contents;
} }
#search-input { #search-input {
background: var(--bg-surface); background: var(--bg-surface);
border: 1px solid var(--border); border: 1px solid var(--border);
@@ -185,6 +199,20 @@ a, a:visited, a:hover, a:active {
box-shadow: 0 0 0 2px var(--accent-glow); box-shadow: 0 0 0 2px var(--accent-glow);
} }
@media (max-width: 767px) {
#search-input {
width: 100%;
max-width: 350px;
font-size: 0.85rem;
}
}
@media (max-width: 480px) {
#search-input {
width: calc(100vw - 80px);
max-width: 300px;
}
}
.content-view { .content-view {
flex: 1; flex: 1;
@@ -192,8 +220,13 @@ a, a:visited, a:hover, a:active {
padding: 0 2rem 2rem 2rem; padding: 0 2rem 2rem 2rem;
} }
.page { @media (max-width: 767px) {
.content-view {
padding: 0 1rem 2rem 1rem;
}
}
.page {
max-width: 1600px; max-width: 1600px;
margin: 0 auto; margin: 0 auto;
animation: fadeIn 0.3s ease-out; animation: fadeIn 0.3s ease-out;
@@ -204,56 +237,64 @@ a, a:visited, a:hover, a:active {
opacity: 0; opacity: 0;
transform: translateY(10px); transform: translateY(10px);
} }
to { to {
opacity: 1; opacity: 1;
transform: translateY(0); transform: translateY(0);
} }
} }
#source-list { #source-list {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
overflow-x: auto;
padding-bottom: 1rem; padding-bottom: 1rem;
scrollbar-width: none; scrollbar-width: none;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
scroll-behavior: smooth;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
} }
#source-list::-webkit-scrollbar { #source-list::-webkit-scrollbar {
display: none; height: 6px;
}
#source-list::-webkit-scrollbar-track {
background: transparent;
}
#source-list::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 3px;
}
#source-list::-webkit-scrollbar-thumb:hover {
background: var(--border-hover);
}
@media (max-width: 767px) {
#source-list {
gap: 0.75rem;
}
} }
.source-button { .source-button {
background: var(--bg-surface); background: var(--bg-surface);
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: var(--radius-md); border-radius: var(--radius-md);
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1rem; gap: 1rem;
padding: 0.75rem 1rem; padding: 0.75rem 1rem;
min-width: 200px; min-width: 200px;
width: auto; width: auto;
height: auto; height: auto;
cursor: pointer; cursor: pointer;
transition: all 0.2s; transition: all 0.2s;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
text-align: left; text-align: left;
flex-shrink: 0;
} }
.source-button:hover { .source-button:hover {
@@ -269,6 +310,13 @@ a, a:visited, a:hover, a:active {
color: var(--text-primary); color: var(--text-primary);
} }
@media (max-width: 767px) {
.source-button {
min-width: 160px;
padding: 0.6rem 0.8rem;
gap: 0.75rem;
}
}
.source-button img, .source-button img,
.source-button .brand-icon { .source-button .brand-icon {
@@ -277,9 +325,15 @@ a, a:visited, a:hover, a:active {
border-radius: 6px; border-radius: 6px;
object-fit: cover; object-fit: cover;
flex-shrink: 0; flex-shrink: 0;
} }
@media (max-width: 767px) {
.source-button img,
.source-button .brand-icon {
width: 28px;
height: 28px;
}
}
.source-text-wrapper { .source-text-wrapper {
display: flex; display: flex;
@@ -301,38 +355,56 @@ a, a:visited, a:hover, a:active {
.source-url { .source-url {
font-size: 0.75rem; font-size: 0.75rem;
color: var(--text-tertiary); color: var(--text-tertiary);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
@media (max-width: 767px) {
.source-name {
font-size: 0.85rem;
}
.source-url {
font-size: 0.7rem;
}
}
.gallery-masonry { .gallery-masonry {
column-count: 2; display: grid;
column-gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 1rem;
}
.gallery-masonry:not(.books-only) {
grid-auto-rows: 8px;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.gallery-masonry { .gallery-masonry {
column-count: 3; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
} }
} }
@media (min-width: 1024px) { @media (min-width: 1024px) {
.gallery-masonry { .gallery-masonry {
column-count: 4; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
} }
} }
@media (min-width: 1400px) { @media (min-width: 1400px) {
.gallery-masonry { .gallery-masonry {
column-count: 5; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
} }
} }
.image-entry { @media (max-width: 480px) {
margin-bottom: 1rem; .gallery-masonry {
grid-template-columns: 1fr;
}
}
.image-entry:not([data-type="book"]) {
margin-bottom: 0;
border-radius: var(--radius-md); border-radius: var(--radius-md);
overflow: hidden; overflow: hidden;
position: relative; position: relative;
@@ -342,34 +414,30 @@ a, a:visited, a:hover, a:active {
cursor: zoom-in; cursor: zoom-in;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
} }
.image-entry:hover { .image-entry:not([data-type="book"]):hover {
transform: scale(1.02); transform: scale(1.02);
z-index: 2; z-index: 2;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
} }
@media (max-width: 767px) {
.image-entry:hover {
transform: none;
}
}
.image-entry img { .image-entry img {
width: 100%; width: 100%;
height: auto; height: auto;
display: block; aspect-ratio: auto;
opacity: 0;
transition: opacity 0.3s;
} }
.image-entry img.loaded { .image-entry img.loaded {
opacity: 1; opacity: 1;
} }
.image-entry img:not(.loaded) {
opacity: 1;
}
.image-buttons { .image-buttons {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@@ -383,17 +451,20 @@ a, a:visited, a:hover, a:active {
opacity: 0; opacity: 0;
transition: 0.2s; transition: 0.2s;
top: auto; top: auto;
right: auto; right: auto;
flex-direction: row; flex-direction: row;
} }
.image-entry:hover .image-buttons { .image-entry:hover .image-buttons {
opacity: 1; opacity: 1;
} }
@media (max-width: 767px) {
.image-buttons {
opacity: 0.6;
padding: 1.5rem 0.75rem 0.75rem 0.75rem;
}
}
.image-buttons button { .image-buttons button {
width: 32px; width: 32px;
@@ -409,7 +480,6 @@ a, a:visited, a:hover, a:active {
cursor: pointer; cursor: pointer;
transition: 0.2s; transition: 0.2s;
padding: 0; padding: 0;
} }
.image-buttons button:hover { .image-buttons button:hover {
@@ -422,6 +492,16 @@ a, a:visited, a:hover, a:active {
height: 16px; height: 16px;
} }
@media (max-width: 767px) {
.image-buttons button {
width: 36px;
height: 36px;
}
.image-buttons button svg {
width: 18px;
height: 18px;
}
}
.settings-grid { .settings-grid {
display: grid; display: grid;
@@ -429,6 +509,13 @@ a, a:visited, a:hover, a:active {
gap: 1.5rem; gap: 1.5rem;
} }
@media (max-width: 640px) {
.settings-grid {
grid-template-columns: 1fr;
gap: 1rem;
}
}
.settings-card { .settings-card {
background: var(--bg-surface); background: var(--bg-surface);
border: 1px solid var(--border); border: 1px solid var(--border);
@@ -436,6 +523,12 @@ a, a:visited, a:hover, a:active {
padding: 1.5rem; padding: 1.5rem;
} }
@media (max-width: 767px) {
.settings-card {
padding: 1rem;
}
}
.settings-card h3 { .settings-card h3 {
margin-top: 0; margin-top: 0;
font-size: 1.1rem; font-size: 1.1rem;
@@ -443,7 +536,6 @@ a, a:visited, a:hover, a:active {
color: var(--text-primary); color: var(--text-primary);
} }
fieldset { fieldset {
border: none; border: none;
padding: 0; padding: 0;
@@ -473,7 +565,6 @@ input[type="radio"] {
height: 1.2em; height: 1.2em;
} }
.hidden { .hidden {
display: none !important; display: none !important;
} }
@@ -488,7 +579,11 @@ input[type="radio"] {
gap: 1rem; gap: 1rem;
} }
@media (max-width: 767px) {
.loading-state {
padding: 2rem 1rem;
}
}
#tag-info-modal { #tag-info-modal {
position: fixed; position: fixed;
@@ -499,14 +594,14 @@ input[type="radio"] {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 1rem;
} }
#tag-info-modal.hidden { #tag-info-modal.hidden {
display: none; display: none;
} }
#tag-info-modal>div { #tag-info-modal > div {
background: var(--bg-surface); background: var(--bg-surface);
border: 1px solid var(--border); border: 1px solid var(--border);
padding: 2rem; padding: 2rem;
@@ -515,6 +610,15 @@ input[type="radio"] {
max-width: 500px; max-width: 500px;
position: relative; position: relative;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
max-height: 80vh;
overflow-y: auto;
}
@media (max-width: 767px) {
#tag-info-modal > div {
padding: 1.5rem;
width: 95%;
}
} }
#tag-info-close-button { #tag-info-close-button {
@@ -525,6 +629,12 @@ input[type="radio"] {
border: none; border: none;
color: var(--text-tertiary); color: var(--text-tertiary);
cursor: pointer; cursor: pointer;
font-size: 1.5rem;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
} }
.tag-cloud { .tag-cloud {
@@ -534,7 +644,6 @@ input[type="radio"] {
margin-top: 1rem; margin-top: 1rem;
} }
#tag-info-content span { #tag-info-content span {
background: var(--bg-surface-hover); background: var(--bg-surface-hover);
border: 1px solid var(--border); border: 1px solid var(--border);
@@ -544,7 +653,6 @@ input[type="radio"] {
font-size: 0.8rem; font-size: 0.8rem;
} }
.toast { .toast {
position: fixed; position: fixed;
bottom: 2rem; bottom: 2rem;
@@ -561,6 +669,18 @@ input[type="radio"] {
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
transition: 0.3s; transition: 0.3s;
max-width: calc(100vw - 4rem);
}
@media (max-width: 767px) {
.toast {
bottom: 1rem;
right: 1rem;
left: 1rem;
max-width: none;
padding: 0.75rem 1rem;
font-size: 0.9rem;
}
} }
.toast:not(.hidden) { .toast:not(.hidden) {
@@ -573,4 +693,43 @@ input[type="radio"] {
transform: translateY(0); transform: translateY(0);
opacity: 1; opacity: 1;
pointer-events: all; pointer-events: all;
}
#gallery-placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
padding: 4rem 1rem;
break-inside: avoid;
column-span: all;
}
#gallery-placeholder p {
max-width: 300px;
text-align: center;
white-space: normal;
margin: 0;
}
.image-entry img.loaded {
opacity: 1;
transition: opacity 0.3s ease-in;
min-height: unset;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.image-entry.newly-added {
animation: fadeInUp 0.4s ease-out;
} }