Giter Site home page Giter Site logo

moveover's Introduction

MoveOver

MoveOver is a Canva style landing page.

With extra goodness:

  • Extended browser support (Firefox: more on it later)
  • Responsive, i.e., almost all sized screens
  • Mobile (single touch) support

How to use

Script tag

<script type="text/javascript" src="move-over.js"></script>
<script type="text/javascript">
    MoveOver({
        canvas: document.querySelector('canvas'),  // optional
        imgSrc: './1.jpg',
        imgBSrc: './1.b.jpg',
        fps: 30,  // optional
    });
</script>

AMD Module

<script type="text/javascript" src="require.js"></script>
<script type="text/javascript" src="move-over.js"></script>
<script type="text/javascript">
    require(['MoveOver'], function (MoveOver) {
        MoveOver({
            canvas: document.querySelector('canvas'),  // optional
            imgSrc: './1.jpg',
            imgBSrc: './1.b.jpg',
            fps: 30,  // optional
        });
    });
</script>

But Why?

But Why?

The blur-unblur effect on Canva is one of my personal favorites. But there's a hiccup. If you visit the website on FIrefox, you might land on their alternate version.

But Why?

If you look at the url, it goes something like https://www.canva.com/?pageVariant=template&utm_expid=... By removing the part pageVariant=template&, the default page is loaded.

As of the time of posting, the trails are all "sharp".

But why?

Because webkit and gecko handle blurs differently. And the difference is made visible when different composite operations are mixed together.

Long story short, by saving / restoring canvas context around paint operations, the problem can be circumvented.

Demo

The demo uses the technique mentioned above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.