Skip to content

Instantly share code, notes, and snippets.

View rileyrichter's full-sized avatar

Ben Parker rileyrichter

View GitHub Profile
// Grab the prefers reduced media query.
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
const locationSection = document.querySelector("#location");
const headingAnimation = document.querySelector("#heading");
const fourUp = document.querySelectorAll(".four-up-image");
const fourUpOne = document.querySelector(".four-up-image._1");
const fourUpTwo = document.querySelector(".four-up-image._2");
const fourUpThree = document.querySelector(".four-up-image._3");
const fourUpFour = document.querySelector(".four-up-image._4");
const locationLarge = document.querySelector("#location-large");
/*
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
<!--
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
const submit = document.querySelector("#submit");
const honeypot = document.querySelector("#work-email");
honeypot.oninput = function () {
if (honeypot.value.length > 0) {
submit.disabled = true;
}
};
.business {
position: absolute;
left: 0%;
top: 0%;
right: auto;
bottom: auto;
z-index: -1;
overflow: hidden;
width: 0px;
height: 0px;
@rileyrichter
rileyrichter / webflow-airtable.js
Created May 24, 2022 17:52
Airtable script to create, update, and delete Webflow items
const config = input.config({
title: "Script Settings",
items: [
input.config.text("webflowAPI", {
label: "Webflow API Key",
}),
input.config.text("collectionID", {
label: "Collection ID",
}),
],
<script src="https://player.vimeo.com/api/player.js"></script>
// On document ready, let's fetch some data
window.addEventListener("DOMContentLoaded", (event) => {
const handleError = (response) => {
if (!response.ok) {
throw Error(` ${response.status} ${response.statusText}`);
} else {
return response.json();
}
}; //handler function that throws any encountered error
function writeJobs() {
jobIds.forEach((jobId) => {
const handleError = (response) => {
if (!response.ok) {
throw Error(` ${response.status} ${response.statusText}`);
} else {
return response.json();
}
};
fetch(
// Triggers when the DOM is ready
window.addEventListener("DOMContentLoaded", (event) => {
const handleError = (response) => {
if (!response.ok) {
throw Error(` ${response.status} ${response.statusText}`);
} else {
return response.json();
}
};
fetch(