<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>小毅尔勒的博客</title>
        <link>https://587v5.com</link>
        <description>小毅尔勒</description>
        <atom:link href="https://587v5.com/rss.html" rel="self" />
        <language>zh-cn</language>
        <lastBuildDate>Mon, 17 Aug 2026 09:30:55 GMT</lastBuildDate>
        <item>
            <title>go 连接redis集群</title>
            <link>https://587v5.com/post/go lian-jie-redis-ji-qun.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-41a">go redis cluster 代码：</a></li>
</ul>
</div><p>最近用redis shake做redis数据迁移，由于redis提供的客户端没有用于查看集群的工具，且我部署的redis集群是基于k8s来构建的，没有使用ingress做转发，所以只能在k8s内部访问集群，于是我先用go+gin框架编写了访问redis集群的代码，然后打成镜像，再部署到k8s中，创建一个svc类型为NodePort方便外部访问。</p>
<p>环境搭建完毕后，访问接口，发现连接redis集群失败，报错：</p>
<pre><code class="hljs lang-stata">dial tcp: <span class="hljs-keyword">lookup</span> redis-<span class="hljs-keyword">cluster</span>-v2-0.redis-<span class="hljs-keyword">cluster</span>-v2.redis: i/o timeout</code></pre><p>我尝试在容器内部ping | telnet redis集群某一结点地址，发现网络是可通的，后面在代码中新增net.dail()去连接redis集群，报另一个错误：</p>
<pre><code class="hljs lang-angelscript">got <span class="hljs-number">4</span> elements <span class="hljs-keyword">in</span> cluster info address, expected <span class="hljs-number">2</span> <span class="hljs-keyword">or</span> <span class="hljs-number">3</span></code></pre><p>百度发现使用的go redis版本与redis的版本不一致造成的，</p>
<p>Redis 6.0及以下版本：选择Go-redis v8.0及以下版本。</p>
<p>Redis 7.0及以上版本：选择Go-redis v9.0及以上版本。</p>
<p>由于我部署的redis集群是7.0，但go redis使用的版本是 v8[&quot;github.com/go-redis/redis/v8&quot;]，于是修改go redis版本：</p>
<pre><code class="hljs lang-1c"> <span class="hljs-string">"github.com/redis/go-redis/v9"</span></code></pre><p>重新部署一遍就可以了，</p>
<h3><a id="toc-41a" class="anchor" href="#toc-41a"></a>go redis cluster 代码：</h3>
<pre><code class="hljs lang-stata">package client

import (
    <span class="hljs-string">"context"</span>
    <span class="hljs-string">"github.com/BurntSushi/toml"</span>
    <span class="hljs-string">"github.com/redis/go-redis/v9"</span>
    <span class="hljs-string">"net"</span>
    <span class="hljs-string">"redis-cluster-web/log"</span>
)

<span class="hljs-keyword">type</span> RedisClient struct {
<span class="hljs-comment">    *redis.Client</span>
<span class="hljs-comment">    *redis.ClusterClient</span>
}

<span class="hljs-keyword">type</span> <span class="hljs-keyword">Conf</span> struct {
    RedisConf `toml:<span class="hljs-string">"redis"</span>`
}

<span class="hljs-keyword">type</span> RedisConf struct {
    Addrs    []string `toml:<span class="hljs-string">"addrs"</span>`
    Addr     string   `json:<span class="hljs-string">"addr"</span>`
    Database int      `toml:<span class="hljs-string">"database"</span>`
    Password string   `toml:<span class="hljs-string">"password"</span>`
}

<span class="hljs-keyword">var</span> RC RedisClient

func init() {
    RC.NewRedisClient()
    RC.NewRedisClusterClient()
}

func (r *RedisClient) NewRedisClient() {
    <span class="hljs-keyword">conf</span> := <span class="hljs-keyword">Conf</span>{}
    _, <span class="hljs-keyword">err</span> := toml.DecodeFile(<span class="hljs-string">"redis.toml"</span>, &amp;<span class="hljs-keyword">conf</span>)
    <span class="hljs-keyword">if</span> <span class="hljs-keyword">err</span> != nil {
        <span class="hljs-keyword">log</span>.<span class="hljs-keyword">Error</span>.Println(<span class="hljs-string">"read redis conf err:"</span>, <span class="hljs-keyword">err</span>)
        <span class="hljs-keyword">return</span>
    }
    redisAddr := <span class="hljs-keyword">conf</span>.Addr
    r.Client = redis.NewClient(&amp;redis.Options{
        Addr:     redisAddr,
        Password: <span class="hljs-keyword">conf</span>.Password,
    })
}
<span class="hljs-comment">// 我把redis配置写在.toml的配置文件中</span>
func (r *RedisClient) NewRedisClusterClient() {
    <span class="hljs-keyword">conf</span> := <span class="hljs-keyword">Conf</span>{}
    _, <span class="hljs-keyword">err</span> := toml.DecodeFile(<span class="hljs-string">"redis.toml"</span>, &amp;<span class="hljs-keyword">conf</span>)
    <span class="hljs-keyword">if</span> <span class="hljs-keyword">err</span> != nil {
        <span class="hljs-keyword">log</span>.<span class="hljs-keyword">Error</span>.Println(<span class="hljs-string">"read redis conf err:"</span>, <span class="hljs-keyword">err</span>)
        <span class="hljs-keyword">return</span>
    }
    r.ClusterClient = redis.NewClusterClient(&amp;redis.ClusterOptions{
        Addrs: <span class="hljs-keyword">conf</span>.Addrs,
    })
    <span class="hljs-comment">// 打印集群信息</span>
    info := r.ClusterClient.ClusterInfo(context.Background())
    <span class="hljs-comment">// 打印集群节点信息 </span>
    nodes := r.ClusterClient.ClusterNodes(context.Background())
    <span class="hljs-keyword">log</span>.Info.Println(info)
    <span class="hljs-keyword">log</span>.Info.Println(nodes)
    <span class="hljs-comment">// dial redis节点</span>
    <span class="hljs-keyword">for</span> _, addr := <span class="hljs-keyword">range</span> <span class="hljs-keyword">conf</span>.Addrs {
        _, <span class="hljs-keyword">err</span> = <span class="hljs-keyword">net</span>.Dial(<span class="hljs-string">"tcp"</span>, addr)
        <span class="hljs-keyword">if</span> <span class="hljs-keyword">err</span> != nil {
            <span class="hljs-keyword">log</span>.<span class="hljs-keyword">Error</span>.Println(<span class="hljs-keyword">err</span>)
        } <span class="hljs-keyword">else</span> {
            <span class="hljs-keyword">log</span>.Info.Println(<span class="hljs-string">"dail "</span>, addr, <span class="hljs-string">" success"</span>)
        }
    }
}</code></pre>
            ]]></description>
            <pubDate>Mon, 01 Dec 2025 04:48:35 GMT</pubDate>
            <guid>https://587v5.com/post/go lian-jie-redis-ji-qun.html</guid>
        </item>
        <item>
            <title>Nano Banana 火爆全网：迄今最强文生图模型，革命性升级你的图像创作</title>
            <link>https://587v5.com/post/Nano Banana huo-bao-quan-wang-：-qi-jin-zui-qiang-wen-sheng-tu-mo-xing-，-ge-ming-xing-sheng-ji-ni-de-tu-xiang-chuang-zuo.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-6e3">Nano Banana 火爆全网：迄今最强文生图模型，革命性升级你的图像创作</a><ul>
