大猫咪 发表于 2022-3-23 23:09

门德尔松:威尼斯船歌 学习帖

<style type="text/css">
/* 帖子容器 */
#tzDiv {
      position: relative;
      left: -214px;
      width: 1024px;
      height: 600px;
      top: 80px;
      background: #eee url('https://s3.bmp.ovh/imgs/2022/03/4d512af871599fc6.webp') no-repeat center/cover;
      opacity: 0.8;
}
/* 音乐控制按钮 */
.picBtn {
      position: absolute;
       width: 100px;
       height: 100px;
       left: 180px;
       bottom: 60px;
       border: none;
       outline: none;
       border-radius: 8px;
       background: transparent url('http://image.hnol.net/c/2022-02/23/01/2022022301050291-5087368.gif') no-repeat;
       cursor: pointer;
}
/* 文本时钟 */
#textClock {
      position: absolute;
      top: 180px;
      right: 200px;
      width: 300px;
      height: 30px;
      font: 20px / 30px Sans-Serif;
      text-align: center;
}
/* 走马灯父框 */
.txtFly {
      position: absolute;
      width: 260px;
      height: 30px;
      right: 100px;
      bottom: 100px;
      overflow: hidden;
}
/* 走马灯文本 */
.txtFly div {
      position: absolute;
      left: 260px;
      font: normal 18px /20px Sans-Serif;
      word-break: keep-all;
      white-space:nowrap;
}
/* 变色文本 */
.txtBg {
      position: absolute;
      top: 80px;
      right: 100px;
      font-size: 4rem;
      color: transparent;
      width: 500px;
      height: 100px;
      line-height: 100px;
      text-align: center;
      background-image: linear-gradient(90deg, green, olive, transparent, tomato, green);
      background-size: 500px 100px;
      background-position: 500px 0;
      border: 1px solid;
      background-clip: text;
      -webkit-background-clip: text;
      animation: chgc 2s linear infinite;
}
/* 文本变色动画 */
@keyframes chgc {
      from { background-position: -500px 0; }
      to { background-position: 0 0; }
}
</style>

<div id="tzDiv">
      <div class="txtBg">门德尔松:威尼斯船歌</div>
      <div id="textClock"></div>
      <div class="txtFly">
                <div id="ziFly">门德尔松的三首威尼斯船歌均采用小调,旋律具有多愁善感的悲歌式音调,乐句平衡对称,绵长的气息感,表现出一种缓慢而又忧郁的情绪,使人联想到船夫的歌声。三首船歌的主题旋律均以级进为主,偶有跳进(四、六度)后马上与反方向的级进进行相平衡,形成了“拱形”结构,体现了浪漫主义早期器乐声乐化的倾向。。</div>
      </div>
      <button id="picBtn" class="picBtn"></button>
      <audio id="music" src="http://music.163.com/song/media/outer/url?id=1855110001.mp3" loop="loop" autoplay="autoplay" ></audio>
</div>

<script language="javascript">

fly(); //运行走马灯
showTime(); //显示时间
setInterval(showTime, 1000); //运行时钟

//文本时钟函数
function showTime(){
      var now = new Date();
      var year = now.getFullYear();
      var month = now.getMonth() + 1;
      var date = now.getDate();
      var day = now.getDay();
      var hour = now.getHours();
      if(hour < 10) hour = "0" + hour;
      var minute = now.getMinutes();
      if(minute < 10) minute = "0" + minute;
      var second = now.getSeconds();
      if(second < 10) second = "0" + second;
      document.getElementById("textClock").innerHTML = year + "年" + month + "月" + date + "日 星期" + toHz(day) + "" + hour + ":" + minute + ":" + second;
}
function toHz(num) { var hz = "日一二三四五六九"; return(hz.charAt(num)); }
//音乐控制代码
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-02/23/01/2022022301050291-5087368.gif')") : (mu.pause(), btn.style.background="url('http://image.hnol.net/c/2022-02/23/01/2022022301050291-5087368.gif')");
}

