Skip to content

Instantly share code, notes, and snippets.

View benrobygreene's full-sized avatar

Ben Greene benrobygreene

  • BVAccel
  • San Diego
View GitHub Profile
@benrobygreene
benrobygreene / Marquee.js
Created November 12, 2019 18:27
Marquee
import { debounce } from 'common/Helpers';
const dom = {
marquee: 'data-marquee-wrapper',
marqueeText: 'data-marquee-text',
};
/**
* Build an animation for a marquee wrapper
*
@benrobygreene
benrobygreene / installer.js
Last active February 26, 2023 22:18
Service Workers
/**
* If there are service workers available to us, then on window load we can register our worker
*/
'serviceWorker' in navigator && window.addEventListener('load', () => {
navigator.serviceWorker.register('worker.js')
.then(() => {
// Registration was successful
console.log('ServiceWorker registration successful!');
}, (err) => {
// registration failed :(