<li><a href="#toc-fa2">电商场景</a><ul>
<li><a href="#toc-86c">1. 背景和服装替换</a></li>
<li><a href="#toc-012">2. 人物换饰品</a></li>
<li><a href="#toc-924">3. 单手持物/产品放置一致性</a></li>
<li><a href="#toc-8cf">4. 物品换配件</a></li>
</ul>
</li>
<li><a href="#toc-946">广告场景</a><ul>
<li><a href="#toc-c0d">5. 四宫格蒙太奇分镜（Multi-Panel Montage）</a></li>
<li><a href="#toc-18f">6. 带 Logo 的广告短片</a></li>
<li><a href="#toc-084">7. 单品拆解</a></li>
</ul>
</li>
<li><a href="#toc-b3b">摄像场景</a><ul>
<li><a href="#toc-78a">8. 高机位视图</a></li>
<li><a href="#toc-a74">9. 第一人称 POV + 背景虚化</a></li>
<li><a href="#toc-e55">10. 微距摄影 (超真实昆虫)</a></li>
<li><a href="#toc-19f">11. 分镜/B-roll 四帧序列</a></li>
<li><a href="#toc-e54">12. 姿势调整 (重定向)</a></li>
<li><a href="#toc-b80">13. DSLR 风格照片升级：低清照 → 拟单反质感</a></li>
</ul>
</li>
<li><a href="#toc-491">社媒场景</a><ul>
<li><a href="#toc-c75">14. INS、小红书、朋友圈九宫格图</a></li>
<li><a href="#toc-244">15. YouTube 缩略图创作</a></li>
</ul>
</li>
<li><a href="#toc-1f3">动漫场景</a><ul>
<li><a href="#toc-a97">16. 连续漫画续集</a></li>
<li><a href="#toc-503">17. 定格动画木偶风格</a></li>
<li><a href="#toc-1fe">18. 简笔画转人物动作</a></li>
<li><a href="#toc-607">19. 生成一套角色设定/故事书</a></li>
</ul>
</li>
<li><a href="#toc-afb">城市建筑场景</a><ul>
<li><a href="#toc-b21">20. 科幻景观概念图</a></li>
<li><a href="#toc-26b">21. 谷歌街景标识</a></li>
<li><a href="#toc-ef5">22. 2D 图片转 3D 建模</a></li>
</ul>
</li>
<li><a href="#toc-d73">3D 场景</a><ul>
<li><a href="#toc-9f4">23. 3D 遮罩和部分特定编辑</a></li>
<li><a href="#toc-66e">24. 插画变手办</a></li>
</ul>
</li>
<li><a href="#toc-461">实用搞钱场景</a><ul>
<li><a href="#toc-967">25. 旧照片修复和增强</a></li>
<li><a href="#toc-031">26. 专业级照片精修</a></li>
<li><a href="#toc-aca">27. 3D 模型赚钱思路</a></li>
</ul>
</li>
<li><a href="#toc-e56">其他场景</a><ul>
<li><a href="#toc-585">28. 图片计数</a></li>
</ul>
</li>
<li><a href="#toc-532">Final：如何真正玩转 Nano Banana</a></li>
</ul>
</li>
</ul>
</div><h1><a id="toc-6e3" class="anchor" href="#toc-6e3"></a>Nano Banana 火爆全网：迄今最强文生图模型，革命性升级你的图像创作</h1>
<p>如果你还记得 GPT-4o 的图像生成能力有多惊艳，那 <strong>Nano Banana</strong> 的表现至少是它的 <strong>10 倍以上</strong>。它以“<strong>人物一致性</strong>”为核心亮点，这一点在商业落地中价值巨大，比如电商领域，甚至能直接取代部分 Photoshop 的功能。目前，它已集成到谷歌的 <strong>Gemini 2.5 Flash</strong> 模型中，你可以在 <a href="https://aistudio.google.com/">https://aistudio.google.com/</a> <strong>免费试用</strong>。
<img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_946a5d8e8a2405d98cbeec8183bd7949" alt="image.png"></p>
<p>废话不多说，这里整理了全网爆火的 <strong>28 种玩法</strong>（按场景分类），让你全面体验 Nano Banana 带来的图像革命。每个玩法都附带<strong>提示词示例</strong>和<strong>参考链接</strong>，建议逐一尝试，感受其高效与精准。</p>
<hr>
<h2><a id="toc-fa2" class="anchor" href="#toc-fa2"></a>电商场景</h2>
<p>适合“上新/换装/场景化展示/统一风格”等<strong>高频小改 + 批量产出</strong>任务。只需少量指令，就能实现换背景、换服饰、加道具、控制手势拿物、产品一致性放置等操作，大幅缩短精修流程。</p>
<h3><a id="toc-86c" class="anchor" href="#toc-86c"></a>1. 背景和服装替换</h3>
<p>更改主体环境和服装，同时保持姿势和细节，适用于<strong>虚拟试衣</strong>或<strong>商品主题再想象</strong>。  
<strong>提示词</strong>：  
<code>Change the background to Marrakech and the clothes to a Moroccan Djellaba</code><br><strong>参考</strong>：<a href="https://x.com/marouane53/status/1960349731512877416">https://x.com/marouane53/status/1960349731512877416</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_69ad41db8d758af069f4e88cf329644a" alt="image.png"></p>
<p><strong>类似玩法</strong>：上传自拍 + 服装网图，一键生成多张上身效果图，取代真人模特拍摄。<br><strong>参考</strong>：<a href="https://x.com/8co28/status/1960526924712960316">https://x.com/8co28/status/1960526924712960316</a>  </p>
<h3><a id="toc-012" class="anchor" href="#toc-012"></a>2. 人物换饰品</h3>
<p>更换眼镜类型并添加互补物体（如饮料），保留面部特征，适合<strong>个性化肖像</strong>或<strong>产品展示</strong>。  
<strong>提示词</strong>：  
<code>Make that computer glass to black sunglass with a healthy drink</code><br><strong>参考</strong>：[<a href="https://x.com/Star_Knight12/status/1960406677414666655%5D">https://x.com/Star_Knight12/status/1960406677414666655]</a>
<img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_4572f08eeff1dc1e4ec07f81ec911354" alt="image.png"></p>
<h3><a id="toc-924" class="anchor" href="#toc-924"></a>3. 单手持物/产品放置一致性</h3>
<p>添加或调整产品位置，通过手臂/手部姿态确保无缝整合，<strong>电商视觉效果</strong>必备。<br><strong>提示词</strong>：  
<code>Let the woman hold this bag with one arm raised forward.</code><br><strong>参考</strong>：<a href="https://x.com/HalimAlrasihi/status/1956368322414432295">https://x.com/HalimAlrasihi/status/1956368322414432295</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_ecb1554c23b2360306f0005268200dac" alt="image.png"></p>
<h3><a id="toc-8cf" class="anchor" href="#toc-8cf"></a>4. 物品换配件</h3>
<p>替换特定配件（如手机壳），不改变图像其余部分，适合<strong>快速产品变体生成</strong>和 <strong>A/B 测试</strong>。  
<strong>提示词</strong>：  
<code>change the iphone cover to this cover</code><br><strong>参考</strong>：<a href="https://x.com/Salmaaboukarr/status/1960351687534661884">https://x.com/Salmaaboukarr/status/1960351687534661884</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_162110c6ce2d386236ae51da0f059de7" alt="image.png"></p>
<hr>
<h2><a id="toc-946" class="anchor" href="#toc-946"></a>广告场景</h2>
<p>专注<strong>多面板编排</strong>、<strong>品牌元素一致性</strong>，以及从静态图到短视频的<strong>素材工程化</strong>。先用 Nano Banana 生成/修改图像，再结合视频模型添加动效。</p>
<h3><a id="toc-c0d" class="anchor" href="#toc-c0d"></a>5. 四宫格蒙太奇分镜（Multi-Panel Montage）</h3>
<p>根据参考风格，生成展示不同时刻的多面板图像，适用于<strong>广告系列统一风格</strong>。  
<strong>提示词</strong>：  
<code>Create a 4-panel montage showing sporting moments. Use the style of the reference image.</code><br><strong>参考</strong>：<a href="https://x.com/ai_artworkgen/status/1958102908504780853">https://x.com/ai_artworkgen/status/1958102908504780853</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_773af2f3100973df122baf36e9f8fbd9" alt="![image.png](https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_d4b4d68299ba95c680bd7cdb1c8e27a8)image.png"></p>
<h3><a id="toc-18f" class="anchor" href="#toc-18f"></a>6. 带 Logo 的广告短片</h3>
<p>将品牌 Logo 无缝置入衍生场景，创建<strong>品牌故事性内容</strong>。  
<strong>提示词</strong>：  
<code>Original image from Ideogram. Nano Banana to reimagine the logo in new places. Runway Gen-4 Turbo to animate to video.</code><br><strong>（流程：Ideogram 生成带 Logo 原图 → Nano Banana 置入新场景 → Runway Gen-4 Turbo 动画化）</strong><br><strong>参考</strong>：<a href="https://x.com/jerrod_lew/status/1960356192766542208">https://x.com/jerrod_lew/status/1960356192766542208</a>  </p>
<h3><a id="toc-084" class="anchor" href="#toc-084"></a>7. 单品拆解</h3>
<p>从复杂场景中分离独立商品（如相机、耳机、鞋子），以陈列方式展示，适合<strong>产品目录制作</strong>。  
<strong>提示词</strong>：  
<code>A man is standing in a modern electronic store analyzing a digital camera. He is wearing a watch. On the table in front of him are sunglasses, headphones on a stand, a shoe, a helmet and a sneaker, a white sneaker and a black sneaker</code><br><strong>参考</strong>：<a href="https://x.com/MrDavids1/status/1960659805917331938">https://x.com/MrDavids1/status/1960659805917331938</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_3a8aa998c1e2f215b68f78c2447f9c21" alt="image.png"></p>
<hr>
<h2><a id="toc-b3b" class="anchor" href="#toc-b3b"></a>摄像场景</h2>
<p>擅长<strong>机位切换</strong>、<strong>POV 视角</strong>、<strong>姿态重定向</strong>、<strong>拟单反质感</strong>等摄影指令，对<strong>短剧</strong>、<strong>B-roll</strong>、<strong>剧情海报</strong>非常友好。</p>
<h3><a id="toc-78a" class="anchor" href="#toc-78a"></a>8. 高机位视图</h3>
<p>从原图生成<strong>高角度俯拍</strong>版本。<br><strong>提示词</strong>：  
<code>Create a high-angle view of this shot</code><br><strong>参考</strong>：<a href="https://x.com/TomLikesRobots/status/1960014126165733841">https://x.com/TomLikesRobots/status/1960014126165733841</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_7a81cb71723355aee067f8820de9f710" alt="image.png"></p>
<h3><a id="toc-a74" class="anchor" href="#toc-a74"></a>9. 第一人称 POV + 背景虚化</h3>
<p>切换到<strong>第一人称视角</strong>，模糊背景，营造沉浸式镜头感。<br><strong>提示词</strong>：  
<code>swap the camera angle to a 1st person POV showing the head of the dragon from behind and blurred battleground on the background</code><br><strong>参考</strong>：<a href="https://x.com/techhalla/status/1958517274760851787">https://x.com/techhalla/status/1958517274760851787</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_1158cec04b26cc4c2a86d4f9a8a515a5" alt="image.png"></p>
<blockquote>
<p><strong>对比</strong>：Midjourney 需要更长的提示词，如：<br><code>A wide cinematic low-angle shot of a monstrous winged beast...</code></p>
</blockquote>
<h3><a id="toc-e55" class="anchor" href="#toc-e55"></a>10. 微距摄影 (超真实昆虫)</h3>
<p>生成细节丰富的<strong>微距作品</strong>。  
<strong>提示词</strong>：  
<code>A hyper-realistic macro photograph of a bumblebee, covered in pollen, landing on a single, dew-covered petal of a purple iris. The background is a soft, out-of-focus garden.</code><br><strong>参考</strong>：[<a href="https://www.reddit.com/r/singularity/comments/1mpei4u/nanobanana_new_image_model_examples/%5D">https://www.reddit.com/r/singularity/comments/1mpei4u/nanobanana_new_image_model_examples/]</a>
<img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_bc5bbaecb7ff5f59bb42450f62a4c108" alt="image.png"></p>
<h3><a id="toc-19f" class="anchor" href="#toc-19f"></a>11. 分镜/B-roll 四帧序列</h3>
<p>生成多帧<strong>视觉故事序列</strong>。  
<strong>提示词</strong>：  
<code>provide a 4-panel montage of b-roll footage of this subject, 16:9: 1. standing outside (back to the camera) 2. getting into the driver seat of a white sports car 3. getting into a matte gold horse-drawn chariot in the middle of the street 4. standing looking up towards the heavens with arms outstretched upwards (back to the camera)</code><br><strong>参考</strong>：<a href="https://x.com/ai_artworkgen/status/1958490177090822264">https://x.com/ai_artworkgen/status/1958490177090822264</a>  </p>
<h3><a id="toc-e54" class="anchor" href="#toc-e54"></a>12. 姿势调整 (重定向)</h3>
<p>简单改变主体<strong>姿势或注视方向</strong>。  
<strong>提示词</strong>：  
<code>I simply asked it to create a photo of someone looking straight ahead.</code><br><strong>参考</strong>：<a href="https://x.com/arrakis_ai/status/1955901155726516652">https://x.com/arrakis_ai/status/1955901155726516652</a><br><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250901/upload_1ff807fb9a93cc2b21690b58556a64d8" alt="image.png"></p>
<h3><a id="toc-b80" class="anchor" href="#toc-b80"></a>13. DSLR 风格照片升级：低清照 → 拟单反质感</h3>
<p>增强低质量照片模仿<strong>高端相机</strong>。  
<strong>提示词</strong>：  
<code>Make this image look like a shot taken from [any top DSLR details]</code><br><strong>参考</strong>：<a href="https://x.com/HarshithLucky3/status/1960531361875591268">https://x.com/HarshithLucky3/status/1960531361875591268</a>  </p>
<hr>
<h2><a id="toc-491" class="anchor" href="#toc-491"></a>社媒场景</h2>
<p>一键生成<strong>平台风格网格图</strong>和<strong>封面</strong>，助力内容创作者。</p>
<h3><a id="toc-c75" class="anchor" href="#toc-c75"></a>14. INS、小红书、朋友圈九宫格图</h3>
<p>将核心图片嵌入<strong>九宫格</strong>，自动生成协调补充图像。<br><strong>提示词</strong>：  
<code>put this on a social media instagram grid and add more images that works with the grid</code><br><strong>参考</strong>：<a href="https://x.com/Salmaaboukarr/status/1960382811459748232">https://x.com/Salmaaboukarr/status/1960382811459748232</a>  </p>
<h3><a id="toc-244" class="anchor" href="#toc-244"></a>15. YouTube 缩略图创作</h3>
<p>结合人物、文字、背景创建<strong>夸张缩略图</strong>。  
<strong>提示词</strong>：  
<code>Create a YouTube thumbnail of this guy looking surprise with a tiny banana in his hand. The text should say &quot;Nano Banana is WILD&quot;, modern style font</code><br><strong>参考</strong>：<a href="https://x.com/markgadala/status/1960370481543938380">https://x.com/markgadala/status/1960370481543938380</a>  </p>
<hr>
<h2><a id="toc-1f3" class="anchor" href="#toc-1f3"></a>动漫场景</h2>
<p>覆盖<strong>连续分镜</strong>、<strong>停格动画</strong>、<strong>草图转动作</strong>、<strong>完整人设包</strong>等 AIGC 动漫流程。</p>
<h3><a id="toc-a97" class="anchor" href="#toc-a97"></a>16. 连续漫画续集</h3>
<p>在原有画风下<strong>续写下一格</strong>。  
<strong>提示词</strong>：  
<code>Try continue prompts in Gemini 2.5 Flash image generation (nano banana)</code><br><strong>参考</strong>：<a href="https://x.com/HarshithLucky3/status/1960379341981745223">https://x.com/HarshithLucky3/status/1960379341981745223</a>  </p>
<h3><a id="toc-503" class="anchor" href="#toc-503"></a>17. 定格动画木偶风格</h3>
<p>创建<strong>手工定格动画图像</strong>，富含纹理和光效。<br><strong>提示词</strong>：  
<code>Ultra detailed stop-motion animation frame, two handmade toys interacting on a miniature set, felt and fabric textures...</code><br><strong>参考</strong>：<a href="https://www.reddit.com/r/Bard/comments/1mr6ays/nanobanana_is_nearly_on_par_with_imagen_4_while/">https://www.reddit.com/r/Bard/comments/1mr6ays/nanobanana_is_nearly_on_par_with_imagen_4_while/</a>  </p>
<h3><a id="toc-1fe" class="anchor" href="#toc-1fe"></a>18. 简笔画转人物动作</h3>
<p>将<strong>火柴人草图</strong>结合人物形象生成动态场景。<br><strong>参考</strong>：<a href="https://x.com/yachimat_manga/status/1960471174758195494">https://x.com/yachimat_manga/status/1960471174758195494</a>  </p>
<h3><a id="toc-607" class="anchor" href="#toc-607"></a>19. 生成一套角色设定/故事书</h3>
<p>产出<strong>比例、三视图、表情、动作、服装</strong>设定板。<br><strong>提示词</strong>：  
<code>为我生成人物的角色设定（Character Design） 比例设定...</code><br><strong>参考</strong>：<a href="https://x.com/ZHO_ZHO_ZHO/status/1960669234276753542">https://x.com/ZHO_ZHO_ZHO/status/1960669234276753542</a>  </p>
<hr>
<h2><a id="toc-afb" class="anchor" href="#toc-afb"></a>城市建筑场景</h2>
<p>从<strong>科幻概念</strong>到<strong>现实标注与建模</strong>，图像理解能力出色。</p>
<h3><a id="toc-b21" class="anchor" href="#toc-b21"></a>20. 科幻景观概念图</h3>
<p>渲染丰富<strong>外星世界</strong>。  
<strong>提示词</strong>：  
<code>A hyper-realistic sci-fi landscape of a vibrant alien planet...</code><br><strong>参考</strong>：<a href="https://www.reddit.com/r/singularity/comments/1mpei4u/nanobanana_new_image_model_examples/">https://www.reddit.com/r/singularity/comments/1mpei4u/nanobanana_new_image_model_examples/</a>  </p>
<h3><a id="toc-26b" class="anchor" href="#toc-26b"></a>21. 谷歌街景标识</h3>
<p>上传截图，让它<strong>注释点位信息</strong>。  
<strong>提示词</strong>：  
<code>you are a location-based AR experience generator. highlight [point of interest] in this image and annotate relevant information about it.</code><br><strong>参考</strong>：<a href="https://x.com/bilawalsidhu/status/1960529167742853378">https://x.com/bilawalsidhu/status/1960529167742853378</a>  </p>
<h3><a id="toc-ef5" class="anchor" href="#toc-ef5"></a>22. 2D 图片转 3D 建模</h3>
<p>将夜晚建筑转为<strong>白天等距 3D 视图</strong>。  
<strong>提示词</strong>：  
<code>Make Image Daytime and Isometric (Building Only)</code><br><strong>参考</strong>：<a href="https://x.com/Zieeett/status/1960420874806247762">https://x.com/Zieeett/status/1960420874806247762</a>  </p>
<hr>
<h2><a id="toc-d73" class="anchor" href="#toc-d73"></a>3D 场景</h2>
<p>在 2D 中实现 <strong>3D 效果</strong>，如体素遮罩、部件上色、插画转手办。</p>
<h3><a id="toc-9f4" class="anchor" href="#toc-9f4"></a>23. 3D 遮罩和部分特定编辑</h3>
<p>遮罩体积，编辑姿势并<strong>颜色编码</strong>。  
<strong>提示词</strong>：  
<code>Mask the 3D volume of specific parts...</code><br><strong>参考</strong>：<a href="https://x.com/HbTteok/status/1957101835522904129">https://x.com/HbTteok/status/1957101835522904129</a>  </p>
<h3><a id="toc-66e" class="anchor" href="#toc-66e"></a>24. 插画变手办</h3>
<p>转化 <strong>2D 角色为 3D 手办</strong>，包括包装和建模过程。<br><strong>提示词</strong>：  
<code>turn this photo into a character figure...</code><br><strong>参考</strong>：<a href="https://x.com/ZHO_ZHO_ZHO/status/1958539464994959715">https://x.com/ZHO_ZHO_ZHO/status/1958539464994959715</a>  </p>
<hr>
<h2><a id="toc-461" class="anchor" href="#toc-461"></a>实用搞钱场景</h2>
<p>商业变现潜力巨大，从<strong>修复</strong>到<strong>精修</strong>，再到<strong>定制商品</strong>。</p>
<h3><a id="toc-967" class="anchor" href="#toc-967"></a>25. 旧照片修复和增强</h3>
<p>裁剪、修复、上色、放大<strong>复古照片</strong>。  
<strong>提示词</strong>：  
`帮我处理一下这样照片，要求是：</p>
<ol>
<li>只截取照片内容部分，移除桌面的背景、边框</li>
<li>修复照片里面的污损</li>
<li>把照片做成彩色的</li>
<li>高清放大照片
`  </li>
</ol>
<p><strong>参考</strong>：<a href="https://x.com/passluo/status/1960549038425825581">https://x.com/passluo/status/1960549038425825581</a>  </p>
<h3><a id="toc-031" class="anchor" href="#toc-031"></a>26. 专业级照片精修</h3>
<p>去除痘痘/瑕疵，保留<strong>永久标记</strong>，效果自然。<br><strong>提示词</strong>：  
<code>Clean the face by removing acne... Preserve all permanent marks...</code><br><strong>参考</strong>：<a href="https://www.reddit.com/r/GeminiAI/comments/1n1bxow/why_does_gemini_api_block_my_skin_retouching/">https://www.reddit.com/r/GeminiAI/comments/1n1bxow/why_does_gemini_api_block_my_skin_retouching/</a>  </p>
<h3><a id="toc-aca" class="anchor" href="#toc-aca"></a>27. 3D 模型赚钱思路</h3>
<p>将人物照片转为<strong>定制 3D 玩具人偶</strong>，生成商品图。<br><strong>参考</strong>：<a href="https://x.com/AmbitiousXU/status/1959941388046684373">https://x.com/AmbitiousXU/status/1959941388046684373</a>  </p>
<hr>
<h2><a id="toc-e56" class="anchor" href="#toc-e56"></a>其他场景</h2>
<h3><a id="toc-585" class="anchor" href="#toc-585"></a>28. 图片计数</h3>
<p>计算元素数量，进行运算并<strong>添加新元素</strong>，适合<strong>教育/解谜</strong>内容。<br><strong>提示词</strong>：  
<code>Count the number of strawberries... multiply that by two and add as many bananas...</code><br><strong>参考</strong>：<a href="https://x.com/HarshithLucky3/status/1960379341981745223">https://x.com/HarshithLucky3/status/1960379341981745223</a>  </p>
<hr>
<h2><a id="toc-532" class="anchor" href="#toc-532"></a>Final：如何真正玩转 Nano Banana</h2>
<ul>
<li><strong>工作流化</strong>：先制定<strong>标准化提示词模板</strong>（主体不变 → 视角/姿态 → 局部修改 → 材质/光源 → 输出规格），集成到 <strong>n8n</strong> 等脚本批量运行。  </li>
<li><strong>一致性Tips</strong>：人物/品牌一致性“<strong>非常接近但非100%</strong>”，保留参考图，多轮微调 + 对比稳定风格（参考社区讨论：<a href="https://www.reddit.com/r/Bard/comments/1mvhhh1/nanobanana_is_amazing_but_it_does_not_produce/?utm_source=chatgpt.com">https://www.reddit.com/r/Bard/comments/1mvhhh1/nanobanana_is_amazing_but_it_does_not_produce/</a>）。  </li>
<li><strong>合规与风险</strong>：输出含 <strong>SynthID 水印</strong>，商用注意平台规范、肖像/商标权。  </li>
<li><strong>与 GPT 协作</strong>：GPT 适合<strong>脑洞初稿</strong>，Nano Banana 负责<strong>精准落地</strong>。GPT 生成 moodboard，Nano Banana 精修合成，提升性价比。</li>
</ul>
<p><strong>Nano Banana</strong> 正引领图像革命，试用后你会发现，它不只是工具，更是<strong>创意加速器</strong>！</p>

            ]]></description>
            <pubDate>Mon, 01 Sep 2025 02:38:11 GMT</pubDate>
            <guid>https://587v5.com/post/Nano Banana huo-bao-quan-wang-：-qi-jin-zui-qiang-wen-sheng-tu-mo-xing-，-ge-ming-xing-sheng-ji-ni-de-tu-xiang-chuang-zuo.html</guid>
        </item>
        <item>
            <title>批量修改 Git 提交中的用户名和邮箱信息</title>
            <link>https://587v5.com/post/pi-liang-xiu-gai- Git ti-jiao-zhong-de-yong-hu-ming-he-you-xiang-xin-xi.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-828">批量修改 Git 提交中的用户名和邮箱信息</a><ul>
