This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Give section an attribute of "data-cms-section" */ | |
[data-cms-section]:not(:has(.w-dyn-item)) { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original code source and use agreement here: https://gist.github.com/rileyrichter/b2e5b5d9fe8952372ce49fafc75dea8b | |
const canonical = document.querySelector('link[rel="canonical"]'); | |
const urlParams = new URLSearchParams(window.location.search); | |
const paginationParam = Array.from(urlParams.entries()).find(([key]) => | |
/^[a-z0-9]{8}_page$/.test(key) | |
); | |
if (paginationParam) { | |
const canonical = document.querySelector('link[rel="canonical"]'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Target the preloader element | |
const preloaderElement = document.getElementById('preloader'); | |
// Set the amount of time to wait in milliseconds | |
// Test by changing to 1 * 60 * 1000 for 1 min | |
const waitTime = 24 * 60 * 60 * 1000; // 24 hours | |
// Check if the local storage item is present and valid | |
if (!localStorage.getItem('preloaderShown') || Date.now() - localStorage.getItem('preloaderShown') > | |
waitTime) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Validate email field for only business emails | |
document.addEventListener("DOMContentLoaded", function () { | |
// UPDATE THIS - ID on the <form> | |
let form = document.getElementById("pardot-form"); | |
// UPDATE THIS - ID on text element to display errors | |
let errorElement = document.getElementById("email-domain-error"); | |
form.addEventListener("submit", function (event) { | |
// UPDATE THIS - ID on the email <input> | |
let emailInput = document.getElementById("email"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place this in the <head> and update the href to your images for each color mode --> | |
<link href="favicon-light.png" rel="icon" media="(prefers-color-scheme: light)" /> | |
<link href="favicon-dark.png" rel="icon" media="(prefers-color-scheme: dark)" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See test example of this here: https://codepen.io/cmoen89/pen/Baxdwxe?editors=1010 | |
$(function () { | |
$( "a[data-clean='remove-http']" ).each(function() { | |
var clean = $(this).text().replace(/^\/\/|^.*?:(\/\/)?/, ''); | |
$(this).text(clean); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function responsiveScript() { | |
// only run script below 767 px screen width | |
if (window.innerWidth <= 767) { | |
// do something awesome on mobile only here | |
} | |
} | |
// run script on page load | |
responsiveScript(); | |
// run script on window resize | |
window.addEventListener("resize", responsiveScript); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config = input.config ({ | |
title: 'Airtable <> Webflow sync', | |
description: 'An example script that could be used to send or update records from Airtable to Webflow', | |
items: [ | |
input.config.text ('apiKey', { | |
label: 'Webflow API Key', | |
description: 'note: anyone with access to this base can see your API key' | |
}), | |
input.config.text('webflowSiteID',{ | |
label:'Webflow Site ID', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Static values */ | |
font-size: clamp(1rem, 2.5vw, 2rem); | |
width: clamp(20rem, 30vw, 70rem); | |
/* Calculated values */ | |
width: clamp(100px, calc(30% / 2rem + 10px), 900px); |
NewerOlder