【css | loading】好看的loading特效

示例:

https://code.juejin.cn/pen/7277764394618978365

html

<div class="pl"><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__dot"></div><div class="pl__text">Loading…</div>
</div>

css

:root {--bg: #454954;--fg: #e3e4e8;--fg-t: rgba(227, 228, 232, 0.5);--primary1: #255ff4;--primary2: #5583f6;--trans-dur: 0.3s;font-size: calc(16px + (20 - 16) * (100vw - 320px) / (1280 - 320));
}body {background-color: var(--bg);background-image: linear-gradient(135deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));color: var(--fg);font: 1em/1.5 "Varela Round", Helvetica, sans-serif;height: 100vh;min-height: 360px;display: grid;place-items: center;transition: background-color var(--trans-dur), color var(--trans-dur);
}.pl {box-shadow: 2em 0 2em rgba(0, 0, 0, 0.2) inset, -2em 0 2em rgba(255, 255, 255, 0.1) inset;display: flex;justify-content: center;align-items: center;position: relative;letter-spacing: 0.1em;text-transform: uppercase;transform: rotateX(30deg) rotateZ(45deg);width: 15em;height: 15em;
}
.pl, .pl__dot {border-radius: 50%;
}
.pl__dot {animation-name: shadow;box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0, 0, 0, 0.5);top: calc(50% - 0.75em);left: calc(50% - 0.75em);width: 1.5em;height: 1.5em;
}
.pl__dot, .pl__dot:before, .pl__dot:after {animation-duration: 2s;animation-iteration-count: infinite;position: absolute;
}
.pl__dot:before, .pl__dot:after {content: "";display: block;left: 0;width: inherit;transition: background-color var(--trans-dur);
}
.pl__dot:before {animation-name: pushInOut1;background-color: var(--bg);border-radius: inherit;box-shadow: 0.05em 0 0.1em rgba(255, 255, 255, 0.2) inset;height: inherit;z-index: 1;
}
.pl__dot:after {animation-name: pushInOut2;background-color: var(--primary1);border-radius: 0.75em;box-shadow: 0.1em 0.3em 0.2em rgba(255, 255, 255, 0.4) inset, 0 -0.4em 0.2em #2e3138 inset, 0 -1em 0.25em rgba(0, 0, 0, 0.3) inset;bottom: 0;clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);height: 3em;transform: rotate(-45deg);transform-origin: 50% 2.25em;
}
.pl__dot:nth-child(1) {transform: rotate(0deg) translateX(5em) rotate(0deg);z-index: 5;
}
.pl__dot:nth-child(1), .pl__dot:nth-child(1):before, .pl__dot:nth-child(1):after {animation-delay: 0s;
}
.pl__dot:nth-child(2) {transform: rotate(-30deg) translateX(5em) rotate(30deg);z-index: 4;
}
.pl__dot:nth-child(2), .pl__dot:nth-child(2):before, .pl__dot:nth-child(2):after {animation-delay: -0.1666666667s;
}
.pl__dot:nth-child(3) {transform: rotate(-60deg) translateX(5em) rotate(60deg);z-index: 3;
}
.pl__dot:nth-child(3), .pl__dot:nth-child(3):before, .pl__dot:nth-child(3):after {animation-delay: -0.3333333333s;
}
.pl__dot:nth-child(4) {transform: rotate(-90deg) translateX(5em) rotate(90deg);z-index: 2;
}
.pl__dot:nth-child(4), .pl__dot:nth-child(4):before, .pl__dot:nth-child(4):after {animation-delay: -0.5s;
}
.pl__dot:nth-child(5) {transform: rotate(-120deg) translateX(5em) rotate(120deg);z-index: 1;
}
.pl__dot:nth-child(5), .pl__dot:nth-child(5):before, .pl__dot:nth-child(5):after {animation-delay: -0.6666666667s;
}
.pl__dot:nth-child(6) {transform: rotate(-150deg) translateX(5em) rotate(150deg);z-index: 1;
}
.pl__dot:nth-child(6), .pl__dot:nth-child(6):before, .pl__dot:nth-child(6):after {animation-delay: -0.8333333333s;
}
.pl__dot:nth-child(7) {transform: rotate(-180deg) translateX(5em) rotate(180deg);z-index: 2;
}
.pl__dot:nth-child(7), .pl__dot:nth-child(7):before, .pl__dot:nth-child(7):after {animation-delay: -1s;
}
.pl__dot:nth-child(8) {transform: rotate(-210deg) translateX(5em) rotate(210deg);z-index: 3;
}
.pl__dot:nth-child(8), .pl__dot:nth-child(8):before, .pl__dot:nth-child(8):after {animation-delay: -1.1666666667s;
}
.pl__dot:nth-child(9) {transform: rotate(-240deg) translateX(5em) rotate(240deg);z-index: 4;
}
.pl__dot:nth-child(9), .pl__dot:nth-child(9):before, .pl__dot:nth-child(9):after {animation-delay: -1.3333333333s;
}
.pl__dot:nth-child(10) {transform: rotate(-270deg) translateX(5em) rotate(270deg);z-index: 5;
}
.pl__dot:nth-child(10), .pl__dot:nth-child(10):before, .pl__dot:nth-child(10):after {animation-delay: -1.5s;
}
.pl__dot:nth-child(11) {transform: rotate(-300deg) translateX(5em) rotate(300deg);z-index: 6;
}
.pl__dot:nth-child(11), .pl__dot:nth-child(11):before, .pl__dot:nth-child(11):after {animation-delay: -1.6666666667s;
}
.pl__dot:nth-child(12) {transform: rotate(-330deg) translateX(5em) rotate(330deg);z-index: 6;
}
.pl__dot:nth-child(12), .pl__dot:nth-child(12):before, .pl__dot:nth-child(12):after {animation-delay: -1.8333333333s;
}
.pl__text {font-size: 0.75em;max-width: 5rem;position: relative;text-shadow: 0 0 0.1em var(--fg-t);transform: rotateZ(-45deg);
}/* Animations */
@keyframes shadow {from {animation-timing-function: ease-in;box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0, 0, 0, 0.3);}25% {animation-timing-function: ease-out;box-shadow: 0.1em 0.1em 0 0.1em black, 0.8em 0 0.8em rgba(0, 0, 0, 0.5);}50%, to {box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0, 0, 0, 0.3);}
}
@keyframes pushInOut1 {from {animation-timing-function: ease-in;background-color: var(--bg);transform: translate(0, 0);}25% {animation-timing-function: ease-out;background-color: var(--primary2);transform: translate(-71%, -71%);}50%, to {background-color: var(--bg);transform: translate(0, 0);}
}
@keyframes pushInOut2 {from {animation-timing-function: ease-in;background-color: var(--bg);clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);}25% {animation-timing-function: ease-out;background-color: var(--primary1);clip-path: polygon(0 25%, 100% 25%, 100% 100%, 0 100%);}50%, to {background-color: var(--bg);clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);}
}

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/77602.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