<li><a href="#toc-93c">为什么要修改 Git 提交历史？</a></li>
<li><a href="#toc-1c1">一键批量修改脚本</a></li>
<li><a href="#toc-1bb">注意事项</a></li>
<li><a href="#git-filter-branch-%E5%B8%B8%E7%94%A8%E5%8A%9F%E8%83%BD"><code>git filter-branch</code> 常用功能</a><ul>
<li><a href="#toc-1a6">示例</a></li>
</ul>
</li>
<li><a href="#toc-fcc">替代工具</a></li>
<li><a href="#toc-50d">常见问题</a></li>
<li><a href="#toc-9d2">管理 Git 用户信息提示</a></li>
</ul>
</li>
</ul>
</div><h1><a id="toc-828" class="anchor" href="#toc-828"></a>批量修改 Git 提交中的用户名和邮箱信息</h1>
<h2><a id="toc-93c" class="anchor" href="#toc-93c"></a>为什么要修改 Git 提交历史？</h2>
<ul>
<li><strong>错误用户信息</strong>：误用个人邮箱而非公司邮箱。</li>
<li><strong>统一管理</strong>：为团队协作统一提交信息。</li>
<li><strong>隐私保护</strong>：隐藏真实用户信息。</li>
</ul>
<h2><a id="toc-1c1" class="anchor" href="#toc-1c1"></a>一键批量修改脚本</h2>
<p>使用 <code>git filter-branch</code> 修改提交历史的用户名和邮箱：</p>
<pre><code class="language-bash">#!/bin/sh
git filter-branch --env-filter &#39;
OLD_EMAIL=&quot;旧邮箱@example.com&quot;
CORRECT_NAME=&quot;新用户名&quot;
CORRECT_EMAIL=&quot;新邮箱@example.com&quot;
if [ &quot;$GIT_COMMITTER_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ]; then
    export GIT_COMMITTER_NAME=&quot;$CORRECT_NAME&quot;
    export GIT_COMMITTER_EMAIL=&quot;$CORRECT_EMAIL&quot;
fi
if [ &quot;$GIT_AUTHOR_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ]; then
    export GIT_AUTHOR_NAME=&quot;$CORRECT_NAME&quot;
    export GIT_AUTHOR_EMAIL=&quot;$CORRECT_EMAIL&quot;
fi
&#39; --tag-name-filter cat -- --branches --tags</code></pre>
<h2><a id="toc-1bb" class="anchor" href="#toc-1bb"></a>注意事项</h2>
<ul>
<li><strong>备份仓库</strong>：操作前用 <code>git clone --mirror</code> 备份。</li>
<li><strong>多人协作</strong>：修改历史会更改提交哈希，需提前通知协作者。</li>
<li><strong>不可逆操作</strong>：理解操作原理后再执行。</li>
</ul>
<h2><a id="toc-d31" class="anchor" href="#toc-d31"></a><code>git filter-branch</code> 常用功能</h2>
<ol>
<li><p><strong>基本用法</strong>：</p>
<pre><code class="language-bash">git filter-branch [选项] &lt;filter&gt; -- --all</code></pre>
<ul>
<li><code>--all</code>：应用到所有分支。</li>
<li><code>&lt;filter&gt;</code>：指定操作类型。</li>
</ul>
</li>
<li><p><strong>常用选项</strong>：</p>
<ul>
<li><code>--env-filter</code>：修改作者/提交者信息。</li>
<li><code>--tree-filter</code>：修改文件内容或删除文件（较慢）。</li>
<li><code>--index-filter</code>：高效修改暂存区文件。</li>
<li><code>--commit-filter</code>：自定义提交信息。</li>
<li><code>--tag-name-filter</code>：更新标签。</li>
<li><code>--prune-empty</code>：删除空提交。</li>
</ul>
</li>
</ol>
<h3><a id="toc-1a6" class="anchor" href="#toc-1a6"></a>示例</h3>
<ul>
<li><p><strong>修改用户信息</strong>：</p>
<pre><code class="language-bash">git filter-branch --env-filter &#39;
OLD_EMAIL=&quot;旧邮箱@example.com&quot;
CORRECT_NAME=&quot;新用户名&quot;
CORRECT_EMAIL=&quot;新邮箱@example.com&quot;
if [ &quot;$GIT_COMMITTER_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ]; then
    export GIT_COMMITTER_NAME=&quot;$CORRECT_NAME&quot;
    export GIT_COMMITTER_EMAIL=&quot;$CORRECT_EMAIL&quot;
