Skip to content

Instantly share code, notes, and snippets.

---
baseURL: https://example.com
languageCode: en-us
title: Ryan Dejaeghers
pygmentsstyle: monokai
theme: novela
permalinks:
post: /:title/
paginate: 6
social:
@ryandejaegher
ryandejaegher / config.yaml
Last active April 11, 2020 21:05
This is the config.yaml file for ryandejaegher.com
---
baseURL: https://example.com
languageCode: en-us
title: Ryan Dejaeghers
pygmentsstyle: monokai
theme: novela
permalinks:
post: /:title/
paginate: 6
social:
@ryandejaegher
ryandejaegher / minimumPriceQuantity.js
Last active April 6, 2020 19:42
This is a plugin for Squarespace to add a minimumPriceQuantity option for checkout
// REQUIREMENTS
// User should be able to set the minimum required price
// User should be able to adjust the error message
// User should be able to change the currency symbol to match their country
// The error message should be temporarily displayed if they are below the order minimum
// The error message should display the required minimum amount
// The error message should disappear once they are above the order minimum
@ryandejaegher
ryandejaegher / socialLinksHamburger.js
Last active March 30, 2020 11:41
This code clones the social navigation header links in the Brine template of Squarespace and adds them to the hamburger menu. Useful for users who are using the hamburger menu in desktop view.
<script>
/* Use with the Brine Templates */
(function(){
var socialLinks = document.querySelector('.Header-social');
var socialLinksClone = socialLinks.cloneNode(true);
var mobileBar = document.querySelector('.Mobile-bar--top > div[data-nc-container="top-left"]');
mobileBar.appendChild(socialLinksClone)
}())
</script>
@ryandejaegher
ryandejaegher / addTikTokSquarespace.js
Last active March 30, 2020 11:47
This code adds the TikTok icon to Squarespace social icons. If a user adds a link to a TikTok profile in the social accounts for Squarespace it will add the TikTok icon instead of the "link" placeholder.
/* This is the CSS to change the fill cover on hover/not hover. Using :not it is possible to make changes
#thing svg:not(:hover) {
fill:rgba(31,31,31,.4);
transition:fill 170ms ease-in-out;
}
<?xml version="1.0"?><svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50px" height="50px"> <path d="M41,4H9C6.243,4,4,6.243,4,9v32c0,2.757,2.243,5,5,5h32c2.757,0,5-2.243,5-5V9C46,6.243,43.757,4,41,4z M37.006,22.323 c-0.227,0.021-0.457,0.035-0.69,0.035c-2.623,0-4.928-1.349-6.269-3.388c0,5.349,0,11.435,0,11.537c0,4.709-3.818,8.527-8.527,8.527 s-8.527-3.818-8.527-8.527s3.818-8.527,8.527-8.527c0.178,0,0.352,0.016,0.527,0.027v4.202c-0.175-0.021-0.347-0.053-0.527-0.053 c-2.404,0-4.352,1.948-4.352,4.352s1.948,4.352,4.352,4.352s4.527-1.894,4.527-4.298c0-0.095,0.042-19.594,0.042-19.594h4.016 c0.378,3.591,3.277,6.425,6.901,6.685V22.323z"/></svg>
*/
@ryandejaegher
ryandejaegher / customizeComingSoonSquarespace.js
Last active March 30, 2020 11:52
This code is used to customize the coming soon page for Squarespace, you must add it to the code injection in page settings instead of the site code injection
<script>
(function(){
var comingSoonText = document.querySelector('#sqs-slash-page-header');
comingSoonText.innerHTML = `coming <span class="really">(really)</span> soon`;
}());
</script>
@ryandejaegher
ryandejaegher / css-grid.css
Last active March 30, 2020 13:33
CSS Grid Utilities
.grid {
display: grid;
}
.col-span-1 {
grid-column: span 1;
}
.col-span-2 {
grid-column: span 2;
@ryandejaegher
ryandejaegher / easyIntersectionObserver.js
Last active April 8, 2020 19:48
Demo of intersection observer inspired by Alligator.io
/*
Use this to easily add a fading effect to elements using IntersectionObserver,
intersectionObserver will "watch" for elements visibility on the page
*/
(function () {
myImgs = document.querySelectorAll('img');
observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
@ryandejaegher
ryandejaegher / addLinkHTML.js
Last active April 8, 2020 16:49
This is a simple code to add HTML to either side of links in Squarespace
/*
Add Icons to HTML Links JavaScript
Demo
addHeaderHTML(getLink('/contact'),'before','<span>Cool</span>')
addHeaderHTML(getLink('/contact'),'before','<span>Cool</span>')
*/
@ryandejaegher
ryandejaegher / sectionParallax.js
Last active August 24, 2022 11:47
Add ability to add parallax for individual sections
function onScroll(e) {
console.log(e);
console.log('yes');
}
var observer = new IntersectionObserver(entries => {
console.log(entries)
entries.forEach(entry => {