Skip to content

Commit 2525497

Browse files
authored
Update news.html
1 parent eb4bf05 commit 2525497

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

‎_layouts/news.html‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,48 @@
252252
.comment-action-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
253253
.comment-action-btn.delete:hover { color: #ef4444; }
254254

255+
/* PŁYWAJĄCY PRZYCISK POWROTU DO ARCHIWUM NEWSÓW */
256+
.back-to-news-floating {
257+
position: fixed;
258+
bottom: 30px;
259+
right: 30px;
260+
background: rgba(15, 23, 42, 0.85);
261+
border: 1px solid var(--accent-blue);
262+
color: #fff;
263+
padding: 12px 18px;
264+
border-radius: 8px;
265+
font-family: 'JetBrains Mono', monospace;
266+
font-size: 0.8rem;
267+
font-weight: 700;
268+
cursor: pointer;
269+
backdrop-filter: blur(10px);
270+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
271+
display: flex;
272+
align-items: center;
273+
gap: 8px;
274+
z-index: 999;
275+
transition: 0.3s ease;
276+
opacity: 0;
277+
visibility: hidden;
278+
text-decoration: none;
279+
}
280+
281+
.back-to-news-floating.visible {
282+
opacity: 1;
283+
visibility: visible;
284+
}
285+
286+
.back-to-news-floating:hover {
287+
background: var(--accent-blue);
288+
color: #0f172a;
289+
transform: translateY(-3px);
290+
box-shadow: 0 15px 30px rgba(0, 210, 255, 0.3);
291+
}
292+
255293
@media (max-width: 1024px) {
256294
.post-container { grid-template-columns: 1fr; padding: 0 20px; }
257295
.sidebar-toc { position: static; }
296+
.back-to-news-floating { bottom: 20px; right: 20px; padding: 10px 14px; font-size: 0.75rem; }
258297
}
259298
</style>
260299

@@ -302,6 +341,11 @@ <h4 class="toc-title">// Spis Treści</h4>
302341

303342
</div>
304343

344+
<!-- PŁYWAJĄCY PRZYCISK POWROTU DO LISTY NEWSÓW -->
345+
<a href="/newsy.html" id="backToNewsBtn" class="back-to-news-floating">
346+
<span>&larr;</span> // NEWSY
347+
</a>
348+
305349
<script>
306350
// AUTOMATYCZNY SPIS TREŚCI ZE STRUKTURY NAGŁÓWKÓW
307351
const articleBody = document.getElementById('articleBody');
@@ -327,6 +371,18 @@ <h4 class="toc-title">// Spis Treści</h4>
327371
document.getElementById('shareX').href = `https://twitter.com/intent/tweet?url=${currentUrl}&text=${currentTitle}`;
328372
document.getElementById('shareFB').href = `https://www.facebook.com/sharer/sharer.php?u=${currentUrl}`;
329373

374+
// OBSŁUGA PŁYWAJĄCEGO PRZYCISKU POWROTU DO NEWSÓW
375+
const backToNewsBtn = document.getElementById('backToNewsBtn');
376+
377+
window.addEventListener('scroll', () => {
378+
// Pokaż przycisk, gdy użytkownik przewinie stronę w dół o więcej niż 300px
379+
if (window.scrollY > 300) {
380+
backToNewsBtn.classList.add('visible');
381+
} else {
382+
backToNewsBtn.classList.remove('visible');
383+
}
384+
});
385+
330386
// SYSTEM KOMENTARZY (LOCALSTORAGE)
331387
const postId = window.location.pathname;
332388
const commentAuthor = document.getElementById('commentAuthor');

0 commit comments

Comments
 (0)