查看: 102|回复: 51

[特效] 【漫步特效】秋窗风雨夕《两个视频+扣人物叠加》

[复制链接]
发表于 2025-10-30 18:29 | 显示全部楼层 |阅读模式
本帖最后由 云端漫步 于 2025-10-30 18:46 编辑

鱼 鱼 鱼 鱼 鱼 鱼 鱼 鱼 人物

评分

13

查看全部评分

点评
回复

使用道具

 楼主| 发表于 2025-10-30 18:30 | 显示全部楼层
@一鹿向北 人素十多年前真爱下载保存着。

评分

1

查看全部评分

点评
回复

使用道具

 楼主| 发表于 2025-10-30 18:34 | 显示全部楼层
回复

使用道具

发表于 2025-10-30 19:36 | 显示全部楼层
没点我名字,我倒是很想进来看看,看到一个鲤鱼精
点评
回复

使用道具

 楼主| 发表于 2025-10-30 19:40 | 显示全部楼层
素心 发表于 2025-10-30 19:36
没点我名字,我倒是很想进来看看,看到一个鲤鱼精

素心同学晚上好,下次艾特你要来哈,我家沙发舒服吗
点评
回复

使用道具

发表于 2025-10-30 19:41 | 显示全部楼层
这个,仔细看看,也学习下,很精致的制作,所有的素都精挑细选
点评
回复

使用道具

 楼主| 发表于 2025-10-30 19:47 | 显示全部楼层
本帖最后由 云端漫步 于 2025-10-31 12:20 编辑
素心 发表于 2025-10-30 19:41
这个,仔细看看,也学习下,很精致的制作,所有的素都精挑细选


