Giter Club home page Giter Club logo

comcastifyjs's Introduction

ComcastifyJS

With all this internet going around, sometimes you just want to experience the thrill of a long page load. Give your users the chance to enjoy a little slice of the future by slow loading your website's images with ComcastifyJS!

Lets slow things down!

  1. Include comcastify.js on your page, or use the latest version from our CDN:

    <script src="http://code.onion.com/comcastify.js"></script>
  2. Prepare the images on your page on document ready (so images don't show up before the box):

    comcastifyjs.letsPrepareTheseImages();
  3. Initialize comcastify on window load (so image sizes are properly calculated):

    comcastifyjs.fixMyImagesLoadingSoFast({
        boxColor: '#123456',
        loadMaxPercent: 0.75,
        loadSpeed: 100,
        loadIncrement: 5
    });
  4. Switch up parameters to change your experience:

    • elements : A list of DOM elements to limit comcastification to.
    • boxColor : The hex color for the box placed over images.
    • loadMaxPercent : The max percentage of image to load. (0 to 1)
    • loadSpeed : Time required to load your images to their max in ms.
    • loadIncrement : Number of pixels to load each time the loadSpeed timer ticks.
    • randLoadIncrement: Set to true to make load increment random, loadIncrement ignored in this case.
    • randomPause : Probability of skipping a pass each time the loadSpeed timer ticks. (0 to 1)
    • progressiveJPEG Set to true to enable progressive JPEG emulation

See it in action!

See an example on the project's site at: http://theonion.github.io/comcastifyjs/

Or, see it modeled by these koalas!

That's it!

Now grab a coffee and enjoy the load times!

comcastifyjs's People

Contributors

csinchok avatar gweedo767 avatar iagowp avatar jeveleth avatar jjmerino avatar johnheroy avatar kand avatar kevinsawicki avatar shanswami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comcastifyjs's Issues

Not loading slow enough?

I love this project!!

This is so useful! I still think there are many areas which could be improved. Please consider adding a paid teared system where premium members can decrease speeds EVEN MORE than free users!!!

Does not add jpeg artifacts?

While this is a great tool for any dev wanting to add that extra excitement to a web application, it is disappointing that the tool does not add any jpeg artifacts to the images, for that extra twist when the image finally appears.

I feel that jpeg artifacts go hand-in-hand with slow loading and is a must in any library like this one that wants to stay competitive in the fast-moving world of web application degradation.

inline background versus adding a div

Great stuff, just nit picking on how it could be done without adding additional elements into the DOM.

Hide the targeted img tags and hook up onload callbacks for each of the images, which will be used to grab the height when their finished.

Remove the src and move it onto an inlined styled background. Set the img height to 0 and the margin-bottom to the cached height value from the onload callback. Now begin to emulate the comcast-effect by increasing the height and decreasing the margin-bottom.

Please add support for the entire page

Can we make this so selective elements load faster than others? Just like the frame around a button for instance. Make that loud super fast, and then make the other parts of the page load really slow from the top down...?

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.