css-animations

CSS3 - animate text align left/center/right

扶醉桌前 提交于 2019-12-01 22:22:02
问题 I've got one line (not wrapped) text inside full width div. Is it possible to animate this element text alignment so text moves to given side/center - I know I could mensure width and use relative/absolute positioning , but I dont find it straight solution and it also may cause some responsive issues? Here is demo without animations yet. 回答1: I needed something similar today. I wanted a button that started with text aligned to the right, but then animated the text to center on hover/focus.

animate speedometer needle with pure css

橙三吉。 提交于 2019-12-01 22:06:49
问题 I have tried my best here Jsfiddle. Now I want to animate the center needle point slowly to fastly from left to right. I have heard about css keyframes and tried it. But, it goes left and right. I didn't get the expected result. How do I animate this needle using just pure css? CSS #logo { display: inline-block; position: relative; } #logo .speedometer { width: 80px; height: 80px; border-radius: 100%; border: 20px solid #000; border-right: 20px solid white; border-bottom: 20px solid white;

Animate parent div when an input is focused

邮差的信 提交于 2019-12-01 20:46:18
问题 I am trying to make it so when someone clicks on the input box it rises to the top of the screen. I am able to make this work but I can't the other content within the parent div to move with it. Here is what I have: container{ } input#search-bar:focus{ position: absolute; border: 1px solid #008ABF; transition: 0.35s ease; color: #008ABF; margin-top: -10px; } <div class="container"> <div class="brandHeader"> <h1>My Header</h1> </div> <form class="formHolder"> <input type="text" id="search-bar"

Background animation performance

99封情书 提交于 2019-12-01 20:44:25
问题 I'm trying to create content loader but got a performance problem with background animation. It's smooth when there are only a few elements on the screen but dramatically drops fps while increasing stub elements count to 20-30. Now I know that animating background-position property is a bad idea and it is better to use transforms for this. but how can I do this? I'd like to keep seamless animation. Gradient should be relative to screen, not to container. Here is some code: const cardsRoot =

CSS Animation pausing when element is hidden

浪尽此生 提交于 2019-12-01 20:22:22
I'm working on adding click/touch animations to buttons on a project I'm working on, and I've come across a frustrating problem concerning animating buttons which show and hide elements. The project is a single page mobile web app with a handful of buttons on it. I'm using jQuery to set a css keyframe animation on a button when it's pressed. The button hides the current page, and shows a new one. The problem is, when I click the button, the page changes before the animation is complete, and the animation is paused whilst the container is hidden. When the container is re-shown, the animation

infinite loop slider using keyframes css3

一曲冷凌霜 提交于 2019-12-01 19:30:23
I was making a slider using css3 keyframes. I don't want my last slide directly jump to first slide. I found some questions related to it and found that duplicating the first image trick will work. It works fine first time, but second time the first slide take double time compare to normal time which is obvious because last slide and first slide are same. So is there any way to resolve this issue? Also I found this answer , in this the last solution is too close to answer this question, but the problem is when it starts, its coming from the right i.e transform:translateX(100%) which I don't

Animate parent div when an input is focused

╄→гoц情女王★ 提交于 2019-12-01 18:37:27
I am trying to make it so when someone clicks on the input box it rises to the top of the screen. I am able to make this work but I can't the other content within the parent div to move with it. Here is what I have: container{ } input#search-bar:focus{ position: absolute; border: 1px solid #008ABF; transition: 0.35s ease; color: #008ABF; margin-top: -10px; } <div class="container"> <div class="brandHeader"> <h1>My Header</h1> </div> <form class="formHolder"> <input type="text" id="search-bar" placeholder="Search"> </form> </div> What I want is My Header to also move up 10px at the same time as

Grouping CSS @keyframes rules

自闭症网瘾萝莉.ら 提交于 2019-12-01 18:01:25
I completely understand that you cannot group animation keyframes selectors such as @keyframes, @-moz-keyframes, @-webkit-keyframes { /*do something*/ } and that you absolutely MUST do @keyframes { /*do something*/ } @-moz-keyframes { /*do something*/ } @-webkit-keyframes { /*do something*/ } I know there are pre-processors that can do all this for me. But I am more interested in the reason behind why this is the case? My google-fu is failing me. It seems to always direct me to a stackoverflow page telling someone they 'cannot' do it and they must separate them all out, or telling people about

Why doesn't my keyframe animation for link color work in Chrome?

核能气质少年 提交于 2019-12-01 17:38:24
Using @keyframes (and animation ) to animate a color does not work in Chrome. Demo: https://jsfiddle.net/ed3pypwr/ In Chrome the link stays blue. In Firefox it goes from red to green as expected. On a div it works fine in Chrome as well. Is there any way to solve this? EDIT I know it should be prefixed with -webkit- to ensure maximum compatibility, but this is not the issue here. It does not work anyway. EDIT 2 A solution would be to put the link in a wrapper and use currentColor : https://jsfiddle.net/b84gttu6/ . Is there a better way ? Old versions (<43) of Chrome use the prefixed @-webkit

animation-fill-mode not working

天涯浪子 提交于 2019-12-01 17:06:45
Im trying to get a header to fly in and after that when you hover it, it should shake (both with css3 animation). It flies in the way i want, also shakes, but after ive removed the mouse from the element it goes back to the original margin-right (it had before the flyin animation) even though ive set `-animation-fill-mode: forwards; When i look in chromedevtools the element never changes its margin-right (even though the animation works..). Can i fix this? Also, is there a way of preventing the first animation to happen again after the shake animation? flyin animation: #name { margin:40px 2%