Fun with transition
How do I make an fun with transition?
An instructional demo of transition for the 2015 HTML and CSS3 Best Practices class at Startup Institute Boston.. What is a fun with transition? How do you make a fun with transition? This script and codes were developed by Paul Demers on 28 August 2022, Sunday.
Fun with transition - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Fun with transition</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='css/cdbdd22df1a82e2eacfc4fb16.css'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .effect-example { width: 40rem; height: 8rem; display: block; margin: 0 auto 1rem; border: 5px solid rgba(255, 255, 255, 0.25); cursor: pointer; display: table;
}
.effect-example-square { height: 12rem; width: 12rem;
}
.effect-name { font-weight: bold; font-size: 2rem; color: #fff; text-align: center; line-height: 1; margin: 0; display: table-cell; vertical-align: middle;
}
.effect-grow { transition-property: width; transition-duration: .5s; transition-timing-function: linear; background: rebeccapurple;
}
.effect-grow:hover { width: 50rem;
}
.effect-rotate { transform: rotate(0deg); background: grey; transition: transform .5s ease-in-out;
}
.effect-rotate:hover { transform: rotate(360deg);
}
.effect-wheel { border-radius: 50%; margin-left: -1.25rem; transform: rotate(0deg); background: blue; transition: transform .5s ease-in-out, margin-left .5s ease-in-out;
}
.effect-wheel:active { margin-left: 40rem; transform: rotate(360deg);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <header> <h1>Fun with <code>transition</code></h1> <div class="si-logo"> <img src="https://d2e1tcbrruuso7.cloudfront.net/static/images/si-logo-white.9e7839aec491.svg" alt="" /> </div>
</header>
<div class="container"> <section class="property"> <div class="property-example"> <h2 class="property-header">Grow on Hover Example:</h2> <p>Hover over the purple rectangle to see it grow</p> <div class="effect-example effect-grow"> <p class="effect-name">I grow on hover!</p> </div> <code class="language-markup">
.example{ /* The property you want to transition */ transition-property: width; /* How long you want the transition to take */ transition-duration: .5s; /* linear | ease-in | ease-out | ease-in-out */ transition-timing-function: linear;
} </code> </div> <div class="property-example"> <h2 class="property-header">Rotate on Hover Example:</h2> <p>Hover over the purple rectangle to see it rotate</p> <div class="effect-example effect-example-square effect-rotate"> <p class="effect-name">I rotate on hover!</p> </div> <code class="language-markup">
.example{ transform: rotate(0deg); background: grey; /* transition can be written in shorthand format */ /* transition-property transition-duration transition-timing-property */ transition: transform .5s ease-in-out;
}
.example:hover{ transform: rotate(360deg);
} </code> </div> <div class="property-example"> <h2 class="property-header">Spinning Wheel on Click Example:</h2> <p>Click on the wheel to see it move and spin.</p> <div class="effect-example effect-example-square effect-wheel"> <p class="effect-name">Click the wheel!</p> </div> <code class="language-markup">
.example{ border-radius: 50%; margin-left: -1.25rem; transform: rotate(0deg); background: blue; /* Transition multiple properties at the same time */ transition: transform .5s ease-in-out, margin-left .5s ease-in-out;
}
.example:active{ margin-left: 40rem; transform: rotate(360deg);
} </code> </div> <article> <h2>More Info:</h2> <ul> <li><a href="http://caniuse.com/#search=box-shadow" title="transition on Caniuse" target="_blank">Caniuse</a></li> <li><a href="http://autoprefixer.github.io/" title="transition on AutoPrefixer" target="_blank">Autoprefixer</a></li> <li><a href="http://codepen.io/search?q=transition&limit=all&depth=everything&show_forks=false" title="transition on CodePen" target="_blank">transition on CodePen</a></li> </ul> </article> </section>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/prism/0.0.1/prism.min.js'></script>
</body>
</html>
Fun with transition - Script Codes CSS Codes
.effect-example { width: 40rem; height: 8rem; display: block; margin: 0 auto 1rem; border: 5px solid rgba(255, 255, 255, 0.25); cursor: pointer; display: table;
}
.effect-example-square { height: 12rem; width: 12rem;
}
.effect-name { font-weight: bold; font-size: 2rem; color: #fff; text-align: center; line-height: 1; margin: 0; display: table-cell; vertical-align: middle;
}
.effect-grow { transition-property: width; transition-duration: .5s; transition-timing-function: linear; background: rebeccapurple;
}
.effect-grow:hover { width: 50rem;
}
.effect-rotate { transform: rotate(0deg); background: grey; transition: transform .5s ease-in-out;
}
.effect-rotate:hover { transform: rotate(360deg);
}
.effect-wheel { border-radius: 50%; margin-left: -1.25rem; transform: rotate(0deg); background: blue; transition: transform .5s ease-in-out, margin-left .5s ease-in-out;
}
.effect-wheel:active { margin-left: 40rem; transform: rotate(360deg);
}
Developer | Paul Demers |
Username | demersdesigns |
Uploaded | August 28, 2022 |
Rating | 3 |
Size | 5,264 Kb |
Views | 62,744 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
CSS3 Filters Exploration | 3,308 Kb |
A Pen by Paul Demers | 2,526 Kb |
Icon Fonts and CSS3 Animations | 3,288 Kb |
Fullscreen Overlay | 5,310 Kb |
Project Timeline Visualization | 10,115 Kb |
Populate Login with User Avatar | 3,324 Kb |
Fancy Radios, Checkboxes, and Selects | 6,801 Kb |
Animated Gradient Text Backgrounds | 2,927 Kb |
Project Timeline | 9,790 Kb |
Icon Font Social Icons | 2,920 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Adding Items | Valhead | 4,008 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
Flexbox Test | Icutpeople | 2,486 Kb |
Random Gradients - JS | Aldlevine | 2,026 Kb |
A bit of elegance | Hackthevoid | 9,095 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
Pictos font library from CodePen | Jstam | 3,790 Kb |
Cut and Paste Roll Link | BottomlineInteractive | 2,546 Kb |
SVG Text Masking | JMChristensen | 2,141 Kb |
404 Page | Saransh | 2,666 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!