|
|

楼主 |
发表于 2022-4-6 17:50
|
显示全部楼层
感觉动画有点粗糙,需要细细调整吧。这是只是提供UFO发出探照光柱的实现思路与方法:
- <style>
- .stage {
- position: relative;
- left: -352px;
- width: 1300px;
- height: 533px;
- background: #000 url('https://638183.freep.cn/638183/Pic/2022/jz.gif') no-repeat center/cover;
- overflow: hidden;
- filter: blur(1px);
- cursor: pointer;
- opacity: .9;
- }
- .stage::before {
- content:attr(data-1);
- position: absolute;
- right: 10px;
- top: 10px;
- font: 900 3em/1em Sans-seirf;
- color: green;
- text-shadow: 2px 2px 4px rgba(0,0,0,.6);
- }
- #ufo {
- position: absolute;
- filter: blur(.5px);
- width: 205px; height: 124px;
- animation: fly 8s ease-in-out infinite alternate;
- }
- #ufo::after {
- content: '';
- left: 80px; bottom: -10px;
- position: absolute;
- width: 0px;
- height: 0px;
- border: 20px solid;
- border-color: transparent transparent green transparent;
- filter: blur(1px);
- opacity: .6;
- transition: .5s;
- transform-origin: 050%;
- transform: scale(5,30) ;
- animation: rot 8s ease-in-out infinite alternate;
- }
- @keyframes fly { to { transform: rotate(20deg) translate(1100px); } }
- @keyframes rot { to { transform: rotate(30deg) scale(15,20) ; } }
- </style>
- <div class="stage" data-1="Kara - 白昼梦">
- <div id="ufo">
- <img alt="" src="https://638183.freep.cn/638183/Pic/2022/feidie.gif" width="205" height="124" />
- </div>
- </div>
- <script>
- let stage = document.querySelector('.stage');
- let aud = document.createElement('audio');
- aud.src = 'http://www.kumeiwp.com/sub/filestores/2022/03/23/78088abc2dcb7c061f0a5929ef406b5d.mp3';
- aud.autoplay = true;
- aud.loop = true;
- stage.appendChild(aud);
- stage.onclick = () => { aud.paused ? aud.play() : aud.pause(); }
- </script>
复制代码
|
|