Giter Site home page Giter Site logo

john-azzaro / study-css-transitions Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 139 KB

A handy study in the implementation of basic CSS color transitions on a webpage, including removing and adding special class to achieve the effect, as well as special conditional logic as well.

CSS 66.88% HTML 16.41% JavaScript 16.71%
javascript css css-transition addclass-jquery removeclass-jquery

study-css-transitions's Introduction

CSS Transitions Study

See it Live: https://john-azzaro.github.io/Study-CSS-Transitions/

What is CSS Transitions Study?

The CSS Transitions Study examines the implementation of transitional effects to web pages using HTML, CSS, JavaScript, and jQuery for the buisness logic. In this particular study, when the user scrolls down the page, the background will change colors as the second page reveals itself.

Here are a few questions from the study to explore:


What are the key takeaways from the calculator study?

Primary objective revolves around the background-active class.


So the transition for the study is pretty basic, changes the color of the background as the user scrolls down. The effect itself is pretty straight forward, specifically that on scroll, if the if the user scroll is greater than the inner height of the window (divided by 4 so it changes at a later point in the scoll), then add the class "background-active" class. If not, remove it.

function backgroundChange() {                      
    if(window.scrollY > window.innerHeight / 4) {       
        $('body').addClass('background-active');      
    } else {                                    
        $('body').removeClass('background-active');   
    }         
}

function handleScroll() {                          
    $(window).on('scroll', backgroundChange)           
}

Does CSS Transitions Study feature commentary?

Yes! I use extensive commentary (mostly in the form of my thought process) so that the new and curious can follow the logic in the program and get an idea of my reasoning behind each and every line of code. In addition to my line-by-line commantary, I also provide a Process text file that gives a good outline of my implementation process.


What are the key features of CSS Transitions Study?

Since this study is ongoing, basic functionalities are covered first and more advanced features are added or will be added in the future:

Features: Feature Notes:
color transition When the user scrolls down (and back up) the background color will change color.

Screenshots

transition1 transition2

study-css-transitions's People

Contributors

john-azzaro avatar

Watchers

 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.