fi
if [ &quot;$GIT_AUTHOR_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ]; then
    export GIT_AUTHOR_NAME=&quot;$CORRECT_NAME&quot;
    export GIT_AUTHOR_EMAIL=&quot;$CORRECT_EMAIL&quot;
fi
&#39; -- --all</code></pre>
</li>
<li><p><strong>删除文件</strong>：</p>
<pre><code class="language-bash">git filter-branch --index-filter &#39;git rm --cached --ignore-unmatch .env&#39; -- --all</code></pre>
</li>
</ul>
<h2><a id="toc-fcc" class="anchor" href="#toc-fcc"></a>替代工具</h2>
<p><code>git filter-repo</code>：比 <code>git filter-branch</code> 更快、更易用，适合大规模仓库清理。</p>
<h2><a id="toc-50d" class="anchor" href="#toc-50d"></a>常见问题</h2>
<ol>
<li><p><strong>修改历史会影响安全性吗？</strong>
不会直接影响，但可能导致同步问题，需备份并通知团队。</p>
</li>
<li><p><strong>其他开发者如何同步？</strong>
需重新拉取代码，可能需解决冲突。</p>
</li>
<li><p><strong>其他修改方法？</strong></p>
<ul>
<li><code>git commit --amend</code>：修改最近提交。</li>
<li><code>git rebase -i</code>：交互式修改多条提交。</li>
</ul>
</li>
</ol>
<h2><a id="toc-9d2" class="anchor" href="#toc-9d2"></a>管理 Git 用户信息提示</h2>
<ul>
<li><strong>全局配置</strong>：<pre><code class="language-bash">git config --global user.name &quot;Your Name&quot;
git config --global user.email &quot;your_email@example.com&quot;</code></pre>
</li>
<li><strong>项目级配置</strong>：在 <code>.git/config</code> 设置本地用户信息。</li>
<li><strong>检查提交信息</strong>：提交前确认用户名和邮箱。</li>
</ul>

            ]]></description>
            <pubDate>Fri, 22 Aug 2025 02:52:14 GMT</pubDate>
            <guid>https://587v5.com/post/pi-liang-xiu-gai- Git ti-jiao-zhong-de-yong-hu-ming-he-you-xiang-xin-xi.html</guid>
        </item>
        <item>
            <title>微信小程序强制刷新并跳转至指定页面</title>
            <link>https://587v5.com/post/wei-xin-xiao-cheng-xu-qiang-zhi-shua-xin-bing-tiao-zhuan-zhi-zhi-ding-ye-mian.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-ac8">微信小程序强制刷新并跳转至指定页面</a></li>
</ul>
</div><h3><a id="toc-ac8" class="anchor" href="#toc-ac8"></a>微信小程序强制刷新并跳转至指定页面</h3>
<pre><code class="hljs lang-css"><span class="hljs-selector-tag">uni</span><span class="hljs-selector-class">.reLaunch</span>({
  <span class="hljs-attribute">url</span>: <span class="hljs-string">'/pages/index/index'</span>
});</code></pre>
            ]]></description>
            <pubDate>Mon, 18 Aug 2025 13:01:52 GMT</pubDate>
            <guid>https://587v5.com/post/wei-xin-xiao-cheng-xu-qiang-zhi-shua-xin-bing-tiao-zhuan-zhi-zhi-ding-ye-mian.html</guid>
        </item>
        <item>
            <title>绿联NAS部署nginx转发直播流，提供小红书、抖音等直播</title>
            <link>https://587v5.com/post/lv-lian-NAS-bu-shu-nginx-zhuan-fa-zhi-bo-liu-，-ti-gong-xiao-hong-shu-、-dou-yin-deng-zhi-bo.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-a40">Nginx RTMP 直播流转发配置指南、提供小红书、抖音等直播</a></li>
</ul>
</div><h3><a id="toc-a40" class="anchor" href="#toc-a40"></a>Nginx RTMP 直播流转发配置指南、提供小红书、抖音等直播</h3>
<p>本文档整理了在 NAS 上使用 Docker Compose 部署 Nginx RTMP 服务器，转发直播流,在小红书、抖音等平台直播
前提条件</p>
<p>NAS 环境：
已启用 Docker 和 Docker Compose。
开放端口：1935（RTMP）、8080（HTTP）。
建议配置：2 核 CPU，4GB 内存，10Mbps 带宽。</p>
<p>OBS Studio：用于推流。
直播平台：需获取 RTMP 推流地址（如 rtmp://push.example.com/live/your_stream_key）。
工具：VLC、FFplay 用于测试拉流。</p>
<p>配置步骤</p>
<ol>
<li>配置 Docker Compose
在 NAS 的共享文件夹（如 /share/homes/nginx-rtmp）中创建 <pre><code class="hljs lang-vim">docker-compose.yml：
<span class="hljs-keyword">version</span>: <span class="hljs-string">'3.8'</span>
service<span class="hljs-variable">s:</span>
nginx-rtmp:
 image: tiangolo/nginx-rtmp:latest
 container_name: nginx-rtmp
 port<span class="hljs-variable">s:</span>
   - <span class="hljs-string">"1935:1935"</span> # RTMP 端口
   - <span class="hljs-string">"8080:80"</span>   # HTTP 端口（HLS）
 volume<span class="hljs-variable">s:</span>
   - ./nginx.<span class="hljs-keyword">conf</span>:/etc/nginx/nginx.<span class="hljs-keyword">conf</span>:ro
   - ./hl<span class="hljs-variable">s:</span>/tmp/hls
   - ./<span class="hljs-built_in">log</span><span class="hljs-variable">s:</span>/var/<span class="hljs-built_in">log</span>/nginx
 restar<span class="hljs-variable">t:</span> unless-stopped
 network<span class="hljs-variable">s:</span>
   - rtmp-net
network<span class="hljs-variable">s:</span>
rtmp-ne<span class="hljs-variable">t:</span>
 driver: bridge</code></pre></li>
</ol>
<p>创建目录并设置权限：</p>
<pre><code class="hljs lang-awk">mkdir -p <span class="hljs-regexp">/share/</span>homes<span class="hljs-regexp">/nginx-rtmp/</span>{hls,logs}
chmod -R <span class="hljs-number">777</span> <span class="hljs-regexp">/share/</span>homes<span class="hljs-regexp">/nginx-rtmp</span></code></pre><ol start="2">
<li>配置 Nginx
创建 /share/homes/nginx-rtmp/nginx.conf：</li>
</ol>
<pre><code class="hljs lang-properties"><span class="hljs-attr">worker_processes</span> <span class="hljs-string">1;</span>
<span class="hljs-attr">events</span> <span class="hljs-string">{</span>
    <span class="hljs-attr">worker_connections</span> <span class="hljs-string">512;</span>
<span class="hljs-attr">}</span>

<span class="hljs-attr">rtmp</span> <span class="hljs-string">{</span>
    <span class="hljs-attr">server</span> <span class="hljs-string">{</span>
        <span class="hljs-attr">listen</span> <span class="hljs-string">1935;</span>
        <span class="hljs-attr">chunk_size</span> <span class="hljs-string">512;</span>
        <span class="hljs-attr">ping</span> <span class="hljs-string">30s;</span>
        <span class="hljs-attr">notify_method</span> <span class="hljs-string">get;</span>

        <span class="hljs-attr">application</span> <span class="hljs-string">live {</span>
            <span class="hljs-attr">live</span> <span class="hljs-string">on;</span>
            <span class="hljs-attr">record</span> <span class="hljs-string">off;</span>
            <span class="hljs-attr">allow</span> <span class="hljs-string">publish 192.168.1.0/24; # 替换为局域网网段</span>
            <span class="hljs-attr">allow</span> <span class="hljs-string">play all;</span>
            <span class="hljs-attr">drop_idle_publisher</span> <span class="hljs-string">10s;</span>
<span class="hljs-comment">            # push rtmp://push.example.com/live/your_stream_key; # 替换为实际密钥，调试时可禁用</span>
        <span class="hljs-attr">}</span>

        <span class="hljs-attr">application</span> <span class="hljs-string">hls {</span>
            <span class="hljs-attr">live</span> <span class="hljs-string">on;</span>
            <span class="hljs-attr">hls</span> <span class="hljs-string">on;</span>
            <span class="hljs-attr">hls_path</span> <span class="hljs-string">/tmp/hls;</span>
            <span class="hljs-attr">hls_fragment</span> <span class="hljs-string">1s;</span>
            <span class="hljs-attr">hls_playlist_length</span> <span class="hljs-string">4s;</span>
            <span class="hljs-attr">hls_cleanup</span> <span class="hljs-string">off;</span>
            <span class="hljs-attr">hls_nested</span> <span class="hljs-string">on;</span>
        <span class="hljs-attr">}</span>
    <span class="hljs-attr">}</span>
<span class="hljs-attr">}</span>

