<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>NotionNext BLOG</title>
        <link>https://blog.ykxkykx.cn/</link>
        <description>这是一个由NotionNext生成的站点</description>
        <lastBuildDate>Sun, 19 May 2024 20:29:30 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2024, 游方</copyright>
        <item>
            <title><![CDATA[简单的网页数字变更动画实现]]></title>
            <link>https://blog.ykxkykx.cn/article/91657089</link>
            <guid>https://blog.ykxkykx.cn/article/91657089</guid>
            <pubDate>Fri, 13 Dec 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[通常情况下，数字在网页中的变化是直接转变为另一个值。而如果在数字转化的过程中，每次改变一点点，最终转变为另一个值，会让干硬的网页变得更加生动一点。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-a2fb2b51ca62431e8334079632c5f36b"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-95fe12c3695e48fdbe5f20e613146621" data-id="95fe12c3695e48fdbe5f20e613146621"><span><div id="95fe12c3695e48fdbe5f20e613146621" class="notion-header-anchor"></div><a class="notion-hash-link" href="#95fe12c3695e48fdbe5f20e613146621" title="分析拆解"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">分析拆解</span></span></h3><div class="notion-text notion-block-d479951d9b474112a1bdf2df30a4a127">数字变更的整个周期，主要分为三个状态。</div><ol start="1" class="notion-list notion-list-numbered notion-block-101620ee826e475184a54829e9bd4bff"><li>数字的初始状态（即原始值</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-4cc4192108e64c5ca3dd4d90649e6406"><li>数字变化中的状态（原始值到新赋值之间的变动</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-313b308faaab4cd59bcb42aba9f90f28"><li>数字的结束状态（即新赋值</li></ol><div class="notion-text notion-block-91221fe7284d469298f34e13fcea6f64">状态的变化可能性</div><ol start="1" class="notion-list notion-list-numbered notion-block-c13ddf5e750a4f8d984bb96956a2e445"><li>数字一次性由少变到多，或者由多变到少</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-7bb7482328fe4c868d147c3b12b59962"><li>数字变化状态中，多次改变结束状态的值</li></ol><blockquote class="notion-quote notion-block-d90ad134ff3247edbc7e2c873d695eda"><div>这里解释下两种变化可能性，第一种就是说，数字的变化从少到多或者从多到少，都是一次性变化，中间不会有任何干扰。而第二种，打个比方，初始值为1，新赋值为10，数字在从1到10的渐变中，还没有变化完全，仅仅变到了7的时候，就被用户再一次改变了新赋值为5或者20（即可能比第一个新赋值低，也可能高）。这个时候，应该顺应此时已经变化到的数值7，以7为起点，向着5或者20去渐增或者渐减。不然，重新以1为起点开始向5或者20进行变化，就会有违和感。而顺应已经变化到的值进行变化，即便中途进行了再多次数值变更，整体的变化仍是流畅自然的。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-c820d5f70afa4f5b8c7556f4982041c1" data-id="c820d5f70afa4f5b8c7556f4982041c1"><span><div id="c820d5f70afa4f5b8c7556f4982041c1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c820d5f70afa4f5b8c7556f4982041c1" title="代码实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">代码实现</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3ed2d3adcc3f40d397c63f46091cc9ba" data-id="3ed2d3adcc3f40d397c63f46091cc9ba"><span><div id="3ed2d3adcc3f40d397c63f46091cc9ba" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3ed2d3adcc3f40d397c63f46091cc9ba" title="注意事项"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">注意事项</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-32d086646fea4a47a7a6d374957348e0"><li>进行变化的数值变量，本身不能是一个单纯的基本变量，而应该存储在一个对象中。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-31229b2f424542d8ae38855e2b23724e"><li>此方法需要一个map来进行临时的计时器数据变量保存</li></ol><div class="notion-blank notion-block-2c802d68e8ee4beb8ae3af0dfd41e8de"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[cesium超速入门总结]]></title>
            <link>https://blog.ykxkykx.cn/article/d8b922e0</link>
            <guid>https://blog.ykxkykx.cn/article/d8b922e0</guid>
            <pubDate>Mon, 16 Dec 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[由于工作原因，做了一些有关 cesium 的三维地图开发。基于我所用到的功能，于此做一个入门总结，并记录下曾踩下的坑。初学者可依照以下整个完整流程，复现功能内容。做此记录时，cesium 版本为 ^1.64.0]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-b05740311f8442abb670101da2fbf6fc"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-60fd8253fe154d3bae9058b6c4d8b368">由于工作原因，做了一些有关 <code class="notion-inline-code">cesium</code> 的三维地图开发。基于我所用到的功能，于此做一个入门总结，并记录下曾踩下的坑。初学者可依照以下整个完整流程，复现功能内容。做此记录时，<code class="notion-inline-code">cesium</code> 版本为 <code class="notion-inline-code">^1.64.0</code></div><div class="notion-text notion-block-e08133589bb24a6ea734ef85d65eab0e"><em>注：这里虽然利用了 </em><code class="notion-inline-code"><em>npm</em></code><em> 或 </em><code class="notion-inline-code"><em>yarn</em></code><em> 来快速安装 </em><code class="notion-inline-code"><em>cesium</em></code><em> ，但实际的demo只需</em><em><b>直接引用文件</b></em><em>，不需要打包</em></div><hr class="notion-hr notion-block-f32bb1c5c09449529ed6cc5b2604ad0b"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-6b4a980114324f51bc8eddb23da0e9ce" data-id="6b4a980114324f51bc8eddb23da0e9ce"><span><div id="6b4a980114324f51bc8eddb23da0e9ce" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6b4a980114324f51bc8eddb23da0e9ce" title="测试用demo路径结构描述"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">测试用demo路径结构描述</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-0af90627a6804d0986f71666dd77a465" data-id="0af90627a6804d0986f71666dd77a465"><span><div id="0af90627a6804d0986f71666dd77a465" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0af90627a6804d0986f71666dd77a465" title="准备工作"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">准备工作</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-5afa33bfde064d94814adfdb67917011" data-id="5afa33bfde064d94814adfdb67917011"><span><div id="5afa33bfde064d94814adfdb67917011" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5afa33bfde064d94814adfdb67917011" title="开发环境"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">开发环境</span></span></h4><div class="notion-text notion-block-accd194a29e94ce78aeacb167cacf672">建议使用 VSCode 进行开发，并安装插件 <code class="notion-inline-code">Live Server</code>，用于启动此 <code class="notion-inline-code">index.html</code> 文件</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-d4c72a166aa446618ec4302fd2fec9d8" data-id="d4c72a166aa446618ec4302fd2fec9d8"><span><div id="d4c72a166aa446618ec4302fd2fec9d8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d4c72a166aa446618ec4302fd2fec9d8" title="安装cesium"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装cesium</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-097e6ad955d44907955070786a54ba28" data-id="097e6ad955d44907955070786a54ba28"><span><div id="097e6ad955d44907955070786a54ba28" class="notion-header-anchor"></div><a class="notion-hash-link" href="#097e6ad955d44907955070786a54ba28" title="index.html文件初始化"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">index.html文件初始化</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-edc8e215ddf7448ca71d5baf27ef2189" data-id="edc8e215ddf7448ca71d5baf27ef2189"><span><div id="edc8e215ddf7448ca71d5baf27ef2189" class="notion-header-anchor"></div><a class="notion-hash-link" href="#edc8e215ddf7448ca71d5baf27ef2189" title="初始界面预览"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>初始界面预览</b></span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-056c305deed447d0927d2f2a44be2fa1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F10e51cf9-68b9-4e15-a66f-379815e4afe6%2F3cc9f566-409f-4b68-b645-790887b5b55d%2FUntitled.png?table=block&amp;id=056c305d-eed4-47d0-927d-2f2a44be2fa1&amp;t=056c305d-eed4-47d0-927d-2f2a44be2fa1&amp;width=2928&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-dedda3a1f5054884a3b2936624acf8e1" data-id="dedda3a1f5054884a3b2936624acf8e1"><span><div id="dedda3a1f5054884a3b2936624acf8e1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dedda3a1f5054884a3b2936624acf8e1" title="常用初始化配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">常用初始化配置</span></span></h3><div class="notion-text notion-block-fc9ef8339f6640dfb8e7c9354cb57993">以下内容不会给出完整代码，但会给出完整核心代码片段，读者对照初始化 <code class="notion-inline-code">index.html</code> 自行增添或者更改即可运行，若出现误差，可尝试把 <code class="notion-inline-code">cesium</code> 版本调整到 <code class="notion-inline-code">^1.64.0</code>。以下 <code class="notion-inline-code">js</code> 代码均直接在 <code class="notion-inline-code">script</code> 标签全局命名空间中出现。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-f653d9a6ec4548668fd83109bf0841fd" data-id="f653d9a6ec4548668fd83109bf0841fd"><span><div id="f653d9a6ec4548668fd83109bf0841fd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f653d9a6ec4548668fd83109bf0841fd" title="隐藏界面小控件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">隐藏界面小控件</span></span></h4><div class="notion-text notion-block-596428dbb6bf4068bb2e100f6420f3ae">通过初试配置，将界面上默认显示的控件隐藏，以便进行自定义</div><div class="notion-text notion-block-bc53c4e4d039421b9354d665c6818c37">仅仅是如此设置，底部还剩一段图片加文字信息，这里可以通过 <code class="notion-inline-code">css</code> 手动隐藏。在 <code class="notion-inline-code">style</code> 中添加如下代码。</div><div class="notion-text notion-block-33a047cf5e4a4a02903090b274c97f73">如此，一个干净完整的地球便出现了</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1cc686137ac1472bab3e0e04f14b9c0c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F10e51cf9-68b9-4e15-a66f-379815e4afe6%2F56e3f1c7-3483-48d9-bc4d-66090c156fce%2FUntitled.png?table=block&amp;id=1cc68613-7ac1-472b-ab3e-0e04f14b9c0c&amp;t=1cc68613-7ac1-472b-ab3e-0e04f14b9c0c&amp;width=2924&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-5adf13a17ee24d698a585175d8946bb1" data-id="5adf13a17ee24d698a585175d8946bb1"><span><div id="5adf13a17ee24d698a585175d8946bb1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5adf13a17ee24d698a585175d8946bb1" title="去掉光圈"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">去掉光圈</span></span></h4><div class="notion-text notion-block-7cfe56ef36454c9d9c7ee21e726a08c4">如果有人觉得地球外层的光圈太扎眼，可以通过以下方式去除</div><div class="notion-text notion-block-5867f9c57d2741e59488eca0778f6b1b">效果如下</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-7e51fa1d5f7144018dbf368222240133"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F10e51cf9-68b9-4e15-a66f-379815e4afe6%2Fba1e0734-2f5a-4abf-8d76-49d12af0a241%2FUntitled.png?table=block&amp;id=7e51fa1d-5f71-4401-8dbf-368222240133&amp;t=7e51fa1d-5f71-4401-8dbf-368222240133&amp;width=2926&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-257fb21e7a5646aba2799c3ad148943f" data-id="257fb21e7a5646aba2799c3ad148943f"><span><div id="257fb21e7a5646aba2799c3ad148943f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#257fb21e7a5646aba2799c3ad148943f" title="聚焦框和信息框的隐藏"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">聚焦框和信息框的隐藏</span></span></h4><div class="notion-text notion-block-a09566f4ccfa413a9ae98bd575ddb0d4">默认情况下，如果左键双击 <code class="notion-inline-code">cesium</code> 地图上的实体内容，<code class="notion-inline-code">camera</code> 视角会自动聚焦过去，并显示自带的聚焦框以及实体的信息框</div><div class="notion-blank notion-block-663b8e36017a4ddeba4933dc368d25ad"> </div><div class="notion-text notion-block-a2d4ee2873034d579b3b1223243f174f">默认不显示聚焦框和信息框</div><div class="notion-text notion-block-1bf10d0b0f89494d84c145cd152d11f9">取消默认的左键双击实体效果，便于自定义其他交互</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-d9219fabf6b84cfbbcb3c4737e5ab38c" data-id="d9219fabf6b84cfbbcb3c4737e5ab38c"><span><div id="d9219fabf6b84cfbbcb3c4737e5ab38c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d9219fabf6b84cfbbcb3c4737e5ab38c" title="地形加载"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">地形加载</span></span></h4><div class="notion-text notion-block-0554dac0adc74352af3f28b633ca666f">初始化时默认加载地形</div><div class="notion-text notion-block-adda4b432fa04504af0cbc77fb97ec0d">后期手动添加地形</div><div class="notion-text notion-block-395fe08ffef64209adcfb12e736cef25"><em><b>坑</b></em>：此方法加载地形时，加载的是 <code class="notion-inline-code">cesium</code> 自己发布的地形服务。一旦 <code class="notion-inline-code">cesium</code> 官方版本更新，则会导致地形加载失败（默认加载的底图也是如此）。浏览器控制台会报Token过期的错，但是实际上就算你更改了 <code class="notion-inline-code">Cesium.Ion.defaultAccessToken</code> 的值仍然不能解决此问题。正确操作是，<b>升级项目的 </b><code class="notion-inline-code"><b>cesium</b></code><b> 版本</b>即可。最好的方法是，发布自己的地形以及底图服务，并加载。这样就不会受到 <code class="notion-inline-code">cesium</code> 版本更新的影响。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-3ba6fbe3f4854a3b9a2a4f8a4cf3d5d8" data-id="3ba6fbe3f4854a3b9a2a4f8a4cf3d5d8"><span><div id="3ba6fbe3f4854a3b9a2a4f8a4cf3d5d8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3ba6fbe3f4854a3b9a2a4f8a4cf3d5d8" title="底图服务加载"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">底图服务加载</span></span></h4><div class="notion-text notion-block-bd1ef23afbb145f29911790c80a5a502"><code class="notion-inline-code">imageryProvider</code> 除了下面示例的 <code class="notion-inline-code">ArcGisMapServerImageryProvider</code> 以外，还有分别用于加载其他不同框架底图服务的构造函数，具体内容，可在<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://cesium.com/docs/cesiumjs-ref-doc/">官方文档</a>中搜索 <code class="notion-inline-code">imageryProvider</code> 查询。</div><div class="notion-text notion-block-a4c60b762fc641e0b7ff7bfa803cbd43">
