gpt4 book ai didi

css - 页面加载动画在加载时闪烁(缩放更改)

转载 作者:行者123 更新时间:2023-11-27 23:59:03 24 4
gpt4 key购买 nike

我们的 Angular (v7) 应用程序有一个启动动画,它基本上显示了一个嵌入到 index.html 中的旋转轮(CSS 动画),因此它会在页面加载时立即显示。

这工作正常,但是每加载 ~4 个页面,缩放级别就会轻微闪烁(我在 Windows 10 上使用最新的 Chrome),这意味着保存“启动消息”的方形 div 从一个尺寸开始,然后下降约 5% 的大小。它发生得非常快,从静态 HTML 内容呈现到 View 的那一刻到呈现 Angular View 之前大约一秒钟。看起来某些渲染引擎正在延迟加载并且出现问题(?)

会不会是 Angular 正在改变页面加载时的缩放/平移系数?

Index.html

<!doctype html>
<html lang="en" class="mitzi-page-root">
<head>
<meta charset="utf-8">
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.mitzi-splash-view-indicator {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
-webkit-animation: fadein 2s;
animation: fadein 2s;
}

@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}

@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}

.mitzi-splash-indicator-dialog-bg {
position: absolute;
width: 15rem;
height: 12rem;
align-self: center;
border-style: solid;
border-width: .1rem;
border-radius: 1rem;
background: #FFFFFF;
border-color: #378b68;
-webkit-animation: fadein 5s;
animation: fadein 5s;
}

.mitzi-splash-indicator-loader-wrapper {
position: absolute;
left: 4.6875rem;
top: 2.2495rem;
width: 5.625rem;
height: 5.625rem;
padding-bottom: 3rem;
}

.mitzi-splash-indicator-loader {
width: 5.625rem;
height: 5.625rem;
align-self: center;
animation: mitzi-splash-indicator-spin 1s steps(8) infinite;
}

.mitzi-splash-indicator-message {
position: absolute;
top: 9.125rem;
width: 100%;
text-align: center;
height: 1rem;
line-height: 1rem;
font-family: 'Open Sans', serif;
font-size: 1rem;
font-weight: normal;
color: #2A6E52;
}

@keyframes mitzi-splash-indicator-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

.mitzi-splash-indicator-spinner {
fill: #0c573c;
}
</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open Sans">
<link rel="shortcut icon" sizes="32x32" href="assets/img/favicon-mitzi.png" type="image/png" />
</head>
<body class="mitzi-body">
<mitzi-root>
</mitzi-root>
<div id="mitzi_app_preloader" class="mitzi-splash-view-indicator">
<div class="mitzi-splash-indicator-dialog-bg">
<div class="mitzi-splash-indicator-loader-wrapper">
<div class="mitzi-splash-indicator-loader">
<svg class="mitzi-splash-indicator-spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="background: none;">
<!-- HERE COMES SOME **STATIC** SVG GRAPHICS THAT IS BEING ROTATED BY **CSS** (AND NOT BY SVG ANIMATIONS - WHICH *WOULD* MESS THINGS UP)... -->
</svg>
</div>
</div>
<span class="mitzi-splash-indicator-message">Loading ...</span>
</div>
</div>
<div style="display: none !important" id="hidden-div-for-assets-load-on-startup">
<img src="assets/img/common/error.svg">
<img src="assets/img/status_icons/form_error.png">
<span class="pi pi-times"></span>
</div>
<title>mitzi</title>
</body>
</html>

最佳答案

box-sizing 由我们自己的代码设置....这会触发 div 大小的微小变化

关于css - 页面加载动画在加载时闪烁(缩放更改),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56096966/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com