这代码是明码,代码我写清楚了,发表时去除中文行/* 可根据需要调整透明度 */。你可照着做。

  1. <style>
  2. #mydiv {
  3.     margin: 130px 0 30px calc(50% - 800px);
  4.     display: grid;
  5.     place-items: center;
  6.     width: 1800px;
  7.     height: 900px;
  8.     background: lightblue url('https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/hhb.jpg') no-repeat center/cover;
  9.     box-shadow: 3px 3px 20px #000;
  10.     user-select: none;
  11.     overflow: hidden;
  12.     position: relative;
  13.     z-index: 1;  
  14. }
  15. #vid {
  16.     position: absolute;
  17.     width: 100%;
  18.     height: 100%;
  19.     object-fit: cover;
  20.     pointer-events: none;
  21.     mix-blend-mode: screen;
  22.       mask: linear-gradient(to top right, red 88%, transparent 0);   
  23.     -webkit-mask: linear-gradient(to top right, red 88%, transparent 0);   
  24.     z-index: 2;
  25.     opacity: .75;
  26. }
  27. #vid2 {
  28.     position: absolute;
  29.     width: 130%;
  30.     height: 130%;
  31.     object-fit: cover;
  32.     pointer-events: none;
  33.     mix-blend-mode: screen; /* 滤色模式 */
  34.     z-index: 3;
  35.     opacity: 0.8; /* 可根据需要调整透明度 */
  36. }
  37. /* 鱼图片样式 */
  38. #fish {
  39.     position: absolute;
  40.     right: 150px; /* 右侧距离 */
  41.     bottom: 150px; /* 底部距离 */
  42.     width: 180px; /* 宽度 */
  43.     height: 120px; /* 高度 */
  44.     z-index: 4; /* 确保显示在其他元素上方 */
  45. }
  46. /* 新增中间的两条鱼样式 */
  47. #fish2 {
  48.     position: absolute;
  49.     left: 60%; /* 左侧距离,偏中间位置 */
  50.     top: 65%; /* 顶部距离,偏中间位置 */
  51.     width: 200px;
  52.     height: 140px;
  53.     z-index: 4;
  54.     transform: scaleX(-1); /* 水平翻转,让鱼朝左游 */
  55. }
  56. #fish3 {
  57.     position: absolute;
  58.     right: 35%; /* 右侧距离,偏中间位置 */
  59.     bottom: 40%; /* 底部距离,偏中间位置 */
  60.     width: 160px;
  61.     height: 110px;
  62.     z-index: 4;
  63. }
  64. /* 鱼群样式 */
  65. .fish-school {
  66.     position: absolute;
  67.     z-index: 4;
  68. }
  69. /* 人物图片样式 */
  70. #character {
  71.     position: absolute;
  72.     width: 100%; /* 与底图相同宽度 */
  73.     height: 100%; /* 与底图相同高度 */
  74.     object-fit: cover; /* 保持比例填充容器 */
  75.     z-index: 5; /* 确保显示在其他元素上方 */
  76. }
  77. </style>
  78.   
  79. <div id="mydiv">
  80.     <audio id="aud" src="https://mp3.joy127.com/music/12604.mp3" autoplay loop></audio>
  81.     <video id="vid" src="https://img.tukuppt.com/video_show/15653652/00/80/83/60d04564c32f7.mp4" autoplay="" loop="" muted=""></video>
  82.     <video id="vid2" src="https://img.tukuppt.com/video_show/7165162/00/17/65/5ecb8aff3ce01.mp4" autoplay="" loop="" muted=""></video>
  83.     <!-- 鱼图片元素 -->
  84.     <img id="fish" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  85.     <img id="fish2" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  86.     <img id="fish3" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  87.     <!-- 鱼群元素 -->
  88.     <img class="fish-school" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  89.     <img class="fish-school" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  90.     <img class="fish-school" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  91.     <img class="fish-school" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  92.     <img class="fish-school" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/ee.gif" alt="鱼">
  93.     <!-- 新增人物图片元素 -->
  94.     <img id="character" src="https://webftp-bbs.hnol.net/ggkj2017/yunduanmanbu/16/6/5/hhg.png" alt="人物">
  95. </div>

  96. <script>
  97. // 初始化鱼群动画
  98. document.addEventListener('DOMContentLoaded', function() {
  99.     const fishSchool = document.querySelectorAll('.fish-school');
  100.     const container = document.getElementById('mydiv');
  101.     const containerWidth = container.offsetWidth;
  102.     const containerHeight = container.offsetHeight;
  103.    
  104.     // 为每条鱼设置初始位置和动画
  105.     fishSchool.forEach((fish, index) => {
  106.         // 随机大小 (50-120px)
  107.         const size = 50 + Math.random() * 70;
  108.         fish.style.width = `${size}px`;
  109.         fish.style.height = `${size * 0.67}px`; // 保持原比例
  110.         
  111.         // 从右下角偏中位置出发
  112.         const startX = containerWidth - 300 + Math.random() * 200;
  113.         const startY = containerHeight - 300 + Math.random() * 150;
  114.         fish.style.left = `${startX}px`;
  115.         fish.style.top = `${startY}px`;
  116.         
  117.         // 随机水平翻转(部分鱼朝左游,部分朝右游)
  118.         if (Math.random() > 0.7) {
  119.             fish.style.transform = 'scaleX(-1)';
  120.         }
  121.         
  122.         // 动画函数 - 向中间游动
  123.         function animateFish() {
  124.             // 随机目标位置(中间区域)
  125.             const targetX = containerWidth * 0.3 + Math.random() * containerWidth * 0.4;
  126.             const targetY = containerHeight * 0.3 + Math.random() * containerHeight * 0.4;
  127.             const duration = 15000 + Math.random() * 20000; // 15-35秒
  128.             const startTime = performance.now();
  129.             
  130.             function move(currentTime) {
  131.                 const elapsed = currentTime - startTime;
  132.                 const progress = Math.min(elapsed / duration, 1);
  133.                
  134.                 // 缓动函数 - 使运动更自然
  135.                 const easeProgress = 1 - Math.pow(1 - progress, 3);
  136.                
  137.                 // 计算当前位置
  138.                 const currentX = startX + (targetX - startX) * easeProgress;
  139.                 const currentY = startY + (targetY - startY) * easeProgress;
  140.                
  141.                 fish.style.left = `${currentX}px`;
  142.                 fish.style.top = `${currentY}px`;
  143.                
  144.                 // 到达目标后重新设置动画
  145.                 if (progress < 1) {
  146.                     requestAnimationFrame(move);
  147.                 } else {
  148.                     // 短暂停留后重新开始
  149.                     setTimeout(animateFish, 2000 + Math.random() * 3000);
  150.                 }
  151.             }
  152.             
  153.             requestAnimationFrame(move);
  154.         }
  155.         
  156.         // 错开动画开始时间,使鱼群运动更自然
  157.         setTimeout(animateFish, index * 1000);
  158.     });
  159. });
  160. </script>
复制代码

评分

4

查看全部评分

点评
回复

使用道具

发表于 2025-10-30 20:06 | 显示全部楼层
云端漫步 发表于 2025-10-30 19:40
素心同学晚上好,下次艾特你要来哈,我家沙发舒服吗

我也没坐上沙发呀。我自带蒲团呀
点评
回复

使用道具

发表于 2025-10-30 20:08 | 显示全部楼层
云端漫步 发表于 2025-10-30 19:47
这代码是明码,代码我写清楚了,发表时去除中文行/* 可根据需要调整透明度 */。你可照着做。

...

漫步同学还真是大好人一枚,还明码,我都想呼叫一下地瓜  谁来对一下密码呢
那我简单的学习一下哈
点评
回复

使用道具

发表于 2025-10-30 21:02 | 显示全部楼层
不懂音画的来啦,欢迎不,哈哈哈
点评
回复

使用道具

您需要登录后才可以回帖 登录 | 中文注册

本版积分规则

手机版|千山论坛 ( 冀ICP备2024055714号 )

GMT+8, 2025-12-17 14:11

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表