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 / checkbox-switcher.json
Created February 27, 2024 22:26
Bricks Checkbox Switcher
{"id":331,"name":"checkbox-switcher","title":"Checkbox Switcher","date":"2024-02-27 22:25:10","date_formatted":"February 27, 2024","author":{"name":"wpeasy","avatar":"https:\/\/secure.gravatar.com\/avatar\/9911a97df3fb8c171d76f74f51feb01b?s=60&d=mm&r=g","url":"http:\/\/base-wordpress.local"},"permalink":"https:\/\/base-wordpress.local\/template\/checkbox-switcher\/","thumbnail":false,"bundles":[],"tags":[],"type":"section","content":[{"id":"vycagh","name":"section","parent":0,"children":["emodvu"],"settings":[],"label":"Checkbox Based"},{"id":"emodvu","name":"container","parent":"vycagh","children":["dhlctq","jippoh","mfwwqu"],"settings":{"_cssCustom":"\n.bricks-is-frontend #brxe-emodvu:has(.toggle-switch__checkbox:checked) .state-0-content{\n\tdisplay: none;\n}\n\n\n.bricks-is-frontend #brxe-emodvu:not(:has(.toggle-switch__checkbox:checked)) .state-1-content{\n\tdisplay: none;\n}"},"label":"Free Pro switcher (CSS)"},{"id":"dhlctq","name":"block","parent":"emodvu","children":["igpdel","erdeuh","prerjb"],"sett
@wpeasy
wpeasy / content-toggle-template.json
Created March 2, 2024 22:36
CSS Only Content Toggle
{"content":[{"id":"vycagh","name":"section","parent":0,"children":["emodvu"],"settings":{"_cssGlobalClasses":["shblsr"],"_cssCustom":"#brxe-vycagh { \n \n\t--state-0-color: var(--action);\n --state-0-label-color: var(--action-light);\n --state-0-track-color: var(--secondary-light-trans-30); \n --state-0-label-0-color: white;\n --state-0-label-1-color: var(--primary);\n \n --state-1-color: var(--primary); \n --state-1-label-color: var(--primary-dark);\n --state-1-track-color: var(--primary-light-trans-20);\n --state-1-label-0-color: var(--action-light);\n --state-1-label-1-color: white;\n \n}"},"label":"Free Pro"},{"id":"emodvu","name":"container","parent":"vycagh","children":["dhlctq","spcnac"],"settings":{"_cssGlobalClasses":["dpfyhy"]},"label":"switcher wrapper (CSS)"},{"id":"dhlctq","name":"block","parent":"emodvu","children":["igpdel","erdeuh","prerjb"],"settings":{"_alignItems":"center","_cssGlobalClasses":["tiobzx"]},"label":"Header Wrapper"},{"id":"igpdel","name":"heading","parent":"dhlctq"
@wpeasy
wpeasy / bb-custom-animations.json
Created March 18, 2024 10:34
Bricks Builder Custom animations
{"content":[{"id":"tzokwu","name":"section","parent":0,"children":["dnmjru","vzhpze","pxrcda"],"settings":{}},{"id":"dnmjru","name":"container","parent":"tzokwu","children":["srcfhs"],"settings":[]},{"id":"srcfhs","name":"text","parent":"dnmjru","children":[],"settings":{"text":"<p>There it is. With something so strong, a little bit can go a long way. Let your heart be your guide. Let's make a nice big leafy tree. Let's do it again then, what the heck. We can always carry this a step further. There's really no end to this.</p><p>There isn't a rule. You just practice and find out which way works best for you. I started painting as a hobby when I was little. I didn't know I had any talent. I believe talent is just a pursued interest. Anybody can do what I do. Nice little fluffy clouds laying around in the sky being lazy. If you overwork it you become a cloud killer. There's nothing worse than a cloud killer. You got your heavy coat out yet? It's getting colder. Be brave.</p><p>The very fact that you're aware of
@wpeasy
wpeasy / rest-endpoint.php
Created March 29, 2024 02:44
Bricks Live Update Options
<?php
add_action('rest_api_init', 'wpe_register_live_options_rest_route');
function wpe_register_live_options_rest_route() {
register_rest_route('v1/wpe_live_options', '/get_options', array(
'methods' => 'GET',
'callback' => 'mb_live_options_get_options',
'permission_callback' => 'wpe_verify_referrer_hostname'
));
@wpeasy
wpeasy / template-v1.json
Created April 14, 2024 21:42
Bricks Multi Getter
{"content":[{"id":"pvgpqz","name":"block","parent":"qpveqx","children":["nplvpo","bnytfm"],"settings":{"_cssGlobalClasses":["vqsvry"]},"label":"Greeter"},{"id":"nplvpo","name":"block","parent":"pvgpqz","children":["krzjsc","pcvgqk","xkljep","bsbgde"],"settings":{"_cssGlobalClasses":["jygnpk"]},"label":"Message"},{"id":"bnytfm","name":"block","parent":"pvgpqz","children":["tayvfi"],"settings":{"_cssGlobalClasses":["ffvjmd"]},"label":"Triggers"},{"id":"krzjsc","name":"heading","parent":"nplvpo","children":[],"settings":{"text":"I am a heading","_cssGlobalClasses":["wfbmzt"]}},{"id":"pcvgqk","name":"text","parent":"nplvpo","children":[],"settings":{"text":"<p>Here goes your text ... Select any part of your text to access the formatting toolbar.</p>","_cssGlobalClasses":["cbatsv"]},"label":"Text"},{"id":"xkljep","name":"button","parent":"nplvpo","children":[],"settings":{"text":"I am a button","style":"primary","_cssGlobalClasses":["mkkvzf","kmdcmf"],"link":{"type":"external","url":"#"}},"label":"CTA"},{"id":"byn
@wpeasy
wpeasy / javascript.js
Created April 19, 2024 06:39
Bricks fix focus state.
(() => {
document.addEventListener("DOMContentLoaded", () => {
const removeCSSRule = (selectorText) => {
// Get all stylesheets in the document
const stylesheets = document.styleSheets;
// Loop through all stylesheets
for (let i = 0; i < stylesheets.length; i++) {
const stylesheet = stylesheets[i];
@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) {
@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 / 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-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