Skip to content

Instantly share code, notes, and snippets.

View rileyrichter's full-sized avatar

Ben Parker rileyrichter

View GitHub Profile
<!--
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
<!--
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
<!--
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.
@rileyrichter
rileyrichter / fetch-webflow.js
Created September 1, 2022 22:01
Using the fetch API with Webflow and No Code API
// Setting global variables
const emailForm = document.querySelector("#email-form");
const screenOne = document.querySelector("#screen-one");
const screenLoading = document.querySelector("#loading");
const screenTwo = document.querySelector("#screen-two");
const resultName = document.querySelector("#result-name");
const resultEmail = document.querySelector("#result-email");
const resultNumber = document.querySelector("#result-number");
const nextButton = document.querySelector("#submit");
const nameInput = document.querySelector("#name");
@rileyrichter
rileyrichter / tippy-code.html
Created August 31, 2022 20:33
Popover code
<!-- Add this code to the body section of custom code -->
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script type="text/javascript">
tippy("[data-template]", {
content(reference) {
const id = reference.getAttribute("data-template");
const template = document.getElementById(id);
return template.innerHTML;
},
// Clicking the menu item switches the
// slider by clicking the corresponding slider nav
/*
MIT License
Copyright (c) 2022 rileyrichter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
// 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.