|
|

楼主 |
发表于 2022-11-9 18:06
|
显示全部楼层
本帖最后由 马黑黑 于 2022-11-9 18:11 编辑
82#代码:
- <style>
- #mama {
- margin: 50px auto 0;
- position: relative;
- width: 400px;
- height: 400px;
- display: grid;
- grid-template-rows: repeat(8,8fr);
- grid-template-columns: repeat(8,8fr);
- border-radius: 50%;
- overflow: hidden;
- }
- #mama > span {
- width: 40px;
- height: 40px;
- border-radius: 0 100%;
- opacity: .75;
- }
- </style>
- <div id="mama"></div>
- <script>
- for(j=0; j<64; j++) {
- let span = document.createElement('span');
- let size = Math.random()*30 + 20;
- span.style.cssText = `
- width: ${size}px;
- height: ${size}px;
- background: linear-gradient(135deg, #${Math.random().toString(16).substr(-6)}, #${Math.random().toString(16).substr(-6)});
- transform: rotate(${Math.random()*180}deg);
- `;
- mama.appendChild(span);
- }
- </script>
复制代码
|
|