Skip to content

Instantly share code, notes, and snippets.

View wpeasy's full-sized avatar

Alan Blair wpeasy

  • WPEasy Pty Ltd
  • Brisbane Australia
View GitHub Profile
@wpeasy
wpeasy / template.json
Created September 28, 2024 22:52
Bricks Title Animations
{"content":[{"id":"fyecqm","name":"section","parent":0,"children":["qzlujg","zktbjl"],"settings":{"_cssGlobalClasses":["azghyr"]}},{"id":"zktbjl","name":"container","parent":"fyecqm","children":["mqcylv"],"settings":[]},{"id":"mqcylv","name":"div","parent":"zktbjl","children":["lsmava","jrzudn","pnnpsg"],"settings":{"_cssGlobalClasses":["soqrhe","mjjnlw"]},"label":"WPE Title 1"},{"id":"lsmava","name":"text-basic","parent":"mqcylv","children":[],"settings":{"text":"WPE Title 1","tag":"p","_cssGlobalClasses":["xgjnoo"]},"label":"Upper Title"},{"id":"pnnpsg","name":"text-basic","parent":"mqcylv","children":[],"settings":{"text":"Lower Title","tag":"p","_cssGlobalClasses":["xuiylk"]},"label":"Lower Title"},{"id":"jrzudn","name":"divider","parent":"mqcylv","children":[],"settings":{"_cssGlobalClasses":["pefdqc"]}},{"id":"inoygc","name":"text","parent":"qzlujg","children":[],"settings":{"text":"<p>Isn't that fantastic that you can create an almighty tree that fast? Every day I learn. Be so very light. Be a gentle w
@wpeasy
wpeasy / template.json
Created September 18, 2024 20:28
Bricks Example Run Once code with Accordion
{"content":[{"id":"eada11","name":"section","parent":0,"children":["hzsuiu","gbxdvt"],"settings":{}},{"id":"hzsuiu","name":"container","parent":"eada11","children":["dbxacc"],"settings":[]},{"id":"dbxacc","name":"block","parent":"hzsuiu","children":["iamhht","abvaos"],"settings":{"_cssGlobalClasses":["hrqmoc"]},"label":"WPEasy Accordion (CSS)"},{"id":"iamhht","name":"accordion-nested","parent":"dbxacc","children":["pchmwm","viyjzy"],"settings":{"_cssGlobalClasses":["eikstu"]}},{"id":"pchmwm","name":"block","parent":"iamhht","children":["jhnvvm","kljwky"],"settings":{"_cssGlobalClasses":["ozntht"]},"label":"Item"},{"id":"jhnvvm","name":"block","parent":"pchmwm","children":["wnkirt"],"settings":{"_alignItems":"center","_direction":"row","_justifyContent":"space-between","_hidden":{"_cssClasses":"accordion-title-wrapper"},"tag":"custom","customTag":"h3","_cssGlobalClasses":["dfpgrd"]},"label":"Heading"},{"id":"wnkirt","name":"block","parent":"jhnvvm","children":["fknsni","jajptx"],"settings":{"tag":"custom","cus
@wpeasy
wpeasy / styles.css
Created September 13, 2024 02:12
Bricks Interaction Animations Util Class
/* Available globally */
:root {
--wpe-transition-distance: 15px;
--wpe-transition-rotation: 15deg;
/* use as globals if you wish to
e.g. var(--wpe-animation-duration--fast);
*/
--wpe-animation-duration--fast: 0.2s;
@wpeasy
wpeasy / template.json
Created July 7, 2024 23:32
ACSS A11Y Contrast Checker
{"content":[{"id":"zpoqdc","name":"section","parent":0,"children":["hxxvtj","eqyrql","tnchrj"],"settings":{},"label":"A11Y"},{"id":"hxxvtj","name":"code","parent":"zpoqdc","children":[],"settings":{"executeCode":true,"noRoot":true,"signature":"ef34dcb5f72679007750c01717fcfdf7","user_id":1,"time":1720392610,"code":"<script type=\"module\">\n // Function to convert RGB to Luminance\n const rgbToLuminance = (rgb) => {\n const rgbArr = rgb.match(/\\d+/g).map(Number);\n const [r, g, b] = rgbArr.map((value) => {\n value /= 255;\n return value <= 0.03928 ? value / 12.92 : Math.pow((value + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n }\n\n // Function to calculate the contrast ratio\n const calculateContrastRatio = (luminance1, luminance2) => {\n const brighter = Math.max(luminance1, luminance2);\n const darker = Math.min(luminance1, luminance2);\n return (brighter + 0.05) / (darker + 0.05);\n }\n\n // Function to check A11Y compliance\n const ch
@wpeasy
wpeasy / template.json
Created July 7, 2024 06:35
Bricks Builder Splitting JS
{"content":[{"id":"nzmpxb","name":"code","parent":0,"children":[],"settings":{"code":"<link rel=\"stylesheet\" href=\"https://unpkg.com/splitting/dist/splitting.css\" />\n<link rel=\"stylesheet\" href=\"https://unpkg.com/splitting/dist/splitting-cells.css\" />\n<script src=\"https://unpkg.com/splitting/dist/splitting.min.js\"></script>\n\n<script type=\"module\">\n Splitting(); \n</script>","executeCode":true,"noRoot":true,"signature":"388e5749bc3a3f681d4be4dc49285866","user_id":1,"time":1720330112}},{"id":"yqnnjo","name":"section","parent":0,"children":["vtzawa"],"settings":{}},{"id":"vtzawa","name":"container","parent":"yqnnjo","children":["pudafr"],"settings":{"_alignItems":"center"}},{"id":"pudafr","name":"text-basic","parent":"vtzawa","children":[],"settings":{"text":"Select any part of","tag":"p","_cssGlobalClasses":["kekkpn"],"_attributes":[{"id":"wcvkrk","name":"data-splitting"}]},"label":"Split Text"}],"source":"bricksCopiedElements","sourceUrl":"https://acss-at-based.local","version":"1.9.9","globa
@wpeasy
wpeasy / template.json
Last active August 18, 2024 12:08
Bricks Remote Slider Buttons
{"content":[{"id":"chbcen","name":"section","parent":0,"children":["dssnom"],"settings":{}},{"id":"dssnom","name":"container","parent":"chbcen","children":["ipncxv"],"settings":{"_display":"grid","_gridGap":"1rem","_gridTemplateColumns":"repeat(2, minmax(0, 1fr))"}},{"id":"dbe55a","name":"block","parent":"ipncxv","children":["771f25","909e90","a7136e","iwrkdr","2686bd"],"settings":{"_direction":"row","_cssGlobalClasses":["mkgizl"],"_attributes":[{"id":"jlzjql","name":"data-wpe-splide-id","value":"brxe-oennwd"},{"id":"hsqwec","name":"aria-role","value":"tablist"}],"tag":"ul"},"label":"WPE Splide Buttons"},{"id":"771f25","name":"div","parent":"dbe55a","children":["693011"],"settings":{"tag":"li","_cssGlobalClasses":["etqxgn"],"_attributes":[{"id":"bvagrz","name":"role","value":"presentation"}]},"label":"LI"},{"id":"693011","name":"button","parent":"771f25","children":[],"settings":{"text":"About","style":"primary","_cssGlobalClasses":["bggreh"],"tag":"button","_attributes":[{"id":"wycehu","name":"role","value":
@wpeasy
wpeasy / template-w-js.json
Created May 29, 2024 06:21
Zebre Card JS
{"content":[{"id":"viygze","name":"section","parent":0,"children":["egnjib"],"settings":[]},{"id":"egnjib","name":"container","parent":"viygze","children":["yonmxz","oqmbbl","uwohbk","rzygds"],"settings":{"taxonomies":["category","post_tag"],"extrasCustomQueryCode":"<style>\nh1.my-heading {\n color: crimson;\n}\n</style>\n\n<h1 class='my-heading'>Just some custom HTML</h1>","_display":"grid","_gridGap":"3rem","_gridTemplateColumns":"1fr 1fr 1fr"}},{"id":"yonmxz","name":"block","parent":"egnjib","children":["tlcgnn","loidvy","gisipf"],"settings":{"taxonomies":["category","post_tag"],"extrasCustomQueryCode":"<style>\nh1.my-heading {\n color: crimson;\n}\n</style>\n\n<h1 class='my-heading'>Just some custom HTML</h1>","_cssGlobalClasses":["dvrfvx"]},"label":"Zebre Card"},{"id":"tlcgnn","name":"image","parent":"yonmxz","children":[],"settings":{"tag":"figure","caption":"none","_cssGlobalClasses":["ysiige"],"image":{"id":463,"filename":"iegvy4o3bym.jpg","size":"large","full":"https://bb-card-tutorial.local/wp-con
@wpeasy
wpeasy / template.json
Created May 28, 2024 23:37
Card Transition Part 2 template
{"content":[{"id":"horvqp","name":"section","parent":0,"children":["sanapy"],"settings":{}},{"id":"sanapy","name":"container","parent":"horvqp","children":["tnmmsn","ulnnev","nldauu","dvkokk"],"settings":{"taxonomies":["category","post_tag"],"extrasCustomQueryCode":"<style>\nh1.my-heading {\n color: crimson;\n}\n</style>\n\n<h1 class='my-heading'>Just some custom HTML</h1>","_display":"grid","_gridGap":"3rem","_gridTemplateColumns":"1fr 1fr 1fr"}},{"id":"tnmmsn","name":"div","parent":"sanapy","children":["ejhnwh","zfemip","tpipnu"],"settings":{"taxonomies":["category","post_tag"],"extrasCustomQueryCode":"<style>\nh1.my-heading {\n color: crimson;\n}\n</style>\n\n<h1 class='my-heading'>Just some custom HTML</h1>","_cssGlobalClasses":["azsttb"]},"label":"Zebre Card V2"},{"id":"ejhnwh","name":"image","parent":"tnmmsn","children":[],"settings":{"tag":"figure","caption":"none","_cssGlobalClasses":["nlnmzm"],"image":{"id":463,"filename":"iegvy4o3bym.jpg","size":"large","full":"https://bb-card-tutorial.local/wp-co
@wpeasy
wpeasy / template.json
Created May 28, 2024 06:42
Zebre Card Template
{"content":[{"id":"viygze","name":"section","parent":0,"children":["egnjib"],"settings":[]},{"id":"egnjib","name":"container","parent":"viygze","children":["yonmxz","oqmbbl","uwohbk","rzygds"],"settings":{"taxonomies":["category","post_tag"],"extrasCustomQueryCode":"<style>\nh1.my-heading {\n color: crimson;\n}\n</style>\n\n<h1 class='my-heading'>Just some custom HTML</h1>","_display":"grid","_gridGap":"3rem","_gridTemplateColumns":"1fr 1fr 1fr"}},{"id":"yonmxz","name":"block","parent":"egnjib","children":["tlcgnn","loidvy","gisipf"],"settings":{"taxonomies":["category","post_tag"],"extrasCustomQueryCode":"<style>\nh1.my-heading {\n color: crimson;\n}\n</style>\n\n<h1 class='my-heading'>Just some custom HTML</h1>","_cssGlobalClasses":["dvrfvx"]},"label":"Zebre Card"},{"id":"tlcgnn","name":"image","parent":"yonmxz","children":[],"settings":{"tag":"figure","caption":"none","_cssGlobalClasses":["ysiige"],"image":{"id":463,"filename":"iegvy4o3bym.jpg","size":"large","full":"https://bb-card-tutorial.local/wp-con
@wpeasy
wpeasy / script.js
Last active April 26, 2024 03:19
Bricks Intersection Observers
(() => {
const animateAttribute = "data-animate";
const partialInSelector = ".animate-in-viewport";
const partialRootMargin = "-20% 0px -20% 0px";
const fullInSelector = ".animate-fully-in-viewport";
// Debounce function to limit the rate of execution
function debounce(func, delay) {