Skip to content

Instantly share code, notes, and snippets.

j2is

Block or report user

Report or block j2is

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View useSmoothScroll.js
import {
useRef, useCallback, useEffect, useState
} from 'react';
import smoothscroll from 'smoothscroll-polyfill';
smoothscroll.polyfill();
function useSmoothScroll() {
const scrollRafPending = useRef(false);
const scrollRafInstance = useRef(false);
@j2is
j2is / img.twig
Created Jan 22, 2019
Macro for responsive images
View img.twig
{###
# macros for responsive images
#
# https://straightupcraft.com/articles/responsive-images-with-twig-macros
# https://nystudio107.com/blog/creating-optimized-images-in-craft-cms
#
# usage simple: {{ macro_img.responsive(asset) }}
# usage extra: {{ macro_img.responsive(assetThumbnail, {alt: 'some thumb', class: ['thumb-class'], {style: 'thumb'}}) }}
#}
You can’t perform that action at this time.