fancoolo-fx 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.distignore +15 -0
- package/README.md +41 -5
- package/package.json +13 -2
- package/src/fx.js +3 -0
- package/.github/workflows/release.yml +0 -27
- package/wp-plugin/fancoolo-fx/assets/ScrollTrigger.min.js +0 -11
- package/wp-plugin/fancoolo-fx/assets/SplitText.min.js +0 -11
- package/wp-plugin/fancoolo-fx/assets/fx.js +0 -573
- package/wp-plugin/fancoolo-fx/assets/gsap.min.js +0 -11
- package/wp-plugin/fancoolo-fx/fancoolo-fx.php +0 -449
- /package/{wp-plugin/fancoolo-fx/readme.txt → readme.txt} +0 -0
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* Plugin Name: Fancoolo FX
|
|
4
|
-
* Plugin URI: https://github.com/krstivoja/fancoolo-fx
|
|
5
|
-
* Description: A class-driven GSAP animation wrapper. Add CSS classes in Gutenberg and get animations — no JavaScript needed.
|
|
6
|
-
* Version: 1.2.0
|
|
7
|
-
* Author: Fancoolo
|
|
8
|
-
* Author URI: https://github.com/krstivoja
|
|
9
|
-
* License: ISC
|
|
10
|
-
* Text Domain: fancoolo-fx
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
if ( ! defined( 'ABSPATH' ) ) {
|
|
14
|
-
exit;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
define( 'FANCOOLO_FX_VERSION', '1.2.0' );
|
|
18
|
-
define( 'FANCOOLO_FX_PATH', plugin_dir_path( __FILE__ ) );
|
|
19
|
-
define( 'FANCOOLO_FX_URL', plugin_dir_url( __FILE__ ) );
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* ─── Frontend: Enqueue GSAP + FX scripts ────────────────────────────
|
|
23
|
-
*/
|
|
24
|
-
function fancoolo_fx_enqueue_scripts() {
|
|
25
|
-
// 1. GSAP core
|
|
26
|
-
wp_enqueue_script(
|
|
27
|
-
'gsap',
|
|
28
|
-
FANCOOLO_FX_URL . 'assets/gsap.min.js',
|
|
29
|
-
array(),
|
|
30
|
-
'3.14.2',
|
|
31
|
-
true
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
// 2. ScrollTrigger
|
|
35
|
-
wp_enqueue_script(
|
|
36
|
-
'gsap-scrolltrigger',
|
|
37
|
-
FANCOOLO_FX_URL . 'assets/ScrollTrigger.min.js',
|
|
38
|
-
array( 'gsap' ),
|
|
39
|
-
'3.14.2',
|
|
40
|
-
true
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
// 3. SplitText
|
|
44
|
-
wp_enqueue_script(
|
|
45
|
-
'gsap-splittext',
|
|
46
|
-
FANCOOLO_FX_URL . 'assets/SplitText.min.js',
|
|
47
|
-
array( 'gsap' ),
|
|
48
|
-
'3.14.2',
|
|
49
|
-
true
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
// 4. Fancoolo FX
|
|
53
|
-
wp_enqueue_script(
|
|
54
|
-
'fancoolo-fx',
|
|
55
|
-
FANCOOLO_FX_URL . 'assets/fx.js',
|
|
56
|
-
array( 'gsap', 'gsap-scrolltrigger', 'gsap-splittext' ),
|
|
57
|
-
FANCOOLO_FX_VERSION,
|
|
58
|
-
true
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
// 5. Custom modifiers (if file exists and is not empty)
|
|
62
|
-
$custom_file = fancoolo_fx_get_custom_file_path();
|
|
63
|
-
if ( file_exists( $custom_file ) && filesize( $custom_file ) > 0 ) {
|
|
64
|
-
$upload_dir = wp_upload_dir();
|
|
65
|
-
$custom_url = $upload_dir['baseurl'] . '/fancoolo-fx/custom.js';
|
|
66
|
-
wp_enqueue_script(
|
|
67
|
-
'fancoolo-fx-custom',
|
|
68
|
-
$custom_url,
|
|
69
|
-
array( 'fancoolo-fx' ),
|
|
70
|
-
filemtime( $custom_file ),
|
|
71
|
-
true
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
add_action( 'wp_enqueue_scripts', 'fancoolo_fx_enqueue_scripts' );
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* ─── Helper: Get path to custom.js in uploads ──────────────────────
|
|
79
|
-
*/
|
|
80
|
-
function fancoolo_fx_get_custom_file_path() {
|
|
81
|
-
$upload_dir = wp_upload_dir();
|
|
82
|
-
return $upload_dir['basedir'] . '/fancoolo-fx/custom.js';
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* ─── Admin: Register settings page under Appearance ─────────────────
|
|
87
|
-
*/
|
|
88
|
-
function fancoolo_fx_add_admin_page() {
|
|
89
|
-
add_theme_page(
|
|
90
|
-
'Fancoolo FX',
|
|
91
|
-
'Fancoolo FX',
|
|
92
|
-
'edit_theme_options',
|
|
93
|
-
'fancoolo-fx',
|
|
94
|
-
'fancoolo_fx_render_admin_page'
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
add_action( 'admin_menu', 'fancoolo_fx_add_admin_page' );
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* ─── Admin: Enqueue CodeMirror on our settings page ─────────────────
|
|
101
|
-
*/
|
|
102
|
-
function fancoolo_fx_admin_enqueue( $hook ) {
|
|
103
|
-
if ( 'appearance_page_fancoolo-fx' !== $hook ) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// WordPress built-in CodeMirror
|
|
108
|
-
$settings = wp_enqueue_code_editor( array( 'type' => 'text/javascript' ) );
|
|
109
|
-
|
|
110
|
-
if ( false !== $settings ) {
|
|
111
|
-
wp_add_inline_script(
|
|
112
|
-
'code-editor',
|
|
113
|
-
sprintf(
|
|
114
|
-
'jQuery(function($) {
|
|
115
|
-
if ($("#fancoolo-fx-editor").length) {
|
|
116
|
-
var editor = wp.codeEditor.initialize($("#fancoolo-fx-editor"), %s);
|
|
117
|
-
// Auto-resize
|
|
118
|
-
editor.codemirror.on("change", function(cm) {
|
|
119
|
-
cm.refresh();
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
});',
|
|
123
|
-
wp_json_encode( $settings )
|
|
124
|
-
)
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
add_action( 'admin_enqueue_scripts', 'fancoolo_fx_admin_enqueue' );
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* ─── Admin: Handle form save ────────────────────────────────────────
|
|
132
|
-
*/
|
|
133
|
-
function fancoolo_fx_handle_save() {
|
|
134
|
-
if ( ! isset( $_POST['fancoolo_fx_save'] ) ) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if ( ! check_admin_referer( 'fancoolo_fx_save_action', 'fancoolo_fx_nonce' ) ) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if ( ! current_user_can( 'edit_theme_options' ) ) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
$content = isset( $_POST['fancoolo_fx_code'] ) ? wp_unslash( $_POST['fancoolo_fx_code'] ) : '';
|
|
147
|
-
|
|
148
|
-
$upload_dir = wp_upload_dir();
|
|
149
|
-
$dir = $upload_dir['basedir'] . '/fancoolo-fx';
|
|
150
|
-
|
|
151
|
-
if ( ! file_exists( $dir ) ) {
|
|
152
|
-
wp_mkdir_p( $dir );
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
$file = $dir . '/custom.js';
|
|
156
|
-
file_put_contents( $file, $content );
|
|
157
|
-
|
|
158
|
-
add_settings_error(
|
|
159
|
-
'fancoolo_fx',
|
|
160
|
-
'fancoolo_fx_saved',
|
|
161
|
-
'Custom JavaScript saved.',
|
|
162
|
-
'success'
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
add_action( 'admin_init', 'fancoolo_fx_handle_save' );
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* ─── Admin: Render the settings page ────────────────────────────────
|
|
169
|
-
*/
|
|
170
|
-
function fancoolo_fx_render_admin_page() {
|
|
171
|
-
$custom_file = fancoolo_fx_get_custom_file_path();
|
|
172
|
-
$content = file_exists( $custom_file ) ? file_get_contents( $custom_file ) : '';
|
|
173
|
-
|
|
174
|
-
settings_errors( 'fancoolo_fx' );
|
|
175
|
-
?>
|
|
176
|
-
<style>
|
|
177
|
-
.ffx-tabs { display: flex; gap: 0; border-bottom: 1px solid #c3c4c7; margin: 20px 0 0; }
|
|
178
|
-
.ffx-tab { padding: 10px 20px; cursor: pointer; font-weight: 600; font-size: 14px; color: #50575e; border: 1px solid transparent; border-bottom: none; margin-bottom: -1px; background: none; border-radius: 4px 4px 0 0; }
|
|
179
|
-
.ffx-tab:hover { color: #1d2327; }
|
|
180
|
-
.ffx-tab.active { background: #fff; border-color: #c3c4c7; color: #1d2327; }
|
|
181
|
-
.ffx-panel { display: none; background: #fff; border: 1px solid #c3c4c7; border-top: none; padding: 24px; }
|
|
182
|
-
.ffx-panel.active { display: block; }
|
|
183
|
-
.ffx-panel-editor { padding: 0; position: relative; }
|
|
184
|
-
.ffx-panel-editor .CodeMirror { border: none; }
|
|
185
|
-
.ffx-save-btn { position: absolute; top: 12px; right: 12px; z-index: 10; }
|
|
186
|
-
.ffx-copy-wrap { position: relative; }
|
|
187
|
-
.ffx-copy-btn { position: absolute; top: 8px; right: 8px; padding: 4px 10px; font-size: 11px; cursor: pointer; background: #3c434a; color: #bbb; border: 1px solid #555; border-radius: 3px; }
|
|
188
|
-
.ffx-copy-btn:hover { color: #fff; border-color: #888; }
|
|
189
|
-
.ffx-copy-btn.copied { color: #46b450; border-color: #46b450; }
|
|
190
|
-
.ffx-pre { background: #23282d; color: #eee; padding: 16px; border-radius: 4px; margin: 0; overflow-x: auto; font-size: 13px; line-height: 1.6; }
|
|
191
|
-
.ffx-class-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #f0f0f1; }
|
|
192
|
-
.ffx-class-row:last-child { border-bottom: none; }
|
|
193
|
-
.ffx-class-row code { background: #f0f0f1; padding: 3px 8px; border-radius: 3px; font-size: 13px; cursor: pointer; transition: background 0.15s; }
|
|
194
|
-
.ffx-class-row code:hover { background: #2271b1; color: #fff; }
|
|
195
|
-
.ffx-class-row code.copied { background: #46b450; color: #fff; }
|
|
196
|
-
.ffx-class-row .ffx-desc { color: #646970; font-size: 13px; }
|
|
197
|
-
.ffx-group-title { font-weight: 600; font-size: 14px; padding: 12px 0 4px; color: #1d2327; border-bottom: 2px solid #2271b1; margin-bottom: 4px; }
|
|
198
|
-
</style>
|
|
199
|
-
|
|
200
|
-
<div class="wrap">
|
|
201
|
-
<h1>Fancoolo FX</h1>
|
|
202
|
-
<p>
|
|
203
|
-
GSAP animation wrapper is active. Add <code>.fx-*</code> classes to blocks in Gutenberg
|
|
204
|
-
and they will animate automatically.
|
|
205
|
-
</p>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<!-- ── Tabs ── -->
|
|
209
|
-
<div class="ffx-tabs">
|
|
210
|
-
<button class="ffx-tab active" data-tab="editor">Editor</button>
|
|
211
|
-
<button class="ffx-tab" data-tab="config">Config Reference</button>
|
|
212
|
-
<button class="ffx-tab" data-tab="classes">Classes Reference</button>
|
|
213
|
-
</div>
|
|
214
|
-
|
|
215
|
-
<!-- ═══ Editor Tab ═══ -->
|
|
216
|
-
<div class="ffx-panel ffx-panel-editor active" data-panel="editor">
|
|
217
|
-
<form method="post">
|
|
218
|
-
<?php wp_nonce_field( 'fancoolo_fx_save_action', 'fancoolo_fx_nonce' ); ?>
|
|
219
|
-
<input type="submit" name="fancoolo_fx_save" class="button button-primary ffx-save-btn" value="Save Changes">
|
|
220
|
-
<textarea
|
|
221
|
-
id="fancoolo-fx-editor"
|
|
222
|
-
name="fancoolo_fx_code"
|
|
223
|
-
rows="20"
|
|
224
|
-
style="width: 100%; font-family: monospace;"
|
|
225
|
-
><?php echo esc_textarea( $content ); ?></textarea>
|
|
226
|
-
</form>
|
|
227
|
-
</div>
|
|
228
|
-
|
|
229
|
-
<!-- ═══ Config Reference Tab ═══ -->
|
|
230
|
-
<div class="ffx-panel" data-panel="config">
|
|
231
|
-
|
|
232
|
-
<h3>Config Options</h3>
|
|
233
|
-
<table class="widefat fixed striped" style="max-width: 700px;">
|
|
234
|
-
<thead>
|
|
235
|
-
<tr><th>Option</th><th>Default</th><th>Description</th></tr>
|
|
236
|
-
</thead>
|
|
237
|
-
<tbody>
|
|
238
|
-
<tr><td><code>FX.config.tagMap</code></td><td><code>null</code></td><td>Auto-animate elements by tag/selector — no classes needed</td></tr>
|
|
239
|
-
<tr><td><code>FX.config.sectionSelector</code></td><td><code>'section'</code></td><td>Containers for bare-class and tagMap triggering</td></tr>
|
|
240
|
-
<tr><td><code>FX.config.scrollStart</code></td><td><code>'top 85%'</code></td><td>When scroll animations trigger (GSAP ScrollTrigger start format)</td></tr>
|
|
241
|
-
<tr><td><code>FX.config.scrollOnce</code></td><td><code>true</code></td><td>Play once or replay on every scroll</td></tr>
|
|
242
|
-
</tbody>
|
|
243
|
-
</table>
|
|
244
|
-
|
|
245
|
-
<h3 style="margin-top: 24px;">JS API Functions</h3>
|
|
246
|
-
<table class="widefat fixed striped" style="max-width: 700px;">
|
|
247
|
-
<thead>
|
|
248
|
-
<tr><th>Function</th><th>Description</th></tr>
|
|
249
|
-
</thead>
|
|
250
|
-
<tbody>
|
|
251
|
-
<tr><td><code>FX.textReveal(el, opts)</code></td><td>Split text lines, masked reveal upward</td></tr>
|
|
252
|
-
<tr><td><code>FX.reveal(el, opts)</code></td><td>Slide up with fade</td></tr>
|
|
253
|
-
<tr><td><code>FX.spinReveal(el, opts)</code></td><td>Rotate and scale in</td></tr>
|
|
254
|
-
<tr><td><code>FX.bgReveal(el, opts)</code></td><td>Background slide up</td></tr>
|
|
255
|
-
<tr><td><code>FX.scaleIn(el, opts)</code></td><td>Scale up with fade</td></tr>
|
|
256
|
-
<tr><td><code>FX.fadeIn(el, opts)</code></td><td>Opacity + subtle scale, no movement</td></tr>
|
|
257
|
-
<tr><td><code>FX.blurIn(el, opts)</code></td><td>Fade in while deblurring</td></tr>
|
|
258
|
-
<tr><td><code>FX.clipUp(el, opts)</code></td><td>Clip-path wipe from bottom</td></tr>
|
|
259
|
-
<tr><td><code>FX.clipDown(el, opts)</code></td><td>Clip-path wipe from top</td></tr>
|
|
260
|
-
<tr><td><code>FX.tiltIn(el, opts)</code></td><td>3D perspective reveal (scrub-based)</td></tr>
|
|
261
|
-
<tr><td><code>FX.init()</code></td><td>Re-scan DOM — call after changing any config</td></tr>
|
|
262
|
-
</tbody>
|
|
263
|
-
</table>
|
|
264
|
-
|
|
265
|
-
<h3 style="margin-top: 24px;">Examples <span style="font-weight:normal;color:#646970;font-size:13px;">(click code to copy)</span></h3>
|
|
266
|
-
|
|
267
|
-
<h4 style="margin-top: 16px;">Auto-animate by tag</h4>
|
|
268
|
-
<div class="ffx-copy-wrap">
|
|
269
|
-
<button class="ffx-copy-btn" data-target="ex1">Copy</button>
|
|
270
|
-
<pre class="ffx-pre" id="ex1">FX.config.tagMap = {
|
|
271
|
-
'h1,h2,h3,h4,h5,h6': 'textReveal',
|
|
272
|
-
'p,blockquote': 'textReveal',
|
|
273
|
-
'img,video': 'reveal',
|
|
274
|
-
};
|
|
275
|
-
FX.config.sectionSelector = 'section, .wp-block-group';
|
|
276
|
-
FX.init();</pre>
|
|
277
|
-
</div>
|
|
278
|
-
|
|
279
|
-
<h4 style="margin-top: 16px;">Change scroll trigger position</h4>
|
|
280
|
-
<div class="ffx-copy-wrap">
|
|
281
|
-
<button class="ffx-copy-btn" data-target="ex2">Copy</button>
|
|
282
|
-
<pre class="ffx-pre" id="ex2">FX.config.scrollStart = 'top center';
|
|
283
|
-
FX.init();</pre>
|
|
284
|
-
</div>
|
|
285
|
-
|
|
286
|
-
<h4 style="margin-top: 16px;">Replay animations on re-scroll</h4>
|
|
287
|
-
<div class="ffx-copy-wrap">
|
|
288
|
-
<button class="ffx-copy-btn" data-target="ex3">Copy</button>
|
|
289
|
-
<pre class="ffx-pre" id="ex3">FX.config.scrollOnce = false;
|
|
290
|
-
FX.init();</pre>
|
|
291
|
-
</div>
|
|
292
|
-
|
|
293
|
-
<h4 style="margin-top: 16px;">Compound sequence</h4>
|
|
294
|
-
<div class="ffx-copy-wrap">
|
|
295
|
-
<button class="ffx-copy-btn" data-target="ex4">Copy</button>
|
|
296
|
-
<pre class="ffx-pre" id="ex4">document.addEventListener('DOMContentLoaded', function () {
|
|
297
|
-
var hero = document.querySelector('.wp-block-cover');
|
|
298
|
-
if (!hero) return;
|
|
299
|
-
|
|
300
|
-
FX.scaleIn(hero, {
|
|
301
|
-
trigger: 'scroll',
|
|
302
|
-
scrollTrigger: { trigger: hero }
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
var heading = hero.querySelector('h2');
|
|
306
|
-
if (heading) {
|
|
307
|
-
FX.textReveal(heading, {
|
|
308
|
-
trigger: 'scroll',
|
|
309
|
-
delay: 0.2,
|
|
310
|
-
scrollTrigger: { trigger: hero }
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
});</pre>
|
|
314
|
-
</div>
|
|
315
|
-
</div>
|
|
316
|
-
|
|
317
|
-
<!-- ═══ Classes Reference Tab ═══ -->
|
|
318
|
-
<div class="ffx-panel" data-panel="classes">
|
|
319
|
-
|
|
320
|
-
<p style="margin-bottom: 16px; color: #646970;">
|
|
321
|
-
Add these in Gutenberg: select a block → Advanced → Additional CSS class(es). Click any class to copy it.
|
|
322
|
-
</p>
|
|
323
|
-
|
|
324
|
-
<!-- Text Reveal -->
|
|
325
|
-
<div class="ffx-group-title">Text Reveal</div>
|
|
326
|
-
<div class="ffx-class-row"><code data-copy>fx-text-reveal-pl</code><span class="ffx-desc">Page load — masked line-by-line reveal</span></div>
|
|
327
|
-
<div class="ffx-class-row"><code data-copy>fx-text-reveal-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
328
|
-
<div class="ffx-class-row"><code data-copy>fx-text-reveal</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
329
|
-
|
|
330
|
-
<!-- Reveal -->
|
|
331
|
-
<div class="ffx-group-title">Reveal</div>
|
|
332
|
-
<div class="ffx-class-row"><code data-copy>fx-reveal-pl</code><span class="ffx-desc">Page load — slide up with fade</span></div>
|
|
333
|
-
<div class="ffx-class-row"><code data-copy>fx-reveal-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
334
|
-
<div class="ffx-class-row"><code data-copy>fx-reveal</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
335
|
-
|
|
336
|
-
<!-- Spin Reveal -->
|
|
337
|
-
<div class="ffx-group-title">Spin Reveal</div>
|
|
338
|
-
<div class="ffx-class-row"><code data-copy>fx-spin-reveal-pl</code><span class="ffx-desc">Page load — rotate and scale in</span></div>
|
|
339
|
-
<div class="ffx-class-row"><code data-copy>fx-spin-reveal-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
340
|
-
<div class="ffx-class-row"><code data-copy>fx-spin-reveal</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
341
|
-
|
|
342
|
-
<!-- BG Reveal -->
|
|
343
|
-
<div class="ffx-group-title">BG Reveal</div>
|
|
344
|
-
<div class="ffx-class-row"><code data-copy>fx-bg-reveal-pl</code><span class="ffx-desc">Page load — background slide up</span></div>
|
|
345
|
-
<div class="ffx-class-row"><code data-copy>fx-bg-reveal-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
346
|
-
<div class="ffx-class-row"><code data-copy>fx-bg-reveal</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
347
|
-
|
|
348
|
-
<!-- Scale In -->
|
|
349
|
-
<div class="ffx-group-title">Scale In</div>
|
|
350
|
-
<div class="ffx-class-row"><code data-copy>fx-scale-in-pl</code><span class="ffx-desc">Page load — scale up with fade</span></div>
|
|
351
|
-
<div class="ffx-class-row"><code data-copy>fx-scale-in-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
352
|
-
<div class="ffx-class-row"><code data-copy>fx-scale-in</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
353
|
-
|
|
354
|
-
<!-- Fade In -->
|
|
355
|
-
<div class="ffx-group-title">Fade In</div>
|
|
356
|
-
<div class="ffx-class-row"><code data-copy>fx-fade-in-pl</code><span class="ffx-desc">Page load — opacity only, no movement</span></div>
|
|
357
|
-
<div class="ffx-class-row"><code data-copy>fx-fade-in-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
358
|
-
<div class="ffx-class-row"><code data-copy>fx-fade-in</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
359
|
-
|
|
360
|
-
<!-- Blur In -->
|
|
361
|
-
<div class="ffx-group-title">Blur In</div>
|
|
362
|
-
<div class="ffx-class-row"><code data-copy>fx-blur-in-pl</code><span class="ffx-desc">Page load — fade in while deblurring</span></div>
|
|
363
|
-
<div class="ffx-class-row"><code data-copy>fx-blur-in-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
364
|
-
<div class="ffx-class-row"><code data-copy>fx-blur-in</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
365
|
-
|
|
366
|
-
<!-- Clip Up -->
|
|
367
|
-
<div class="ffx-group-title">Clip Reveal</div>
|
|
368
|
-
<div class="ffx-class-row"><code data-copy>fx-clip-up-pl</code><span class="ffx-desc">Page load — clip-path wipe from bottom</span></div>
|
|
369
|
-
<div class="ffx-class-row"><code data-copy>fx-clip-up-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
370
|
-
<div class="ffx-class-row"><code data-copy>fx-clip-up</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
371
|
-
<div class="ffx-class-row"><code data-copy>fx-clip-down-pl</code><span class="ffx-desc">Page load — clip-path wipe from top</span></div>
|
|
372
|
-
<div class="ffx-class-row"><code data-copy>fx-clip-down-st</code><span class="ffx-desc">Scroll triggered</span></div>
|
|
373
|
-
<div class="ffx-class-row"><code data-copy>fx-clip-down</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
374
|
-
|
|
375
|
-
<!-- Tilt In -->
|
|
376
|
-
<div class="ffx-group-title">Tilt In <span style="font-weight:normal;color:#646970;font-size:12px;">(scrub — tied to scroll position)</span></div>
|
|
377
|
-
<div class="ffx-class-row"><code data-copy>fx-tilt-in-st</code><span class="ffx-desc">3D perspective reveal linked to scroll</span></div>
|
|
378
|
-
<div class="ffx-class-row"><code data-copy>fx-tilt-in</code><span class="ffx-desc">Auto triggered inside a section</span></div>
|
|
379
|
-
|
|
380
|
-
<!-- Stagger All -->
|
|
381
|
-
<div class="ffx-group-title" style="margin-top: 20px;">Stagger Children <span style="font-weight:normal;color:#646970;font-size:12px;">(pair with an effect class)</span></div>
|
|
382
|
-
<div class="ffx-class-row"><code data-copy>fx-stagger-all-[img]</code><span class="ffx-desc">Target all img children — requires effect class</span></div>
|
|
383
|
-
<div class="ffx-class-row"><code data-copy>fx-stagger-all-[img,p]</code><span class="ffx-desc">Target img and p children</span></div>
|
|
384
|
-
<div class="ffx-class-row"><code data-copy>fx-stagger-all-[.card]</code><span class="ffx-desc">Target children by CSS class</span></div>
|
|
385
|
-
|
|
386
|
-
<!-- Modifiers -->
|
|
387
|
-
<div class="ffx-group-title" style="margin-top: 20px;">Modifiers <span style="font-weight:normal;color:#646970;font-size:12px;">(combine with any effect class)</span></div>
|
|
388
|
-
<div class="ffx-class-row"><code data-copy>fx-duration-[1.5]</code><span class="ffx-desc">Custom duration (seconds)</span></div>
|
|
389
|
-
<div class="ffx-class-row"><code data-copy>fx-delay-[0.3]</code><span class="ffx-desc">Delay before animating (seconds)</span></div>
|
|
390
|
-
<div class="ffx-class-row"><code data-copy>fx-stagger-[0.25]</code><span class="ffx-desc">Delay between staggered siblings</span></div>
|
|
391
|
-
<div class="ffx-class-row"><code data-copy>fx-ease-[power2.inOut]</code><span class="ffx-desc">GSAP easing function</span></div>
|
|
392
|
-
<div class="ffx-class-row"><code data-copy>fx-start-[top center]</code><span class="ffx-desc">Scroll trigger start position</span></div>
|
|
393
|
-
</div>
|
|
394
|
-
|
|
395
|
-
<p style="margin-top: 24px; color: #646970;">
|
|
396
|
-
This code loads after fx.js on the frontend. Leave empty to use defaults only.<br>
|
|
397
|
-
<strong style="color:#1d2327;">Important:</strong> Always add <code>FX.init();</code> at the end when changing config — it re-scans the page with your new settings.
|
|
398
|
-
</p>
|
|
399
|
-
<p style="margin-top: 12px;">
|
|
400
|
-
<a href="https://krstivoja.github.io/fancoolo-fx/documentation/" target="_blank">
|
|
401
|
-
Full Documentation →
|
|
402
|
-
</a>
|
|
403
|
-
</p>
|
|
404
|
-
</div>
|
|
405
|
-
|
|
406
|
-
<script>
|
|
407
|
-
jQuery(function($) {
|
|
408
|
-
// Fallback copy that works on HTTP (no clipboard API needed)
|
|
409
|
-
function copyText(text) {
|
|
410
|
-
var ta = document.createElement('textarea');
|
|
411
|
-
ta.value = text;
|
|
412
|
-
ta.style.position = 'fixed';
|
|
413
|
-
ta.style.opacity = '0';
|
|
414
|
-
document.body.appendChild(ta);
|
|
415
|
-
ta.select();
|
|
416
|
-
document.execCommand('copy');
|
|
417
|
-
document.body.removeChild(ta);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
// Tab switching
|
|
421
|
-
$('.ffx-tab').on('click', function() {
|
|
422
|
-
var tab = $(this).data('tab');
|
|
423
|
-
$('.ffx-tab').removeClass('active');
|
|
424
|
-
$(this).addClass('active');
|
|
425
|
-
$('.ffx-panel').removeClass('active');
|
|
426
|
-
$('.ffx-panel[data-panel="' + tab + '"]').addClass('active');
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
// Copy code blocks
|
|
430
|
-
$('.ffx-copy-btn').on('click', function() {
|
|
431
|
-
var btn = $(this);
|
|
432
|
-
var target = $('#' + btn.data('target'));
|
|
433
|
-
copyText(target.text());
|
|
434
|
-
btn.text('Copied!').addClass('copied');
|
|
435
|
-
setTimeout(function() { btn.text('Copy').removeClass('copied'); }, 1500);
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
// Copy class on click
|
|
439
|
-
$('[data-copy]').on('click', function() {
|
|
440
|
-
var el = $(this);
|
|
441
|
-
var original = el.text();
|
|
442
|
-
copyText(original);
|
|
443
|
-
el.text('Copied!').addClass('copied');
|
|
444
|
-
setTimeout(function() { el.text(original).removeClass('copied'); }, 1000);
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
</script>
|
|
448
|
-
<?php
|
|
449
|
-
}
|
|
File without changes
|