Skip to content

Instantly share code, notes, and snippets.

@dwigt
dwigt / script.js
Last active August 18, 2020 09:57
GSAP v3.5 banner
// Hide elements before running animations
var banner = $("#banner");
gsap.set(banner, { alpha: 0 });
if (Enabler.isInitialized()) {
init();
} else {
Enabler.addEventListener(studio.events.StudioEvent.INIT, init);
}
@dwigt
dwigt / readme.md
Last active August 18, 2020 09:57
GSAP bugs and fixes

Internet Explorer 11 Choppy scaling animation:

{rotationZ: '0.01deg'}

Button bounces: .to(cta, 0.35, {scale: 1.085, repeat: 3, ease: Power2.easeOut, force3D:true, yoyo:true}, "+=1")

@dwigt
dwigt / BrowserSync gulp4 config
Last active August 3, 2020 09:30
Set up browsersync proxy
import gulp from 'gulp';
import browserSync from 'browser-sync';
import notify from "gulp-notify";
const server = browserSync.create();
function reload(done) {
server.reload();
done();
}
@dwigt
dwigt / inline-svg-function.scss
Created March 24, 2020 07:35 — forked from JacobDB/inline-svg-function.scss
Inline SVG function [SASS]
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
<video width="1280" height="720" class="video" preload="metadata" id="js-videoslide" muted playsinline @(videoslide.Loop ? "loop" : "")>
<source src="@videoslide.Video.GetImageUrl()" type="video/mp4">
</video>
if (videoslide.ShowSoundButton)
{
<div class="slide-video-controls">
<button class="video-sound-button"></button>
<button id="js-videopausebtn">Pause/Play</button>
</div>
}