Skip to content

Commit 798c7f1

Browse files
authored
Merge pull request #4 from totalo-dev/feat-clickable-logo-1445386538123642905
feat: Make Git Master logo clickable to reset app state\n\n- Wraps th…
2 parents 7ecf27b + fd5256b commit 798c7f1

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

assets/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ h1 {
140140
align-items: center;
141141
justify-content: center;
142142
gap: 1rem;
143-
cursor: default;
143+
cursor: pointer;
144144
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
145145
}
146146

assets/js/script.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,3 +1018,22 @@ themeToggle.addEventListener('click', () => {
10181018
// Inicialização
10191019
applyUITranslations();
10201020
renderCards(gitCommands);
1021+
1022+
document.addEventListener('DOMContentLoaded', () => {
1023+
const logoLink = document.getElementById('logoLink');
1024+
if (logoLink) {
1025+
logoLink.addEventListener('click', (e) => {
1026+
e.preventDefault();
1027+
// Volta pro modo estudo, limpa a busca, mostra tudo, reseta filtros
1028+
if (!studyModeBtn.classList.contains('active')) {
1029+
studyModeBtn.click();
1030+
}
1031+
if (searchInput) searchInput.value = '';
1032+
filterBtns.forEach(b => b.classList.remove('active'));
1033+
const allBtn = Array.from(filterBtns).find(b => b.getAttribute('data-filter') === 'all');
1034+
if (allBtn) allBtn.classList.add('active');
1035+
applyFilters();
1036+
window.scrollTo({ top: 0, behavior: 'smooth' });
1037+
});
1038+
}
1039+
});

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
</div>
2828

2929
<header>
30+
<a href="/" id="logoLink" aria-label="Voltar para a página inicial" style="text-decoration: none; color: inherit;">
3031
<h1>
3132
<svg class="git-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="56" height="56">
3233
<path fill="currentColor" d="M125.666 60.106l-55.77-55.77c-2.886-2.888-7.568-2.888-10.458 0L37.195 26.58 52.88 42.264c2.81-1.127 6.136-.713 8.618 1.77 2.652 2.654 3.12 6.517 1.48 9.574l13.798 13.8c3.056-1.642 6.92-1.173 9.574 1.48 3.313 3.313 3.313 8.683 0 11.996-3.315 3.313-8.684 3.313-11.997 0-2.812-2.812-3.177-7.05-1.118-10.22l-12.75-12.75v27.234c1.554.896 2.82 2.378 3.447 4.195 1.134 3.284.092 7.027-2.616 9.734-3.312 3.314-8.682 3.314-11.996 0-3.313-3.313-3.313-8.683 0-11.996 2.705-2.706 6.446-3.748 9.73-2.615V55.088c-3.264-1.114-6.98-2.146-9.66-4.825-3.313-3.313-3.313-8.683 0-11.996 2.81-2.81 7.05-3.176 10.22-1.117L44.025 21.467 4.336 61.156c-2.887 2.888-2.887 7.57 0 10.458l55.772 55.77c2.887 2.888 7.568 2.888 10.457 0l55.102-55.104c2.885-2.886 2.885-7.57 0-10.457z"/>
3334
</svg>
3435
<span class="git-text">Git</span> Master
3536
</h1>
37+
</a>
3638
<p>Seu guia interativo para dominar o versionamento de código.</p>
3739
</header>
3840

0 commit comments

Comments
 (0)