浣溪沙•斜阳晚照
<style>#mydiv {
margin: 30px auto;
padding: 20px 10px;
width: 90%;
min-height: 400px;
border: 1px solid var(--fColor);
color: var(--fColor);
background: var(--bgMain);
position: relative;
pointer-events: none;
--bgMain: linear-gradient(snow,lightgreen,snow);
--bgTitle: lightgreen;
--fColor: black;
--btnWidth: 40px;
--state: paused;
}
#mydiv::before, #mydiv::after { position: absolute; content: ''; }
#mydiv::before {
padding: 0 130px;
content: '浣溪沙 · 斜阳晚照';
left: 250px;
top: -18px;
font: bold 24px / 36px sans-serif;
text-shadow: 1px 1px 2px #111;
border: inherit;
background: var(--bgTitle);
}
#mydiv::after {
width: var(--btnWidth);
height: var(--btnWidth);
background: conic-gradient(var(--fColor),var(--bgTitle),var(--fColor),var(--bgTitle));
border-radius: 50%;
bottom: calc(var(--btnWidth) / -2);
left: calc(50% - var(--btnWidth) / 2);
cursor: pointer;
pointer-events: auto;
animation: rot 5s infinite linear var(--state);
}
#mydiv p { padding: 20px 0; font-size: 16px ; }
.txtRight { position: absolute; text-align: center; right: 10px; bottom: -10px; }
.txtMid { text-align: center; }
@keyframes rot { to { transform: rotate(360deg); } }
</style>
<div id="mydiv">
<p><p><p>萧瑟金风天气凉。壑沟草木露成霜。千畴绿麦换银装。</p>
<p>山下霜枫琼玉色,篱间秋菊蕊珠芳。斜阳残照亦思乡。</p><p>
<p class="txtRight">偶然<br>2023年11月3日</p>
<audio id="aud" src="https://ouran2023.s3-us-east-1.ossfiles.com/yanlei.mp3" autoplay="autoplay" loop="loop"></audio>
<script>
(function () {
let mState = () => mydiv.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
mydiv.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>
楼主好有诗才啊!~~~ 闲庭信步间,夏绿转金秋了!{:10_403:}
页:
[1]