mu.addEventListener("ended", function(){
      btn.style.background="url('http://image.hnol.net/c/2022-02/23/01/2022022301050291-5087368.gif')";
});
//创建走马灯
function fly() {
      var ziFly = document.getElementById('ziFly');
      var width = ziFly.clientWidth;
      var style = document.createElement('style');
      style.type = 'text/css';
      var flyStr = '@keyframes fly {to { left: -' + width + 'px; } }';
      style.innerHTML = flyStr;
      ziFly.appendChild(style);
      ziFly.style.animation = 'fly 40s linear infinite';
}
</script>

加林森 发表于 2022-3-23 23:16

猫猫制作得挺好好的!{:4_204:}

大猫咪 发表于 2022-3-23 23:18

加林森 发表于 2022-3-23 23:16
猫猫制作得挺好好的!

先学习下,好多还要琢磨, 队长学习的真快{:4_204:}

加林森 发表于 2022-3-23 23:22

大猫咪 发表于 2022-3-23 23:18
先学习下,好多还要琢磨, 队长学习的真快

我们继续学习吧。

大猫咪 发表于 2022-3-23 23:24

加林森 发表于 2022-3-23 23:22
我们继续学习吧。

嗯嗯 队长 {:4_179:}

加林森 发表于 2022-3-23 23:27

大猫咪 发表于 2022-3-23 23:24
嗯嗯 队长

不客气的。明天我准备制作国际的音乐出来。

大猫咪 发表于 2022-3-23 23:31

加林森 发表于 2022-3-23 23:27
不客气的。明天我准备制作国际的音乐出来。

嗯嗯   好   等着欣赏{:4_204:} 明天见队长{:4_179:} 晚安!

加林森 发表于 2022-3-23 23:32

大猫咪 发表于 2022-3-23 23:31
嗯嗯   好   等着欣赏   明天见队长   晚安!

晚安,明天见!!!!!!!!!

红影 发表于 2022-3-24 08:42

真漂亮,猫猫做得很棒呢。针对这张图图,要是让底图径向翻个身,把船放在右边,文字就更清晰了呢{:4_187:}

红影 发表于 2022-3-24 09:02

<style type="text/css">
/* 帖子容器 */
#tzDiv1 {
      position: relative;
      left: -214px;
      width: 1024px;
      height: 600px;
      top: 80px;
      background: #eee url('https://pic.imgdb.cn/item/623bc21127f86abb2a293643.jpg') no-repeat center/cover;
      opacity: 0.8;
}
/* 音乐控制按钮 */
.picBtn1 {
      position: absolute;
       width: 100px;
       height: 100px;
       left: 120px;
       bottom: 60px;
       border: none;
       outline: none;
       border-radius: 8px;
       background: transparent url('http://image.hnol.net/c/2022-02/23/01/2022022301050291-5087368.gif') no-repeat;
       cursor: pointer;
}
/* 文本时钟 */
#textClock1 {
      position: absolute;
      top: 180px;
      right: 200px;
      width: 300px;
      height: 30px;
      font: 20px / 30px Sans-Serif;
      text-align: center;
}
/* 走马灯父框 */
.txtFly1 {
      position: absolute;
      width: 260px;
      height: 30px;
      right: 120px;
      bottom: 140px;
      overflow: hidden;
}
/* 走马灯文本 */
.txtFly1 div {
      position: absolute;
      left: 220px;
      text-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
      font: normal 18px /20px Sans-Serif;
      word-break: keep-all;
      white-space:nowrap;
}
/* 变色文本 */
.txtBg1 {
      position: absolute;
      top: 80px;
      right: 100px;
      font-size: 4rem;
      color: transparent;
      width: 500px;
      height: 100px;
      line-height: 100px;
      text-align: center;
      background-image: linear-gradient(90deg, green, olive, transparent, tomato, green);
      background-size: 500px 100px;
      background-position: 500px 0;
      border: 1px solid;
      background-clip: text;
      -webkit-background-clip: text;
      animation: chgc1 2s linear infinite;
}
/* 文本变色动画 */
@keyframes chgc1 {
      from { background-position: -500px 0; }
      to { background-position: 0 0; }
}
</style>