<span class="hljs-attr">http</span> <span class="hljs-string">{</span>
    <span class="hljs-attr">server</span> <span class="hljs-string">{</span>
        <span class="hljs-attr">listen</span> <span class="hljs-string">80;</span>
        <span class="hljs-attr">server_name</span> <span class="hljs-string">localhost;</span>

        <span class="hljs-attr">location</span> <span class="hljs-string">/hls {</span>
            <span class="hljs-attr">types</span> <span class="hljs-string">{</span>
                <span class="hljs-meta">application/vnd.apple.mpegurl</span> <span class="hljs-string">m3u8;</span>
                <span class="hljs-meta">video/mp2t</span> <span class="hljs-string">ts;</span>
            <span class="hljs-attr">}</span>
            <span class="hljs-attr">root</span> <span class="hljs-string">/tmp;</span>
            <span class="hljs-attr">add_header</span> <span class="hljs-string">Access-Control-Allow-Origin *;</span>
            <span class="hljs-attr">add_header</span> <span class="hljs-string">Cache-Control no-cache;</span>
        <span class="hljs-attr">}</span>

        <span class="hljs-attr">location</span> <span class="hljs-string">/stat {</span>
            <span class="hljs-attr">rtmp_stat</span> <span class="hljs-string">all;</span>
            <span class="hljs-attr">rtmp_stat_stylesheet</span> <span class="hljs-string">stat.xsl;</span>
        <span class="hljs-attr">}</span>

        <span class="hljs-attr">location</span> <span class="hljs-string">/stat.xsl {</span>
            <span class="hljs-attr">root</span> <span class="hljs-string">/usr/local/nginx/html;</span>
        <span class="hljs-attr">}</span>
    <span class="hljs-attr">}</span>
<span class="hljs-attr">}</span></code></pre><ol start="3">
<li>启动服务</li>
</ol>
<pre><code class="hljs lang-bash"><span class="hljs-built_in">cd</span> /share/homes/nginx-rtmp
docker-compose up -d
docker <span class="hljs-built_in">exec</span> nginx-rtmp nginx -t</code></pre><ol start="4">
<li>配置 OBS 推流</li>
</ol>
<p>OBS 设置：
服务器：rtmp://nas-ip:1935/live
串流密钥：my_stream
编码器：NVENC（优先）或 x264
比特率：1500-2000 kbps
分辨率：1280x720，帧率：25 fps
关键帧间隔：1 秒
启用“网络优化”（设置 &gt; 高级 &gt; 网络）</p>
<p>启动推流，确认状态栏显示“已连接”。</p>
<ol start="5">
<li>测试拉流</li>
</ol>
<p>RTMP 拉流：ffplay rtmp://nas-ip:1935/live/my_stream</p>
<p>或 VLC：rtmp://nas-ip:1935/live/my_stream
HLS 拉流：
访问：<a href="http://nas-ip:8080/hls/my_stream/my_stream.m3u8">http://nas-ip:8080/hls/my_stream/my_stream.m3u8</a>
VLC 设置：
网络缓存：500ms（工具 &gt; 首选项 &gt; 输入/编解码器）
禁用硬件解码（工具 &gt; 首选项 &gt; 视频）</p>
<ol start="6">
<li>排查卡顿和连接失败</li>
</ol>
<p>OBS 推流：
检查日志：帮助 &gt; 日志文件 &gt; 查看当前日志。
确认码率稳定，无掉帧。</p>
<p>Nginx 日志：</p>
<pre><code class="hljs lang-stata">docker exec nginx-rtmp 
<span class="hljs-keyword">cat</span> /<span class="hljs-keyword">var</span>/<span class="hljs-keyword">log</span>/nginx/{access,<span class="hljs-keyword">error</span>}.<span class="hljs-keyword">log</span></code></pre><p>搜索 publish、play 或 hls 相关错误。
NAS 性能：</p>
<pre><code class="hljs lang-awk">docker stats nginx-rtmp
df -h <span class="hljs-regexp">/share/</span>homes<span class="hljs-regexp">/nginx-rtmp/</span>hls</code></pre><p>若 CPU 高，降低比特率（1000 kbps）。
网络：
确认端口开放：</p>
<pre><code class="hljs lang-angelscript">telnet nas-ip <span class="hljs-number">1935</span>
telnet nas-ip <span class="hljs-number">8080</span></code></pre><p>检查路由器端口转发：1935、8080 到 NAS 内网 IP。</p>
<pre><code class="hljs lang-ebnf"><span class="hljs-attribute">nslookup your-nas-domain</span></code></pre><p>HLS 优化：
调整 hls_fragment（1s）、hls_playlist_length（4s）。
确保 /tmp/hls 权限：docker exec nginx-rtmp chmod -R 777 /tmp/hls</p>
<ol start="7">
<li>验证直播平台</li>
</ol>
<p>打开直播平台客户端，确认直播间画面。
若无画面，重新获取 RTMP 地址，更新 push 指令：</p>
<pre><code class="hljs lang-maxima"><span class="hljs-built_in">push</span> rtmp://<span class="hljs-built_in">push</span>.<span class="hljs-built_in">example</span>.com/live/your_stream_key;</code></pre><p>ps： 小红书直播平台需要将两个地址拼接如</p>
<pre><code class="hljs lang-sas">push rtmp://live-push.xhscdn.com/live/1234567890123456789?txSecret=123456789123456789123456789123456789<span class="hljs-variable">&amp;txTime</span>=68A08DCV<span class="hljs-variable">&amp;txDelayTime</span>=0<span class="hljs-variable">&amp;redExpire</span>=1234567890<span class="hljs-variable">&amp;vendor</span>=tencent;</code></pre><ol start="8">
<li>调试信息
收集以下信息以进一步排查：</li>
</ol>
<p>OBS 日志（推流状态、错误）。
Nginx 日志（access.log、error.log）。
HLS 目录内容（ls -l /share/homes/nginx-rtmp/hls/my_stream）。
VLC 日志（工具 &gt; 消息，调试模式）。
直播平台画面状态。
NAS 型号、网络配置（IP、DDNS、端口）。</p>
<p>总结
通过优化 OBS 推流（低比特率、关键帧间隔）、Nginx 配置（HLS 参数、资源限制）和网络设置（端口、带宽），可解决画面卡顿和连接失败问题。HLS 拉流（<a href="http://nas-ip:8080/hls/my_stream/my_stream.m3u8%EF%BC%89%E6%AF%94">http://nas-ip:8080/hls/my_stream/my_stream.m3u8）比</a> RTMP 更稳定，推荐优先测试。</p>

            ]]></description>
            <pubDate>Sat, 09 Aug 2025 14:16:34 GMT</pubDate>
            <guid>https://587v5.com/post/lv-lian-NAS-bu-shu-nginx-zhuan-fa-zhi-bo-liu-，-ti-gong-xiao-hong-shu-、-dou-yin-deng-zhi-bo.html</guid>
        </item>
        <item>
            <title>npx tailwindcss init 出现tailwind: not found</title>
            <link>https://587v5.com/post/npx tailwindcss init chu-xian-tailwind: not found.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-1aa">npx tailwindcss init 出现tailwind: not found</a></li>
</ul>
</div><h3><a id="toc-1aa" class="anchor" href="#toc-1aa"></a>npx tailwindcss init 出现tailwind: not found</h3>
<pre><code class="hljs lang-angelscript">执行下面命令解决
npm install -D <span class="hljs-symbol">tailwindcss@</span><span class="hljs-number">3.4</span><span class="hljs-number">.17</span>
npx tailwindcss init</code></pre>
            ]]></description>
            <pubDate>Fri, 08 Aug 2025 02:19:36 GMT</pubDate>
            <guid>https://587v5.com/post/npx tailwindcss init chu-xian-tailwind: not found.html</guid>
        </item>
        <item>
            <title>.user.ini 作用和配置</title>
            <link>https://587v5.com/post/.user.ini zuo-yong-he-pei-zhi.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-468">.user.ini 作用和配置</a></li>
</ul>
</div><h3><a id="toc-468" class="anchor" href="#toc-468"></a>.user.ini 作用和配置</h3>
<p>.user.ini是php防跨站目录访问的文件配置，里面放的是你网站的文件夹路径地址。</p>
<p>目的是防止跨目录访问和文件跨目录读取。</p>
<p>配置文件都是放在根目录 .user.ini</p>
<p><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250806/upload_0be0bc0ea5b691f4ac8c3b0b250bbfd7" alt="image.png"></p>
<p>image</p>
<p>例如Bt面板创建后的格式如下：</p>
<p><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250806/upload_43638cfc4404a93105877a53882639c5" alt="image.png"></p>
<pre><code class="hljs lang-elixir"> open_basedir=<span class="hljs-regexp">/项目路径/</span><span class="hljs-symbol">:/tmp/</span><span class="hljs-symbol">:/proc/</span>   </code></pre><p>当做了目目录分离的时候需要把分离的目录都加进去，或者把共同的父目录写进去就表示包含旗下全部子目录可访问权限</p>
<p>，否则会提示找不到这个目录或者这个目录不可写的错误提示</p>
<pre><code class="hljs lang-arcade">open_basedir=<span class="hljs-regexp">/www/</span>wwwroot/:<span class="hljs-regexp">/tmp/</span>:<span class="hljs-regexp">/proc/</span></code></pre>
            ]]></description>
            <pubDate>Wed, 06 Aug 2025 10:20:24 GMT</pubDate>
            <guid>https://587v5.com/post/.user.ini zuo-yong-he-pei-zhi.html</guid>
        </item>
        <item>
            <title>css3磁吸立体卡片</title>
            <link>https://587v5.com/post/css3-ci-xi-li-ti-ka-pian.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-50d">磁吸立体卡片</a></li>
