Skip to content

Instantly share code, notes, and snippets.

@memetican
memetican / webflow-breakpoints.css
Last active July 15, 2023 07:09
Webflow CSS breakpoints
h1::after {
content: " (Desktop View)";
}
@media (min-width: 1280px) {
h1::after {
content: " (1280px View)";
}
}
@media (min-width: 1440px) {
@memetican
memetican / webflow-breakpoints.js
Created July 15, 2023 09:45
Webflow JS breakpoints
// Webflow breakpoints
const breakpoints = {
large1920: '(min-width: 1920px)',
large1440: '(min-width: 1440px) and (max-width: 1919px)',
large1280: '(min-width: 1280px) and (max-width: 1439px)',
desktop: '(min-width: 992px) and (max-width: 1279px)',
tablet: '(min-width: 768px) and (max-width: 991px)',
mobileLandscape: '(min-width: 480px) and (max-width: 767px)',
mobilePortrait: '(max-width: 479px)'
};
<div class="video-responsive">
<iframe width="853" height="480" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" frameborder="0" allowfullscreen></iframe>
</div>
<style>
.video-responsive {
position: relative;
overflow: hidden;
padding-top: 56.25%; /* 16:9 Aspect Ratio */
}
.scrollable-div {
position: relative;
overflow: auto;
}
.scrollable-div::after {
content: "";
position: absolute;
top: 0;
right: 0;
@memetican
memetican / css-highlight-animation.css
Last active August 26, 2023 20:34
CSS Highlight Animation
.anim-bg {
position: relative;
}
.anim-bg::before {
content: "";
position: absolute;
left: -0.2rem; /* Start 0.2rem to the left */
width: 0%; /* Initial width */
height: 100%;
@memetican
memetican / dropbox-video.html
Created August 27, 2023 19:46
Hosting Files Externally
<style>
.video-container {
position: relative;
width: 100%;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
overflow: hidden;
}
.video-container video {
position: absolute;
@memetican
memetican / dropbox-audio.html
Created August 27, 2023 19:57
Host Audio on Dropbox
<audio controls>
<source src="https://www.dropbox.com/scl/fi/evjxcongu3lf3prcwzgeu/throughgatesofsilverkey_01_lovecraft_64kb.mp3?rlkey=hjt8fcolveyog0qpjojbfef8c&dl=1" type="audio/mp3">
Your browser does not support the audio element.
</audio>
<script src="https://cdn.jsdelivr.net/npm/macy@2.5.0/dist/macy.min.js"></script>
<script>
var macy = Macy({
container: '#macy-container',
trueOrder: false,
waitForImages: false,
margin: 24,
columns: 3, // Webflow desktop and above
breakAt: {
991: 3, // Webflow tablet
@memetican
memetican / group-hash-navigation.html
Created September 5, 2023 20:44
Grouped Collection List Items
<script>
(function() {
var currentScript = document.currentScript;
var link = currentScript.closest('a');
if (link) {
link.href = "#glossary-group-";
}
})();
</script>
<script>
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([  
'richtext',  
(textInstances) => {  
console.log('richtext Successfully loaded!');      
},  
]);    
</script>