Skip to content

Commit 8e3f7dc

Browse files
committed
feat: add click tracking for key page interactions and new hero/features call-to-action buttons with updated styling.
1 parent 0f9d7c9 commit 8e3f7dc

File tree

2 files changed

+92
-6
lines changed

2 files changed

+92
-6
lines changed

docs/index.html

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,26 @@
600600
background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
601601
}
602602

603+
/* Secondary Button */
604+
.secondary-btn {
605+
display: inline-flex;
606+
align-items: center;
607+
background: rgba(255, 255, 255, 0.05);
608+
color: var(--text-muted);
609+
padding: 0.8rem 1.5rem;
610+
border-radius: 9999px;
611+
font-weight: 500;
612+
text-decoration: none;
613+
transition: all 0.2s ease;
614+
border: 1px solid var(--border);
615+
}
616+
617+
.secondary-btn:hover {
618+
background: var(--surface-hover);
619+
color: var(--text-main);
620+
border-color: var(--text-muted);
621+
}
622+
603623
/* Zig-Zag Features */
604624
.feature-section {
605625
padding: 4rem 0;
@@ -727,7 +747,8 @@
727747
<div style="width: 1px; height: 24px; background: rgba(255,255,255,0.1);"></div>
728748
<img src="https://img.shields.io/github/downloads/Bharath-code/git-scope/total?style=flat-square&color=7C3AED&label=Downloads"
729749
alt="Downloads" height="20">
730-
<a href="https://github.com/Bharath-code/git-scope" target="_blank" style="text-decoration: none;">
750+
<a href="https://github.com/Bharath-code/git-scope" target="_blank" style="text-decoration: none;"
751+
id="nav-github-link">
731752
<img src="https://img.shields.io/github/stars/Bharath-code/git-scope?style=social"
732753
alt="GitHub Stars" height="20">
733754
</a>
@@ -743,6 +764,24 @@ <h1>Stop <span class="gradient-text">cd-ing.</span> <br> Start Coding.</h1>
743764
flow state without endlessly <code>cd</code>-ing through nested directories.
744765
</p>
745766

767+
<!-- Hero CTAs -->
768+
<div style="display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; flex-wrap: wrap;">
769+
<a href="https://github.com/Bharath-code/git-scope" target="_blank" class="hero-cta-btn"
770+
id="hero-cta-star">
771+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
772+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
773+
style="margin-right: 0.5rem;">
774+
<polygon
775+
points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2">
776+
</polygon>
777+
</svg>
778+
Star on GitHub
779+
</a>
780+
<a href="#features" class="secondary-btn" id="hero-cta-features">
781+
How it Works
782+
</a>
783+
</div>
784+
746785
<!-- Simplified Install -->
747786
<div class="install-section" style="margin-bottom: 2rem;">
748787
<div class="install-box" onclick="copyInstallCommand()"
@@ -759,7 +798,8 @@ <h1>Stop <span class="gradient-text">cd-ing.</span> <br> Start Coding.</h1>
759798
</div>
760799
<div style="margin-top: 1rem;">
761800
<a href="https://github.com/Bharath-code/git-scope/releases" target="_blank"
762-
style="color: var(--text-muted); font-size: 0.9rem; text-decoration: underline;">View
801+
style="color: var(--text-muted); font-size: 0.9rem; text-decoration: underline;"
802+
id="hero-install-options">View
763803
Windows, Linux & Go Install</a>
764804
</div>
765805
</div>
@@ -790,6 +830,8 @@ <h1>Stop <span class="gradient-text">cd-ing.</span> <br> Start Coding.</h1>
790830

791831
</section>
792832

833+
834+
793835
<section class="value-prop" style="margin-bottom: 6rem; text-align: center;">
794836
<p
795837
style="color: var(--primary); font-weight: 600; letter-spacing: 0.05em; margin-bottom: 1rem; text-transform: uppercase; font-size: 0.9rem;">
@@ -861,6 +903,17 @@ <h3><span style="color: var(--primary);">03.</span> Stats & Visuals</h3>
861903

862904
</div>
863905

906+
<!-- More Features Link -->
907+
<div style="text-align: center; margin-top: 4rem; margin-bottom: 6rem;">
908+
<p style="color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.1rem;">
909+
...plus Disk Usage,Timeline,Sorting, and more.
910+
</p>
911+
<a href="https://github.com/Bharath-code/git-scope#features" target="_blank" class="secondary-btn"
912+
id="features-view-all">
913+
View full feature list on GitHub &rarr;
914+
</a>
915+
</div>
916+
864917
<!-- Keyboard Cheat Sheet -->
865918
<section style="margin: 6rem 0; text-align: center;">
866919
<h2 style="font-size: 2rem; margin-bottom: 2rem;">Vim-Style Efficiency</h2>

docs/main.js

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function trackEvent(eventName, title) {
3030
// ===============================
3131
function copyInstallCommand() {
3232
const command = "brew tap Bharath-code/tap && brew install git-scope";
33-
33+
3434
// Fallback for non-secure contexts
3535
if (!navigator.clipboard) {
3636
const ta = document.createElement('textarea');
@@ -54,9 +54,9 @@ function copyInstallCommand() {
5454
function showCopyFeedback() {
5555
const icon = document.getElementById('copy-icon');
5656
if (!icon) return;
57-
57+
5858
const originalHTML = icon.innerHTML;
59-
59+
6060
// Change to Checkmark
6161
icon.innerHTML = '<polyline points="20 6 9 17 4 12"></polyline>';
6262
icon.style.opacity = '1';
@@ -70,7 +70,37 @@ function showCopyFeedback() {
7070
}
7171

7272
// ===============================
73-
// SESSION SUMMARY
73+
// CLICK TRACKING
74+
// ===============================
75+
document.getElementById('nav-github-link')?.addEventListener('click', () => {
76+
trackEvent('github-star-click', 'Clicked GitHub Stars in Nav');
77+
});
78+
79+
document.getElementById('hero-install-options')?.addEventListener('click', () => {
80+
trackEvent('install-options-click', 'Clicked View Windows/Linux Install');
81+
});
82+
83+
document.getElementById('hero-cta-star')?.addEventListener('click', () => {
84+
trackEvent('hero-cta-star-click', 'Clicked Hero Star CTA');
85+
});
86+
87+
document.getElementById('hero-cta-features')?.addEventListener('click', () => {
88+
trackEvent('hero-cta-features-click', 'Clicked Hero Features CTA');
89+
});
90+
91+
document.getElementById('features-view-all')?.addEventListener('click', () => {
92+
trackEvent('features-view-all-click', 'Clicked View All Features');
93+
});
94+
95+
document.querySelectorAll('footer a').forEach(link => {
96+
link.addEventListener('click', () => {
97+
const linkName = link.textContent.trim();
98+
trackEvent('footer-click-' + linkName.toLowerCase().replace(/\s+/g, '-'), 'Clicked ' + linkName + ' in footer');
99+
});
100+
});
101+
102+
// ===============================
103+
// SCROLL DEPTH TRACKING
74104
// ===============================
75105
let maxScroll = 0;
76106
let scrollMilestones = { 25: false, 50: false, 75: false, 100: false };
@@ -87,6 +117,9 @@ window.addEventListener('scroll', () => {
87117
}
88118
});
89119

120+
// ===============================
121+
// SESSION SUMMARY
122+
// ===============================
90123
window.addEventListener('beforeunload', () => {
91124
analytics.track('session_end', {
92125
maxScroll: maxScroll,

0 commit comments

Comments
 (0)