blog logs

博客更新记录及相关信息

logs

说明:

该文章用于记录博客日志 废话

以及一些参考资料


更新计划

文章:

clash相关以及机场推荐
zerotier相关文章
ollama+openwebui部署llm
mklink软连接实现c盘瘦身
ryzan-ai简单教程

博客:

添加个人收藏夹页面
完善更多细节

已完成

2025/3/22

为博客加入随机图片

js插件代码
document.addEventListener('DOMContentLoaded', () => {
   const banner = document.getElementById('banner');
   if (!banner) return;

    //配置项(可按需修改)
   const config = {
     debounceTime: 300,    // 防抖时间(ms)
     maxRetry: 3,          // 最大重试次数
     cacheBuster: true,    // 启用缓存清理
     transition: '1s ease' // 背景过渡动画
   };

   // API列表
   const APIs = [
     // 参考https://zichen.zone/archives/acg-api.html
     // 横图
     'https://api.mtyqx.cn/api/random.php',
     'https://api.r10086.com/樱道随机图片api接口.php?图片系列=  动漫综合2',
     'https://api.tomys.top/api/acgimg',
     'https://www.loliapi.com/acg/pc/',
     'https://t.alcy.cc/pc',
     'https://t.alcy.cc/moe',
     // 自适应
     'https://www.loliapi.com/acg/',
     'https://t.alcy.cc/ycy',
     'https://t.alcy.cc/moez',
     // 竖图
     'https://www.loliapi.com/acg/pe/',
     'https://t.alcy.cc/moemp',
     'https://t.alcy.cc/mp'

   ];

   // 状态管理
   let currentLoader = null;
   let retryCount = 0;
   let isPortrait = checkOrientation();

   // 智能选择API
   function selectAPI() {
     return isPortrait ? APIs.slice(-6) : APIs.slice(0, 9);
   }

   // 方向检测
   function checkOrientation() {
     return window.matchMedia("(orientation: portrait)"). matches;
   }

   // 防抖函数
   function debounce(fn, delay) {
     let timer;
     return (...args) => {
       clearTimeout(timer);
       timer = setTimeout(() => fn.apply(this, args), delay);
     };
   }

   // 设置背景(带过渡动画)
   function setBackground(url) {
     banner.style.transition = `background-image ${config.  transition}`;
     banner.style.backgroundImage = `url('${url}')`;
   }

   // 加载新图片
   function loadNewImage() {
     if (currentLoader) {
       currentLoader.onload = null;
       currentLoader.onerror = null;
     }

     const apiPool = selectAPI();
     const randomAPI = apiPool[Math.floor(Math.random() *   apiPool.length)];
     const finalURL = config.cacheBuster 
       ? `${randomAPI}?r=${Date.now()}`
       : randomAPI;

     currentLoader = new Image();
     currentLoader.onload = () => {
       retryCount = 0;
       setBackground(finalURL);
     };
     currentLoader.onerror = () => {
       if (retryCount < config.maxRetry) {
         retryCount++;
         loadNewImage();
       } else {
         setBackground(theme.banner.default_bg);
       }
     };
     currentLoader.src = finalURL;
   }

   // 方向变化处理
   const handleOrientationChange = debounce(() => {
     const newOrientation = checkOrientation();
     if (newOrientation !== isPortrait) {
       isPortrait = newOrientation;
       loadNewImage();
     }
   }, config.debounceTime);

   // 事件监听
   window.addEventListener('resize',  handleOrientationChange);

   // 清理监听(防止内存泄漏)
   window.addEventListener('beforeunload', () => {
     window.removeEventListener('resize',   handleOrientationChange);
   });

   // 初始化加载
   loadNewImage();
 });

2025/3/8

搭建个人图床

使用github+cloudflare+picgo实现

该图床除了显示图片,还可以直接显示md文件(没有渲染),txt文件,其他文件会直接下载(有兴趣可以自己多试试)

参考文章:

Github+Cloudflare搭建图床 | Cactus’s Blog


2025/3/2

博客嵌入markdown编辑器

嵌入的编辑器为 editor.md修改版

修改特色:

  • 加入本地 md 文件读取功能
  • 处理文档中相对路径图片的加载问题
  • 给编辑器加入自动保存功能
  • 编辑器代码大小优化

参考文章:

为博客加入一个好用的在线MD编辑工具 | DebuggerX’s Blog


2025/3/1

域名fallingstar.xyz上线

从下往上

配置github page
换cluodflare的dns
购买域名

2025/1/27

添加live2d看板娘

使用OhMyLive2D组件

参考资料:

如何给网页添加Live2D看板娘 | 莫 の 小屋

为你的个人博客添加一个Live2D看板娘_哔哩哔哩_bilibili

OhMyLive2D


2025/1/8

解决网站特效问题

得出结论: 你永远不知道访客的网络能不能访问cdn,所以还是用本地的吧…

参考资料:

Hexo + Fluid 美化 | EmoryHuang’s Blog

2025/1/2

博客主体完成

这天连续肝了5个小时,累死我了,好在是在一天内搞完了🤪

参考资料:

如何使用 Hexo 搭建博客 - licyk的小窝


blog logs
http://meteor-fsk.github.io/2025/01/08/blog-logs/
作者
fallingstar
发布于
2025年1月8日
许可协议