</ul>
</div><h3><a id="toc-50d" class="anchor" href="#toc-50d"></a>磁吸立体卡片</h3>
<p><img src="https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250725/upload_74bb7021ce8c5b08b8cb055612484e72" alt="录屏2025-07-25 09.gif"></p>
<pre><code class="hljs lang-xml"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"zh-CN"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>磁吸立体卡片 - @xiaoyierle<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
        * {
            <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">box-sizing</span>: border-box;
        }

        <span class="hljs-selector-tag">body</span> {
            <span class="hljs-attribute">font-family</span>: -apple-system, BlinkMacSystemFont, <span class="hljs-string">'Segoe UI'</span>, Roboto, sans-serif;
            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">linear-gradient</span>(<span class="hljs-number">135deg</span>, #e8e8e8 <span class="hljs-number">0%</span>, #d1d1d1 <span class="hljs-number">50%</span>, #c8c8c8 <span class="hljs-number">100%</span>);
            <span class="hljs-attribute">min-height</span>: <span class="hljs-number">100vh</span>;
            <span class="hljs-attribute">display</span>: flex;
            <span class="hljs-attribute">align-items</span>: center;
            <span class="hljs-attribute">justify-content</span>: center;
            <span class="hljs-attribute">padding</span>: <span class="hljs-number">20px</span>;
            <span class="hljs-attribute">overflow</span>: hidden;
        }

        <span class="hljs-comment">/* === 磁吸区域 === */</span>
        <span class="hljs-selector-class">.magnetic-area</span> {
            <span class="hljs-attribute">width</span>: <span class="hljs-number">600px</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">600px</span>;
            <span class="hljs-attribute">display</span>: flex;
            <span class="hljs-attribute">align-items</span>: center;
            <span class="hljs-attribute">justify-content</span>: center;
            <span class="hljs-attribute">position</span>: relative;
        }

        <span class="hljs-comment">/* === 卡片容器 === */</span>
        <span class="hljs-selector-class">.card</span> {
            <span class="hljs-attribute">width</span>: <span class="hljs-number">320px</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">450px</span>;
            <span class="hljs-attribute">perspective</span>: <span class="hljs-number">1000px</span>;
            <span class="hljs-attribute">cursor</span>: pointer;
            <span class="hljs-attribute">position</span>: relative;
            <span class="hljs-attribute">transition</span>: transform <span class="hljs-number">0.3s</span> <span class="hljs-built_in">cubic-bezier</span>(<span class="hljs-number">0.25</span>, <span class="hljs-number">0.46</span>, <span class="hljs-number">0.45</span>, <span class="hljs-number">0.94</span>);
            <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">drop-shadow</span>(<span class="hljs-number">0</span> <span class="hljs-number">25px</span> <span class="hljs-number">50px</span> rgba(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.15</span>));
        }

        <span class="hljs-selector-class">.card</span><span class="hljs-selector-pseudo">:hover</span> {
            <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">drop-shadow</span>(<span class="hljs-number">0</span> <span class="hljs-number">35px</span> <span class="hljs-number">70px</span> rgba(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.25</span>));
        }

        <span class="hljs-comment">/* === 扩展控制区域 === */</span>
        <span class="hljs-selector-class">.card-control-area</span> {
            <span class="hljs-attribute">position</span>: absolute;
            <span class="hljs-attribute">top</span>: -<span class="hljs-number">30px</span>;
            <span class="hljs-attribute">left</span>: -<span class="hljs-number">30px</span>;
            <span class="hljs-attribute">right</span>: -<span class="hljs-number">30px</span>;
            <span class="hljs-attribute">bottom</span>: -<span class="hljs-number">30px</span>;
            <span class="hljs-attribute">pointer-events</span>: all;
            <span class="hljs-attribute">z-index</span>: <span class="hljs-number">50</span>;
        }

        <span class="hljs-comment">/* === 卡片内容 === */</span>
        <span class="hljs-selector-class">.card-content</span> {
            <span class="hljs-attribute">position</span>: relative;
            <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>;
            <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">24px</span>;
            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">linear-gradient</span>(<span class="hljs-number">145deg</span>, #<span class="hljs-number">1</span>a1a1a, #<span class="hljs-number">000</span>);
            <span class="hljs-attribute">transform-style</span>: preserve-<span class="hljs-number">3</span>d;
            <span class="hljs-attribute">transition</span>: transform <span class="hljs-number">0.2s</span> <span class="hljs-built_in">cubic-bezier</span>(<span class="hljs-number">0.25</span>, <span class="hljs-number">0.46</span>, <span class="hljs-number">0.45</span>, <span class="hljs-number">0.94</span>);
            <span class="hljs-attribute">overflow</span>: hidden;
            <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.1</span>);
            <span class="hljs-attribute">box-shadow</span>: 
                inset <span class="hljs-number">0</span> <span class="hljs-number">1px</span> <span class="hljs-number">0</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.1</span>),
                inset <span class="hljs-number">0</span> -<span class="hljs-number">1px</span> <span class="hljs-number">0</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.5</span>);
            <span class="hljs-attribute">pointer-events</span>: all;
        }

        <span class="hljs-comment">/* 卡片纹理 */</span>
        <span class="hljs-selector-class">.card-content</span><span class="hljs-selector-pseudo">::before</span> {
            <span class="hljs-attribute">content</span>: <span class="hljs-string">''</span>;
            <span class="hljs-attribute">position</span>: absolute;
            <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">right</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">bottom</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">background</span>: 
                <span class="hljs-built_in">repeating-linear-gradient</span>(
                    <span class="hljs-number">45deg</span>,
                    transparent,
                    transparent <span class="hljs-number">1px</span>,
                    rgba(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.02</span>) <span class="hljs-number">1px</span>,
                    <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.02</span>) <span class="hljs-number">2px</span>
                );
            <span class="hljs-attribute">pointer-events</span>: none;
            <span class="hljs-attribute">z-index</span>: <span class="hljs-number">1</span>;
        }

        <span class="hljs-comment">/* === 图层样式 === */</span>
        <span class="hljs-selector-class">.card-layer</span> {
            <span class="hljs-attribute">position</span>: absolute;
            <span class="hljs-attribute">inset</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">display</span>: flex;
            <span class="hljs-attribute">align-items</span>: center;
            <span class="hljs-attribute">justify-content</span>: center;
            <span class="hljs-attribute">transition</span>: transform <span class="hljs-number">0.15s</span> <span class="hljs-built_in">cubic-bezier</span>(<span class="hljs-number">0.25</span>, <span class="hljs-number">0.46</span>, <span class="hljs-number">0.45</span>, <span class="hljs-number">0.94</span>);
        }

        <span class="hljs-comment">/* 背景图片 */</span>
        <span class="hljs-selector-class">.card-bg-image</span> {
            <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>;
            <span class="hljs-attribute">object-fit</span>: cover;
            <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">24px</span>;
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(-<span class="hljs-number">50px</span>) <span class="hljs-built_in">scale</span>(<span class="hljs-number">1.1</span>);
            <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">contrast</span>(<span class="hljs-number">1.2</span>) <span class="hljs-built_in">brightness</span>(<span class="hljs-number">0.9</span>) <span class="hljs-built_in">saturate</span>(<span class="hljs-number">0.8</span>);
            <span class="hljs-attribute">transition</span>: transform <span class="hljs-number">0.15s</span> <span class="hljs-built_in">cubic-bezier</span>(<span class="hljs-number">0.25</span>, <span class="hljs-number">0.46</span>, <span class="hljs-number">0.45</span>, <span class="hljs-number">0.94</span>);
        }

        <span class="hljs-comment">/* 文字样式 */</span>
        <span class="hljs-selector-class">.card-text</span> {
            <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
            <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">600</span>;
            <span class="hljs-attribute">text-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">8px</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.5</span>);
            <span class="hljs-attribute">letter-spacing</span>: <span class="hljs-number">0.5px</span>;
        }

        <span class="hljs-selector-class">.title</span> {
            <span class="hljs-attribute">align-items</span>: flex-end;
            <span class="hljs-attribute">justify-content</span>: flex-start;
            <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">28px</span> <span class="hljs-number">28px</span>;
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">20px</span>;
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(<span class="hljs-number">40px</span>);
        }

        <span class="hljs-selector-class">.code</span> {
            <span class="hljs-attribute">align-items</span>: flex-end;
            <span class="hljs-attribute">justify-content</span>: flex-end;
            <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span> <span class="hljs-number">28px</span> <span class="hljs-number">28px</span> <span class="hljs-number">0</span>;
            <span class="hljs-attribute">font-family</span>: <span class="hljs-string">'SF Mono'</span>, <span class="hljs-string">'Monaco'</span>, <span class="hljs-string">'Inconsolata'</span>, <span class="hljs-string">'Roboto Mono'</span>, monospace;
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">20px</span>; <span class="hljs-comment">/* 与title保持一致 */</span>
            <span class="hljs-attribute">font-weight</span>: <span class="hljs-number">600</span>; <span class="hljs-comment">/* 与title保持一致 */</span>
            <span class="hljs-attribute">color</span>: <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.9</span>); <span class="hljs-comment">/* 稍微提亮 */</span>
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(<span class="hljs-number">40px</span>);
        }

        <span class="hljs-comment">/* 图标样式 */</span>
        <span class="hljs-selector-class">.icon</span> {
            <span class="hljs-attribute">width</span>: <span class="hljs-number">32px</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">32px</span>;
            <span class="hljs-attribute">fill</span>: <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.9</span>);
            <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">drop-shadow</span>(<span class="hljs-number">0</span> <span class="hljs-number">2px</span> <span class="hljs-number">4px</span> rgba(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.3</span>));
            <span class="hljs-attribute">transition</span>: all <span class="hljs-number">0.2s</span> ease;
        }

        <span class="hljs-selector-class">.icon</span><span class="hljs-selector-pseudo">:hover</span> {
            <span class="hljs-attribute">fill</span>: <span class="hljs-number">#fff</span>; <span class="hljs-comment">/* 保持白色，不变蓝 */</span>
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">scale</span>(<span class="hljs-number">1.1</span>);
        }

        <span class="hljs-selector-class">.icon-top-right</span> {
            <span class="hljs-attribute">align-items</span>: flex-start;
            <span class="hljs-attribute">justify-content</span>: flex-end;
            <span class="hljs-attribute">padding</span>: <span class="hljs-number">28px</span>;
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(<span class="hljs-number">50px</span>);
            <span class="hljs-attribute">cursor</span>: pointer;
            <span class="hljs-attribute">z-index</span>: <span class="hljs-number">100</span>;
        }

        <span class="hljs-selector-class">.icon-top-right</span><span class="hljs-selector-pseudo">:hover</span> <span class="hljs-selector-class">.icon</span> {
            <span class="hljs-attribute">fill</span>: <span class="hljs-number">#fff</span>; <span class="hljs-comment">/* 保持白色 */</span>
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">scale</span>(<span class="hljs-number">1.2</span>);
        }

        <span class="hljs-comment">/* 二维码样式 */</span>
        <span class="hljs-selector-class">.qr-code</span> {
            <span class="hljs-attribute">width</span>: <span class="hljs-number">120px</span>;
            <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>;
            <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">12px</span>;
            <span class="hljs-attribute">border</span>: <span class="hljs-number">3px</span> solid <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.9</span>);
            <span class="hljs-attribute">box-shadow</span>: 
                <span class="hljs-number">0</span> <span class="hljs-number">8px</span> <span class="hljs-number">25px</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.3</span>),
                inset <span class="hljs-number">0</span> <span class="hljs-number">1px</span> <span class="hljs-number">0</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.8</span>);
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(<span class="hljs-number">80px</span>);
            <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">drop-shadow</span>(<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">20px</span> rgba(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.4</span>));
            <span class="hljs-attribute">animation</span>: qrCodeFloat <span class="hljs-number">4s</span> ease-in-out infinite;
        }

        <span class="hljs-keyword">@keyframes</span> qrCodeFloat {
            0%, 100% { 
                <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(<span class="hljs-number">80px</span>) <span class="hljs-built_in">scale</span>(<span class="hljs-number">1</span>);
                <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">drop-shadow</span>(<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">20px</span> rgba(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.4</span>));
            }
            50% { 
                <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateZ</span>(<span class="hljs-number">80px</span>) <span class="hljs-built_in">scale</span>(<span class="hljs-number">1.05</span>);
                <span class="hljs-attribute">filter</span>: <span class="hljs-built_in">drop-shadow</span>(<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">25px</span> rgba(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.6</span>));
            }
        }

        <span class="hljs-comment">/* === 增强的光泽效果 === */</span>
        <span class="hljs-selector-class">.card-glare</span> {
            <span class="hljs-attribute">position</span>: absolute;
            <span class="hljs-attribute">width</span>: <span class="hljs-number">250px</span>; <span class="hljs-comment">/* 增大光圈 */</span>
            <span class="hljs-attribute">height</span>: <span class="hljs-number">250px</span>;
            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">radial-gradient</span>(
                circle, 
                rgba(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.6</span>) <span class="hljs-number">0%</span>,  <span class="hljs-comment">/* 增强中心亮度 */</span>
                <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.3</span>) <span class="hljs-number">20%</span>, <span class="hljs-comment">/* 增强内圈亮度 */</span>
                <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.1</span>) <span class="hljs-number">40%</span>,
                <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.05</span>) <span class="hljs-number">60%</span>,
                transparent <span class="hljs-number">80%</span>
            );
            <span class="hljs-attribute">mix-blend-mode</span>: overlay;
            <span class="hljs-attribute">opacity</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translate</span>(-<span class="hljs-number">50%</span>, -<span class="hljs-number">50%</span>) <span class="hljs-built_in">scale</span>(<span class="hljs-number">1.5</span>);
            <span class="hljs-attribute">transition</span>: opacity <span class="hljs-number">0.2s</span> ease;
            <span class="hljs-attribute">pointer-events</span>: none;
            <span class="hljs-attribute">z-index</span>: <span class="hljs-number">15</span>;
            <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>;
        }

        <span class="hljs-comment">/* === 磁吸指示器 === */</span>
        <span class="hljs-selector-class">.magnetic-indicator</span> {
            <span class="hljs-attribute">position</span>: absolute;
            <span class="hljs-attribute">width</span>: <span class="hljs-number">6px</span>; <span class="hljs-comment">/* 稍微增大 */</span>
            <span class="hljs-attribute">height</span>: <span class="hljs-number">6px</span>;
            <span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.9</span>); <span class="hljs-comment">/* 改为白色 */</span>
            <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>;
            <span class="hljs-attribute">pointer-events</span>: none;
            <span class="hljs-attribute">opacity</span>: <span class="hljs-number">0</span>;
            <span class="hljs-attribute">transition</span>: opacity <span class="hljs-number">0.2s</span> ease;
            <span class="hljs-attribute">z-index</span>: <span class="hljs-number">20</span>;
        }

        <span class="hljs-selector-class">.magnetic-indicator</span><span class="hljs-selector-class">.active</span> {
            <span class="hljs-attribute">opacity</span>: <span class="hljs-number">1</span>;
            <span class="hljs-attribute">animation</span>: magneticPulse <span class="hljs-number">1s</span> ease-in-out infinite;
        }

        <span class="hljs-keyword">@keyframes</span> magneticPulse {
            0%, 100% { 
                <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">scale</span>(<span class="hljs-number">1</span>);
                <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0.7</span>); <span class="hljs-comment">/* 白色脉动 */</span>
            }
            50% { 
                <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">scale</span>(<span class="hljs-number">1.5</span>);
                <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">12px</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0</span>); <span class="hljs-comment">/* 增强脉动范围 */</span>
            }
        }

        <span class="hljs-comment">/* === 性能优化 === */</span>
        <span class="hljs-selector-class">.card-content</span>,
        <span class="hljs-selector-class">.card-layer</span>,
        <span class="hljs-selector-class">.card-bg-image</span> {
            <span class="hljs-attribute">will-change</span>: transform;
        }

        <span class="hljs-comment">/* === 响应式 === */</span>
        <span class="hljs-keyword">@media</span> (<span class="hljs-attribute">max-width:</span> <span class="hljs-number">480px</span>) {
            <span class="hljs-selector-class">.magnetic-area</span> {
                <span class="hljs-attribute">width</span>: <span class="hljs-number">400px</span>;
                <span class="hljs-attribute">height</span>: <span class="hljs-number">400px</span>;
            }

            <span class="hljs-selector-class">.card</span> {
                <span class="hljs-attribute">width</span>: <span class="hljs-number">280px</span>;
                <span class="hljs-attribute">height</span>: <span class="hljs-number">390px</span>;
            }

            <span class="hljs-selector-class">.title</span> {
                <span class="hljs-attribute">font-size</span>: <span class="hljs-number">18px</span>;
                <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">24px</span> <span class="hljs-number">24px</span>;
            }

            <span class="hljs-selector-class">.code</span> {
                <span class="hljs-attribute">font-size</span>: <span class="hljs-number">18px</span>;
                <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span> <span class="hljs-number">24px</span> <span class="hljs-number">24px</span> <span class="hljs-number">0</span>;
            }

            <span class="hljs-selector-class">.icon-top-right</span> {
                <span class="hljs-attribute">padding</span>: <span class="hljs-number">24px</span>;
            }

            <span class="hljs-selector-class">.icon</span> {
                <span class="hljs-attribute">width</span>: <span class="hljs-number">28px</span>;
                <span class="hljs-attribute">height</span>: <span class="hljs-number">28px</span>;
            }

            <span class="hljs-selector-class">.qr-code</span> {
                <span class="hljs-attribute">width</span>: <span class="hljs-number">100px</span>;
                <span class="hljs-attribute">height</span>: <span class="hljs-number">100px</span>;
            }
        }
    </span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"code-type"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"html"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"magnetic-area"</span>&gt;</span>
        <span class="hljs-comment">&lt;!-- 磁吸指示器 --&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"magnetic-indicator"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card"</span>&gt;</span>
            <span class="hljs-comment">&lt;!-- 扩展控制区域 --&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-control-area"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

            <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-content"</span>&gt;</span>
                <span class="hljs-comment">&lt;!-- 背景图片层 --&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-layer"</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-bg-image"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250725/upload_5d3f1e6e40a8b8d13a12564118a74207"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"xiaoyierle Background"</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

                <span class="hljs-comment">&lt;!-- 光泽效果层 --&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-glare"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

                <span class="hljs-comment">&lt;!-- 文字层 --&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-layer title"</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-text"</span>&gt;</span>@xiaoyierle<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-layer code"</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-text"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

                <span class="hljs-comment">&lt;!-- Home图标层 - 移到右上角 --&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-layer icon-top-right"</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-name">svg</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"icon"</span> <span class="hljs-attr">viewBox</span>=<span class="hljs-string">"0 0 24 24"</span>&gt;</span>
                        <span class="hljs-tag">&lt;<span class="hljs-name">path</span> <span class="hljs-attr">d</span>=<span class="hljs-string">"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"</span>/&gt;</span>
                    <span class="hljs-tag">&lt;/<span class="hljs-name">svg</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

                <span class="hljs-comment">&lt;!-- 二维码层 --&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-layer"</span>&gt;</span>
                    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"qr-code"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://personaltailor.oss-cn-beijing.aliyuncs.com/blog/20250725/upload_a7c8b6e5463f25daf54e35aebf1e7a5d"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"xiaoyierle QR Code"</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript">
        <span class="hljs-keyword">const</span> magneticArea = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.magnetic-area'</span>);
        <span class="hljs-keyword">const</span> card = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.card'</span>);
        <span class="hljs-keyword">const</span> content = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.card-content'</span>);
        <span class="hljs-keyword">const</span> controlArea = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.card-control-area'</span>);
        <span class="hljs-keyword">const</span> indicator = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.magnetic-indicator'</span>);
        <span class="hljs-keyword">const</span> homeIcon = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.icon-top-right'</span>);

        <span class="hljs-comment">// 获取所有图层</span>
        <span class="hljs-keyword">const</span> layers = {
            <span class="hljs-attr">title</span>: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.title'</span>),
            <span class="hljs-attr">code</span>: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.code'</span>),
            <span class="hljs-attr">iconTopRight</span>: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.icon-top-right'</span>),
            <span class="hljs-attr">qrCode</span>: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.qr-code'</span>),
            <span class="hljs-attr">bgImage</span>: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.card-bg-image'</span>),
            <span class="hljs-attr">glare</span>: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'.card-glare'</span>)
        };

        <span class="hljs-comment">// 配置参数</span>
        <span class="hljs-keyword">const</span> config = {
            <span class="hljs-comment">// 磁吸配置</span>
            <span class="hljs-attr">magneticStrength</span>: <span class="hljs-number">0.3</span>,
            <span class="hljs-attr">magneticRadius</span>: <span class="hljs-number">200</span>,

            <span class="hljs-comment">// 旋转配置</span>
            <span class="hljs-attr">maxRotate</span>: <span class="hljs-number">25</span>,
            <span class="hljs-attr">rotateMultiplier</span>: <span class="hljs-number">1.5</span>,

            <span class="hljs-comment">// 视差配置</span>
            <span class="hljs-attr">sensitivity</span>: {
                <span class="hljs-attr">text</span>: <span class="hljs-number">12</span>,
                <span class="hljs-attr">iconSmall</span>: <span class="hljs-number">16</span>,
                <span class="hljs-attr">qrCode</span>: <span class="hljs-number">20</span>,
                <span class="hljs-attr">background</span>: <span class="hljs-number">-8</span>
            }
        };

        <span class="hljs-keyword">let</span> isInMagneticField = <span class="hljs-literal">false</span>;
        <span class="hljs-keyword">let</span> isHovering = <span class="hljs-literal">false</span>;
        <span class="hljs-keyword">let</span> animationFrame;

        <span class="hljs-comment">// 计算距离</span>
        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getDistance</span>(<span class="hljs-params">x1, y1, x2, y2</span>) </span>{
            <span class="hljs-keyword">return</span> <span class="hljs-built_in">Math</span>.sqrt(<span class="hljs-built_in">Math</span>.pow(x2 - x1, <span class="hljs-number">2</span>) + <span class="hljs-built_in">Math</span>.pow(y2 - y1, <span class="hljs-number">2</span>));
        }

        <span class="hljs-comment">// 磁吸效果</span>
        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">applyMagneticEffect</span>(<span class="hljs-params">mouseX, mouseY</span>) </span>{
            <span class="hljs-keyword">const</span> areaRect = magneticArea.getBoundingClientRect();
            <span class="hljs-keyword">const</span> cardRect = card.getBoundingClientRect();

            <span class="hljs-keyword">const</span> areaCenterX = areaRect.left + areaRect.width / <span class="hljs-number">2</span>;
            <span class="hljs-keyword">const</span> areaCenterY = areaRect.top + areaRect.height / <span class="hljs-number">2</span>;

            <span class="hljs-keyword">const</span> cardCenterX = cardRect.left + cardRect.width / <span class="hljs-number">2</span>;
            <span class="hljs-keyword">const</span> cardCenterY = cardRect.top + cardRect.height / <span class="hljs-number">2</span>;

            <span class="hljs-keyword">const</span> distance = getDistance(mouseX, mouseY, areaCenterX, areaCenterY);

            <span class="hljs-keyword">if</span> (distance &lt; config.magneticRadius) {
                isInMagneticField = <span class="hljs-literal">true</span>;

                <span class="hljs-keyword">const</span> magneticForce = (config.magneticRadius - distance) / config.magneticRadius;
                <span class="hljs-keyword">const</span> pullStrength = magneticForce * config.magneticStrength;

                <span class="hljs-keyword">const</span> deltaX = (mouseX - cardCenterX) * pullStrength;
                <span class="hljs-keyword">const</span> deltaY = (mouseY - cardCenterY) * pullStrength;

                card.style.transform = <span class="hljs-string">`translate(<span class="hljs-subst">${deltaX}</span>px, <span class="hljs-subst">${deltaY}</span>px)`</span>;

                indicator.style.left = <span class="hljs-string">`<span class="hljs-subst">${mouseX - areaRect.left}</span>px`</span>;
                indicator.style.top = <span class="hljs-string">`<span class="hljs-subst">${mouseY - areaRect.top}</span>px`</span>;
                indicator.classList.add(<span class="hljs-string">'active'</span>);

            } <span class="hljs-keyword">else</span> {
                isInMagneticField = <span class="hljs-literal">false</span>;
                card.style.transform = <span class="hljs-string">'translate(0px, 0px)'</span>;
                indicator.classList.remove(<span class="hljs-string">'active'</span>);
            }
        }

        <span class="hljs-comment">// 更新卡片变换</span>
        <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">updateCardTransforms</span>(<span class="hljs-params">mouseX, mouseY</span>) </span>{
            <span class="hljs-keyword">if</span> (!isHovering) <span class="hljs-keyword">return</span>;

            <span class="hljs-keyword">const</span> rotateY = mouseX * config.maxRotate * config.rotateMultiplier;
            <span class="hljs-keyword">const</span> rotateX = -mouseY * config.maxRotate * config.rotateMultiplier;

            <span class="hljs-keyword">const</span> scale = <span class="hljs-number">1</span> + (<span class="hljs-built_in">Math</span>.abs(mouseX) + <span class="hljs-built_in">Math</span>.abs(mouseY)) * <span class="hljs-number">0.02</span>;

            content.style.transform = <span class="hljs-string">`rotateX(<span class="hljs-subst">${rotateX}</span>deg) rotateY(<span class="hljs-subst">${rotateY}</span>deg) scale(<span class="hljs-subst">${scale}</span>)`</span>;

            <span class="hljs-keyword">const</span> { sensitivity } = config;
            layers.title.style.transform = <span class="hljs-string">`translateZ(40px) translateX(<span class="hljs-subst">${mouseX * sensitivity.text}</span>px) translateY(<span class="hljs-subst">${mouseY * sensitivity.text}</span>px)`</span>;
            layers.code.style.transform = <span class="hljs-string">`translateZ(40px) translateX(<span class="hljs-subst">${mouseX * sensitivity.text}</span>px) translateY(<span class="hljs-subst">${mouseY * sensitivity.text}</span>px)`</span>;
            layers.iconTopRight.style.transform = <span class="hljs-string">`translateZ(50px) translateX(<span class="hljs-subst">${mouseX * sensitivity.iconSmall}</span>px) translateY(<span class="hljs-subst">${mouseY * sensitivity.iconSmall}</span>px)`</span>;
            layers.qrCode.style.transform = <span class="hljs-string">`translateZ(80px) translateX(<span class="hljs-subst">${mouseX * sensitivity.qrCode}</span>px) translateY(<span class="hljs-subst">${mouseY * sensitivity.qrCode}</span>px)`</span>;
            layers.bgImage.style.transform = <span class="hljs-string">`translateZ(-50px) scale(1.1) translateX(<span class="hljs-subst">${mouseX * sensitivity.background}</span>px) translateY(<span class="hljs-subst">${mouseY * sensitivity.background}</span>px)`</span>;
        }

        <span class="hljs-comment">// 全局鼠标移动事件</span>
        <span class="hljs-built_in">document</span>.addEventListener(<span class="hljs-string">'mousemove'</span>, (e) =&gt; {
            <span class="hljs-keyword">if</span> (animationFrame) {
                cancelAnimationFrame(animationFrame);
            }

            animationFrame = requestAnimationFrame(<span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
                applyMagneticEffect(e.clientX, e.clientY);

                <span class="hljs-keyword">if</span> (isHovering) {
                    <span class="hljs-keyword">const</span> cardRect = card.getBoundingClientRect();
                    <span class="hljs-keyword">const</span> x = e.clientX - cardRect.left;
                    <span class="hljs-keyword">const</span> y = e.clientY - cardRect.top;

                    <span class="hljs-keyword">const</span> { width, height } = cardRect;
                    <span class="hljs-keyword">const</span> mouseX = (x / width) - <span class="hljs-number">0.5</span>;
                    <span class="hljs-keyword">const</span> mouseY = (y / height) - <span class="hljs-number">0.5</span>;

                    updateCardTransforms(mouseX, mouseY);

                    layers.glare.style.left = <span class="hljs-string">`<span class="hljs-subst">${x}</span>px`</span>;
                    layers.glare.style.top = <span class="hljs-string">`<span class="hljs-subst">${y}</span>px`</span>;
                    layers.glare.style.opacity = <span class="hljs-string">'1'</span>;
                }
            });
        });

        <span class="hljs-comment">// 扩展控制区域鼠标事件</span>
        controlArea.addEventListener(<span class="hljs-string">'mouseenter'</span>, () =&gt; {
            isHovering = <span class="hljs-literal">true</span>;
        });

        controlArea.addEventListener(<span class="hljs-string">'mouseleave'</span>, () =&gt; {
            isHovering = <span class="hljs-literal">false</span>;

            <span class="hljs-keyword">if</span> (animationFrame) {
                cancelAnimationFrame(animationFrame);
            }

            content.style.transform = <span class="hljs-string">'rotateX(0deg) rotateY(0deg) scale(1)'</span>;
            layers.title.style.transform = <span class="hljs-string">'translateZ(40px)'</span>;
            layers.code.style.transform = <span class="hljs-string">'translateZ(40px)'</span>;
            layers.iconTopRight.style.transform = <span class="hljs-string">'translateZ(50px)'</span>;
            layers.qrCode.style.transform = <span class="hljs-string">'translateZ(80px)'</span>;
            layers.bgImage.style.transform = <span class="hljs-string">'translateZ(-50px) scale(1.1)'</span>;
            layers.glare.style.opacity = <span class="hljs-string">'0'</span>;
        });

        <span class="hljs-comment">// 卡片点击事件</span>
        card.addEventListener(<span class="hljs-string">'click'</span>, (e) =&gt; {
            <span class="hljs-comment">// 如果点击的是Home图标，不执行卡片点击</span>
            <span class="hljs-keyword">if</span> (e.target.closest(<span class="hljs-string">'.icon-top-right'</span>)) {
                <span class="hljs-keyword">return</span>;
            }

            <span class="hljs-comment">// 点击反馈效果</span>
            content.style.transform = <span class="hljs-string">'rotateX(0deg) rotateY(0deg) scale(0.95)'</span>;
            setTimeout(<span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
                content.style.transform = <span class="hljs-string">'rotateX(0deg) rotateY(0deg) scale(1)'</span>;
                <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'点击卡片'</span>);
            }, <span class="hljs-number">150</span>);
        });

        <span class="hljs-comment">// Home图标点击事件</span>
        homeIcon.addEventListener(<span class="hljs-string">'click'</span>, (e) =&gt; {
            e.stopPropagation(); <span class="hljs-comment">// 阻止事件冒泡</span>

            <span class="hljs-comment">// 图标点击效果</span>
            <span class="hljs-keyword">const</span> icon = homeIcon.querySelector(<span class="hljs-string">'.icon'</span>);
            icon.style.transform = <span class="hljs-string">'scale(0.9)'</span>;
            setTimeout(<span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
                icon.style.transform = <span class="hljs-string">'scale(1.1)'</span>;
                <span class="hljs-comment">// 打开Twitter页面</span>
                <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'点击卡片'</span>);
            }, <span class="hljs-number">100</span>);
        });

        <span class="hljs-comment">// 防止选中文字</span>
        card.addEventListener(<span class="hljs-string">'selectstart'</span>, (e) =&gt; {
            e.preventDefault();
        });

        <span class="hljs-comment">// 离开磁吸区域时重置</span>
        magneticArea.addEventListener(<span class="hljs-string">'mouseleave'</span>, () =&gt; {
            isInMagneticField = <span class="hljs-literal">false</span>;
            card.style.transform = <span class="hljs-string">'translate(0px, 0px)'</span>;
            indicator.classList.remove(<span class="hljs-string">'active'</span>);
        });
    </span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>

