我實現了客戶要求的五彩斑斕的黑!!!

五彩斑斕的黑????五彩斑斕???還黑??之前只是笑笑就過去了。。那麼能不能實現呢,,,今天他來了!!!

效果圖:展示出來的效果顏色和光暈的顏色都是用c3寫成的動畫效果,由於不支持上傳視頻,就截了幾幀的圖片,有想要自己實現這個動畫效果的,最後代碼附上(超級簡單)!

動畫的實現原理主要就是色相的反轉和光暈模糊度的設置
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
代碼:

html代碼:

<body>
    <div class="outer">
        <div class="inner"></div>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
    </div>
</body>

css代碼:

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #2a3137;
    min-height: 100vh;
}
.outer {
    position: relative;
    height: 200px;
    width: 200px;
    background: linear-gradient(#14ffe0,#ffeb3b,#ff00e0);
    border-radius: 50%;
    animation: rotate 1.5s linear infinite;
}
.inner {
    position: absolute;
    height: 180px;
    width: 180px;
    background: black;
    top: 10px;
    left: 10px;
    border-radius: 50%;
    z-index: 9;
}
@keyframes rotate {
    0%{
        filter: hue-rotate(0deg);
    }
    100%{
        filter: hue-rotate(360deg);
    }
}
.outer span {
    position: absolute;
    height: 200px;
    width: 200px;
    background: linear-gradient(#14ffe0,#ffeb3b,#ff00e0);
    border-radius: 50%;
}
span:nth-child(1) {
    filter: blur(5px);
}
span:nth-child(2) {
    filter: blur(10px);
}
span:nth-child(3) {
    filter: blur(45px);
}
span:nth-child(4) {
    filter: blur(150px);
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章