我遇到了我創建的預加載器的問題。 這僅僅是一個簡單的面膜效果,看起來像這樣:CSS Scale在轉換時會導致鋸齒狀的邊緣
(function() {
'use strict';
setTimeout(function() {
document.body.className = 'loaded';
}, 3000);
})();
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
#loader-wrapper .loader-background {
position: fixed;
top: 0;
width: 100%;
height: 100%;
z-index: 1000;
background-color: #000000;
}
#loader-wrapper .loader-background::after {
content: '';
position: absolute;
left: 150px;
bottom: 150px;
border-radius: 100%;
width: 150px;
height: 150px;
box-shadow: 0px 0px 0px 2000px #000000;
-webkit-transition: all 3s;
-moz-transition: all 3s;
transition: all 3s;
}
.loaded #loader-wrapper {
visibility: hidden;
}
.loaded #loader-wrapper .loader-background::after {
-webkit-transform: scale(20);
-moz-transform: scale(20);
-ms-transform: scale(20);
transform: scale(20);
}
.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
/* Chrome, Opera 15+, Safari 3.1+ */
-ms-transform: rotate(0deg);
/* IE 9 */
transform: rotate(0deg);
/* Firefox 16+, IE 10+, Opera */
}
100% {
-webkit-transform: rotate(360deg);
/* Chrome, Opera 15+, Safari 3.1+ */
-ms-transform: rotate(360deg);
/* IE 9 */
transform: rotate(360deg);
/* Firefox 16+, IE 10+, Opera */
}
}
<h1>This content is visible when the circle exapnds</h1>
\t <div id="loader-wrapper">
\t \t <div id="loader"></div>
\t \t <div class="loader-background"></div>
\t </div>
我創建了一個codepen所以你可以看到這個問題:
https://codepen.io/r3plica/pen/rwLagV
(注意,這是在鉻)
你可能會試一下blured有點陰影:'box-shadow:0px 0px 0px 2000px#000000,inset 0 0 5px#000000;'https://codepen.io/anon/pen/YQWyOz –