当前位置:网站首页>旋转彩色三叶草
旋转彩色三叶草
2022-06-29 23:53:00 【 星云 】

<!DOCTYPE html>
<html lang="en">
<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">
<title>Document</title>
<style> @keyframes move {
0%, 100% {
width: 12rem; } 50% {
width: 20rem; } } body {
background-color: #222; } .group {
margin: auto; width: 25rem; height: 25rem; text-align: left; } .box {
position: absolute; white-space: nowrap; top: 50%; width: 20rem; } .ball {
display: inline-block; width: .75rem; height: .75rem; border-radius: 100%; } .bar {
display: inline-block; height: .75rem; animation: move 2s ease-in-out infinite; } </style>
</head>
<body>
<div class="container">
<div id="group" class="group">
</div>
</div>
</body>
<script> var group = document.getElementById('group'); // 无脚本一样可以良好展示,但是得多写好多重复代码,而且不好改 for (var i = 0; i < 18; i++) {
var ball = document.createElement('div'); ball.className = 'ball'; ball.setAttribute('style', `background-color: hsl(${
i * 20},100%,50%)`) var bar = document.createElement('div'); bar.className = 'bar'; bar.setAttribute('style', `animation-delay: -${
i / 3}s;`) var box = document.createElement('div'); box.className = 'box'; box.setAttribute('style', `transform: rotate(${
i * 20}deg);`) box.appendChild(bar); box.appendChild(ball); group.appendChild(box); } </script>
</html>
边栏推荐
猜你喜欢

What is IGMP? What is the difference between IGMP and ICMP?

Exploration and Practice on the future direction of byte cloud database

Use of jetpack's room in combination with flow

QT learning 02 GUI program example analysis

Teach you step by step to install webwind notes on edge browser

Matplotlib histogram of Matplotlib visualization plt bar()

Overseas digital authentication service provider advance AI was selected into the "2022 brand sea Service Market Research Report" of equalocean

一步步教你在Edge浏览器上安装网风笔记

Sword finger offer 15 Number of 1 in binary

Buffer flow exercise
随机推荐
Golang泛型的巧妙应用,防止变量空指针错误,防止结构体字段空指针错误
我想知道今天还可以开户么?另外想问,现在在线开户安全么?
koa2学习和使用
Matplotlib plt Hist() parameter explanation
网上开户选哪个证券公司?还有,在线开户安全么?
绿树公司官方网站
LC:有效的数独 + 旋转图像
Is China Merchants Securities reliable? Is it safe to open a stock account?
Serialization of binary tree 297 Serialization and deserialization of binary tree 652 Find duplicate subtrees
Sword finger offer 15 Number of 1 in binary
Shell positional parameter variables and predefined variables
Applet plug-in access, development and precautions
Test d'installation du cluster metaq
Analysis of common vlog parameters
QT learning 03 birth and essence of QT
How about counting Berry Pie 4? What are the possible ways to play?
Zhongkang holdings opens the offering: it plans to raise HK $395million net, and it is expected to be listed on July 12
Golang6 reflection
剑指 Offer 15. 二进制中1的个数
Solr basic operation 1