Git Product home page Git Product logo

snippets's Introduction

Code snippets

Some pieces of code that I ones wrote and intent to re-use in the future.

Stuff inside

Color.js

Converts both colors to the same [RGB] format and then find out if they are contrast.

Effects.js

Makes all animations optional depending on variable doAnimate.

getComputedStyle.js

x-browser implementation of getComputedStyle.

getElementsAround.js

Gets the bounding elements based on previous or next siblings.

getStyleSheetContent.js

Gets the stylesheet object in x-browser way.

Invert.js

A jQuery plugin that reverses the colors of the element using CSS3 effects.

Example of usage:

  • Note: jquery is a dependency
  • Download the script
  • Add a script to the page that is going to use it <script src="invert.js"></script>
  • Now it is ready to use:
      $(document).ready(function() {
        $('body').invert();
        $(document).on('keypress', function(event) {
          if (event.keyCode === 32) { // space
            $(event.target).invert('revert');
          }
        });
      });

snippets's People

Contributors

akhabibullina avatar

Watchers

James Cloos avatar  avatar

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.