css-transitions

CSS transition when class removed

五迷三道 提交于 2019-12-03 04:05:43
问题 I have a form that functions as a settings page. When form elements are modified, they are marked as unsaved and have a different border color. When the form is saved, they are marked as saved by having another border color. What I want is that when the form is saved, the border will gradually fade out. The order will go: <input type='text' class='unsaved' /> Not saved yet, border is yellow <input type='text' class='saved' /> Saved, so the border is green <input type='text' class='' /> Fade

CSS system alternative to Masonry

穿精又带淫゛_ 提交于 2019-12-03 03:49:06
I remember a CSS grid system alternative to Masonry (Vanilla) http://masonry.desandro.com/ . That site was black background and displaying/arranging colored boxes (periodic table elements) . It also had filtering boxes based on their shapes and size (like round, square e.t.c) . It was also using hardware acceleration. I spend a lot of time to find it but no luck. Anyone knows this site? Why not just check the source of its counterpart, Isotope: http://isotope.metafizzy.co/index.html I'm using this. And it works great with Bootstrap. Basically instead of container, I am using WALL: <style>

CSS Transform causes flicker in Safari, but only when the browser is >= 2000px wide

↘锁芯ラ 提交于 2019-12-03 03:37:19
问题 You read that right. Tested on multiple machines in the office and the only difference between scenarios was browser size. A coworker narrowed it down to a 2000px sweet spot. Lo-and-behold when we each resize our browsers to be >= 2000px wide and mouse over an element with a transform animation various elements on the page — specifically any element with a CSS gradient background — will flicker. Inversely, if you resize the browser to be < 2000px wide and mouse over that same element no

Animate an element on a sine path

痞子三分冷 提交于 2019-12-03 03:09:12
I neeed to move an element on sine wave or path as shown in above image. I made something. But it is not working as I want. img { position:absolute; animation: roam infinite; animation-duration: 15s; } @keyframes roam { 0% { left: 50px; top:100px } 10%{ left:100px; top:100px } 20%{ left:200px; top:200px } 30%{ left:300px; top:50px } 40%{ left:400px; top:200px } } <img src="https://developer.chrome.com/extensions/examples/api/idle/idle_simple/sample-128.png"> You can move an element on a sine path with 2 CSS keyframe animations . The point is to translate left right with a linear timing

Why is transition on 'margin' and 'padding' laggy in webkit browsers?

最后都变了- 提交于 2019-12-03 02:52:55
I tried to apply CSS transition on margin and padding property. I wanted to make the background visually larger on hover. So I increased the padding and decreased the margin accordingly on hover, so that the text will remain on their current position. Here's the code .content { width: 600px; margin: auto; } a.btn { background-color: #5C9E42; color: #fff; text-decoration: none; font-size: 35px; border-radius: 5px; padding: 10px; text-shadow: 2px 2px 2px #696969; transition: all 0.3s ease; } a.btn:hover { background-color: #23570E; padding: 20px; margin: -10px; } <div class="content"> <p>Lorem

use transition on ::-webkit-scrollbar?

喜夏-厌秋 提交于 2019-12-03 02:26:30
is it possible to use transitions on webkit scrollbars? I tried: div#main::-webkit-scrollbar-thumb { background: rgba(255,204,102,0.25); -webkit-transition: background 1s; transition: background 1s; } div#main:hover::-webkit-scrollbar-thumb { background: rgba(255,204,102,1); } but it isn't working. Or is it possible to create a similar effect (without javascript)? Here is a jsfiddle showing the rgba transition problem It is fairly easy to achieve using Mari M's background-color: inherit; technique in addition with -webkit-background-clip: text; . Live demo; https://jsfiddle.net/s10f04du/

CSS Filter on Retina Display: Fuzzy Images

▼魔方 西西 提交于 2019-12-03 02:08:46
When you apply a -webkit-filter and a -webkit-transition to an Image and change the filter on hover, the image transition does well, but then the image gets really fuzzy. Note: This only happens on Retina-Displays — no problem at all with 'normal' ppi-displays, but fuzzy on for example a new MacBook Pro with Retina Display. My CSS (without vendor-prefixes): img {filter:grayscale(1);filter:saturate(0%);transition:2s ease;width:200px;height:200px} img:hover {filter:grayscale(0)}​ Note: to see the effect/bug, I've set the transition-duration to 2 Seconds Check out my Demo: http://jsfiddle.net

CSS3 transition only when class is added, not when removed

∥☆過路亽.° 提交于 2019-12-03 01:52:15
I have the following CSS example: .message{ background-color: red; transition: background-color 5s; -webkit-transition: background-color 5s; /* Safari */ transition-delay: 2s; -webkit-transition-delay: 2s; /* Safari */ } .unreadMessage{ background-color: blue; } Then, i have a DIV with .message class, and by pressing a Button, i add the class .unreadMessage , and by pressing another Button, i remove it. With this example, every time i change background-color , by adding or removing .unreadMessage , it does the CSS transition. What i want to do, is, if possible, to have an instant color change

Make some gradient move endlessly in a progress bar like in Windows 7

二次信任 提交于 2019-12-02 23:29:46
I wonder if it's possible to make a gradient move inside a div from left to right endlessly using only CSS3 features? There is no need to support all browsers, I just want to experiment. The example is that shiny effect on top of the blue progress bar. An example is appreciated. Using this CSS you can let a gradient move endlessly (based on the link in Michael's comment): .bar { background: -webkit-linear-gradient(left , #0193CD 30%, #66D4E5 80%, #0193CD 100%) repeat; -webkit-background-size: 50% 100%; -webkit-animation-name: moving-gradient; -webkit-animation-duration: 1s; -webkit-animation

Get x on Bezier curve given y

早过忘川 提交于 2019-12-02 22:27:34
问题 I have a Bezier curve: (0,0) , (.25,.1) , (.25,1) , and (1,1) . This is graphically seen here: http://cubic-bezier.com/#.25,.1,.25,1 We see on the x axis is time. This is my unknown. This is a unit cell. So I was wondering how can I get x when y is 0.5? Thanks I saw this topic: y coordinate for a given x cubic bezier But it loops, I need to avoid something loops So I found this topic: Cubic bezier curves - get Y for given X But I can't figure out how to solve a cubic polynomial in js :( 回答1: