jamesnimlos / pixel-flow Goto Github PK
View Code? Open in Web Editor NEWan image pixelating filter jquery plugin
an image pixelating filter jquery plugin
Hello,
I'm using Pixel Flow gradient animation on every page of my website. But sometimes animation doesn't start when I open page. And when I refresh that same page, animation starts normally. Console doesn't shows any error, and with console.logs in "tick" function I found out that animation happens, but canvas doesn't render it somehow.
Problem happens only in Safari browser (both MacBook Pro and iPhone).
Am I doing something wrong or is it Safari problem?
This is my code:
var funcOpts = [{
lg: { location: [-1, -0.5, 0.7, 1], resolution : [800, 0] }
}];
function startPixelAnimation() {
// Pixel
var $pixelImgs = $('.pixel-wrapper img');
Promise.all($pixelImgs.map(function(_, pixelImg) {
return waitForImage(pixelImg);
})).then(function() {
$pixelImgs.PixelFlow({ resolution: 32});
var $pixelImgWrapper = $('.pixel-wrapper');
var pixelFlow = $pixelImgWrapper.find('canvas').data('plugin_PixelFlow');
pixelFlow.offsetX = pixelFlow.width;
TweenMax.fromTo(pixelFlow, 2, {
offsetX: pixelFlow.width,
autoCSS: false
}, {
offsetX: 0,
autoCSS: false,
onUpdate: tick,
roundProps: 'offsetX',
onUpdateParams: ['{self}', pixelFlow]
}
);
function tick(tween, pF) {
pF.linearGradient(funcOpts[0].lg);
}
});
}
PS. I'm using Pixel Flow with Fullpage.js, but I think that should not be a problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.