<div id="tzDiv1">
      <div class="txtBg1">门德尔松:威尼斯船歌</div>
      <div id="textClock1"></div>
      <div class="txtFly1">
                <div id="ziFly1">门德尔松的三首威尼斯船歌均采用小调,旋律具有多愁善感的悲歌式音调,乐句平衡对称,绵长的气息感,表现出一种缓慢而又忧郁的情绪,使人联想到船夫的歌声。三首船歌的主题旋律均以级进为主,偶有跳进(四、六度)后马上与反方向的级进进行相平衡,形成了“拱形”结构,体现了浪漫主义早期器乐声乐化的倾向。。</div>
      </div>
      <button id="picBtn1" class="picBtn1"></button>
      <audio id="music" src="http://music.163.com/song/media/outer/url?id=1855110001.mp3" loop="loop" autoplay="autoplay" ></audio>
</div>

<script language="javascript">

fly1(); //运行走马灯
showTime1(); //显示时间
setInterval(showTime1, 1000); //运行时钟

//文本时钟函数
function showTime1(){
      var now = new Date();
      var year = now.getFullYear();
      var month = now.getMonth() + 1;
      var date = now.getDate();
      var day = now.getDay();
      var hour = now.getHours();
      if(hour < 10) hour = "0" + hour;
      var minute = now.getMinutes();
      if(minute < 10) minute = "0" + minute;
      var second = now.getSeconds();
      if(second < 10) second = "0" + second;
      document.getElementById("textClock1").innerHTML = year + "年" + month + "月" + date + "日 星期" + toHz(day) + "" + hour + ":" + minute + ":" + second;
}
function toHz(num) { var hz = "日一二三四五六九"; return(hz.charAt(num)); }
//音乐控制代码
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-02/23/01/2022022301050291-5087368.gif')") : (mu.pause(), btn.style.background="url('http://image.hnol.net/c/2022-02/23/01/2022022301050291-5087368.gif')");
}

mu.addEventListener("ended", function(){
      btn.style.background="url('http://image.hnol.net/c/2022-02/23/01/2022022301050291-5087368.gif')";
});
//创建走马灯
function fly1() {
      var ziFly1 = document.getElementById('ziFly1');
      var width = ziFly1.clientWidth;
      var style = document.createElement('style');
      style.type = 'text/css';
      var flyStr = '@keyframes fly {to { left: -' + width + 'px; } }';
      style.innerHTML = flyStr;
      ziFly1.appendChild(style);
      ziFly1.style.animation = 'fly 40s linear infinite';
}
</script>

红影 发表于 2022-3-24 09:20

好像船放左边好点呢{:4_173:}

红影 发表于 2022-3-24 09:26

或者把文字放在左边,挤在一起不太好。

加林森 发表于 2022-3-24 12:15

红影 发表于 2022-3-24 09:26
或者把文字放在左边,挤在一起不太好。

红影这个翻转真好看。{:4_199:}

大猫咪 发表于 2022-3-24 12:36

加林森 发表于 2022-3-23 23:32
晚安,明天见!!!!!!!!!

队长中午好{:4_187:}{:4_179:}

大猫咪 发表于 2022-3-24 12:43

底图径向翻个身{:4_189:}还可以这样啊,怎么翻呢{:5_106:}哈哈 红影好厉害{:4_179:}

大猫咪 发表于 2022-3-24 12:44

红影 发表于 2022-3-24 09:26
或者把文字放在左边,挤在一起不太好。

嗯嗯   还得学习   

加林森 发表于 2022-3-24 13:14

大猫咪 发表于 2022-3-24 12:36
队长中午好

猫猫中午好{:4_190:}{:4_179:}

红影 发表于 2022-3-24 20:40

加林森 发表于 2022-3-24 12:15
红影这个翻转真好看。

我只是觉得转一下,能让文字更有地方展示{:4_173:}

红影 发表于 2022-3-24 20:40

大猫咪 发表于 2022-3-24 12:43
底图径向翻个身还可以这样啊,怎么翻呢哈哈 红影好厉害

我用美图左右翻转,一下就好了啊。我不会PS呢{:4_173:}

加林森 发表于 2022-3-24 20:44

红影 发表于 2022-3-24 20:40
我只是觉得转一下,能让文字更有地方展示

嗯嗯,这样看起来就有整体感了。
页: [1] 2
查看完整版本: 门德尔松:威尼斯船歌 学习帖