第51节:cesium 范围查询(含源码+视频)

结果示例: 完整源码: <template><div class="viewer"><el-button-group class="top_item"><el-button type=

Axure RP 10汉化版下载 Axure RP 10 mac授权码

Axure RP10汉化版是最强大的计划&#xff0c;原型设计和交付给开发人员的方法&#xff0c;而无需编写代码。能够制作逼真的&#xff0c;动态形式的原型。 Axure RP 10汉化版下载 Axure RP 10 mac授权码 RP 10有什么新功能&#xff1f; 1.显示动态面板 使用Axure RP 10&…

docker 镜像内执行命令显示:You requested GPUs: [0] But your machine only has: []

目录 问题描述&#xff1a; 问题解决&#xff1a; 问题描述&#xff1a; 在docker 镜像环境中&#xff0c;执行“docker exec -it container_name /bin/bash “进入容器之后&#xff0c;执行对应的python命令&#xff0c;显示You requested GPUs: [0] But your machine only…

【深度学习】P1 单层神经网络 - 线性回归(待完成)

单层神经网络 - 线性回归 线性回归基本要素1. 模型2. 模型训练3. 训练数据4. 损失函数5. 优化算法6. 模型预测 线性回归与神经网络1. 神经网络图 以一个简单的房屋价格预测为例&#xff0c;介绍解释线性回归这一单层神经网络。无需纠结于什么是单层神经网络&#xff0c;在本文的…

Hadoop_02

hadoop相比于传统文件系统的优点&#xff1a; 1.无限扩展 2.传统文件元数据分布在不同的机器上难以寻找&#xff0c;通过将元数据统一存放在一个服务器上解决 3.传统文件太大导致上传下载慢&#xff0c;通过分块并行上传到服务器解决 4.副本机制数据不容易丢失&#xff0c;解决…

python代码笔记230910

1.解释错误&#xff1a;TypeError: only integer scalar arrays can be converted to a scalar index 抱歉给出的解释有误。要返回列表中最小值的索引&#xff0c;可以使用index()方法。然而&#xff0c;当你尝试在列表中包含多个相同最小值时&#xff0c;index()方法可能会引…

JavaScript里面的二进制

概述 最近在做IOT设备配网开发的时候&#xff0c;处理了很多跟二进制、字节相关的事情&#xff0c;总结了一下JavaScript中有关二进制方面的一些知识点。 二进制和字节 首先&#xff0c;现代计算机是基于二进制的&#xff0c;从现代计算机电路来说&#xff0c;只有高电平/低电平…

Sql语句大全--查询

今天抽空整理下项目中的Sql语句* 项目中用到的Sql语句大全 Selcet 语句&#xff0c;有简有难 Selcet 语句&#xff0c;有简有难 基本的查询语句 select * from OLASCS.LLDC where CAPOLselect CATAX,CASU from OLASCS.LLDC where CAPOL IN (122345)SELECT EO,EANT, EAUS, sub…

