Skip to content

Instantly share code, notes, and snippets.

@vincentsmuda
vincentsmuda / LazysizesModifier.php
Created September 12, 2018 20:06
A Statamic modifier that adjusts the markup of images coming from content areas to appease lazysizes general convention.
<?php
/**
*
* Lazysizes Modifier
* - Will add the lazyload class
* - Turns all srcs into data-src and srcset into data-srcset.
* - Generates a low rez blurred image to start.
*
* How to use:
@vincentsmuda
vincentsmuda / SrcsetsModifier.php
Created September 12, 2018 19:59
Statamic srcset modifier for content strings and general src manipulation
<?php
/**
*
* Srcset Modifier
* This modifier is meant to be used on objects with inaccessible srcsets.
*
* How to use:
* {{ content | srcsets:1440,1080,960,768,480,150 }}
* or <img src="{{ the_image | srcsets:1440,1080,960,768,480,150 }}">
@vincentsmuda
vincentsmuda / node_modules_extractor.js
Last active April 27, 2017 21:15
Node Modules Dist Extractor
// Grab fs for file manipulation
const fs = require('fs');
// Export our function
module.exports = function (packages = []) {
// Set up the package dir
let package_files = {
main: []
},
@vincentsmuda
vincentsmuda / gist:11381564
Created April 28, 2014 19:22
CSS3 Social Revealer buttons
<style>
.social-revealer {
position: relative;
display: inline-block;
width: 200px;
height: 35px;
max-width: 100%;
background: #eee;
padding-left: 36px;
margin-bottom: 0px;