Skip to content

Commit f411862

Browse files
m2declaude
andcommitted
Add install tabs (Homebrew, Cargo, npm) to docs homepage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3af8db7 commit f411862

2 files changed

Lines changed: 79 additions & 4 deletions

File tree

docs/assets/style.css

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,68 @@ main {
171171
margin: 0 auto 2rem;
172172
}
173173

174-
.install-block {
175-
display: inline-block;
174+
.install-tabs {
175+
display: inline-flex;
176+
flex-direction: column;
177+
align-items: center;
178+
gap: 0;
179+
max-width: 480px;
180+
width: 100%;
181+
}
182+
183+
.install-tab-buttons {
184+
display: flex;
185+
gap: 0;
186+
border: 1px solid var(--border);
187+
border-bottom: none;
188+
border-radius: 8px 8px 0 0;
189+
overflow: hidden;
190+
background: var(--bg-secondary);
191+
width: 100%;
192+
}
193+
194+
.install-tab {
195+
flex: 1;
196+
padding: 0.5rem 1rem;
197+
font-size: 0.8125rem;
198+
font-weight: 500;
199+
border: none;
200+
background: transparent;
201+
color: var(--text-muted);
202+
cursor: pointer;
203+
transition: color 0.15s, background 0.15s;
204+
border-right: 1px solid var(--border);
205+
}
206+
207+
.install-tab:last-child {
208+
border-right: none;
209+
}
210+
211+
.install-tab:hover {
212+
color: var(--text);
213+
}
214+
215+
.install-tab.active {
216+
background: var(--bg-code);
217+
color: var(--text);
218+
font-weight: 600;
219+
}
220+
221+
.install-panel {
222+
display: none;
223+
width: 100%;
176224
background: var(--bg-code);
177225
border: 1px solid var(--border);
178-
border-radius: 8px;
226+
border-radius: 0 0 8px 8px;
179227
padding: 0.75rem 1.5rem;
180228
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
181229
font-size: 0.9375rem;
182230
color: var(--text);
231+
text-align: left;
232+
}
233+
234+
.install-panel.active {
235+
display: block;
183236
}
184237

185238
/* ===== Search & Filters ===== */

docs/templates/index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@
2626
<section class="hero">
2727
<h1>Stop Googling API setup docs</h1>
2828
<p>Step-by-step interactive guides for setting up API credentials. Browse the guides below, or install the CLI and follow along in your terminal.</p>
29-
<div class="install-block">cargo install getapi</div>
29+
<div class="install-tabs" id="install-tabs">
30+
<div class="install-tab-buttons">
31+
<button class="install-tab active" data-tab="brew">Homebrew</button>
32+
<button class="install-tab" data-tab="cargo">Cargo</button>
33+
<button class="install-tab" data-tab="npm">npm</button>
34+
</div>
35+
<div class="install-panel active" data-tab="brew">brew install m2de/tap/getapi</div>
36+
<div class="install-panel" data-tab="cargo">cargo install getapi</div>
37+
<div class="install-panel" data-tab="npm">npx getapi-cli list</div>
38+
</div>
3039
</section>
3140

3241
<section class="filters">
@@ -68,6 +77,19 @@ <h1>Stop Googling API setup docs</h1>
6877

6978
{% block scripts %}
7079
<script>
80+
(function() {
81+
var tabs = document.querySelectorAll('.install-tab');
82+
var panels = document.querySelectorAll('.install-panel');
83+
tabs.forEach(function(tab) {
84+
tab.addEventListener('click', function() {
85+
var t = tab.getAttribute('data-tab');
86+
tabs.forEach(function(b) { b.classList.remove('active'); });
87+
panels.forEach(function(p) { p.classList.remove('active'); });
88+
tab.classList.add('active');
89+
document.querySelector('.install-panel[data-tab="' + t + '"]').classList.add('active');
90+
});
91+
});
92+
})();
7193
(function() {
7294
var search = document.getElementById('search');
7395
var pills = document.querySelectorAll('.pill');

0 commit comments

Comments
 (0)