Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.11 #168

Merged
merged 17 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
134 changes: 114 additions & 20 deletions assets/css/rrze-elements-blocks.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/rrze-elements-blocks.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions assets/js/timeline/rrze-timeline-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions assets/js/timeline/rrze-timeline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
try {
gsap.registerPlugin(ScrollTrigger);

const prefersReducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;

const timelineItems = document.querySelectorAll(
".wp-block-rrze-elements-timeline-item"
);

if (!prefersReducedMotion) {
timelineItems.forEach((item) => {
const tooltip = item.querySelector(".tooltip");

gsap.set(item, { opacity: 0 });
gsap.set(tooltip, { opacity: 0, y: 50 });

const tl = gsap.timeline({
scrollTrigger: {
trigger: item,
start: "top 80%",
toggleActions: "play none none none",
},
});

// Animate the li element: fade in over 0.3 seconds
tl.to(item, {
opacity: 1,
duration: 0.3,
ease: "power1.inOut",
});

// Animate the tooltip: opacity and y over 0.7 seconds
tl.to(
tooltip,
{
opacity: 1,
y: 0,
duration: 0.7,
ease: "power1.in",
},
0 // Starts at the same time as the li animation
);
});
} else {
// If the user prefers reduced motion, ensure items are visible without animation
timelineItems.forEach((item) => {
item.style.opacity = 1;
const tooltip = item.querySelector(".tooltip");
tooltip.style.opacity = 1;
tooltip.style.transform = "translateY(0)";
});
}
} catch (error) {
console.error("Animation initialization failed:", error);
}
2 changes: 1 addition & 1 deletion build/accordion/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "rrze-elements/accordion",
"version": "1.0.10",
"version": "1.0.11",
"title": "Accordion item",
"category": "rrze_elements",
"description": "Creates an inner accordion item",
Expand Down
2 changes: 1 addition & 1 deletion build/accordions/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "rrze-elements/accordions",
"version": "1.0.10",
"version": "1.0.11",
"title": "Inner Accordion",
"category": "rrze_elements",
"parent": [
Expand Down
2 changes: 1 addition & 1 deletion build/alert/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "rrze-elements/alert",
"version": "1.0.10",
"version": "1.0.11",
"title": "Alert",
"category": "rrze_elements",
"description": "Used to highlight important information and warnings.",
Expand Down
2 changes: 1 addition & 1 deletion build/block-blueprint/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "rrze-elements/block-blueprint",
"version": "1.0.10",
"version": "1.0.11",
"title": "Blueprint",
"category": "rrze_elements",
"description": "Creates a blueprint block.",
Expand Down
2 changes: 1 addition & 1 deletion build/collapse/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "rrze-elements/collapse",
"version": "1.0.10",
"version": "1.0.11",
"title": "Accordion-item",
"category": "design",
"description": "Creates an accordion block",
Expand Down
2 changes: 1 addition & 1 deletion build/collapse/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '63c0a4c8c9a2454e494f');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '33e2c3a51f10621f5d2f');
2 changes: 1 addition & 1 deletion build/collapse/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/collapsibles/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "rrze-elements/collapsibles",
"version": "1.0.10",
"version": "1.0.11",
"title": "Accordion",
"category": "rrze_elements",
"description": "Creates an accordion block",
Expand Down
Loading
Loading