欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > Vue实现网页首屏加载动画

Vue实现网页首屏加载动画

2025/5/11 15:51:30 来源:https://blog.csdn.net/qq_43557848/article/details/144714377  浏览:    关键词:Vue实现网页首屏加载动画

效果预览

在这里插入图片描述

在public/index.html 文件中添加动画

<!DOCTYPE html>
<html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1.0"><link rel="icon" href="./favicon.ico"><title>后台管理系统</title><style>.loading-overlay {position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-color: #2d3a4b;display: flex;flex-direction: column;justify-content: center;align-items: center;z-index: 9999;}.loading-spinner {border: 8px solid #f3f3f3;/* Light grey */border-top: 8px solid #3498db;/* Blue */border-radius: 50%;width: 50px;height: 50px;animation: spin 1s linear infinite;}.loading-message {font-size: 20px;color: #fff;margin-top: 10px;/* 调整上边距 */}@keyframes spin {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);}}</style></head><body><noscript><strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div class="loading-overlay" id="loadingOverlay"><div class="loading-spinner"></div><div class="loading-message">正在加载系统资源,请耐心等待...</div></div><div id="app"></div><script>// 模拟内容加载完成window.addEventListener('load', function() {var loadingOverlay = document.getElementById('loadingOverlay');if (loadingOverlay) {loadingOverlay.style.display = 'none';}});</script></body><script src="./config.js"></script>
</html>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词