Merge branch 'dev'
This commit is contained in:
+33
-2
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>CZ účty na Mastodonu – Mamutovo</title>
|
||||
<script>if(localStorage.getItem('theme')==='light')document.documentElement.classList.add('light');</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;700;800&display=swap');
|
||||
|
||||
@@ -20,7 +21,22 @@
|
||||
--muted2: #555;
|
||||
--border: #282828;
|
||||
--radius: 10px;
|
||||
--nav-bg: rgba(13,13,13,0.9);
|
||||
}
|
||||
html.light {
|
||||
--bg: #ffffff;
|
||||
--surface: #f8f8f8;
|
||||
--surface2: #f0f0f0;
|
||||
--surface3: #e8e8e8;
|
||||
--border: #e0e0e0;
|
||||
--text: #1a1a1a;
|
||||
--muted: #666666;
|
||||
--muted2: #999999;
|
||||
--accent: #06b6d4;
|
||||
--nav-bg: rgba(245,245,245,0.9);
|
||||
}
|
||||
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; line-height: 1; flex-shrink: 0; color: var(--text); transition: border-color .15s; }
|
||||
.theme-toggle:hover { border-color: var(--accent); }
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
@@ -38,7 +54,7 @@ nav {
|
||||
justify-content: space-between;
|
||||
padding: 1rem 2rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: rgba(13,13,13,0.9);
|
||||
background: var(--nav-bg);
|
||||
backdrop-filter: blur(10px);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@@ -303,6 +319,11 @@ select:focus { border-color: var(--accent); }
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
.card-avatar {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
border-color: var(--accent);
|
||||
@@ -566,6 +587,7 @@ select:focus { border-color: var(--accent); }
|
||||
}
|
||||
|
||||
.site-footer-inner a:hover { color: var(--accent); }
|
||||
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:1000;align-items:center;justify-content:center} .modal-overlay.active{display:flex} .modal-card{background:var(--surface);border-radius:16px;max-width:420px;width:90%;overflow:hidden;position:relative} .modal-close{position:absolute;top:.75rem;right:.75rem;background:none;border:none;color:var(--muted);font-size:1.2rem;cursor:pointer} .modal-header{position:relative;height:120px;background:var(--surface2)} .modal-header-img{width:100%;height:120px;object-fit:cover} .modal-avatar{width:72px;height:72px;border-radius:12px;border:3px solid var(--surface);position:absolute;bottom:-36px;left:1.2rem} .modal-body{padding:2.5rem 1.2rem 1.2rem} .modal-name{font-size:1.2rem;font-weight:700;color:var(--text)} .modal-handle{color:var(--muted);font-size:.85rem;margin-bottom:.5rem} .modal-bio{color:var(--muted);font-size:.9rem;margin-bottom:.75rem;line-height:1.5} .modal-tags{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.75rem} .modal-stats{display:flex;gap:1.5rem}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -576,6 +598,7 @@ select:focus { border-color: var(--accent); }
|
||||
<a href="start.html">← Průvodce</a>
|
||||
<a href="accounts.html" class="active">CZ účty</a>
|
||||
</div>
|
||||
<button id="theme-toggle" class="theme-toggle" onclick="toggleTheme()" aria-label="Přepnout téma">🌙</button>
|
||||
<span class="nav-updated"><span id="lastUpdated">načítám...</span><span id="refreshCountdown" style="margin-left:0.4rem;color:var(--muted2);font-size:0.65rem;font-family:'Space Mono',monospace;"></span><span id="refreshBadge" style="margin-left:0.5rem;font-size:0.65rem;font-family:'Space Mono',monospace;transition:color 0.3s;"></span></span>
|
||||
</nav>
|
||||
|
||||
@@ -629,6 +652,13 @@ select:focus { border-color: var(--accent); }
|
||||
<div class="empty" id="emptyEl">Žádné účty neodpovídají filtru. Zkus jiný výraz.</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const light = document.documentElement.classList.toggle('light');
|
||||
localStorage.setItem('theme', light ? 'light' : 'dark');
|
||||
document.getElementById('theme-toggle').textContent = light ? '☀️' : '🌙';
|
||||
}
|
||||
if (localStorage.getItem('theme') === 'light') document.getElementById('theme-toggle').textContent = '☀️';
|
||||
|
||||
// ────────────────────────────────
|
||||
// DATA – fallback když není JSON
|
||||
// ────────────────────────────────
|
||||
@@ -857,7 +887,7 @@ function cardHTML(a, idx) {
|
||||
<a class="card-link" href="${a.url}" target="_blank" rel="noopener noreferrer" aria-label="Profil ${a.name}"></a>
|
||||
<div class="card-header">
|
||||
${a.header ? `<img class="card-header-img" src="${a.header}" alt="">` : ''}
|
||||
<img class="card-avatar" src="${av}" alt="" onerror="this.src='${avatarFallback(a.name)}'">
|
||||
<img class="card-avatar" src="${av}" alt="" onclick="event.stopPropagation();openModal(filtered[${idx}])" onerror="this.src='${avatarFallback(a.name)}'">
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-name">${a.name}</div>
|
||||
@@ -1119,5 +1149,6 @@ loadAccounts();
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<div id="profile-modal" class="modal-overlay" onclick="closeModal()"><div class="modal-card" onclick="event.stopPropagation()"><button class="modal-close" onclick="closeModal()">✕</button><div class="modal-header"><img id="modal-header-img" class="modal-header-img" src="" alt="" style="display:none"><img id="modal-avatar" class="modal-avatar" src="" alt=""></div><div class="modal-body"><div id="modal-name" class="modal-name"></div><div id="modal-handle" class="modal-handle"></div><div id="modal-bio" class="modal-bio"></div><div id="modal-tags" class="modal-tags"></div><div class="modal-stats"><div class="stat"><span id="modal-followers" class="stat-val"></span><span class="stat-label">Sledující</span></div><div class="stat"><span id="modal-statuses" class="stat-val"></span><span class="stat-label">Postů</span></div></div><a id="modal-follow" href="" target="_blank" class="follow-btn" style="margin-top:1rem;display:inline-block">+ Sledovat</a></div></div></div><script>function openModal(a){const av=a.avatar||avatarFallback(a.name);document.getElementById('modal-avatar').src=av;document.getElementById('modal-avatar').onerror=function(){this.src=avatarFallback(a.name);};const hi=document.getElementById('modal-header-img');if(a.header){hi.src=a.header;hi.style.display='block';}else{hi.style.display='none';}document.getElementById('modal-name').textContent=a.name;document.getElementById('modal-handle').textContent='@'+a.handle;document.getElementById('modal-bio').textContent=a.bio||'';document.getElementById('modal-tags').innerHTML=(a.tags||[]).map(t=>`<span class="card-tag">#${t}</span>`).join('');document.getElementById('modal-followers').textContent=fmt(a.followers);document.getElementById('modal-statuses').textContent=fmt(a.statuses);document.getElementById('modal-follow').href=followUrl(a.handle);document.getElementById('profile-modal').classList.add('active');document.body.style.overflow='hidden';}function closeModal(){document.getElementById('profile-modal').classList.remove('active');document.body.style.overflow='';}document.addEventListener('keydown',e=>{if(e.key==='Escape')closeModal();});</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Aplikace – Mamutovo</title>
|
||||
<script>if(localStorage.getItem('theme')==='light')document.documentElement.classList.add('light');</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;700;800&display=swap');
|
||||
|
||||
@@ -21,6 +22,19 @@
|
||||
--border: #282828;
|
||||
--radius: 10px;
|
||||
}
|
||||
html.light {
|
||||
--bg: #ffffff;
|
||||
--surface: #f8f8f8;
|
||||
--surface2: #f0f0f0;
|
||||
--surface3: #e8e8e8;
|
||||
--border: #e0e0e0;
|
||||
--text: #1a1a1a;
|
||||
--muted: #666666;
|
||||
--muted2: #999999;
|
||||
--accent: #06b6d4;
|
||||
}
|
||||
.theme-toggle { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; line-height: 1; position: fixed; top: 1rem; right: 1rem; z-index: 200; transition: border-color .15s; }
|
||||
.theme-toggle:hover { border-color: var(--accent); }
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
@@ -278,6 +292,7 @@ h1 span { color: var(--accent); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button id="theme-toggle" class="theme-toggle" onclick="toggleTheme()" aria-label="Přepnout téma">🌙</button>
|
||||
|
||||
<div class="header">
|
||||
<a href="https://fedi.mamutovo.cz" class="badge">🦣 MAMUTOVO · APLIKACE</a>
|
||||
@@ -485,6 +500,13 @@ h1 span { color: var(--accent); }
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const light = document.documentElement.classList.toggle('light');
|
||||
localStorage.setItem('theme', light ? 'light' : 'dark');
|
||||
document.getElementById('theme-toggle').textContent = light ? '☀️' : '🌙';
|
||||
}
|
||||
if (localStorage.getItem('theme') === 'light') document.getElementById('theme-toggle').textContent = '☀️';
|
||||
|
||||
(function () {
|
||||
const filters = document.querySelectorAll('.ftag');
|
||||
const cards = document.querySelectorAll('.card');
|
||||
|
||||
+21
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Základy Mastodonu – Mamutovo</title>
|
||||
<script>if(localStorage.getItem('theme')==='light')document.documentElement.classList.add('light');</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;700;800&display=swap');
|
||||
|
||||
@@ -18,6 +19,17 @@
|
||||
--border: #2e2e2e;
|
||||
--radius: 10px;
|
||||
}
|
||||
html.light {
|
||||
--bg: #ffffff;
|
||||
--surface: #f8f8f8;
|
||||
--surface2: #f0f0f0;
|
||||
--border: #e0e0e0;
|
||||
--text: #1a1a1a;
|
||||
--muted: #666666;
|
||||
--accent: #06b6d4;
|
||||
}
|
||||
.theme-toggle { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; line-height: 1; position: fixed; top: 1rem; right: 1rem; z-index: 200; transition: border-color .15s; }
|
||||
.theme-toggle:hover { border-color: var(--accent); }
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
@@ -174,6 +186,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button id="theme-toggle" class="theme-toggle" onclick="toggleTheme()" aria-label="Přepnout téma">🌙</button>
|
||||
|
||||
<div class="hero">
|
||||
<a href="https://fedi.mamutovo.cz" class="badge">🦣 MAMUTOVO · ZÁKLADY</a>
|
||||
@@ -253,5 +266,13 @@
|
||||
<a href="start.html">← Zpět na průvodce</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const light = document.documentElement.classList.toggle('light');
|
||||
localStorage.setItem('theme', light ? 'light' : 'dark');
|
||||
document.getElementById('theme-toggle').textContent = light ? '☀️' : '🌙';
|
||||
}
|
||||
if (localStorage.getItem('theme') === 'light') document.getElementById('theme-toggle').textContent = '☀️';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Co se děje na Mastodonu | Mamutovo</title>
|
||||
<script>if(localStorage.getItem('theme')==='light')document.documentElement.classList.add('light');</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;700;800&display=swap');
|
||||
:root {
|
||||
--bg: #0d0d0d;
|
||||
--surface: #1a1a1a;
|
||||
--surface2: #222;
|
||||
--border: #2a2a2a;
|
||||
--text: #f0f0f0;
|
||||
--muted: #888;
|
||||
--accent: #00c896;
|
||||
--accent2: #ff6b6b;
|
||||
--nav-bg: rgba(13,13,13,0.95);
|
||||
}
|
||||
html.light {
|
||||
--bg: #ffffff;
|
||||
--surface: #f8f8f8;
|
||||
--surface2: #f0f0f0;
|
||||
--border: #e0e0e0;
|
||||
--text: #1a1a1a;
|
||||
--muted: #666666;
|
||||
--accent: #06b6d4;
|
||||
--nav-bg: rgba(245,245,245,0.95);
|
||||
}
|
||||
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; line-height: 1; flex-shrink: 0; color: var(--text); transition: border-color .15s; }
|
||||
.theme-toggle:hover { border-color: var(--accent); }
|
||||
html.light .post { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body { background: var(--bg); color: var(--text); font-family: 'Syne', sans-serif; min-height: 100vh; }
|
||||
|
||||
/* NAV */
|
||||
nav { display: flex; align-items: center; justify-content: space-between; padding: .9rem 2rem; border-bottom: 1px solid var(--border); background: var(--nav-bg); position: sticky; top: 0; z-index: 100; }
|
||||
.nav-logo { font-family: 'Space Mono', monospace; font-size: .85rem; color: var(--accent); text-decoration: none; font-weight: 700; }
|
||||
.nav-links { display: flex; gap: 1.5rem; }
|
||||
.nav-links a { font-family: 'Space Mono', monospace; font-size: .75rem; color: var(--muted); text-decoration: none; transition: color .15s; }
|
||||
.nav-links a:hover { color: var(--text); }
|
||||
|
||||
/* HERO */
|
||||
.hero { text-align: center; padding: 3rem 2rem 1.5rem; }
|
||||
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; line-height: 1.1; margin-bottom: .75rem; }
|
||||
.hero h1 span { color: var(--accent); }
|
||||
.hero p { color: var(--muted); font-size: 1rem; max-width: 480px; margin: 0 auto 1.5rem; }
|
||||
.cta-bar { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
|
||||
.btn-primary { background: var(--accent); color: #000; padding: .65rem 1.3rem; border-radius: 8px; font-family: 'Space Mono', monospace; font-size: .8rem; font-weight: 700; text-decoration: none; }
|
||||
.btn-secondary { background: transparent; color: var(--text); padding: .65rem 1.3rem; border-radius: 8px; border: 1px solid var(--border); font-family: 'Space Mono', monospace; font-size: .8rem; text-decoration: none; }
|
||||
.btn-primary:hover { opacity: .85; }
|
||||
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
|
||||
|
||||
/* TOP LINKS */
|
||||
.top-links-wrap { padding: 0 1.5rem 1.5rem; max-width: 900px; margin: 0 auto; }
|
||||
.section-label { font-family: 'Space Mono', monospace; font-size: .7rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
|
||||
.top-links-scroll { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
|
||||
.link-card { flex-shrink: 0; width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .15s; }
|
||||
.link-card:hover { border-color: var(--accent); }
|
||||
.link-card-img { width: 100%; height: 120px; object-fit: cover; background: var(--surface2); display: block; }
|
||||
.link-card-img-placeholder { width: 100%; height: 120px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
|
||||
.link-card-body { padding: .75rem; }
|
||||
.link-domain { font-family: 'Space Mono', monospace; font-size: .65rem; color: var(--muted); margin-bottom: .25rem; }
|
||||
.link-title { font-size: .85rem; font-weight: 700; line-height: 1.3; margin-bottom: .5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.link-shared { display: flex; align-items: center; gap: .4rem; font-family: 'Space Mono', monospace; font-size: .65rem; color: var(--muted); }
|
||||
.link-shared img { width: 18px; height: 18px; border-radius: 4px; }
|
||||
|
||||
/* FILTERS */
|
||||
.filters-wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 1rem; }
|
||||
.filter-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
|
||||
.filter-tab { font-family: 'Space Mono', monospace; font-size: .75rem; padding: .4rem .9rem; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: all .15s; }
|
||||
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
|
||||
.filter-tab.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
|
||||
.filter-count { opacity: .7; }
|
||||
|
||||
/* AUTHORS */
|
||||
.authors-wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem .75rem; }
|
||||
.authors-scroll { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
|
||||
.author-chip { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex-shrink: 0; }
|
||||
.author-chip img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
|
||||
.author-chip-fallback { width: 48px; height: 48px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
|
||||
.author-chip-name { font-size: .65rem; color: var(--muted); text-align: center; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
|
||||
/* FEED */
|
||||
.feed-wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 4rem; }
|
||||
.feed { display: flex; flex-direction: column; gap: .75rem; }
|
||||
.post { display: flex; gap: .75rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: default; transition: background .1s; }
|
||||
.post:hover { background: rgba(255,255,255,.02); }
|
||||
.post-avatar { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; object-fit: cover; }
|
||||
.post-avatar-fallback { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: .85rem; color: var(--text); }
|
||||
.post-main { flex: 1; min-width: 0; }
|
||||
.post-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .2rem; }
|
||||
.post-author { font-weight: 700; font-size: .85rem; }
|
||||
.post-time { font-family: 'Space Mono', monospace; font-size: .65rem; color: var(--muted); flex-shrink: 0; margin-left: .5rem; }
|
||||
.post-handle { font-family: 'Space Mono', monospace; font-size: .65rem; color: var(--muted); margin-bottom: .35rem; }
|
||||
.post-text { font-size: .82rem; line-height: 1.55; color: var(--text); word-break: break-word; }
|
||||
.post-text a { color: var(--accent); text-decoration: none; }
|
||||
.post-media { float: right; margin: 0 0 .25rem .75rem; width: 120px; border-radius: 8px; overflow: hidden; }
|
||||
.post-media img { width: 120px; height: 120px; aspect-ratio: 1/1; object-fit: cover; display: block; }
|
||||
.post-boost { font-family: 'Space Mono', monospace; font-size: .7rem; color: var(--muted); margin-bottom: .3rem; }
|
||||
.post-boost span { color: var(--accent); }
|
||||
|
||||
.loading { text-align: center; color: var(--muted); font-family: 'Space Mono', monospace; font-size: .8rem; padding: 3rem; }
|
||||
|
||||
/* STARTER */
|
||||
.starter-wrap { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 4rem; }
|
||||
.starter { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; text-align: center; }
|
||||
.starter h2 { font-size: 1.3rem; margin-bottom: .5rem; }
|
||||
.starter p { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }
|
||||
.starter-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a class="nav-logo" href="/">🦣 Mamutovo</a>
|
||||
<div class="nav-links">
|
||||
<a href="start.html">Průvodce</a>
|
||||
<a href="accounts.html">CZ účty</a>
|
||||
</div>
|
||||
<button id="theme-toggle" class="theme-toggle" onclick="toggleTheme()" aria-label="Přepnout téma">🌙</button>
|
||||
</nav>
|
||||
|
||||
<div class="hero">
|
||||
<h1>Co se teď děje<br>na <span>Mamutovu</span>?</h1>
|
||||
<p>Živý přehled příspěvků z české Mastodon komunity. Bez registrace.</p>
|
||||
<div class="cta-bar">
|
||||
<a href="start.html" class="btn-primary">Začni tady →</a>
|
||||
<a href="accounts.html" class="btn-secondary">Procházet účty</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="top-links-wrap">
|
||||
<div class="section-label">🔗 Top odkazy</div>
|
||||
<div class="top-links-scroll" id="top-links">
|
||||
<div class="loading">Načítám…</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filters-wrap">
|
||||
<div class="filter-tabs" style="margin-bottom:.75rem">
|
||||
<button class="filter-tab active" data-scope="local" onclick="setScope('local')">🦣 Mamutovo</button>
|
||||
<button class="filter-tab" data-scope="federated" onclick="setScope('federated')">🌍 Celá fediverse</button>
|
||||
</div>
|
||||
<div class="filter-tabs">
|
||||
<button class="filter-tab active" data-filter="all">Vše <span class="filter-count" id="count-all"></span></button>
|
||||
<button class="filter-tab" data-filter="original">Originální <span class="filter-count" id="count-original"></span></button>
|
||||
<button class="filter-tab" data-filter="replies">Odpovědi <span class="filter-count" id="count-replies"></span></button>
|
||||
<button class="filter-tab" data-filter="boosts">Boosty <span class="filter-count" id="count-boosts"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="authors-wrap">
|
||||
<div class="authors-scroll" id="authors-scroll"></div>
|
||||
</div>
|
||||
|
||||
<div class="feed-wrap">
|
||||
<div class="feed" id="feed">
|
||||
<div class="loading">Načítám příspěvky…</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="starter-wrap">
|
||||
<div class="starter">
|
||||
<h2>Líbí se ti to?</h2>
|
||||
<p>Začni sledovat českou komunitu — stáhni starter pack a importuj ho do Mastodonu.</p>
|
||||
<div class="starter-btns">
|
||||
<a href="starter-general.csv" class="btn-primary" download>⬇ Stáhnout CSV</a>
|
||||
<a href="accounts.html" class="btn-secondary">Procházet účty</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const light = document.documentElement.classList.toggle('light');
|
||||
localStorage.setItem('theme', light ? 'light' : 'dark');
|
||||
document.getElementById('theme-toggle').textContent = light ? '☀️' : '🌙';
|
||||
}
|
||||
if (localStorage.getItem('theme') === 'light') document.getElementById('theme-toggle').textContent = '☀️';
|
||||
|
||||
let allPosts = [];
|
||||
let currentFilter = 'all';
|
||||
let currentScope = 'local';
|
||||
|
||||
function setScope(scope) {
|
||||
currentScope = scope;
|
||||
currentFilter = 'all';
|
||||
document.querySelectorAll('[data-scope]').forEach(b => b.classList.toggle('active', b.dataset.scope === scope));
|
||||
document.querySelectorAll('.filter-tab[data-filter]').forEach(b => b.classList.toggle('active', b.dataset.filter === 'all'));
|
||||
loadFeed();
|
||||
}
|
||||
|
||||
function timeAgo(dateStr) {
|
||||
const diff = Math.floor((Date.now() - new Date(dateStr)) / 1000);
|
||||
if (diff < 60) return `${diff}s`;
|
||||
if (diff < 3600) return `${Math.floor(diff/60)}m`;
|
||||
if (diff < 86400) return `${Math.floor(diff/3600)}h`;
|
||||
return new Date(dateStr).toLocaleDateString('cs-CZ', {day:'numeric', month:'numeric'});
|
||||
}
|
||||
|
||||
function stripHTML(html) {
|
||||
return html.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
|
||||
}
|
||||
|
||||
function postType(p) {
|
||||
if (p.reblog) return 'boosts';
|
||||
if (p.in_reply_to_id) return 'replies';
|
||||
return 'original';
|
||||
}
|
||||
|
||||
function renderPost(p) {
|
||||
const isBoost = !!p.reblog;
|
||||
const src = isBoost ? p.reblog : p;
|
||||
const av = src.account.avatar
|
||||
? `<img class="post-avatar" src="${src.account.avatar}" alt="" onerror="this.style.display='none'">`
|
||||
: `<div class="post-avatar-fallback">${(src.account.display_name||src.account.username).charAt(0)}</div>`;
|
||||
const text = stripHTML(src.content || '');
|
||||
const media = src.media_attachments?.find(m => m.type === 'image');
|
||||
const boostLine = isBoost
|
||||
? `<div class="post-boost">🔁 <span>${p.account.display_name||p.account.username}</span> boostnul/a</div>`
|
||||
: '';
|
||||
return `
|
||||
<div class="post">
|
||||
${av}
|
||||
<div class="post-main">
|
||||
${boostLine}
|
||||
<div class="post-top">
|
||||
<span class="post-author">${src.account.display_name||src.account.username}</span>
|
||||
<span class="post-time">${timeAgo(p.created_at)}</span>
|
||||
</div>
|
||||
<div class="post-handle">@${src.account.acct}</div>
|
||||
<div class="post-text">${text.slice(0,300)}${text.length>300?'…':''}</div>
|
||||
${media ? `<div class="post-media"><img src="${media.preview_url}" alt=""></div>` : ''}
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function renderFeed() {
|
||||
const feed = document.getElementById('feed');
|
||||
const filtered = currentFilter === 'all' ? allPosts : allPosts.filter(p => postType(p) === currentFilter);
|
||||
if (!filtered.length) { feed.innerHTML = '<div class="loading">Žádné příspěvky.</div>'; return; }
|
||||
try { feed.innerHTML = filtered.map(renderPost).join(''); } catch(e) { console.error('renderFeed error:', e); feed.innerHTML = '<div class="loading">Chyba vykreslování.</div>'; }
|
||||
}
|
||||
|
||||
function updateAuthors() {
|
||||
const scroll = document.getElementById('authors-scroll');
|
||||
if (!scroll) return;
|
||||
const counts = {};
|
||||
allPosts.forEach(p => {
|
||||
const src = p.reblog ? p.reblog : p;
|
||||
const key = src.account.acct;
|
||||
if (!counts[key]) counts[key] = { account: src.account, count: 0 };
|
||||
counts[key].count++;
|
||||
});
|
||||
const sorted = Object.values(counts).sort((a, b) => b.count - a.count).slice(0, 20);
|
||||
scroll.innerHTML = sorted.map(({ account }) => {
|
||||
const av = account.avatar
|
||||
? `<img src="${account.avatar}" alt="" onerror="this.style.display='none'">`
|
||||
: `<div class="author-chip-fallback">${(account.display_name||account.username).charAt(0)}</div>`;
|
||||
const name = account.display_name || account.username;
|
||||
return `<div class="author-chip">${av}<span class="author-chip-name">${name}</span></div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
function updateCounts() {
|
||||
document.getElementById('count-all').textContent = allPosts.length;
|
||||
document.getElementById('count-original').textContent = allPosts.filter(p => postType(p) === 'original').length;
|
||||
document.getElementById('count-replies').textContent = allPosts.filter(p => postType(p) === 'replies').length;
|
||||
document.getElementById('count-boosts').textContent = allPosts.filter(p => postType(p) === 'boosts').length;
|
||||
}
|
||||
|
||||
async function loadFeed() {
|
||||
try {
|
||||
const res = await fetch('https://mamutovo.cz/api/v1/timelines/public?limit=30' + (currentScope === 'local' ? '&local=true' : ''));
|
||||
allPosts = await res.json();
|
||||
updateCounts();
|
||||
renderFeed();
|
||||
updateAuthors();
|
||||
} catch(e) {
|
||||
document.getElementById('feed').innerHTML = '<div class="loading">Nepodařilo se načíst příspěvky.</div>';
|
||||
}
|
||||
}
|
||||
|
||||
async function loadTopLinks() {
|
||||
const el = document.getElementById('top-links');
|
||||
try {
|
||||
const res = await fetch('https://mamutovo.cz/api/v1/trends/links?limit=8');
|
||||
const links = await res.json();
|
||||
if (!links.length) { el.innerHTML = '<div class="loading">Žádné trendy.</div>'; return; }
|
||||
el.innerHTML = links.map(l => {
|
||||
const img = l.image
|
||||
? `<img class="link-card-img" src="${l.image}" alt="" onerror="this.parentElement.innerHTML='<div class=link-card-img-placeholder>🔗</div>'">`
|
||||
: `<div class="link-card-img-placeholder">🔗</div>`;
|
||||
const domain = new URL(l.url).hostname.replace('www.','');
|
||||
const sharedBy = l.history?.[0] ? `${l.history[0].accounts} lidí` : '';
|
||||
return `
|
||||
<a class="link-card" href="${l.url}" target="_blank" rel="noopener">
|
||||
${img}
|
||||
<div class="link-card-body">
|
||||
<div class="link-domain">${domain}</div>
|
||||
<div class="link-title">${l.title||l.url}</div>
|
||||
<div class="link-shared">👥 Sdílelo ${sharedBy}</div>
|
||||
</div>
|
||||
</a>`;
|
||||
}).join('');
|
||||
} catch(e) {
|
||||
el.innerHTML = '<div class="loading">Trendy nedostupné.</div>';
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelectorAll('.filter-tab[data-filter]').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
document.querySelectorAll('.filter-tab[data-filter]').forEach(b => b.classList.remove('active'));
|
||||
btn.classList.add('active');
|
||||
currentFilter = btn.dataset.filter;
|
||||
renderFeed();
|
||||
});
|
||||
});
|
||||
|
||||
loadTopLinks();
|
||||
loadFeed();
|
||||
setInterval(loadFeed, 60000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -297,6 +297,7 @@ def _to_output(acc):
|
||||
"handle": handle,
|
||||
"bio": bio[:220],
|
||||
"avatar": acc.get("avatar", ""),
|
||||
"header": acc.get("header_static", "") if "missing" not in acc.get("header_static", "") else "",
|
||||
"followers": acc.get("followers_count", 0),
|
||||
"statuses": acc.get("statuses_count", 0),
|
||||
"score": score(acc),
|
||||
|
||||
+21
-1
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Začni na Mastodonu – Mamutovo</title>
|
||||
<script>if(localStorage.getItem('theme')==='light')document.documentElement.classList.add('light');</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;700;800&display=swap');
|
||||
|
||||
@@ -18,6 +19,17 @@
|
||||
--border: #2e2e2e;
|
||||
--radius: 10px;
|
||||
}
|
||||
html.light {
|
||||
--bg: #ffffff;
|
||||
--surface: #f8f8f8;
|
||||
--surface2: #f0f0f0;
|
||||
--border: #e0e0e0;
|
||||
--text: #1a1a1a;
|
||||
--muted: #666666;
|
||||
--accent: #06b6d4;
|
||||
}
|
||||
.theme-toggle { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; line-height: 1; position: fixed; top: 1rem; right: 1rem; z-index: 200; transition: border-color .15s; }
|
||||
.theme-toggle:hover { border-color: var(--accent); }
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
@@ -382,6 +394,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button id="theme-toggle" class="theme-toggle" onclick="toggleTheme()" aria-label="Přepnout téma">🌙</button>
|
||||
|
||||
<div class="hero">
|
||||
<a href="https://fedi.mamutovo.cz" class="badge">🦣 MAMUTOVO · PRŮVODCE</a>
|
||||
@@ -389,7 +402,7 @@
|
||||
<p class="tagline">
|
||||
Žádné algoritmy. Žádné reklamy. <strong>Patří komunitě.</strong><br>
|
||||
Tyhle 4 kroky ti zaplní feed a pomůžou udělat první post.<br>
|
||||
<a href="https://about.mamutovo.cz" target="_blank" class="about-link">Co je Mamutovo.cz?</a>
|
||||
<a href="https://about.mamutovo.cz" target="_blank" class="about-link">Co je Mamutovo.cz?</a> · <a href="deni.html" class="about-link">Co se teď děje? ⚡</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -488,6 +501,13 @@ Rád/a poznám nové lidi 🙂 #Představení #novacek #cesky
|
||||
<div class="copy-toast" id="toast">Zkopírováno! Vlož do pole pro post ✓</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const light = document.documentElement.classList.toggle('light');
|
||||
localStorage.setItem('theme', light ? 'light' : 'dark');
|
||||
document.getElementById('theme-toggle').textContent = light ? '☀️' : '🌙';
|
||||
}
|
||||
if (localStorage.getItem('theme') === 'light') document.getElementById('theme-toggle').textContent = '☀️';
|
||||
|
||||
function copyPost(el) {
|
||||
const text = el.innerText.trim();
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user