TypeScript 中的 any、unknown、never 和 void

any any 表示 任意类型。 它是任意类型的父类&#xff0c;任意类型的值都可以赋予给 any 类型&#xff1a; // 编译不会报错 let anything: any 前端西瓜哥;let flag: boolean true; anything flag;anything { num: 2 };它可以表示任何类型&#xff0c;并使用它们的语法…

AIGC参数量节节攀升,对存储带来的挑战如何解决?

引言 近期&#xff0c;AIGC 相关产品如同雨后春笋一般不断涌现。但在技术层面&#xff0c;大家普遍的关注点更多集中在性能方面&#xff0c;却经常忽略了存储对推理和训练效率的影响&#xff0c;以及 AIGC 内容可能带来的合规风险。我们特邀腾讯云存储的产品负责人 崔剑老师和…

C++ QT qml 学习之 做个登录界面

最近在学习QT,也初探到qml 做ui 的灵活性与强大,于是手痒痒,做个demo 记录下学习成果 主要内容是如何自己编写一个按钮以及qml多窗口。 参考WX桌面版,做一个登录界面,这里面按钮是写的一个组合控件,有 按下,释放,以及正常 三种状态。 import QtQuick 2.0 import QtQ…

数据在内存中的存储——练习3

题目&#xff1a; 3.1 #include <stdio.h> int main() {char a -128;printf("%u\n",a);return 0; }3.2 #include <stdio.h> int main() {char a 128;printf("%u\n",a);return 0; }思路分析&#xff1a; 首先二者极其相似%u是无符号格式进行…

【Linux】—— 在Linux上进行读写文件操作

前言&#xff1a; 在之前&#xff0c;我已经对进程的相关知识进行了详细的介绍。本期开始&#xff0c;我们将要学习的是关于 “基础I/O”的知识&#xff01;&#xff01;&#xff01; 目录 &#xff08;一&#xff09;C文件接口 &#xff08;二&#xff09;系统文件I/O 1、接…

WebDAV之π-Disk派盘 + BubbleUPnP

BubbleUPnP是一款功能强大的Android播放器,支持UPnP/DLNA多屏互动。它可以将手机内容投屏到电视大屏上,与家人和朋友一起共享。此外,BubbleUPnP还提供了丰富的音乐和影视资源,您可以在线搜索并播放喜欢的内容。 以下是BubbleUPnP的一些主要特点: 1. 支持Chromecast和转码…

android java读写yaml文件

目录 申请读写权限&#xff1a; build.gradle中添加库引用&#xff1a; android java读写yaml文件 java修改yaml文件 YamlFile&#xff1a; 修改yaml文件方法2 Yaml&#xff1a; 删除值&#xff1a; 申请读写权限&#xff1a; <uses-permission android:name"and…

WebGL 绘制矩形

上一节绘制了圆点&#xff0c;调用的绘制方法如下&#xff1a;gl.drawArrays(gl.POINTS, 0, 1); 第一个参数明显是个枚举类型&#xff0c;肯定还有其他值&#xff0c;如下所示&#xff1a; POINTS 可视的点LINES 单独线段LINE_STRIP 线条LINE_LOOP 闭合线条TRIANGLES 单独三…

计算机网络篇之域名

计算机网络篇之域名 介绍 一个域名是一个由点分割的字符串序列&#xff0c;用于标识一组IP地址或互联网上的计算机&#xff0c;域名用于在因特网上标识和定位特定的网站或服务 组成 域名由两个主要部分组成&#xff1a;顶级域和二级域&#xff0c;顶级域是域名的最高级别&a…

Codeforces Round 895 (Div. 3) (A~G)

A. Two Vessels 题意&#xff1a;你有两个无限容量杯子A,B&#xff0c;分别装了a&#xff0c;b升的水&#xff0c;此外你还有一个容量为c的杯子C&#xff0c;你可以将一杯的水先倒入C中&#xff0c;再倒入另一个杯子&#xff0c;问你最少需要操作几次能使得A B杯的水量相同。 …

【题解】2596. 检查骑士巡视方案

题解&#xff1a; class Solution {int n,m;bool st[100][100];int flag;int dx[8]{-1,-2,-2,-1,1,2,2,1};int dy[8]{-2,-1,1,2,2,1,-1,-2}; public:bool checkValidGrid(vector<vector<int>>& grid) {m grid.size();n grid[0].size();dfs(grid,0,0,0);ret…

运行时链接

基本概念 运行时链接&#xff0c;是在程序运行时&#xff08;而非编译时或加载时&#xff09;将程序代码与其依赖的库代码进行链接的过程。动态链接在程序启动时或实际运行过程中通过API函数完成。这种方式的主要优点是它允许程序在运行时加载和卸载不同的库模块&#xff0c;从…