Skip to content

Instantly share code, notes, and snippets.

View GraemeFulton's full-sized avatar
😶‍🌫️

Graeme Fulton GraemeFulton

😶‍🌫️
View GitHub Profile
@GraemeFulton
GraemeFulton / lazyloadimage.js
Created June 24, 2021 14:12
Framer Motion Image LazyLoad
import "./styles.css";
import { useState } from "react";
import { motion } from "framer-motion";
export default function App() {
const [imageLoading, setImageLoading] = useState(true);
const [pulsing, setPulsing] = useState(true);
const imageLoaded = () => {
setImageLoading(false);
@GraemeFulton
GraemeFulton / olive-embed.js
Created February 2, 2021 02:14
Olvy React Embed
componentDidMount() {
if(typeof window!=='undefined'){
/** use this to remove the button if needed
var oldBtn = document.getElementById('ovly-trigger')
if(oldBtn){
oldBtn.remove()
}
**/
@GraemeFulton
GraemeFulton / getTwitterLink.js
Created September 15, 2020 07:53
Get twitter link data
<!-- Script tags to resize iframe automatically -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.2.11/iframeResizer.min.js"></script>
<script>
iFrameResize({ autoResize: false }, '#studentstatus')
</script>
<iframe
id="studentstatus"
src="https://studentstat.us/form"
style="width: 1px;min-height:600px; min-width: 100%;"
<script type="text/javascript" src="https://makerbadge.s3.amazonaws.com/blmbadge.js"></script>
<script>
BLMBadge.init({
layout:1,
theme:'dark',
promoText : 'Send a donation '+String.fromCodePoint(0x2192),
promoLink : 'https://minnesotafreedomfund.org/',
message : 'To be silent is to be complicit. Black lives matter.',
title : '#BlackLivesMatter'
})
@GraemeFulton
GraemeFulton / link.html
Created January 21, 2020 19:37
Text decoration link
@GraemeFulton
GraemeFulton / image_tui.js
Created August 1, 2019 08:55
Froala editor with fabric
This file has been truncated, but you can view the full file.
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="background-color: transparent; width: 600px;" width="600" valign="top">
<!-- Image here 👇 -->
<img style="border-radius: 8px;" src="https://s3-us-west-1.amazonaws.com/tinify-bucket/prototypr/temp/2hnlgj">
<!-- Image here 👆 -->
</td>
</tr>
</tbody>
@GraemeFulton
GraemeFulton / audioAnalyser.js
Last active September 19, 2015 13:32
Audio analyser
/**
* AudioAnalyser
* param- soundPath: path to your sound
*/
function AudioAnalyser(soundPath){
this.sound =soundPath;
this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
this.source = this.audioCtx.createBufferSource();
/**
* AudioAnalyser
* param- soundPath: path to your sound
*/
function AudioAnalyser(soundPath){
this.sound =soundPath;
this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
this.source;