Exercise 10 - Animated Webpage

Patricia Coronado

Canvas is not supported in your browser. @import url(https://fonts.googleapis.com/css?family=Fjalla+One); $background: linear-gradient(to bottom, #405166 0%,#656f6f 100%); $red: #e55643 ; $green: #2b9f5e; $yellow: #f1c83c; $shadow: #533d4a; html{ height: 100%; } body{ font-family: 'Fjalla One', sans-serif; background: $background; } .container{ transform: translate(-50%, -50%); top: 50%; left: 50%; display: block; position: absolute; max-width: 225px; } .button{ float: left; position: relative; bottom: -65px; left: 50%; transform: translateX(-50%) rotate(-10deg); color: $red; text-transform: uppercase; opacity: 0; visibility: hidden; cursor: pointer; span{ transform: skew(-10deg); display: block; float: left; text-shadow: $shadow 1px 1px, $shadow 2px 2px, $shadow 3px 3px, $shadow 4px 4px; } } h1{ color: #fff; text-transform: uppercase; font-size: 42px; margin: 0; line-height: 47px; letter-spacing: 2px; } .title{ transform: translateX(-50%) rotate(-10deg); display: block; float: left; left: 50%; position: relative; span { transform: skew(-10deg); display: block; float: left; text-shadow: $shadow 1px 1px, $shadow 2px 2px, $shadow 3px 3px, $shadow 4px 4px, $shadow 5px 5px, $shadow 6px 6px; min-width: 10px; min-height: 10px; position: relative; } } .title{ &:nth-child(1){ color: $red; } &:nth-child(2){ color: $green; } &:nth-child(3){ color: $yellow; } } /* basic styles for black background and crosshair cursor */ body { background: #000; margin: 0; } canvas { cursor: crosshair; display: block; } :root{ --base: #454545; --background: #b3dbf5; --foreground: rgba(30, 144, 255, 0.72); --font: #FFF; } *, *:before, *:after{ box-sizing: inherit; } main{ display: grid; align-items: center; justify-content: center; height: 400px; overflow: none; } .form-container{ padding: 40px; display: flex; justify-content: center; } .checkResult{ margin-top: 20px; text-align: center; font-size: 1.6rem; display: block; } input{ border: none; border-radius: 0px; border-bottom: 1px solid grey; font-size: 1.4rem; padding: 10px; outline: none; margin:0; } button{ background: var(--base); border:none; color: var(--font); margin: 0; font-size: 1.4rem; padding: 10px; } $(document).ready(function() { $(".title").lettering(); $(".button").lettering(); }); $(document).ready(function() { animation(); }, 1000); $('.button').click(function() { animation(); }); $(window).click(function(e) { animation(); }); function animation() { var title1 = new TimelineMax(); title1.to(".button", 0, {visibility: 'hidden', opacity: 0}) title1.staggerFromTo(".title span", 0.5, {ease: Back.easeOut.config(1.7), opacity: 0, bottom: -80}, {ease: Back.easeOut.config(1.7), opacity: 1, bottom: 0}, 0.05); title1.to(".button", 0.2, {visibility: 'visible' ,opacity: 1})

Comments

Popular Posts