初始化默认加载其他底图</div><div class="notion-text notion-block-22a545d634f74ed0831118eb325d6573">后期手动添加底图</div><div class="notion-text notion-block-aa2f39e708f94c6e98b981d4fcdead0f"><em><b>注</b></em>：此坑与地形等同</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-94911cad935544afbd9e26f9b03512f3" data-id="94911cad935544afbd9e26f9b03512f3"><span><div id="94911cad935544afbd9e26f9b03512f3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#94911cad935544afbd9e26f9b03512f3" title="视角转换"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">视角转换</span></span></h4><div class="notion-text notion-block-bf328d571a734715960f5466d9bae0fa"><code class="notion-inline-code">camera</code> 相关的所有操作在<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://cesium.com/docs/cesiumjs-ref-doc/Camera.html?classFilter=camera">此处</a>查看</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1b0bf51ba4e64186ab979452b596284b" data-id="1b0bf51ba4e64186ab979452b596284b"><span><div id="1b0bf51ba4e64186ab979452b596284b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b0bf51ba4e64186ab979452b596284b" title="较为常用功能"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">较为常用功能</span></span></h3><div class="notion-text notion-block-0c165b1f681942699c070edbf0aa893d">以下内容，涉及到具体私人发布使用的服务部分，只给出最为核心的代码片段，如何实现。需要读者<b>自行发布或寻找服务</b>进行测试</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4f57d94145d3474cb27ce85922531243" data-id="4f57d94145d3474cb27ce85922531243"><span><div id="4f57d94145d3474cb27ce85922531243" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4f57d94145d3474cb27ce85922531243" title="geojson的加载使用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">geojson的加载使用</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-5af305292a434d209f18c4e07894c02b" data-id="5af305292a434d209f18c4e07894c02b"><span><div id="5af305292a434d209f18c4e07894c02b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5af305292a434d209f18c4e07894c02b" title="针对高精度倾斜摄影加载及显示效果优化"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">针对高精度倾斜摄影加载及显示效果优化</span></span></h4><div class="notion-text notion-block-1b0c0054d9d94366b3b3c44dd6278fb3">倾斜摄影数据以 <code class="notion-inline-code">3dtile</code> 的形式加载出来，通常情况下，只需要有 <code class="notion-inline-code">url</code> 就足够了。以下参数是由于倾斜摄影数据总数据太大，清晰度过高，从而调节参数进行性能优化。这不是一个通用的解决方案，但可以以此为参考。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-924a6ee2f29f4491a0f03bc12abf890a" data-id="924a6ee2f29f4491a0f03bc12abf890a"><span><div id="924a6ee2f29f4491a0f03bc12abf890a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#924a6ee2f29f4491a0f03bc12abf890a" title="限制camera高度的上下限"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">限制camera高度的上下限</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-1c14f7fc53d34013bca60ebdc3a3c859" data-id="1c14f7fc53d34013bca60ebdc3a3c859"><span><div id="1c14f7fc53d34013bca60ebdc3a3c859" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c14f7fc53d34013bca60ebdc3a3c859" title="事件绑定"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">事件绑定</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2310cd3abe1f4b0e811bf2b8634a80e3" data-id="2310cd3abe1f4b0e811bf2b8634a80e3"><span><div id="2310cd3abe1f4b0e811bf2b8634a80e3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2310cd3abe1f4b0e811bf2b8634a80e3" title="通过Cartesian2获得经纬度的方式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">通过Cartesian2获得经纬度的方式</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-a62ef827714841378dd93040c3e729ec" data-id="a62ef827714841378dd93040c3e729ec"><span><div id="a62ef827714841378dd93040c3e729ec" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a62ef827714841378dd93040c3e729ec" title="地图二三维转化"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">地图二三维转化</span></span></h4><div class="notion-blank notion-block-54ba8500848d44d29039d4385cd0a786"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[复制页面内容添加版权声明]]></title>
            <link>https://blog.ykxkykx.cn/article/8181269a</link>
            <guid>https://blog.ykxkykx.cn/article/8181269a</guid>
            <pubDate>Fri, 18 Jan 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[现如今，如果你要直接复制简书、掘金、CSDN 等网站上文章的内容，当你粘贴的时候就会发现，复制的文字中多了几行版权信息。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-7ab392e166b9446982f744a015b7a480"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-7ae97898359e438aa20282f5103071f0">现如今，如果你要直接复制简书、掘金、CSDN 等网站上文章的内容，当你粘贴的时候就会发现，复制的文字中多了几行版权信息。</div><div class="notion-text notion-block-a79e580eed4d4198b0db1705fcf8b559">通常是这样的内容：</div><blockquote class="notion-quote notion-block-996d8d5827614e1a81bca86736047730"><div>作者：【作者名】
链接：【当前网页链接】
来源：【站点名】
著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处</div></blockquote><hr class="notion-hr notion-block-9cb55e3fd9084b7b8c61afb25c461c55"/><div class="notion-text notion-block-22c380740501494999fb2b118fd892ac">实现方式如下：</div><hr class="notion-hr notion-block-c4736cf87ee74e9b8ea4605ab84180df"/><div class="notion-text notion-block-d3528c56362045b782f877ee9b759b26">参考资料：</div><blockquote class="notion-quote notion-block-0dc422d184eb4ec0a1f172ec771fb215"><div><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://developer.mozilla.org/zh-CN/docs/Web/Events/copy">MDN: copy</a>
<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://developer.mozilla.org/zh-CN/docs/Web/API/Selection">MDN: Selection</a></div></blockquote><div class="notion-blank notion-block-ea75b8409276445ea61d8933c091147f"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[费曼技巧问答式总结]]></title>
            <link>https://blog.ykxkykx.cn/article/92d2159c</link>
            <guid>https://blog.ykxkykx.cn/article/92d2159c</guid>
            <pubDate>Wed, 16 Jan 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[费曼技巧的含义及使用方式]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-c39ec5c01516424d8680082ffd19ba3e"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-5d90c326eb2242b9a96174a5be56a199" data-id="5d90c326eb2242b9a96174a5be56a199"><span><div id="5d90c326eb2242b9a96174a5be56a199" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5d90c326eb2242b9a96174a5be56a199" title="费曼技巧是什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">费曼技巧是什么？</span></span></h4><div class="notion-text notion-block-056599b9a24a4be197dd7572ace7808e">费曼技巧，是一种通过模拟教育他人，来判断自己是否真的掌握了某项知识的学习技巧。</div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-e40cf2e6cf104ddbb99f8912547cf581" data-id="e40cf2e6cf104ddbb99f8912547cf581"><span><div id="e40cf2e6cf104ddbb99f8912547cf581" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e40cf2e6cf104ddbb99f8912547cf581" title="为什么费曼技巧有着这样的作用？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">为什么费曼技巧有着这样的作用？</span></span></h4><div class="notion-text notion-block-66eb93a20eaf455a908228dfe95eca39">因为费曼技巧符合大脑的认知规律。</div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-3ccc52ed2c544e17b4d59ffddb9d09aa" data-id="3ccc52ed2c544e17b4d59ffddb9d09aa"><span><div id="3ccc52ed2c544e17b4d59ffddb9d09aa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3ccc52ed2c544e17b4d59ffddb9d09aa" title="怎样具体应用费曼技巧？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">怎样具体应用费曼技巧？</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b26136791fb64371a943e2fe82801868"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F10e51cf9-68b9-4e15-a66f-379815e4afe6%2Fda2829e3-8fb8-4400-bc31-13fe0acd00ed%2FUntitled.png?table=block&amp;id=b2613679-1fb6-4371-a943-e2fe82801868&amp;t=b2613679-1fb6-4371-a943-e2fe82801868&amp;width=1288&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-1110bc8c9f774653a8c78631e3e96371" data-id="1110bc8c9f774653a8c78631e3e96371"><span><div id="1110bc8c9f774653a8c78631e3e96371" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1110bc8c9f774653a8c78631e3e96371" title="实践费曼技巧后，掌握知识的表现是什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实践费曼技巧后，掌握知识的表现是什么？</span></span></h4><div class="notion-text notion-block-c71cfb863c544d48b5cbbebcc7afb6cd">能够用极其简单具象的东西，来回答高度抽象的问题。</div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-49a0752982e94739b2b93fe441387df3" data-id="49a0752982e94739b2b93fe441387df3"><span><div id="49a0752982e94739b2b93fe441387df3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#49a0752982e94739b2b93fe441387df3" title="费曼技巧可以用来干什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">费曼技巧可以用来干什么？</span></span></h4><div class="notion-text notion-block-63deda10a5c04cbbab8efc92526fa7e4">学习任何知识，技能，深入理解其本质。</div><div class="notion-blank notion-block-59816c81ef4c4da2894578b5dac109a0"> </div><div class="notion-blank notion-block-a9e025a0afab4b5f8768a43d1f8d37b2"> </div><div class="notion-blank notion-block-d358a61166e1455b89a4d07c95025729"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[hexo博客实现url锚点与markdown分级标题同步]]></title>
            <link>https://blog.ykxkykx.cn/article/a82e8cf8</link>
            <guid>https://blog.ykxkykx.cn/article/a82e8cf8</guid>
            <pubDate>Tue, 19 Mar 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[有的网页页面，可以在页面滚动的时候，给 url 自动添加或者改变锚点，锚点内容即为当前页面正在显示的内容的分级标题。我希望自己的博客页面也能有这样的效果，这样的话，复制 url 的时候就可以带上锚点，打开后就能快速定位到需要查看的内容处。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-12cb3a04a6e341b384e5ae2eac006154"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-24242ca107f345919f2e9ee3c2a1166f" data-id="24242ca107f345919f2e9ee3c2a1166f"><span><div id="24242ca107f345919f2e9ee3c2a1166f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24242ca107f345919f2e9ee3c2a1166f" title="起因"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">起因</span></span></h4><div class="notion-text notion-block-86ad1748f9d44dce9afd9169218b92cb">有的网页页面，可以在页面滚动的时候，给 <code class="notion-inline-code">url</code> 自动添加或者改变锚点，锚点内容即为当前页面正在显示的内容的分级标题。我希望自己的博客页面也能有这样的效果，这样的话，复制 <code class="notion-inline-code">url</code> 的时候就可以带上锚点，打开后就能快速定位到需要查看的内容处。</div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-560dce589ec443eb916fc6f5e930fd10" data-id="560dce589ec443eb916fc6f5e930fd10"><span><div id="560dce589ec443eb916fc6f5e930fd10" class="notion-header-anchor"></div><a class="notion-hash-link" href="#560dce589ec443eb916fc6f5e930fd10" title="分析"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">分析</span></span></h4><div class="notion-text notion-block-b424ff3de3bf44b1be74c9c220d65598">要实现这个功能，做到以下两点就可以了</div><ol start="1" class="notion-list notion-list-numbered notion-block-c49bbe65bafd4b4f9587bc3e648d437f"><li>判断位于当前浏览器视口顶部的元素属于哪一个分级标题的内容</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-02cc720d77d94d969e774149dfeb8b2d"><li>将当前分级标题的 <code class="notion-inline-code">id</code> 名作为锚点添加或修改到 url 尾部</li></ol><div class="notion-text notion-block-c4d1a0ccc8b24a39be23b70797d10e7c">打开控制台，可以看到，hexo next 的主题，通过 markdown 渲染出的内容，包含在 <code class="notion-inline-code"><span class="notion-gray_background">class</span></code> 为 <code class="notion-inline-code">post-block</code> 的元素中。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-2b3715548d924d968439455e632d6570"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F10e51cf9-68b9-4e15-a66f-379815e4afe6%2Ffeffda90-4fc9-486f-bbf7-6aebdc5b46ee%2FUntitled.png?table=block&amp;id=2b371554-8d92-4d96-8439-455e632d6570&amp;t=2b371554-8d92-4d96-8439-455e632d6570&amp;width=2514&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-c35415c3d30a4b0eb118fc962124661b">而所有的分级标题渲染出来后，会依次对应 <code class="notion-inline-code">html</code> 的 <code class="notion-inline-code">h1</code> 到 <code class="notion-inline-code">h6</code> 标签，且 <code class="notion-inline-code">id</code> 名与标题等同。（不过空格会被替换为 - )</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1f32f5041b61418fa93117ed0a336dd7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F10e51cf9-68b9-4e15-a66f-379815e4afe6%2F18cdfc1f-34ce-4fe6-8e35-c278daeb60b6%2FUntitled.png?table=block&amp;id=1f32f504-1b61-418f-a931-17ed0a336dd7&amp;t=1f32f504-1b61-418f-a931-17ed0a336dd7&amp;width=2354&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-2176f8cad1d342d6a3c0902e4b29b8ee" data-id="2176f8cad1d342d6a3c0902e4b29b8ee"><span><div id="2176f8cad1d342d6a3c0902e4b29b8ee" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2176f8cad1d342d6a3c0902e4b29b8ee" title="实现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实现</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-803cad68e6cf4199a18d48b4368ce1e4" data-id="803cad68e6cf4199a18d48b4368ce1e4"><span><div id="803cad68e6cf4199a18d48b4368ce1e4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#803cad68e6cf4199a18d48b4368ce1e4" title="判断分级标题的内容"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">判断分级标题的内容</span></span></h4><div class="notion-text notion-block-c4384a9ddcac4635beab7c1db0afd397">我们可以通过 <code class="notion-inline-code">Element.getBoundingClientRect().top</code> 来获取一个 dom 元素的顶部与视口顶部的距离，如果得到一个负值，那么证明这个元素是在视口之上、或者正处于视口中。我们要的就是处于视口上的那个元素。获取它的 <code class="notion-inline-code">id</code> 即可。</div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-8ff5e9668e1b4864a8f50e9eda17df6a" data-id="8ff5e9668e1b4864a8f50e9eda17df6a"><span><div id="8ff5e9668e1b4864a8f50e9eda17df6a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8ff5e9668e1b4864a8f50e9eda17df6a" title="修改 URL，添加或者改变锚点内容"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">修改 URL，添加或者改变锚点内容</span></span></h4><div class="notion-text notion-block-a1d6f4d5f8f842e78fd9bf742010bed0">利用 HTML5 的历史记录 API，<code class="notion-inline-code">history.replaceState</code>，它可以修改当前历史记录项，改变 url 信息，但却不会引起 url 跳转。</div><h4 class="notion-h notion-h3 notion-h-indent-0 notion-block-07618ddf24374c88a928fd2aefa18195" data-id="07618ddf24374c88a928fd2aefa18195"><span><div id="07618ddf24374c88a928fd2aefa18195" class="notion-header-anchor"></div><a class="notion-hash-link" href="#07618ddf24374c88a928fd2aefa18195" title="代码"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">代码</span></span></h4></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>