《出水莲》(学习水滴与涟漪制作)
本帖最后由 加林森 于 2022-4-11 17:53 编辑 <br /><br /><style>/* 底图 */
.stage {
top:120px;left:-302px;
position: relative;
width:1200px;
height: 765px;
background: #FFF url('https://pic.imgdb.cn/item/6252d13e239250f7c5275237.jpg') no-repeat center/cover;
box-shadow: 4px 4px 5px #888;
border-radius:12px;
}
/* 涟漪 */
.lianyi {
position: absolute;
background: transparent;
border: 1px solid #eee;
border-radius: 50%;
box-shadow: 0px 0px 6px #fff inset, 0 0 8px #000;
position: absolute;
opacity: 0;
}
.lianyi1 {
width: 60px;
height: 60px;
left: 400px;
top: 650px;
animation: circle 1.8s 1.8s linear infinite;
}
.lianyi2 {
width: 60px;
height: 60px;
left: 640px;
top: 620px;
animation: circle2 2.5s 2.5s linear infinite;
}
.lianyi3 {
width: 60px;
height: 60px;
left: 840px;
top: 662px;
animation: circle3 2.0s 1.8s linear infinite;
}
/* 水滴 */
.wdrop {
position: absolute;
border-radius: 80% 0 55% 50% / 55% 0 80% 50%;
transform: rotate(-45deg);
background-image: linear-gradient(45deg, #8CA2FB 0%, #F0F0FD 100%);
}
.wdrop::after {
content: '';
width: 50%;
height: 50%;
position: absolute;
left: 10%; top: 20%;
border-radius: 50%;
background: radial-gradient(circle at 50% 0px, #ffffff, rgba(255, 255, 255, 0) 58%);
filter: blur(5px);
}
.wdrop1 {
left: 420px;
top: 260px;
width: 20px;
height: 20px;
animation: drop 1.8s ease-in infinite;
}
.wdrop2 {
left: 660px;
top: 400px;
width: 18px;
height: 18px;
animation: drop2 2.5s ease-in infinite;
}
.wdrop3 {
left: 860px;
top: 280px;
width: 18px;
height: 18px;
animation: drop3 2.0s ease-in infinite;
}
/* 动画 */
@keyframes drop{
0% { top: 260px; }
100% { top: 650px; }
}
@keyframes circle {
0% { opacity: 0.1; }
100% { transform: scale(3, 1.2); opacity: 0; }
}
@keyframes drop2{
0% { top: 400px; }
100% { top: 620px; }
}
@keyframes circle2 {
0% { opacity: 0.1; }
100% { transform: scale(3, 1); opacity: 0; }
}
@keyframes drop3{
0% { top: 280px; }
100% { top: 662px; }
}
@keyframes circle3 {
0% { opacity: 0.1; }
100% { transform: scale(3, 1); opacity: 0; }
}
/* 音乐控制按钮 */
.picBtn {
position: absolute;
width: 80px;
height: 129px;
left: 100px;
top: 580px;
border: none;
outline: none;
border-radius: 8px;
background: transparent url('http://image.hnol.net/c/2022-03/12/19/20220312194526771-5087368.gif') no-repeat;
cursor: pointer;
}
/* 旋转魔方 */
.cude {
--xyz: 80px;
--bb: -40px;
width: var(--xyz);
height: var(--xyz);
position: relative;
left: 260px; top: 280px;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(-80deg);
transform-origin: 50% 50% 0;
animation: rot 10s linear infinite;
}
.pae {
position: absolute;
left: 0; top: 0;
width: var(--xyz); height: var(--xyz);
background: blue;
opacity: .2;
font: bold 40px / var(--xyz) Arial;
color: #fff;
text-align: center;
text-shadow: 1px 1px 2px #000;
border:1px solid #333;
}
.front { transform: rotateY(0) translateZ(calc(var(--xyz) / 2)); }
.back { transform: translateZ(var(--bb)) rotateY(180deg); }
.left { transform: rotateY(-90deg) translateZ(calc(var(--xyz) / 2)); }
.right { transform: rotateY(90deg) translateZ(calc(var(--xyz) / 2)); }
.top { transform: rotateX(90deg) translateZ(calc(var(--xyz) / 2)); }
.bottom { transform: rotateX(90deg) translateZ(var(--bb)); }
@-webkit-keyframes rot {
from { transform: rotateX(0deg) rotateY(0deg); }
to { transform: rotateX(360deg) rotateY(360deg); }
}
</style>
<div class="stage">
<div class="wdrop wdrop1"></div><div class="lianyi lianyi1"></div>
<div class="wdrop wdrop2"></div><div class="lianyi lianyi2"></div>
<div class="wdrop wdrop3"></div><div class="lianyi lianyi3"></div>
<div style="position: absolute; left:540px; top: 60px; width:650px;">
<img alt="" src="https://pic.imgdb.cn/item/6247dcc127f86abb2a49e093.gif"/></div>
<button id="picBtn" class="picBtn"></button>
<div class="cude">
<div class="pae front">出</div>
<div class="pae left">水</div>
<div class="pae right">莲</div>
<div class="pae bottom">出</div>
<div class="pae top">水</div>
<div class="pae back">莲</div>
</div>
</div>
<audio id="music" src="https://music.163.com/song/media/outer/url?id=5265056.mp3" loop="loop"
autoplay="autoplay" ></audio>
</div><br><br><br><br><br>
<script language="javascript">
var mu = document.getElementById('music');
var btn = document.getElementById('picBtn');
btn.onclick = function(){
mu.paused ? (mu.play(), btn.style.background="url('http://image.hnol.net/c/2022-03/12/19/20220312194526771-5087368.gif')") :
(mu.pause(), btn.style.background="url('http://image.hnol.net/c/2022-03/12/19/202203121947494281-5087368.gif')");
}
mu.addEventListener("ended", function(){
btn.style.background="url('http://image.hnol.net/c/2022-03/12/19/202203121947494281-5087368.gif')";
});
</script>
@马黑黑 @红影 可以考虑将立方体作为按钮来使用 马黑黑 发表于 2022-4-11 12:13
可以考虑将立方体作为按钮来使用
嗯嗯,立方体可能要修改小点才好看。 加林森 发表于 2022-4-11 12:24
嗯嗯,立方体可能要修改小点才好看。
可以修改 马黑黑 发表于 2022-4-11 12:28
可以修改
嗯嗯,知道的。 加林森 发表于 2022-4-11 12:34
嗯嗯,知道的。
{:4_190:} 马黑黑 发表于 2022-4-11 12:36
谢谢。老黑吃午饭没有? 出水莲亦如出浴香妃。。{:4_189:} 出尘唯美。。{:4_199:}{:4_199:} 红芍药 发表于 2022-4-11 13:07
出水莲亦如出浴香妃。。
是的。芍药姑娘中午好!{:4_204:} 红芍药 发表于 2022-4-11 13:08
出尘唯美。。
嗯嗯。{:4_190:} 加林森 发表于 2022-4-11 12:10
@马黑黑 @红影
加林森朋友下午好!学以致用,太美了。 所有马术运用自如!{:4_177:} 很漂亮,欣赏队长好帖{:4_187:} 怎么论坛界面受影响了,队长可能少了哪些语句了? 涟漪在这样的背景下有些看不出呢。我把黑黑的蓝色改成了黑色,因为我那个背景是蓝的,队长可以再改回去蓝色就清晰了{:4_204:} 梦油 发表于 2022-4-11 14:13
加林森朋友下午好!学以致用,太美了。
梦油朋友下午好。 樵歌 发表于 2022-4-11 15:32
所有马术运用自如!
樵歌下午好。 红影 发表于 2022-4-11 15:37
很漂亮,欣赏队长好帖
嗯嗯,终于捣鼓出来了。
页:
[1]
2