Skip to content

Instantly share code, notes, and snippets.

@ryandejaegher
ryandejaegher / full-width-flex.html
Last active April 6, 2020 14:02
code for a full width flex section in Squarespace
<!--Add this to your custom CSS tab in Squarespace-->
<style>
.flex-row {
display: flex;
height: 100%;
}
.breakout {
margin-left: calc(~"50% - 50vw");
margin-right: calc(~"50% - 50vw");
<style>
.grid {
display: grid;
grid-template-columns: repeat(auto-fit,minmax(0,1fr));
grid-template-rows: repeat(auto-fit, minmax(0,1fr));
height: 80vh;
max-height: 80vh;
}
.snap-container::-webkit-scrollbar {
display: none;
@ryandejaegher
ryandejaegher / flex-utilities.css
Last active April 7, 2020 19:24
utility classes for flexbox
/*** Flex Container Classes ***/
.flex {
display: flex;
}
.flex-row {
flex-direction: row;
}
@ryandejaegher
ryandejaegher / remove-comma-squarespace-categories
Last active June 2, 2020 17:11
Remove comma from Squarespace categories
/* Add to Settings -> Advanced -> Code Injection -> Footer in Squarespace */
<script>
window.addEventListener('load', function(){
(function(){
var cats = document.querySelectorAll('.summary-metadata-item--cats, .Blog-meta-item--categories');
cats.forEach(item => {
item.innerHTML = item.innerHTML.replace(", ", "")
})
// Add this to Settings -> Advanced -> Code Injection -> Footer
</script>
(function(){
var imageArray = ['home1.jpg',
'home2.jpg',
'home3.jpg',
'home4.jpg',
'home5.jpg',
'home6.jpg',
// <script>
// Get the header
var header = document.querySelector('header');
// Get SQS 7.1 Logo
var headerLogo = document.querySelector('.header-title-logo img');
// Get SQS 7.1 Logo src
// Create Currency Formatter
const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
[data-section-id='5eda7b0235d90a64cf366be5'] .col .html-block, [data-section-id='5eda7b0235d90a64cf366be5'] .col .button-block {
background-color: white;
}
[data-section-id='5eda7b0235d90a64cf366be5'] .col {
display: flex;
flex-direction: column;
padding: 16px;
}
// Add to Code Injection -> Footer
<script>
window.addEventListener('load', function(){
var next = document.querySelector('.summary-carousel-pager-next');
var autoSlide = function(){
next.click()
};
var startSlideInterval = function(){