最简单的方法实现网页背景色动态化-值得收藏
Python七号
共 2089字,需浏览 5分钟
·
2020-09-12 23:40
<style scoped>.login-container { background-image: linear-gradient(to right , #4876FF , #4966FF ); animation: hueRotate 10s infinite alternate;}@keyframes hueRotate { 0 { filter: hue-rotate(0); } 100% { filter: hue-rotate(360deg); }}style>
<style scoped>
.login-container {
background: -webkit-linear-gradient(
217deg,
#e56420,
#c22525,
#3d9c31,
#37bbde
);
background: linear-gradient(233deg, #e56420, #c22525, #3d9c31, #37bbde);
width: 100%;
height: 100vh;
background-size: cover;
background-blend-mode: hard-light;
-webkit-animation: hue-rotate 5s linear infinite;
animation: hue-rotate 5s linear infinite;
}
@-webkit-keyframes hue-rotate {
from {
-webkit-filter: hue-rotate(0);
-moz-filter: hue-rotate(0);
-ms-filter: hue-rotate(0);
filter: hue-rotate(0);
}
to {
-webkit-filter: hue-rotate(360deg);
-moz-filter: hue-rotate(360deg);
-ms-filter: hue-rotate(360deg);
filter: hue-rotate(360deg);
}
}
@keyframes hue-rotate {
from {
-webkit-filter: hue-rotate(0);
-moz-filter: hue-rotate(0);
-ms-filter: hue-rotate(0);
filter: hue-rotate(0);
}
to {
-webkit-filter: hue-rotate(360deg);
-moz-filter: hue-rotate(360deg);
-ms-filter: hue-rotate(360deg);
filter: hue-rotate(360deg);
}
}
style>
评论