-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabs.html
More file actions
340 lines (282 loc) · 14.8 KB
/
tabs.html
File metadata and controls
340 lines (282 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="./assets/img/favicon.ico">
<title>Tabs</title> <script type="module" crossorigin src="./js/app.min.js?v=1774807247388"></script>
<link rel="stylesheet" crossorigin href="./css/app.min.css?v=1774807247388">
</head>
<body>
<div class="wrapper">
<header class="header" data-anim-header="" data-anim-header-scroll="">
<div class="header__container">
<nav class="menu__body">
<a class="menu__logo" href="/docs/index.html">
<img src="./assets/img/logo.jpg" aria-label="Animmaster Logo" width="50" height="50">
</a>
<ul class="menu__list">
<li class="menu__item">
<a class="menu__link" href="/docs/index.html">Documentation</a>
</li>
<li class="menu__item">
<a class="menu__link menu__link--special" target="_blank" href="https://www.patreon.com/collection/1946808?view=condensed">Animmaster PRO Pack</a>
</li>
</ul>
</nav>
</div>
</header>
<main class="page">
<div data-anim-tabsdoc="" class="doc">
<section class="doc-page box-padding">
<div class="doc-page__container">
<!-- ========================================================= -->
<!-- Top -->
<!-- ========================================================= -->
<div class="doc-top">
<a class="doc-top__back" href="/docs/index.html">← Back to Documentation</a>
</div>
<!-- ========================================================= -->
<!-- Hero -->
<!-- ========================================================= -->
<div class="doc-hero" id="top">
<p class="doc-hero__kicker">Documentation</p>
<h1 class="doc-hero__title">
Component: Tabs
<span class="doc-hero__title-sub">Switch content panels with titles, hash support, and responsive
“spoller” mode</span>
</h1>
<p class="doc-hero__lead">
<strong>Tabs</strong> are a set of titles and their matching content blocks.
Usually only one tab is open at a time. Clicking a title shows the corresponding panel.
</p>
<div class="doc-actions">
<a class="doc-btn doc-btn--primary doc-btn--pulse" href="https://www.patreon.com/collection/1946808?view=condensed" target="_blank" rel="noreferrer">
<span class="doc-btn__text doc-btn__text--default">
Download <span>Animmaster</span> Vite Template
</span>
<span class="doc-btn__text doc-btn__text--hover">
Save your time — start now
</span>
</a>
</div>
</div>
<div class="doc-layout">
<article class="doc-content">
<!-- ========================================================= -->
<!-- 1) Intro / features -->
<!-- ========================================================= -->
<section class="doc-section" id="intro" data-anim-watcher="navigator">
<h2 class="doc-h2">What tabs can do</h2>
<ul class="doc-list">
<li class="doc-list__item">Use multiple independent tab blocks on one page</li>
<li class="doc-list__item">Open a specific tab via URL hash</li>
<li class="doc-list__item">Turn tabs into spollers below a given screen width (handy for mobile)
</li>
<li class="doc-list__item">Animate opening/closing of tab panels</li>
</ul>
<div class="doc-callout doc-callout--accent">
<div class="doc-callout__title">Tip</div>
<div class="doc-callout__text">
The component connects automatically when you use the required <code>data-anim-*</code>
attributes in markup.
</div>
</div>
</section>
<!-- ========================================================= -->
<!-- 2) Location -->
<!-- ========================================================= -->
<section class="doc-section" id="location" data-anim-watcher="navigator">
<h2 class="doc-h2">Component location</h2>
<p class="doc-p">
Files are located in <code>src/components/layout/tabs</code>.
Inside you’ll find the JS, an HTML example, and SCSS styles for the component.
</p>
</section>
<!-- ========================================================= -->
<!-- 3) Markup -->
<!-- ========================================================= -->
<section class="doc-section" id="markup" data-anim-watcher="navigator">
<h2 class="doc-h2">Basic markup</h2>
<p class="doc-p">
Build the structure with:
<code>data-anim-tabs</code> on the wrapper,
<code>data-anim-tabs-titles</code> on the titles container,
and <code>data-anim-tabs-body</code> on the content container.
To make a tab open by default, add <code>--tab-active</code> to its title button.
</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">Tabs block (3 tabs)</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<div data-anim-tabs class="tabs">
<nav data-anim-tabs-titles class="tabs__navigation">
<button type="button" class="tabs__title --tab-active">Tab #1</button>
<button type="button" class="tabs__title">Tab #2</button>
<button type="button" class="tabs__title">Tab #3</button>
</nav>
<div data-anim-tabs-body class="tabs__content">
<div class="tabs__body">Content for Tab #1</div>
<div class="tabs__body">Content for Tab #2</div>
<div class="tabs__body">Content for Tab #3</div>
</div>
</div></code></pre>
</div>
</section>
<!-- ========================================================= -->
<!-- 4) Tabs -> spollers -->
<!-- ========================================================= -->
<section class="doc-section" id="spollers" data-anim-watcher="navigator">
<h2 class="doc-h2">Turn tabs into spollers on breakpoint</h2>
<p class="doc-p">
If you want the tabs to become “spollers” (accordion-like) below a certain width,
set that width as the value of <code>data-anim-tabs</code>.
</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">Tabs become spollers below 768px</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<div data-anim-tabs="768" class="tabs">
...
</div></code></pre>
</div>
<p class="doc-p">
When the transform happens, the wrapper receives a helper class <code>--tab-spoller</code>.
Use it to adjust styling for the spoller layout.
</p>
</section>
<!-- ========================================================= -->
<!-- 5) Hash navigation -->
<!-- ========================================================= -->
<section class="doc-section" id="hash" data-anim-watcher="navigator">
<h2 class="doc-h2">Open a specific tab via URL hash</h2>
<p class="doc-p">
To enable hash behavior, add <code>data-anim-tabs-hash</code> to the tabs wrapper.
Then clicking tab titles will update the URL hash in this format:
<code>#tab-0-1</code> where:
</p>
<ul class="doc-list">
<li class="doc-list__item"><code>0</code> — the index/ID of the tabs block on the page</li>
<li class="doc-list__item"><code>1</code> — the index/ID of the tab inside that block</li>
</ul>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">Enable hash support</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<div data-anim-tabs data-anim-tabs-hash class="tabs">
...
</div></code></pre>
</div>
<div class="doc-callout">
<div class="doc-callout__title">Examples</div>
<div class="doc-callout__text">
<code>#tab-0-1</code> opens the 2nd tab in the 1st tabs block.<br>
<code>#tab-2-0</code> opens the 1st tab in the 3rd tabs block.
</div>
</div>
</section>
<!-- ========================================================= -->
<!-- 6) Animation -->
<!-- ========================================================= -->
<section class="doc-section" id="animate" data-anim-watcher="navigator">
<h2 class="doc-h2">Smooth open animation</h2>
<p class="doc-p">
To make the content switch feel smoother, add <code>data-anim-tabs-animate</code>.
Set its value in milliseconds (default: <code>500</code>).
</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">Animate tabs (1s)</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<div data-anim-tabs data-anim-tabs-animate="1000" class="tabs">
...
</div></code></pre>
</div>
</section>
<!-- ========================================================= -->
<!-- Download -->
<!-- ========================================================= -->
<section class="doc-section" id="download" data-anim-watcher="navigator">
<h2 class="doc-h2">Download</h2>
<p class="doc-p doc-p--margin-b">
Build clean interfaces with compact navigation and fast content switching.
Download the template and start using the Tabs component today.
</p>
<div class="doc-actions">
<a class="doc-btn doc-btn--primary doc-btn--pulse" href="https://www.patreon.com/collection/1946808?view=condensed" target="_blank" rel="noreferrer">
<span class="doc-btn__text doc-btn__text--default">
Download <span>Animmaster</span> Vite Template
</span>
<span class="doc-btn__text doc-btn__text--hover">
Save your time — start now
</span>
</a>
</div>
</section>
<div class="doc-divider"></div>
<!-- ========================================================= -->
<!-- Next -->
<!-- ========================================================= -->
<nav class="doc-next">
<a class="doc-next__link" href="/docs/spoller.html">
Next: Spollers component
<span class="doc-next__arrow">→</span>
</a>
</nav>
</article>
<!-- ========================================================= -->
<!-- TOC -->
<!-- ========================================================= -->
<aside class="doc-toc" aria-label="On this page">
<div class="doc-toc__box">
<div class="doc-toc__title">On this page</div>
<ol class="doc-toc__list">
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#intro">Overview</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#location">Location</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#markup">Markup</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#spollers">Tabs
→ spollers</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#hash">Hash
open</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#animate">Animation</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#download">Download</a></li>
</ol>
</div>
</aside>
</div>
</div>
</section>
</div>
</main>
<footer class="footer" data-anim-footer="">
<div class="footer__container">
<!-- BOTTOM -->
<div class="footer__bottom">
<p class="footer__copy">© 2026 Animmaster</p>
<div class="footer__bug">
<span>Found bug?</span>
<a href="mailto:animmasterstudio@gmail.com">
Report it
</a>
</div>
<div class="footer__author">
Crafted with <span>🤍</span> by
<a target="_blank" href="https://www.instagram.com/animmaster_studio?igsh=MXN0MXkycGxrbDlpag==">
Animmaster
</a>
</div>
</div>
</div>
</footer>
</div>
</body>
</html>