|
|

楼主 |
发表于 2022-4-10 08:39
|
显示全部楼层
原創代碼:
- <style>
- .bgDiv {/* 帖子主體 */
- margin: auto;
- width: 1275px;
- height: 717px;
- left: -339.5px;
- background: url('https://638183.freep.cn/638183/Pic/2022/ysjn.jpg') no-repeat center/cover;
- border: 1px solid;
- position: relative;
- perspective: 1000px;
- }
- .bgDiv::before {/* 煙霧 */
- content: '';
- position: absolute;
- width: inherit;
- height: inherit;
- background: url('https://638183.freep.cn/638183/Pic/2022/smoke1.gif') no-repeat center/cover;
- opacity: .2;
- }
- .btf {/* 蝴蝶 */
- width: 200px;
- height: 113px;
- position: absolute;
- left: 20px;
- bottom: 40px;
- filter: blur(1px);
- animation: fly 40s ease infinite alternate;
- }
- .stage {/* 字幕wrap */
- --len: 80px;
- margin: 200px auto 0;
- position: relative;
- width: var(--len);
- height: var(--len);
- transform-style: preserve-3d;
- animation: rot 15s linear infinite;
- }
- .stage div {/* 字幕面板統一樣式 */
- position: absolute;
- width: inherit;
- height: inherit;
- color: #eee;
- text-shadow: 1px 1px 3px #111;
- font: 2em / var(--len) Arial;
- text-align: center;
- left: 0; top: 0;
- }
- /* 蝴蝶動畫 */
- @keyframes fly { to { left: 1050px; } }
- /* 字幕動畫 */
- @keyframes rot { to { transform: rotateY(-360deg); } }
- </style>
- <div class="bgDiv">
- <div class="stage"></div>
- <img class="btf" src="https://638183.freep.cn/638183/Pic/2022/btf.gif" alt="" />
- </div>
- <script>
- //加載網易云音樂
- let wyy = document.createElement('iframe');
- wyy.src = 'https://music.163.com/outchain/player?type=2&id=548814997&auto=1&height=66';
- wyy.style.display = 'none';
- document.querySelector('.bgDiv').appendChild(wyy);
- //加載字幕
- let stage = document.querySelector(".stage");
- let txt = "花潮論壇歡迎您";
- let angle = 360 / txt.length;
- let w = stage.clientWidth;
- let trz = Math.ceil(Math.tan(Math.PI / 180 * (180 - angle) /2 ) *w / 2);
- let str = "";
- for(j=0; j<txt.length; j++){
- let cc = `#${Math.random().toString(16).substr(-6)}`;
- let ry = Math.floor(j*angle);
- str += `<div style="transform:rotateY(${ry}deg) translateZ(${trz}px); background: ${cc};">${txt.charAt(j)}</div>\n`;
- }
- stage.innerHTML = str;
- </script>
复制代码
|
评分
-
| 参与人数 2 | 威望 +80 |
金钱 +160 |
经验 +80 |
收起
理由
|
加林森
| + 30 |
+ 60 |
+ 30 |
很给力! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|