</code></pre>
            ]]></description>
            <pubDate>Fri, 25 Jul 2025 01:27:55 GMT</pubDate>
            <guid>https://587v5.com/post/css3-ci-xi-li-ti-ka-pian.html</guid>
        </item>
        <item>
            <title>苹果触控板变身电子秤，创意无限！</title>
            <link>https://587v5.com/post/ping-guo-chu-kong-ban-bian-shen-dian-zi-cheng-，-chuang-yi-wu-xian-！.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#toc-9ae">苹果触控板变身电子秤，创意无限！</a></li>
</ul>
</div><h1><a id="toc-9ae" class="anchor" href="#toc-9ae"></a>苹果触控板变身电子秤，创意无限！</h1>
<p>最近发现一个超级有趣的项目——TrackWeight！这位名叫Krish Shah的加拿大开发者竟然把MacBook的Force Touch触控板变成了一个数字称重器！通过利用触控板的压力传感器，这个macOS应用能将压力数据直接转换成重量，单位还是克，简直太神奇了！[捂脸]</p>
<p>项目用到了Takuto Nakamura的Open Multi-Touch Support库，获取触控板的详细压力数据。只要你的MacBook是2015年后的MacBook Pro或2016年后的MacBook，运行macOS 13.0+，就能体验这个“黑科技”。不过得注意，称重时需要手指轻触触控板，因为它靠电容感应来工作，金属物体还得垫块布或纸。</p>
<p>这个项目在GitHub上是开源的，MIT许可证随便折腾！虽然只是实验性质，但已经火遍网络，几天内就收获了2.6k星和百万浏览量！[震惊] 想试试的可以去GitHub看看源码，或者自己编译玩玩，感受一下MacBook的隐藏技能！</p>
<video width="320" height="240" controls> 
  <source src="https://github.com/user-attachments/assets/7eaf9e0b-3dec-4829-b868-f54a8fd53a84" type="video/mp4"> 
