css-animations

How to dynamically generate CSS3 keyframe steps using SASS?

 ̄綄美尐妖づ 提交于 2019-12-23 10:16:17
问题 Let's say I have a key frame animation that has 100 steps that increases top by 1 px in each step. It would be logical to use a program to generate such a css. @keyframes animation { 0% {top:0px;} 1% {top:1px;} 2% {top:2px;} ... 99% {top:99px;} 100% {top:100px;} } While this can be done easily in JS, I want to know if there is a way to do it in SASS. The main problem I'm having right now is I could not find a way to dynamically generate the steps selectors ( 1%, 2%, 3% etc) . I have tried #

How to dynamically generate CSS3 keyframe steps using SASS?

末鹿安然 提交于 2019-12-23 10:15:07
问题 Let's say I have a key frame animation that has 100 steps that increases top by 1 px in each step. It would be logical to use a program to generate such a css. @keyframes animation { 0% {top:0px;} 1% {top:1px;} 2% {top:2px;} ... 99% {top:99px;} 100% {top:100px;} } While this can be done easily in JS, I want to know if there is a way to do it in SASS. The main problem I'm having right now is I could not find a way to dynamically generate the steps selectors ( 1%, 2%, 3% etc) . I have tried #

Javascript shake html element

本小妞迷上赌 提交于 2019-12-23 09:47:02
问题 I'm trying to shake an html element for my game. I found this code here: shake = function (sprite, magnitude = 16, angular = false) { //A counter to count the number of shakes var counter = 1; //The total number of shakes (there will be 1 shake per frame) var numberOfShakes = 10; //Capture the sprite's position and angle so you can //restore them after the shaking has finished var startX = sprite.x, startY = sprite.y, startAngle = sprite.rotation; // Divide the magnitude into 10 units so that

Making a wave animation

▼魔方 西西 提交于 2019-12-23 09:19:54
问题 I am trying to make audio wave animation. What is wrong with this code? I tried to change translate to scale but it didn't work. Could someone give me a link to some exercises of animation? * { -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-perspective: 1000px; perspective: 1000px; } div { width: 400px; height: 200px; margin: 50px auto; } span { display: inline-block; background-color: green; width: 20px; height: 20px; animation: wave 2s linear infinite; } .a1 { animation

CSS Multiple Animations on single element, no javascript

只谈情不闲聊 提交于 2019-12-23 08:49:56
问题 I am trying to create an image slideshow using only CSS and no Javascript. I have an ALMOST working example here: http://codepen.io/k/pen/Dkhei . The problem is that the animation for the 'Previous' functionality won't pause when I stop hovering over its element. I am defining two animations on a single element, whose class name is 'imageContainer'. I am curious to know whether my syntax is wrong or if what I am trying to do is not possible. HTML: <div class='carouselContainer'> <div class=

Apply style after CSS animation without JS

笑着哭i 提交于 2019-12-23 08:07:21
问题 I have a chained CSS animation that's mostly working fine: #product { background: red; width: 10%; height: 10%; border: none; left: -22%; top: 50%; top: 40%; animation: product_across 2s linear, product_down 1s; animation-delay: 0s, 2s; } @-moz-keyframes product_across { from { left: -22%; } to { left: 98%; } } @-moz-keyframes product_down { from { top: 40%; left: 98%; } to { top: 98%; left: 128.5%; } } The thing is, after the first animation ( product_across ) has finished, I want to apply a

Animate Fabric js using GSAP?

不想你离开。 提交于 2019-12-23 04:54:25
问题 I have been playing with the Fabric.js library for a little while. What like about it is the ease of transforming objects and a couple more. I am wondering if there is a plugin or any way to animate Fabric elements using GSAP? 回答1: It can be done by passing the fabric objects into the GSAP const tl = new TimelineLite(); tl.staggerFromTo( [fabricObject], 1, {left: -config.width}, {left: config.width, onUpdate: () => canvas.renderAll()}, 0.4); 来源: https://stackoverflow.com/questions/46324061

Browser prefixes as variables through @each sass

£可爱£侵袭症+ 提交于 2019-12-23 03:06:56
问题 We have a lot of animation planned and am looking for a cleaner way to address all browsers. Something sass-y like this would be great: @each $browser in '-webkit-', '-moz-', '-o-', '-ms-' { @#{$browser}keyframes rotate { from { #{$browser}transform: rotate(0deg);} to { #{$browser}transform: rotate(360deg);} } } Except that the @#{$vendor}keyfr... produces an error expecting a number or function after the @ . Is there a way to force the @ through to the css? Otherwise, has anyone come up with

CSS Animation, working adding class, but not removing the class

你离开我真会死。 提交于 2019-12-23 03:02:45
问题 I've got this keyframe @keyframes jump { 25% { transform: translate3d(0, 0px, 0); } 75% { transform: translate3d(0, 10em, 0); } 100% { transform: translate3d(0, 17.5em, 0); } } Then I have this class .close.form_open { animation: jump .5s forwards linear; -webkit-animation: jump .5s forwards linear; } I'm adding the class form_open with jQuery and when the class is added the animation is working properly, but when I remove the class (with jQuery), it doesn't show the animation. The element

CSS3 Marquee / Ticker animation without space in the end

烂漫一生 提交于 2019-12-23 02:18:26
问题 I'm building a marquee/carousel effect with 2 collections of items. Looping both item-collection spans with translateX is not difficult (here the fiddle), but I don't like the empty space at the end of each loop. Knowing that both collections might differ in width, how could I achieve an effect of "continuity" so after the first loop, the first collection (cyan) appears right after the second (magenta). Any pointer to CSS or JS solutions is highly appreciated... =) 回答1: If the marquee is big