首页
导航
文章导航
壁纸
留言板
更多
直播
友链
统计
关于
Search
1
常用安装脚本知识 [24年10月27日更新]
3 阅读
2
经典老电影10部
3 阅读
3
春天来了清新图片
3 阅读
4
水:生命之源
3 阅读
5
Gmail隐藏技能:一个账号如何变出99个邮箱身分,垃圾注册永远不再困扰你
3 阅读
默认
日常
学习
技术
登录
Search
标签搜索
cloudflare
白嫖
CF
docker
安装
脚本
壁纸
图片
Linux
Caddy
代码
哪吒
节点
域名
邮箱
github
搭建
桌面壁纸
手机壁纸
NAT
ws01
累计撰写
129
篇文章
累计收到
45
条评论
首页
栏目
默认
日常
学习
技术
页面
导航
文章导航
壁纸
留言板
直播
友链
统计
关于
搜索到
7
篇与
的结果
2026-02-10
CF上部署视频播放
CF上部署视频播放特别提醒:1、部署时替换6个链接地址为你的链接地址2、默认登录密码为:admin3、CF上修改登录密码命名:ADMIN_PASSWORD4、链接地址中的文件为:txt格式,txt格式中的MP4播放书写MP4文件直链地址|MP4文件名代码export default { async fetch(request, env, ctx) { // 设置CORS头 const corsHeaders = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'Access-Control-Allow-Headers': 'Content-Type', }; // 处理预检请求 if (request.method === 'OPTIONS') { return new Response(null, { headers: corsHeaders }); } const url = new URL(request.url); // 登录逻辑 if (url.pathname === '/login' && request.method === 'POST') { const formData = await request.formData(); const password = formData.get('password'); const adminPassword = env.ADMIN_PASSWORD || 'admin123'; // 从环境变量读取密码,默认为admin123 if (password === adminPassword) { // 登录成功,设置 Cookie return new Response('', { status: 302, headers: { 'Set-Cookie': `auth=1; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`, 'Location': '/' } }); } else { return new Response(this.renderLoginPage('密码错误,请重试!'), { headers: { 'Content-Type': 'text/html;charset=utf-8', ...corsHeaders } }); } } // 退出逻辑 if (url.pathname === '/logout') { return new Response('', { status: 302, headers: { 'Set-Cookie': `auth=; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=0`, 'Location': '/' } }); } // 检查是否已登录 const cookie = request.headers.get('Cookie') || ''; if (!cookie.includes('auth=1')) { return new Response(this.renderLoginPage(), { headers: { 'Content-Type': 'text/html;charset=utf-8', ...corsHeaders } }); } // 读取七个视频列表文件 let links = []; let links1 = [], links2 = [], links3 = [], links4 = [], links5 = [], links6 = [], links7 = []; let randomLink = ''; const parseList = (text) => text.split('\n').filter(line => line.trim() !== ''); const results = await Promise.allSettled([ fetch('链接地址1').then(r => r.text()).then(parseList), fetch('链接地址2').then(r => r.text()).then(parseList), fetch('链接地址3').then(r => r.text()).then(parseList), fetch('链接地址4').then(r => r.text()).then(parseList), fetch('链接地址5').then(r => r.text()).then(parseList), fetch('链接地址6').then(r => r.text()).then(parseList), fetch('链接地址7t').then(r => r.text()).then(parseList) ]); links1 = results[0].status === 'fulfilled' ? results[0].value : []; links2 = results[1].status === 'fulfilled' ? results[1].value : []; links3 = results[2].status === 'fulfilled' ? results[2].value : []; links4 = results[3].status === 'fulfilled' ? results[3].value : []; links5 = results[4].status === 'fulfilled' ? results[4].value : []; links6 = results[5].status === 'fulfilled' ? results[5].value : []; links7 = results[6].status === 'fulfilled' ? results[6].value : []; links = [...links1, ...links2, ...links3, ...links4, ...links5, ...links6, ...links7]; if (links.length === 0) { links1 = links2 = links3 = links4 = links5 = links6 = links7 = links = ['https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4|测试视频']; } randomLink = links[0].split('|')[0]; // 生成 HTML 内容 const htmlContent = ` <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>自动随机播放 MP4 视频</title> <link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2280%22>💠</text></svg>"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; justify-content: center; align-items: center; background-color: #f0f0f0; font-family: Arial, sans-serif; flex-direction: column; } /* 按钮样式 */ #playPauseBtn, #prevBtn, #nextBtn, #togglePlaylistBtn, #randomBtn, #singleLoopBtn { background-color: black; color: white; border: none; padding: 10px 20px; margin: 5px; cursor: pointer; border-radius: 5px; transition: background-color 0.3s ease; } /* 按钮悬停效果 */ #playPauseBtn:hover, #prevBtn:hover, #nextBtn:hover, #togglePlaylistBtn:hover, #randomBtn:hover, #singleLoopBtn:hover { background-color: #333; } /* 播放模式按钮激活状态 */ #randomBtn.active, #singleLoopBtn.active { background-color: #0F52BA; } #randomBtn.active:hover, #singleLoopBtn.active:hover { background-color: #00318C; } .sites { width: 640px; background: #F2F2F2; border: 1px solid rgba(0,0,0,.01); margin: 6px auto; padding: 10px; height: 320px; display: flex; flex-direction: column; box-sizing: border-box; } .list-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; flex-shrink: 0; } .list-tab { background-color: #ddd; color: #333; border: 1px solid #ccc; padding: 8px 14px; cursor: pointer; border-radius: 6px; font-size: 14px; transition: all 0.2s ease; } .list-tab:hover { background-color: #ccc; } .list-tab.active { background-color: #0F52BA; color: #fff; border-color: #0F52BA; } .list-panel { display: none; flex: 1; min-height: 0; overflow: hidden; flex-direction: column; } .list-panel.active { display: flex; } /* 居中对齐容器 */ .video-container { display: flex; justify-content: center; align-items: center; margin: -0cm 0 0 0; } /* 标题下移 */ h2 { text-align: center; margin-bottom: 1cm; } /* 播放列表:限制高度,超出部分可上下滚动选择,132px显示5个视频列表,156px显示6个视频列表 */ .playlist { list-style-type: none; padding: 0; margin: 0; flex: 1; min-height: 0; max-height: 156px; overflow-y: auto; overflow-x: hidden; text-align: left; border: 1px solid #ccc; background-color: #fff; border-radius: 4px; } .playlist li { margin: 5px 0; cursor: pointer; color: #000000; font-size: 15px; text-decoration: underline; transition: color 0.3s ease; } .playlist li:hover { color: green; } /* 定义正在播放的样式 */ .playlist li.playing { color: red !important; font-weight: bold; } </style> </head> <body> <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1cm;"> <h2 style="margin: 0;">自动随机播放 MP4 视频</h2> <a href="/logout" style="color: #666; text-decoration: none; padding: 8px 12px; border-radius: 6px; transition: all 0.2s; background-color: rgba(0,0,0,0.1);" onmouseover="this.style.backgroundColor='rgba(0,0,0,0.2)'; this.style.color='#333'" onmouseout="this.style.backgroundColor='rgba(0,0,0,0.1)'; this.style.color='#666'" title="退出登录"> <i class="fas fa-sign-out-alt"></i> 退出 </a> </div> <div class="video-container"> <video id="videoPlayer" width="640" height="360" controls> <source src="${randomLink}" type="video/mp4"> 您的浏览器不支持视频播放。 </video> </div> <!-- 新增按钮区域 --> <div style="text-align: center; margin: 4px 0;"> <button id="togglePlaylistBtn">播放列表</button> <button id="playPauseBtn">▶</button> <button id="prevBtn">❚◀</button> <button id="nextBtn">▶❚</button> <button id="randomBtn" title="随机播放">🔀</button> <button id="singleLoopBtn" title="单曲循环">🔁</button> </div> <div class="sites" id="playlistContainer" style="display: none;"> <div class="list-tabs"> <button type="button" class="list-tab" data-list-id="1">列表1</button> <button type="button" class="list-tab" data-list-id="2">列表2</button> <button type="button" class="list-tab" data-list-id="3">列表3</button> <button type="button" class="list-tab" data-list-id="4">列表4</button> <button type="button" class="list-tab" data-list-id="5">列表5</button> <button type="button" class="list-tab" data-list-id="6">列表6</button> <button type="button" class="list-tab" data-list-id="7">列表7</button> <button type="button" class="list-tab active" data-list-id="all">综合列表</button> </div> <div class="list-panel active" id="panel-all"> <ul class="playlist" id="playlist-all" data-list-id="all"> ${links.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="all" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-1"> <ul class="playlist" id="playlist-1" data-list-id="1"> ${links1.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="1" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-2"> <ul class="playlist" id="playlist-2" data-list-id="2"> ${links2.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="2" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-3"> <ul class="playlist" id="playlist-3" data-list-id="3"> ${links3.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="3" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-4"> <ul class="playlist" id="playlist-4" data-list-id="4"> ${links4.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="4" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-5"> <ul class="playlist" id="playlist-5" data-list-id="5"> ${links5.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="5" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-6"> <ul class="playlist" id="playlist-6" data-list-id="6"> ${links6.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="6" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> <div class="list-panel" id="panel-7"> <ul class="playlist" id="playlist-7" data-list-id="7"> ${links7.map((link, index) => { const [url, title] = link.split('|'); return `<li data-src="${url}" data-list-id="7" data-index="${index}">${index + 1}. ${title}</li>`; }).join('')} </ul> </div> </div> <script> const videoLinks = ${JSON.stringify(links)}; const videoLinks1 = ${JSON.stringify(links1)}; const videoLinks2 = ${JSON.stringify(links2)}; const videoLinks3 = ${JSON.stringify(links3)}; const videoLinks4 = ${JSON.stringify(links4)}; const videoLinks5 = ${JSON.stringify(links5)}; const videoLinks6 = ${JSON.stringify(links6)}; const videoLinks7 = ${JSON.stringify(links7)}; const listIdToLinks = { 'all': videoLinks, '1': videoLinks1, '2': videoLinks2, '3': videoLinks3, '4': videoLinks4, '5': videoLinks5, '6': videoLinks6, '7': videoLinks7 }; const videoPlayer = document.getElementById('videoPlayer'); const playPauseBtn = document.getElementById('playPauseBtn'); const prevBtn = document.getElementById('prevBtn'); const nextBtn = document.getElementById('nextBtn'); let currentPlaylistId = 'all'; let currentVideoIndex = 0; let playMode = 'order'; let playedIndexes = []; function getCurrentLinks() { return listIdToLinks[currentPlaylistId] || videoLinks; } document.addEventListener('DOMContentLoaded', () => { playVideo(currentVideoIndex); updatePlaylistStyle(currentPlaylistId, currentVideoIndex); updateModeButtons(); }); function updateModeButtons() { document.getElementById('randomBtn').classList.toggle('active', playMode === 'random'); document.getElementById('singleLoopBtn').classList.toggle('active', playMode === 'single'); } function updatePlaylistStyle(listId, index) { document.querySelectorAll('.playlist li').forEach(li => { li.classList.remove('playing'); if (li.getAttribute('data-list-id') === listId && parseInt(li.getAttribute('data-index'), 10) === index) { li.classList.add('playing'); } }); } function playVideo(index) { const list = getCurrentLinks(); if (!list.length) return; index = (index + list.length) % list.length; currentVideoIndex = index; const [url] = list[index].split('|'); videoPlayer.src = url; videoPlayer.play(); updatePlaylistStyle(currentPlaylistId, currentVideoIndex); } playPauseBtn.addEventListener('click', () => { if (videoPlayer.paused) { videoPlayer.play(); playPauseBtn.textContent = '⏸'; } else { videoPlayer.pause(); playPauseBtn.textContent = '▶'; } }); prevBtn.addEventListener('click', () => { const list = getCurrentLinks(); currentVideoIndex = (currentVideoIndex - 1 + list.length) % list.length; playVideo(currentVideoIndex); }); nextBtn.addEventListener('click', () => { const list = getCurrentLinks(); currentVideoIndex = (currentVideoIndex + 1) % list.length; playVideo(currentVideoIndex); }); videoPlayer.addEventListener('ended', () => { if (playMode === 'single') { videoPlayer.currentTime = 0; videoPlayer.play(); return; } const list = getCurrentLinks(); if (playMode === 'random') { const unplayed = list.map((_, i) => i).filter(i => !playedIndexes.includes(i)); if (unplayed.length === 0) { playedIndexes = []; currentVideoIndex = Math.floor(Math.random() * list.length); } else { currentVideoIndex = unplayed[Math.floor(Math.random() * unplayed.length)]; } playedIndexes.push(currentVideoIndex); } else { currentVideoIndex = (currentVideoIndex + 1) % list.length; } playVideo(currentVideoIndex); }); document.getElementById('randomBtn').addEventListener('click', () => { playMode = playMode === 'random' ? 'order' : 'random'; playedIndexes = []; updateModeButtons(); }); document.getElementById('singleLoopBtn').addEventListener('click', () => { playMode = playMode === 'single' ? 'order' : 'single'; updateModeButtons(); }); const togglePlaylistBtn = document.getElementById('togglePlaylistBtn'); const playlistContainer = document.getElementById('playlistContainer'); togglePlaylistBtn.addEventListener('click', () => { if (playlistContainer.style.display === 'none') { playlistContainer.style.display = 'block'; togglePlaylistBtn.textContent = '隐藏列表'; } else { playlistContainer.style.display = 'none'; togglePlaylistBtn.textContent = '播放列表'; } }); document.querySelectorAll('.list-tab').forEach(tab => { tab.addEventListener('click', () => { const listId = tab.getAttribute('data-list-id'); document.querySelectorAll('.list-tab').forEach(t => t.classList.remove('active')); document.querySelectorAll('.list-panel').forEach(p => p.classList.remove('active')); tab.classList.add('active'); const panel = document.getElementById('panel-' + listId); if (panel) panel.classList.add('active'); }); }); playlistContainer.addEventListener('click', function(event) { if (event.target.tagName === 'LI') { const listId = event.target.getAttribute('data-list-id'); const index = parseInt(event.target.getAttribute('data-index'), 10); const selectedUrl = event.target.getAttribute('data-src'); currentPlaylistId = listId; currentVideoIndex = index; playedIndexes = []; videoPlayer.src = selectedUrl; videoPlayer.play(); updatePlaylistStyle(currentPlaylistId, currentVideoIndex); } }); </script> </body> </html> `; return new Response(htmlContent, { headers: { 'Content-Type': 'text/html', ...corsHeaders, }, }) }, // 登录页面渲染函数 renderLoginPage(msg = '') { return `<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>视频播放器 - 登录</title> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"> <link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2280%22>💠</text></svg>"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Noto Sans SC', 'Segoe UI', Arial, sans-serif; background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); background-size: 400% 400%; animation: gradient-animation 15s ease infinite; height: 100vh; display: flex; justify-content: center; align-items: center; overflow: hidden; } @keyframes gradient-animation { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } .login-container { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); border-radius: 20px; padding: 40px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); width: 100%; max-width: 400px; text-align: center; animation: fadeInUp 0.6s ease-out; } @keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } .logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; color: #333; } .logo i { font-size: 32px; color: #0F52BA; } .logo span { font-size: 24px; font-weight: bold; } .login-title { font-size: 22px; color: #333; margin-bottom: 10px; font-weight: 600; } .login-subtitle { color: #666; margin-bottom: 30px; font-size: 14px; } .error-message { background: rgba(211, 47, 47, 0.1); color: #d32f2f; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; border: 1px solid rgba(211, 47, 47, 0.2); } .form-group { margin-bottom: 20px; text-align: left; } .form-group label { display: block; color: #333; margin-bottom: 8px; font-weight: 500; font-size: 14px; } .password-wrapper { position: relative; width: 100%; } .password-wrapper input { width: 100%; padding: 15px 50px 15px 15px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 16px; outline: none; transition: all 0.3s ease; background: rgba(255, 255, 255, 0.9); } .password-wrapper input:focus { border-color: #0F52BA; box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.1); background: #fff; } .password-wrapper input::placeholder { color: #999; } .toggle-password { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #666; cursor: pointer; font-size: 18px; transition: color 0.3s ease; padding: 5px; } .toggle-password:hover { color: #0F52BA; } .login-btn { width: 100%; padding: 15px; background: linear-gradient(135deg, #0F52BA, #00318C); border: none; border-radius: 12px; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; margin-top: 10px; } .login-btn:hover { background: linear-gradient(135deg, #00318C, #001F5C); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(15, 82, 186, 0.3); } .login-btn:active { transform: translateY(0); } .login-footer { margin-top: 20px; color: #666; font-size: 12px; } .login-footer a { color: #0F52BA; text-decoration: none; } .login-footer a:hover { text-decoration: underline; } /* 响应式设计 */ @media (max-width: 480px) { .login-container { margin: 20px; padding: 30px 20px; } } </style> </head> <body> <div class="login-container"> <div class="logo"> <i class="fas fa-video"></i> <span>视频播放器</span> </div> <h1 class="login-title">🔒 请输入密码</h1> <p class="login-subtitle">访问视频播放器需要身份验证</p> ${msg ? `<div class="error-message">${msg}</div>` : ''} <form method="POST" action="/login"> <div class="form-group"> <label for="password">管理员密码</label> <div class="password-wrapper"> <input type="password" id="password" name="password" placeholder="输入登录密码" required> <button type="button" class="toggle-password" onclick="togglePassword()"> <i class="fas fa-eye"></i> </button> </div> </div> <button type="submit" class="login-btn"> <i class="fas fa-sign-in-alt"></i> 登录 </button> </form> <div class="login-footer"> <p>© 2025 视频播放器</p> </div> </div> <script> function togglePassword() { const input = document.getElementById('password'); const icon = document.querySelector('.toggle-password i'); if (input.type === 'password') { input.type = 'text'; icon.className = 'fas fa-eye-slash'; } else { input.type = 'password'; icon.className = 'fas fa-eye'; } } // 回车键登录 document.getElementById('password').addEventListener('keypress', function(e) { if (e.key === 'Enter') { document.querySelector('form').submit(); } }); // 自动聚焦到密码输入框 window.addEventListener('load', function() { document.getElementById('password').focus(); }); </script> </body> </html>`; }, };
2026年02月10日
2 阅读
0 评论
0 点赞
2025-04-04
一段代码简单在谷歌colab内搭建vpn,完全免费科学上网工具,全网高速免费机场节点抓取
本文转载自科技共享 一段代码简单在谷歌colab内搭建vpn,完全免费科学上网工具,全网高速免费机场节点抓取支持v2ray/clash/singox能够自动爬取全网分享的订阅地址及代理节点,也能够自动注册/续期、订阅转换、节点存活检查等作者项目地址 【点击直达】 谷歌账号注册教程 【点击直达】 1、谷歌colab 【点击直达】 2、在新建的笔记本中,运行以下命令以克隆项目仓库:!git clone https://github.com/wzdnzd/aggregator.git3、安装依赖项:进入克隆的项目目录:%cd aggregator安装项目所需的 Python 依赖项:!pip install -r requirements.txt4、运行项目:在 Colab 中,使用以下命令运行 process.py 脚本:!python -u subscribe/collect.py -s5、查看节点文件【以clash.yaml为例,可改为v2或其它,下载时也类似修改】:clash.yaml!cat /content/aggregator/data/clash.yamlv2节点!cat /content/aggregator/data/v2ray.txt其它!cat /content/aggregator/data/singbox.json6、下载节点文件from google.colab import files files.download('/content/aggregator/data/clash.yaml')
2025年04月04日
2 阅读
0 评论
0 点赞
2024-12-18
网页制作常用代码 不断增加 [2025年7月8更新]
网页制作常用代码:一、直接使用节日代码:<!-- 网页特效 - 樱花 --> <script src="https://ngohome.eu.org/config/9527qita/yinghua.txt"></script> <!-- 网页特效 - 春节快乐【可以】 --> <script src="https://ngohome.eu.org/config/9527qita/chunjie-denglong.txt"> </script> <!-- 网页特效 - 新年快乐 --> <script src="https://ngohome.eu.org/config/9527qita/xingnian-denglong.txt"> </script> <!-- 网页特效 - 五一快乐 --> <script src="https://ngohome.eu.org/config/9527qita/wuyi-denglong.txt"> </script> <!-- 网页特效 - 元旦快乐 --> <script src="https://ngohome.eu.org/config/9527qita/yuandan-denglong.txt"> </script> <!-- 网页特效 - 国庆快乐 --> <script src="https://ngohome.eu.org/config/9527qita/guoqing-denglong.txt"> </script> <!-- 网页特效 - 中秋快乐 --> <script src="https://ngohome.eu.org/config/9527qita/zhongqiu-denglong.txt"> </script>二、本页总访问量1、自建busuanzi<br /> <p> 本页总访问量 <span id="busuanzi_site_pv"></span> 次</p> <script defer src="https://bsz.211119.xyz/js"></script>2、其它busuanzi<br /> <p> 本页总访问量 <span id="busuanzi_value_site_pv"></span> 次</p> <script defer src="https://four-root-occupation.glitch.me/bsz.js"></script>三、网站时间、本页总访问量及其它相关,可灵活修改式样1,访问量、运行时间和版本<span id="timeDate">载入天数...</span> <script language="javascript"> var now = new Date(); function createtime(){ var grt= new Date("01/05/2025 00:00:00");/*---这里是网站的启用时间:月/日/年--*/ now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); document.getElementById("timeDate").innerHTML = "稳定运行"+dnum+"天"; } setInterval("createtime()",250); </script> <span <p> | 本页总访问量 <span id="busuanzi_site_pv"></span> 次 | @ws01 v1.0.0 2025</p></span> <script defer src="https://bsz.211119.xyz/js"></script>式样2,访问量、运行时间、开源和信息<span id="timeDate">载入天数...</span> <script language="javascript"> var now = new Date(); function createtime(){ var grt= new Date("05/09/2024 00:00:00");/*---这里是网站的启用时间:月/日/年--*/ now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); document.getElementById("timeDate").innerHTML = "稳定运行"+dnum+"天"; } setInterval("createtime()",250); </script> <span <p> | 本页总访问量 <span id="busuanzi_site_pv"></span> 次 | 开源于 GitHub <a href="https://github.com/wszx123/My-Nav" target="_blank">@wszx123</a></p></span> <script defer src="https://bsz.211119.xyz/js"></script>式样3,访问量、运行时间、博客和导航链接<span id="timeDate">载入天数...</span> <script language="javascript"> var now = new Date(); function createtime(){ var grt= new Date("05/09/2024 00:00:00");/*---这里是网站的启用时间:月/日/年--*/ now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); document.getElementById("timeDate").innerHTML = "稳定运行"+dnum+"天"; } setInterval("createtime()",250); </script> <span <p> | 本页总访问量 <span id="busuanzi_site_pv"></span> 次 | <a href="https://boke.199881.xyz/" target="_blank"> <span style="color: blue;">博客 | <a href="https://www.199881.xyz/" target="_blank"> <span style="color: green;">导航 </p></span> <script defer src="https://bsz.211119.xyz/js"></script> 四、其它常用代码transform: translateY(12px); /* 子元素往下移动12px */ transform: translateY(-12px); /* 子元素往上移动12px */ justify-content: space-between; /* 子元素分散排列 */ justify-content: flex-start; /* 子元素从左侧开始排列 */ gap: 20px; /* 子元素之间的空隙 */ background: url('https://121.freewebhostmost.com/') no-repeat center center fixed; /* 背景图片 */ background-color: #f4f4f4; /* 背景色 */ min-height: 60px; /* 最小高度设置为60px */ max-height: 120px; /* 最大高度设置为120px */ font-size: 18px; /* 字号大小*/ border-radius: 5px; /* 四角弧度,一般高为5,50为圆*/ border: 2px solid gray; /* 添加2px灰色边框 */ border: 1px #aaa; /* 添加 1px 和 #aaa 色边框 */ --border-color: #aaa; /* 边框,原#436EEED */ border-bottom: 2px dashed #6495ED; /* 添加灰色虚线#ccc */ overflow-y: auto; /* 当内容超过最大高度时显示滚动条 */ margin-left: 20px; /* 分类标签右移添加这一行 */ color: green; /* 分类标签字体颜色添加这一行 */ text-align: left; /* 添加左对齐 */ /* 设置文件名的最大宽度,并且超出部分省略显示 */ .file-name { max-width: 200px; /* 设置最大宽度,您可以调整为合适的值 */ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; /* 确保文件名在一行内显示 */ } /* 设置图片背景的毛玻璃效果,值越大越模糊 */ backdrop-filter: blur(2px); margin-top: -20px; /* 验证码图片向上移动20px */footer代码.footer {position: fixed;bottom: 1cm;left: 50%;transform: translateX(-50%);background-color: rgba(230, 230, 250, 0.4);color: #000000;min-width: 400px;max-width: 1120px;height: 55px;text-align: center;margin: 2px auto;padding: 1px;border-radius: 10px;font-size:15px;}五、php代码中单位转换,其中($bytes, 1) 是保留小数点后一位,改2是二位<?php // 格式化文件大小函数 function formatSize($bytes) { $units = ['字节', 'KB', 'MB', 'GB', 'TB']; $unitIndex = 0; while ($bytes >= 1024 && $unitIndex < count($units) - 1) { $bytes /= 1024; $unitIndex++; } return number_format($bytes, 1) . ' ' . $units[$unitIndex]; } ?>六、适配手机时添加1、网页代码在手机上不适配时,在添加以下代码<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- 添加viewport meta标签,确保页面在移动设备上正确缩放 -->2、大括号中添加相应代码@media (max-width: 768px) { } @media (max-width: 480px) { }七、在html页面添加输入密码才能打开1、密码24小时有效【 使用时请修改 admin 为自己的密码 】 <script> // 页面加载时弹出密码验证 (function() { // 检查是否已存储有效密码 const storedAuth = localStorage.getItem('imagePageAuth'); if (storedAuth) { const authData = JSON.parse(storedAuth); const now = new Date().getTime(); // 检查密码是否在24小时内(24*60*60*1000 = 86400000毫秒) if (now - authData.timestamp < 86400000) { // 密码仍在有效期内,允许访问 return; } else { // 密码已过期,清除存储 localStorage.removeItem('imagePageAuth'); } } // 如果没有有效密码,则要求输入 var password = prompt("请输入密码访问本页面:"); if (password !== "admin") { alert("密码错误!禁止访问。"); window.location.href = "about:blank"; // 密码错误跳转至空白页 } else { // 密码正确,存储当前时间和密码信息(24小时内有效) const authData = { password: password, timestamp: new Date().getTime() }; localStorage.setItem('imagePageAuth', JSON.stringify(authData)); } })(); </script>2、密码当次有效,下一次打开也需要输入【 使用时请修改 admin 为自己的密码 】 <script> // 页面加载时弹出密码验证 (function() { var password = prompt("请输入密码访问本页面:"); if (password !== "admin") { alert("密码错误!禁止访问。"); window.location.href = "about:blank"; // 密码错误跳转至空白页 } })(); </script> 七、icon代码方法1,用图片 <link rel="icon" href="https://img.keplu.eu.org/file/img1/1749897585818_logo04.png" type="image/ico">方法2,用字符 <link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2280%22>🌐</text></svg>">
2024年12月18日
1 阅读
4 评论
0 点赞
2024-11-16
html网页实用代码
一、开站时间开始 <!-- 开站时间开始1,有天、时、分、秒 --> <span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span> <script language="javascript"> var now = new Date(); function createtime(){ var grt= new Date("07/01/2023 00:00:00");/*---这里是网站的启用时间--*/ now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "稳定运行"+dnum+"天"; document.getElementById("times").innerHTML = hnum + "小时" + mnum + "分" + snum + "秒"; } setInterval("createtime()",250); <!-- 开站时间结束 --> <!-- 开站时间开始2,只显示天 --> <span <p> 本页总访问量 <span id="busuanzi_value_site_pv"></span> 次 | @ws01 v1.0.0 2025</p></span> <script defer src="https://four-root-occupation.glitch.me/bsz.js"></script> <span id="timeDate">载入天数...</span> <script language="javascript"> var now = new Date(); function createtime(){ var grt= new Date("09/05/2024 00:00:00");/*---这里是网站的启用时间--*/ now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); document.getElementById("timeDate").innerHTML = "稳定运行"+dnum+"天"; } setInterval("createtime()",250); </script> 二、本页总访问量代码 <p> 本页总访问量 <span id="busuanzi_value_site_pv"></span> 次</p> <script defer src="https://four-root-occupation.glitch.me/bsz.js"></script>三、几个节日灯笼代码1、春节快乐灯笼代码<script defer src="https://four-root-occupation.glitch.me/chunjie-denglong.js"></script>2、国庆快乐灯笼代码<script defer src="https://four-root-occupation.glitch.me/guoqing-denglong.js"></script>3、五一快乐灯笼代码<script defer src="https://four-root-occupation.glitch.me/wuyi-denglong.js"></script>4、中秋快乐灯笼代码<script defer src="https://four-root-occupation.glitch.me/zhongqiu-denglong.js"></script>5、元旦快乐灯笼代码<script defer src="https://four-root-occupation.glitch.me/yuandan-denglong.js"></script>四、html代码变cloudflare workers 代码html代码最前面加上addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }) async function handleRequest(request) { const html = `最后加上`; return new Response(html, { headers: { 'content-type': 'text/html;charset=UTF-8' }, }); }五、页脚信息全在一行上1、添加footer代码,可进行适当调整 .footer { width: 100%; max-width: 800px; margin: 0 auto; padding: 5px 0; background-color: #f0f0f0; color: #666; font-size: 14px; text-align: center; box-sizing: border-box; }2、网页中添加页脚 <div class="footer"> <span id="timeDate">载入天数...</span> <script language="javascript"> var now = new Date(); function createtime(){ var grt= new Date("01/05/2025 00:00:00");/*---这里是网站的启用时间,分别显示月-日-年 --*/ now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); document.getElementById("timeDate").innerHTML = "稳定运行"+dnum+"天"; } setInterval("createtime()",250); </script> <span <p> | 本页总访问量 <span id="busuanzi_value_site_pv"></span> 次 | @ws01 v1.0.0 2025</p></span> <script defer src="https://four-root-occupation.glitch.me/bsz.js"></script>
2024年11月16日
1 阅读
1 评论
0 点赞
2024-09-01
Docker Compose 安装cloudreve
Docker Compose 安装cloudrevegithub项目 一、提前安装好docker和docker-composecurl -fsSL https://get.docker.com | sh && ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin二、docker compose 部署1、依次创建好 /home/html/cloudreve 文件夹(并进入安装文件夹)cd /home/ && mkdir html && cd html && mkdir cloudreve && cd cloudreve2、创建目录结构mkdir -vp cloudreve/{uploads,avatar} \ && touch cloudreve/conf.ini \ && touch cloudreve/cloudreve.db \ && mkdir -p aria2/config \ && mkdir -p data/aria2 \ && chmod -R 777 data/aria23、然后将以下文件保存为 docker-compose.yml,放置于当前目录,与 cloudreve 同一层级,同时,修改文件中的 RPC_SECRETversion: "3.8" services: cloudreve: container_name: cloudreve image: cloudreve/cloudreve:latest restart: unless-stopped ports: - "5212:5212" volumes: - temp_data:/data - ./cloudreve/uploads:/cloudreve/uploads - ./cloudreve/conf.ini:/cloudreve/conf.ini - ./cloudreve/cloudreve.db:/cloudreve/cloudreve.db - ./cloudreve/avatar:/cloudreve/avatar depends_on: - aria2 aria2: container_name: aria2 image: p3terx/aria2-pro restart: unless-stopped environment: - RPC_SECRET=your_aria_rpc_token - RPC_PORT=6800 volumes: - ./aria2/config:/config - temp_data:/data volumes: temp_data: driver: local driver_opts: type: none device: $PWD/data o: bind4、运行镜像# 1.直接运行,log 将会直接输出在当前控制台中,请注意退出之后保持当前容器运行 docker-compose up # 或者,2.后台运行模式,可以从 docker/docker-compose 的日志中获取默认管理员账户用户名和密码,选择2则只能运行5步骤查找帐号和密码 docker-compose up -d5、docker-compose logs 查看实时日志中的 帐号和密码 帐号一般是:admin@cloudreve.org,主要查看密码。docker-compose logs6、Cloudreve 默认会监听5212端口。你可以在浏览器中访问:http://服务器IP:5212 进入 Cloudreve。{dotted startColor="#ff6c6c" endColor="#1989fa"/}在之后的控制面板中,按照如下配置[不可修改] RPC 服务器地址 => http://aria2:6800[可修改, 需保持和 docker-compose.yml 文件一致] RPC 授权令牌 => your_aria_rpc_token[不可修改] Aria2 用作临时下载目录的 节点上的绝对路径 => /data7、更新关闭当前运行的容器,此步骤不会删除挂载的配置文件以及相关目录docker-compose down如果此前已经拉取 docker 镜像,使用以下命令获取最新镜像docker pull cloudreve/cloudreve重复运行步骤即可
2024年09月01日
1 阅读
0 评论
0 点赞
1
2