</video>

<p><a href="https://github.com/KrishKrosh/TrackWeight">项目链接</a></p>

            ]]></description>
            <pubDate>Wed, 23 Jul 2025 05:32:57 GMT</pubDate>
            <guid>https://587v5.com/post/ping-guo-chu-kong-ban-bian-shen-dian-zi-cheng-，-chuang-yi-wu-xian-！.html</guid>
        </item>
        <item>
            <title>微信小程序启动自动检测版本更新，检测到新版本则提示更新</title>
            <link>https://587v5.com/post/wei-xin-xiao-cheng-xu-qi-dong-zi-dong-jian-ce-ban-ben-geng-xin-，-jian-ce-dao-xin-ban-ben-ze-ti-shi-geng-xin.html</link>
            <description><![CDATA[
            <div class="toc"><ul>
<li><a href="#weixin">weixin</a></li>
<li><a href="#uniapp">uniapp</a></li>
</ul>
</div><p>UpdateManager 对象，用来管理更新，可通过 wx.getUpdateManager 接口获取实例</p>
<p>在app.js中的示例代码</p>
<h3><a id="weixin" class="anchor" href="#weixin"></a>weixin</h3>
<pre><code class="hljs lang-actionscript">onShow() {
    <span class="hljs-comment">// 获取小程序更新机制的兼容，由于更新的功能基础库要1.9.90以上版本才支持，所以此处要做低版本的兼容处理</span>
    <span class="hljs-keyword">if</span> (wx.canIUse(<span class="hljs-string">'getUpdateManager'</span>)) {
      <span class="hljs-comment">// wx.getUpdateManager接口，可以获知是否有新版本的小程序、新版本是否下载好以及应用新版本的能力，会返回一个UpdateManager实例</span>
      <span class="hljs-keyword">const</span> updateManager = wx.getUpdateManager()
      <span class="hljs-comment">// 检查小程序是否有新版本发布，onCheckForUpdate：当小程序向后台请求完新版本信息，会通知这个版本告知检查结果</span>
      updateManager.onCheckForUpdate(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> </span>{
        <span class="hljs-comment">// 请求完新版本信息的回调</span>
        <span class="hljs-keyword">if</span> (res.hasUpdate) {
          <span class="hljs-comment">// 检测到新版本，需要更新，给出提示</span>
          wx.showModal({
            title: <span class="hljs-string">'更新提示'</span>,
            content: <span class="hljs-string">'检测到新版本，是否下载新版本并重启小程序'</span>,
            success: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> </span>{
              <span class="hljs-keyword">if</span> (res.confirm) {
                downLoadAndUpdate(updateManager)
              } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (res.cancel) {
                <span class="hljs-comment">// 若用户点击了取消按钮，二次弹窗，强制更新，如果用户选择取消后不需要进行任何操作，则以下内容可忽略</span>
                wx.showModal({
                  title: <span class="hljs-string">'提示'</span>,
                  content: <span class="hljs-string">'本次版本更新涉及到新功能的添加，旧版本将无法正常使用'</span>,
                  showCancel: <span class="hljs-literal">false</span>, <span class="hljs-comment">// 隐藏取消按钮</span>
                  confirmText: <span class="hljs-string">'确认更新'</span>, <span class="hljs-comment">// 只保留更新按钮</span>
                  success: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(res)</span> </span>{
                    <span class="hljs-keyword">if</span> (res.confirm) {
                      downLoadAndUpdate(updateManager)
                    }
                  }
                })
              }
            }
          })
        }
      })
    } <span class="hljs-keyword">else</span> {
      <span class="hljs-comment">// 在最新版本客户端上体验小程序</span>
      wx.showModal({
        title: <span class="hljs-string">'提示'</span>,
        content: <span class="hljs-string">'当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试'</span>,
      })
    }
  },
   <span class="hljs-comment">// 下载小程序最新版本并重启</span>
  downLoadAndUpdate(updateManager){
    wx.showLoading()
    <span class="hljs-comment">// 静默下载更新小程序新版本，onUpdateReady：当新版本下载完成回调</span>
    updateManager.onUpdateReady(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> </span>{
      wx.hideLoading()
      <span class="hljs-comment">// applyUpdate：强制当前小程序应用上新版本并重启</span>
      updateManager.applyUpdate()
    })
    <span class="hljs-comment">// onUpdateFailed：当新版本下载失败回调</span>
    updateManager.onUpdateFailed(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> </span>{
      <span class="hljs-comment">// 下载新版本失败</span>
      wx.showModal({
        title: <span class="hljs-string">'已有新版本'</span>,
        content: <span class="hljs-string">'新版本已经上线了，请删除当前小程序，重新搜索打开'</span>,
      })
    })
  },
</code></pre><p>UpdateManager.applyUpdate() 强制小程序重启并使用新版本。在小程序新版本下载完成后（即收到 onUpdateReady 回调）调用。</p>
<p>UpdateManager.onCheckForUpdate(function listener)
监听向微信后台请求检查更新结果事件。微信在小程序每次启动（包括热启动）时自动检查更新，不需由开发者主动触发。</p>
<p>UpdateManager.onUpdateReady(function listener)
监听小程序有版本更新事件。客户端主动触发下载（无需开发者触发），下载成功后回调</p>
<p>UpdateManager.onUpdateFailed(function listener)
监听小程序更新失败事件。小程序有新版本，客户端主动触发下载（无需开发者触发），下载失败（可能是网络原因等）后回调</p>
<p>在体验码和开发版不能测试，可以使用添加编译的方式检测</p>
<h3><a id="uniapp" class="anchor" href="#uniapp"></a>uniapp</h3>
<pre><code class="hljs lang-javascript"><span class="hljs-keyword">const</span> updateManager = uni.getUpdateManager();

updateManager.onCheckForUpdate(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">res</span>) </span>{
  <span class="hljs-comment">// 请求完新版本信息的回调</span>
  <span class="hljs-built_in">console</span>.log(res.hasUpdate);
});

updateManager.onUpdateReady(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">res</span>) </span>{
  uni.showModal({
    <span class="hljs-attr">title</span>: <span class="hljs-string">'更新提示'</span>,
    <span class="hljs-attr">content</span>: <span class="hljs-string">'新版本已经准备好，是否重启应用？'</span>,
    success(res) {
      <span class="hljs-keyword">if</span> (res.confirm) {
        <span class="hljs-comment">// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启</span>
        updateManager.applyUpdate();
      }
    }
  });

});

updateManager.onUpdateFailed(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">res</span>) </span>{
  <span class="hljs-comment">// 新的版本下载失败</span>
});</code></pre>
            ]]></description>
            <pubDate>Thu, 17 Jul 2025 13:51:54 GMT</pubDate>
            <guid>https://587v5.com/post/wei-xin-xiao-cheng-xu-qi-dong-zi-dong-jian-ce-ban-ben-geng-xin-，-jian-ce-dao-xin-ban-ben-ze-ti-shi-geng-xin.html</guid>
        </item>
    </channel>
</rss>
