-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic.html
More file actions
335 lines (281 loc) · 14.5 KB
/
dynamic.html
File metadata and controls
335 lines (281 loc) · 14.5 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
<!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>Dynamic Adapt</title> <script type="module" crossorigin src="./js/app.min.js?v=1774807247397"></script>
<link rel="stylesheet" crossorigin href="./css/app.min.css?v=1774807247397">
</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-dynamicadaptdoc="" 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: Dynamic Adapt
<span class="doc-hero__title-sub">Move elements across the DOM based on breakpoint</span>
</h1>
<p class="doc-hero__lead">
When building responsive layouts, sometimes you don’t just change styles — you need to change
the <strong>order</strong> or even the <strong>position</strong> of elements in the HTML structure.
Dynamic Adapt moves an element to another container at a specified screen width, and automatically
returns it back when the screen becomes wider again.
</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) What it does -->
<!-- ========================================================= -->
<section class="doc-section" id="what" data-anim-watcher="navigator">
<h2 class="doc-h2">What Dynamic Adapt solves</h2>
<p class="doc-p">
In many cases, responsive design is not only about changing paddings or font sizes.
Sometimes a block must appear in a totally different place in the markup on mobile:
for example, moving a button into the header, placing a sidebar under content, or re-ordering
cards for better UX.
</p>
<div class="doc-callout doc-callout--accent">
<div class="doc-callout__title">Key behavior</div>
<div class="doc-callout__text">
At the given breakpoint, the element is moved to a new container (the HTML structure
actually changes). When the screen grows wider again, the element is returned to its original
place.
</div>
</div>
</section>
<!-- ========================================================= -->
<!-- 2) How to use -->
<!-- ========================================================= -->
<section class="doc-section" id="usage" data-anim-watcher="navigator">
<h2 class="doc-h2">How to use</h2>
<p class="doc-p">
Add the attribute <code>data-anim-dynamic</code> to the element you want to move.
JS is connected automatically when the attribute is present (you can use the <code>da</code>
snippet if you have it).
</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">Attribute format</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">data-anim-dynamic="targetSelector, breakpoint, position, parentSelector"</code></pre>
</div>
<ul class="doc-list">
<li class="doc-list__item"><strong>targetSelector</strong> — (required) selector of the container
to move into.</li>
<li class="doc-list__item"><strong>breakpoint</strong> — (required, default <code>767.98</code>)
screen width where move happens.</li>
<li class="doc-list__item"><strong>position</strong> — (default <code>0</code>) index among
existing children in the target container.</li>
<li class="doc-list__item"><strong>parentSelector</strong> — optional “scope” selector. If
provided, the system searches for the target inside this parent.</li>
</ul>
<div class="doc-callout">
<div class="doc-callout__title">Defaults</div>
<div class="doc-callout__text">
If you omit optional values, the system uses <code>767.98</code> as the breakpoint and
<code>0</code> as the position.
</div>
</div>
</section>
<!-- ========================================================= -->
<!-- 3) Examples -->
<!-- ========================================================= -->
<section class="doc-section" id="examples" data-anim-watcher="navigator">
<h2 class="doc-h2">Examples</h2>
<p class="doc-p">Move a button into <code>.header__actions</code> on mobile:</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">HTML</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<button
class="hero__cta"
data-anim-dynamic=".header__actions, 767.98, 0"
>
Get started
</button></code></pre>
</div>
<p class="doc-p">Move a sidebar under content at <code>991.98</code> and place it after the first
child:</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">HTML</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<aside
class="layout__sidebar"
data-anim-dynamic=".layout__content, 991.98, 1"
>
...
</aside></code></pre>
</div>
<p class="doc-p">
Use a parent selector to disambiguate the target (useful if the same selector appears multiple
times on the page):
</p>
<div class="codeblock" data-codeblock="">
<div class="codeblock__top">
<div class="codeblock__file">HTML</div>
<button class="codeblock__copy" type="button" data-copy="">Copy</button>
</div>
<pre class="codeblock__pre"><code class="codeblock__code">
<div
class="card__meta"
data-anim-dynamic=".card__footer, 767.98, 0, .card"
>
...
</div></code></pre>
</div>
</section>
<!-- ========================================================= -->
<!-- 4) Tips -->
<!-- ========================================================= -->
<section class="doc-section" id="tips" data-anim-watcher="navigator">
<h2 class="doc-h2">Practical tips</h2>
<div class="doc-grid doc-grid--no-grid">
<div class="doc-card doc-card--inline">
<h3 class="doc-h3">Prefer stable selectors</h3>
<p class="doc-p">
Use unique, predictable selectors for targets (BEM-style containers are perfect).
Avoid selectors that might change (like <code>:nth-child</code> or deeply nested chains).
</p>
</div>
<div class="doc-card doc-card--inline">
<h3 class="doc-h3">Think about accessibility</h3>
<p class="doc-p">
Moving elements changes DOM order, which affects keyboard navigation and screen readers.
Make sure the new order still makes sense.
</p>
</div>
<div class="doc-card doc-card--inline">
<h3 class="doc-h3">Use “position” intentionally</h3>
<p class="doc-p">
Position <code>0</code> means “first in target”.
If you need it after an existing block, use <code>1</code>, <code>2</code>, etc.
</p>
</div>
</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 responsive layouts faster: move blocks where they belong without rewriting markup for each
breakpoint.
Download the template and use Dynamic Adapt out of the box.
</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/menuburger.html">
Next: Component: Adaptive Menu (Burger)
<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="#what">What it
does</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#usage">How to
use</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#examples">Examples</a></li>
<li><a class="doc-toc__link" href="#" data-anim-scrollto-header="" data-anim-scrollto="#tips">Tips</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>