1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*******************
 * 在雪花上奔跑 (順時針範例,奔跑8秒)
 * 滑過雪花之後就會自動跑一圈
 *******************/
.snowflake, .snowflake:hover {
    color: #FFFC;
    opacity: 1;
    right: 40px;                    /* 雪花位置 */
    bottom: 45px;                   /* 雪花位置 */
    transform: scale(100%);          /* 可以放大雪花及奔跑圖,預設100% */
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.snowflake::before {
    position: absolute;
    content: ' ';
    background-image: url('https://emos.plurk.com/b46799a38ec1ca1a9fb90bed33568720_w15_h32.gif');   /* 奔跑圖片網址 */
    background-repeat: no-repeat;
    background-position: center top;
    width: calc(100%*2);                /* 按照圖片大小調整(預設2倍) */
    height: calc(100%*2);               /* 按照圖片大小調整(預設2倍) */
    transform: rotate(360deg);           /* 360deg=順時針跑,-360deg=逆時針跑一圈 */
    transition: transform ease-in-out 10s;           /* 奔跑時間(預設8秒) */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    
}
.snowflake:hover::before {
    transform: rotate(0deg);
    transition: ease-in-out 0s;
}