网站侧边栏添加随机小姐姐,随机短视频小卡片

下载说明 1 下载须知:本次购买仅为资源价格,不包含其他服务!默认解压密码:www.ruankor.com
2 下翻看看文章中是否有视频教程,若没有就严格按照文字,从上到下依次操作!
3 【游戏资源(手游、端游、页游H5)全部亲测,如果资源彻底进不了会下架处理,下载链接失效的请反馈】
4 如果进不去,不要怀疑资源有问题,大概率是自己搭建的细节问题,多搭建几遍就好了。
5 所有资源所见即所得,无任何【换皮、修改、换版本,充值到你账上】 之类的服务!

分享一个在侧边栏添加一个视频小卡片,可以根据网站的需求自行更换成喜欢的视频进行播放,用户可点击下一个进行视频更换,增加网站互动率,增加用户的粘性,喜欢的自行下载测试文章也汇总了部分视频API接口,可能会有失效,请自行斟酌使用。

使用教程

后台>>外观>>小工具>>自定义HTML>>放置侧边栏

HTML

<div class="video-container">
        <video id="videoPlayer" autoplay="" muted="" playsinline="" src="视频接口">
                <source src="视频接口" type="video/mp4">
                您的浏览器不支持 HTML5 视频标签。
        </video>
        <div class="volume-control">
                <input id="volumeSlider" class="volume-slider" type="range" min="0" max="1" step="0.01" value="0">
        </div>
        <button class="next-button" id="nextButton">下一个</button>
</div>

CSS和JS

<style>
        .video-container {
                width: 100%;
                height: 100%;
                border-radius: 20px;
                overflow: hidden;
                position: relative;
                background-color: #000;
                box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
                font-family: Arial, sans-serif;
        }

        .video-container video {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
        }

        .video-container .next-button {
                position: absolute;
                bottom: 20px;
                right: 20px;
                background: rgba(255, 255, 255, 0.85);
                border: none;
                color: #000;
                font-size: 12px;
                font-weight: bold;
                padding: 6px 12px;
                border-radius: 50px;
                cursor: pointer;
                box-shadow: 0 4px 10px rgba(255, 255, 255, 0.3);
                transition: transform 0.3s, background 0.3s, opacity 0.3s;
                opacity: 0.5;
        }

        .video-container .next-button:hover {
                transform: translateY(-3px);
                background: rgba(255, 255, 255, 1);
                opacity: 1;
        }

        .video-container .volume-control {
                position: absolute;
                bottom: 30px;
                left: 20px;
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 10px;
                opacity: 0.5;
                transition: opacity 0.3s;
        }

        .video-container .volume-control:hover {
                opacity: 1;
        }

        .video-container .volume-slider {
                width: 80px;
                height: 5px;
                background: #ccc;
                border-radius: 5px;
                outline: none;
                appearance: none;
                cursor: pointer;
        }

        .video-container .volume-slider::-webkit-slider-thumb {
                appearance: none;
                width: 12px;
                height: 12px;
                background: #fff;
                border-radius: 50%;
                cursor: pointer;
        }

        .video-container .volume-slider {
                border: none;
        }
</style>

<script>
        const videoPlayer = document.getElementById('videoPlayer');
        const nextButton = document.getElementById('nextButton');
        const volumeSlider = document.getElementById('volumeSlider');
        const videoUrl = "视频接口";

        function loadVideo() {
                videoPlayer.src = videoUrl;
                videoPlayer.play();
        }

        videoPlayer.addEventListener('ended', loadVideo);
        nextButton.addEventListener('click', loadVideo);
        videoPlayer.addEventListener('click', () => {
                videoPlayer.paused ? videoPlayer.play() : videoPlayer.pause();
        });
        videoPlayer.addEventListener('contextmenu', (e) => e.preventDefault());
        volumeSlider.addEventListener('input', () => {
                videoPlayer.volume = volumeSlider.value;
                videoPlayer.muted = videoPlayer.volume === 0;
        });

        loadVideo();
</script>

一大堆视频接口:

隐藏内容,输入密码后查看
本站完整网址是:
图片[1]-网站侧边栏添加随机小姐姐,随机短视频小卡片 - 软壳源码网-软壳源码网
© 版权声明
THE END
喜欢就记住本站,经常来逛逛吧
点赞29 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容