css - transition 的使用?
大家讲道理
大家讲道理 2017-04-17 14:45:05
0
3
550

想問問transition 該如何使用?

我是去 https://santatracker.google.c...

發現這個效果
移過去會先放大,然後最後再縮小一點 有點彈簧的感覺
這種效果該怎麼做?

我看到他transition 語法似乎是可以累加的?
請問有大神能解釋原理嗎?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
小葫芦


The first transform is represented by a matrix. It is to express the transform effects such as translate, rotate, etc. together in a matrix.
The second transition-delay represents the delay, that is, how long does each transition start after it is triggered. Each one corresponds to the following attributes.
The third transition-duration represents the transition time of each attribute, which also corresponds to one-to-one.
The fourth transition-property is the property name for transition animation, including transform and transparency (a compatible transform is added)
The fifth transition-timing-function is the transition effect speed curve, in addition to linear changes (Constant speed), ease-XX (the one provided is divided into three sections, first fast and then slow), you can also use Bezier curve cubic-bezier(n,n,n,n), Bezier curve The Searle curve can create the rebound effect you mentioned (that is, exceeding the maximum or minimum value and then rebounding)

Attach an address for making Bezier curve


Supplement:
1. Only one transition needs to be written. If it is written in the normal state, the transition effect will be applied when moving in and out. If written in :hover, only moving in will have a transition
//Modified the code in your comment

.reat {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0;
    transform: rotate(15deg);
    background-color: red;
    /*貝塞爾曲線選取的不合適,無回彈,第四個參數要超出最大值 (即1.51)*/
    transition: transform 1s cubic-bezier(.17,.67,.48,1.51), opacity 1s ease;
}
            
.reat:hover {
    /*同名屬性要寫在一起,否則後面的會覆蓋前面的*/
    transform: scale(1.8) rotate(0);
    opacity: 1;
    box-shadow: 4px 14px 0 rgba(0, 0, 0, .125);
}
Ty80

You can refer to this article about transform and transition in CSS
There is detailed information on it

大家讲道理

transition:all 1s;
Transition effect, complete animation in 1 second.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template