PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / blocks / alert / frontend.js

frontend.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/blocks/alert/frontend.js

30 lines 642 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Block Alert
3 */
4 const {
5 Motion: { animate },
6 GHOSTKIT: { events },
7 } = window;
8
9 events.on(document, 'click', '.ghostkit-alert-hide-button', (e) => {
10 e.preventDefault();
11
12 const alert = e.delegateTarget.parentNode;
13
14 events.trigger(alert, 'close.alert.gkt');
15
16 animate(alert, { opacity: 0 }, { duration: 0.5 }).finished.then(() => {
17 alert.style.height = `${alert.offsetHeight}px`;
18 alert.style.paddingTop = '0px';
19 alert.style.paddingBottom = '0px';
20
21 animate(
22 alert,
23 { height: 0, marginTop: 0, marginBottom: 0 },
24 { duration: 0.5 }
25 ).finished.then(() => {
26 events.trigger(alert, 'closed.alert.gkt');
27 });
28 });
29 });
30