├── .github ├── FUNDING.yml └── workflows │ └── npm-publish.yml ├── .gitignore ├── .hintrc ├── LICENSE ├── README.md ├── docs └── v2 │ ├── .gitignore │ ├── .nojekyll │ ├── Css │ └── vue.css │ ├── Docs │ ├── Customization │ │ ├── bookList.md │ │ ├── commentMd.md │ │ ├── config.md │ │ ├── fonticon.md │ │ ├── hook.md │ │ ├── links.md │ │ ├── loading.md │ │ ├── player.md │ │ ├── reprinted.md │ │ ├── rewrite.md │ │ └── statistical.md │ ├── GettingStarted │ │ ├── install.md │ │ ├── versionSwitch.md │ │ └── writtenForm.md │ └── changelog.md │ ├── Js │ ├── docsify.min.js │ └── search.min.js │ ├── README.md │ ├── index.html │ └── sidebar.md ├── easybe ├── 404.php ├── archive.php ├── comments.php ├── footer.php ├── functions.php ├── header.php ├── index.php ├── page.php ├── post.php ├── screenshot.png ├── script │ ├── article-code.11ac8a98.js │ ├── background-particles.e29c708f.js │ ├── background-ribbons.e7215c95.js │ ├── background-season.a0972c6c.js │ ├── banner-images.c6fef51a.js │ ├── circle-magic.489bf3d3.js │ ├── code-hljs.c783343d.js │ ├── com-after.763f9028.js │ ├── com-after.763f9028.js.gz │ ├── com-before.d59f2a5b.js │ ├── com-before.d59f2a5b.js.gz │ ├── day-night.2405df8b.js │ ├── gf-blink.11ba95cd.js │ ├── google-fonts.bc250a9d.js │ ├── iconfont.4d8182cd.js │ ├── mouse-bubble.dbf57e27.js │ ├── mouse-click.bd796115.js │ ├── mouse-mo.cd0eb2f5.js │ ├── mouse-mouse.13b346d6.js │ ├── nh-banner-animation.b1e06e50.js │ ├── owo-css.e7b022f1.js │ ├── owo-js.102751ad.js │ ├── page-article.ef0b9807.js │ ├── page-books.7573bb62.js │ ├── page-common-com-article.17d7553b.js │ ├── page-common-com-article.17d7553b.js.gz │ ├── page-home.72454154.js │ └── page-links.dd9c93a8.js ├── sidebar.php ├── simple-memory.css ├── simple-memory.js ├── simple-memory.js.gz └── style │ ├── background-particles.5ee14091.css │ ├── com-before.56837d37.css │ ├── com-before.56837d37.css.gz │ ├── day-night.1af8a50a.css │ ├── gf-blink.0cc7f6e2.css │ ├── gf-blink.0cc7f6e2.css.gz │ ├── google-fonts.66c39700.css │ ├── google-fonts.66c39700.css.gz │ ├── iconfont.cfd96386.css │ ├── mouse-mouse.5e68e4e5.css │ ├── nh-banner-animation.7ff7a955.css │ ├── owo-css.01842b6b.css │ ├── page-books.0865330e.css │ ├── page-common-com-article.d201bb8b.css │ ├── page-common-com-article.d201bb8b.css.gz │ └── page-links.6794df20.css ├── package-lock.json ├── package.json ├── pnpm-lock.yaml ├── postcss.config.js ├── src ├── components │ ├── articleDirectory │ │ └── articleDirectory.js │ ├── articleInfo │ │ └── articleInfo.js │ ├── articleSuffix │ │ └── articleSuffix.js │ ├── background │ │ ├── particles.js │ │ ├── ribbons.js │ │ └── season.js │ ├── banner │ │ └── banner.js │ ├── bannerImages │ │ └── bannerImages.js │ ├── blogIcon │ │ └── blogIcon.js │ ├── code │ │ ├── code.js │ │ └── lib │ │ │ └── hljs.js │ ├── comment │ │ ├── comment.js │ │ ├── commentTyping │ │ │ ├── commentTyping.js │ │ │ └── textareaCaretPosition.js │ │ └── owo │ │ │ └── owo.js │ ├── common │ │ ├── comAfter.js │ │ └── comBefore.js │ ├── config │ │ └── config.json5 │ ├── console │ │ └── console.js │ ├── dayNight │ │ └── dayNight.js │ ├── event │ │ └── event.js │ ├── footer │ │ └── footer.js │ ├── greenChannel │ │ └── greenChannel.js │ ├── imgBox │ │ └── imgBox.js │ ├── loading │ │ └── loading.js │ ├── mouse │ │ ├── bubble.js │ │ ├── click.js │ │ ├── mo.js │ │ └── mouse.js │ ├── postMeta │ │ └── postMeta.js │ ├── progress │ │ └── progress.js │ ├── rtMenu │ │ └── rtMenu.js │ ├── sidebar │ │ ├── lib │ │ │ ├── classie.js │ │ │ └── main4.js │ │ └── sidebar.js │ ├── status │ │ └── status.js │ └── title │ │ └── title.js ├── hooks │ ├── afterCode.js │ ├── afterLoading.js │ ├── beforeCode.js │ ├── beforeLoading.js │ └── dayNightControl.js ├── main.js ├── page │ ├── article.js │ ├── books.js │ ├── common │ │ └── com-article.js │ ├── home.js │ └── links.js ├── style │ ├── articleDirectory.css │ ├── articleSuffix.css │ ├── base.dark.css │ ├── books.css │ ├── customBtn.css │ ├── gf-blink.css │ ├── google-fonts.css │ ├── iconfont.css │ ├── links.css │ ├── menu_bubble.css │ ├── mouse.css │ ├── nhBannerAnimation.css │ ├── owo.scss │ ├── particles.css │ └── simple-memory.css ├── template │ ├── articleDirectory.html │ ├── articleSuffix.html │ ├── banner.html │ ├── books.html │ ├── dayNight.html │ ├── footer.html │ ├── links.html │ ├── particles.html │ ├── rtMenu.html │ ├── sidebar.html │ └── sidebarNav.html ├── typecho │ ├── 404.php │ ├── archive.php │ ├── comments.php │ ├── footer.php │ ├── functions.php │ ├── header.php │ ├── index.php │ ├── page.php │ ├── post.php │ ├── screenshot.png │ └── sidebar.php ├── utils │ ├── request.js │ └── tools.js └── vendor │ ├── circleMagic │ └── circleMagic.js │ ├── consoleText │ └── consoleText.js │ └── loading │ └── loading.js └── webpack.config.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | #custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | 14 | custom: https://images.cnblogs.com/cnblogs_com/wangyang0210/1943283/o_210308061740wechat.png 15 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: easybe-npm 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: actions/setup-node@v3 16 | with: 17 | node-version: 16 18 | - run: npm ci 19 | - run: npm run build 20 | 21 | publish-npm: 22 | needs: build 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v3 26 | - uses: actions/setup-node@v3 27 | with: 28 | node-version: 16 29 | registry-url: https://registry.npmjs.org/ 30 | - run: npm ci 31 | - run: npm publish 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iws 3 | *.iml 4 | *.ipr 5 | .DS_Store 6 | node_modules 7 | .vscode 8 | -------------------------------------------------------------------------------- /.hintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "development" 4 | ], 5 | "hints": { 6 | "compat-api/css": [ 7 | "default", 8 | { 9 | "ignore": [ 10 | "-moz-font-feature-settings", 11 | "background-clip", 12 | "-webkit-tap-highlight-color" 13 | ] 14 | } 15 | ] 16 | }, 17 | "browserslist": [ 18 | "defaults", 19 | "not ie 11", 20 | "not and_ff <= 110", 21 | "not firefox <= 110", 22 | "not safari <= 16.3" 23 | ] 24 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EasyBe 2 | 3 | 名字是`easy`和`beautiful`的结合,意味着这个主题是一个简单且美观的博客主题,`EasyBe`基于[Cnblogs-Theme](https://github.com/wangyang0210/Cnblogs-Theme/)和 typecho 的默认主题开发。 4 | 5 | - `EasyBe`以阅读为核心,尽可能的美化博客的显示效果,提高用户体验。 6 | - 支持响应,尺寸分别为:(1200px,∞px),(960px,1200px],(720px,960px],(0px,720px] 7 | - 页面效果[EasyBe](https://oyo.cool) 8 | 9 | # Docs 10 | 11 | [永久地址](https://wangyang0210.github.io/EasyBe/v2/#/) 12 | 13 | > 推荐大家使用最新版本,新版本的发布往往代表着功能的完善和 bug 的修复! 14 | >
文档的源文件在 /docs 目录,大家有更完善的文档或建议可以 Pull Request 或 Issues 给我。 15 | >
文档我已经禁止浏览器缓存,但仍可能存在缓存,大家可以尝试强制刷新下(ctrl+f5 / command+shift+r) 16 | 17 | # Author 18 | 19 | **Cnblogs-Theme** © [wangyang0210](https://github.com/wangyang0210), Released under the [MIT](./LICENSE) License.
20 | 21 | > Blog [@Blog](https://oyo.cool/) · GitHub [@GitHub](https://github.com/wangyang0210) · Email i@oyo.cool 22 | -------------------------------------------------------------------------------- /docs/v2/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iws 3 | *.iml 4 | *.ipr 5 | *.log -------------------------------------------------------------------------------- /docs/v2/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/docs/v2/.nojekyll -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/bookList.md: -------------------------------------------------------------------------------- 1 | # 书单 2 | 3 | > 考虑到兼容直接在现有的 books 字段中增加影单相应的字段 4 | 5 | 样式参考:[书单样式](https://oyo.cool/archives/3/) 6 | 7 | ## 配置方式 8 | 9 | ### 标识页面为书单页面 10 | 11 | 首先需要创建一个文章,在文章内容众加入以下代码,来标识该页面为书单页面; 12 | 13 | ```html 14 | 17 | ``` 18 | 19 | ### 配置书单数据 20 | 21 | 书单的配置: 22 | 23 | ```javascript 24 | window.cnblogsConfig = { 25 | bookList: [], 26 | } 27 | ``` 28 | 29 | 一般书单的数据比较多,所以建议将此配置单独出来。例如: 30 | 31 | ```javascript 32 | 33 | // 正常配置 34 | window.cnblogsConfig = { 35 | ... 36 | }; 37 | 38 | // 书单配置 39 | window.cnblogsConfig.bookList = [ 40 | { 41 | title: '在读', 42 | books: [ 43 | { 44 | cover: 'https://images.weserv.nl/?url=https://img3.doubanio.com/view/subject/l/public/s29934992.jpg', 45 | name: '后物欲时代的来临', 46 | formerName: '', 47 | author: '郑也夫', 48 | translator: '', 49 | press: '中信出版社', 50 | year: '2016-8', 51 | score: 2, 52 | readDate: '21.02.05', 53 | readPercentage: '100%' 54 | } 55 | ] 56 | }, 57 | { 58 | title: '已读', 59 | books: [ 60 | { 61 | cover: 'https://images.weserv.nl/?url=https://img3.doubanio.com/view/subject/l/public/s29934992.jpg', 62 | name: '后物欲时代的来临', 63 | formerName: '', 64 | author: '郑也夫', 65 | translator: '', 66 | press: '中信出版社', 67 | year: '2016-8', 68 | score: 5, 69 | }, 70 | { 71 | cover: 'https://images.weserv.nl/?url=https://img3.doubanio.com/view/subject/l/public/s2180473.jpg', 72 | name: '厚黑学', 73 | formerName: '', 74 | author: '李宗吾', 75 | translator: '', 76 | press: '群言出版社', 77 | year: '2006-9', 78 | score: 3, 79 | } 80 | ] 81 | }, 82 | { 83 | title: '已观', 84 | books: [ 85 | { 86 | cover: 'https://images.cnblogs.com/cnblogs_com/wangyang0210/2205307/o_230318061444_p2614500649.webp', 87 | name: '疯狂动物城 Zootopia (2016)', 88 | direct: ' 拜伦·霍华德 / 瑞奇·摩尔 / 杰拉德·布什', 89 | scenarist: 90 | ' 拜伦·霍华德 / 瑞奇·摩尔 / 杰拉德·布什 / 吉姆·里尔顿 / 乔西·特立尼达 / 菲尔·约翰斯顿 / 珍妮弗·李', 91 | star: ' 金妮弗·古德温 / 杰森·贝特曼 / 伊德里斯·艾尔巴 / 珍妮·斯蕾特 / 内特·托伦斯 / 邦尼·亨特 / 唐·雷克 / 汤米·钟 / J·K·西蒙斯 / 奥克塔维亚·斯宾瑟 / 艾伦·图代克 / 夏奇拉 / 雷蒙德·S·佩尔西 / 德拉·萨巴 / 莫里斯·拉马奇 / 菲尔·约翰斯顿 / 约翰·迪·马吉欧 / 凯蒂·洛斯 / 吉塔·雷迪 / 杰西·科尔蒂 / 汤米·利斯特 / 乔希·达拉斯 / 瑞奇·摩尔 / 凯斯·索西 / 彼得·曼斯布里奇 / 拜伦·霍华德 / 杰拉德·布什 / 马克·史密斯 / 乔西·特立尼达 / 约翰·拉维尔 / 克里斯汀·贝尔 / 吉尔·科德斯 / 梅利莎·古德温', 92 | type: ' 喜剧 / 动画 / 冒险', 93 | productionCountry: ' 美国', 94 | language: ' 英语 / 挪威语', 95 | releaseDate: ' 2016-03-04(中国大陆/美国) / 2020-07-24(中国大陆重映)', 96 | filmLength: ' 109分钟(中国大陆) / 108分钟', 97 | alias: ' 优兽大都会(港) / 动物方城市(台) / 动物乌托邦 / 动物大都会 / Zootropolis', 98 | }, 99 | ], 100 | }, 101 | ]; 102 | ``` 103 | 104 | ?> 请按照此格式配置,无内容可以不配置。 105 | 106 | | **Key** | **Description** | 107 | | :----------------------: | :-----------------: | 108 | | **title** | 书目标题,可以不填 | 109 | | **books** | 书目数据 | 110 | | **books.cover** | 封面 | 111 | | **books.name** | 书名 | 112 | | **books.formerName** | 原书名 | 113 | | **books.author** | 作者 | 114 | | **books.translator** | 译者 | 115 | | **books.press** | 出版社 | 116 | | **books.year** | 出版年 | 117 | | **books.score** | 评级 1 ~ 5,支持.5 | 118 | | **books.readDate** | 阅读日期 | 119 | | **books.readPercentage** | 阅读进度 | 120 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/commentMd.md: -------------------------------------------------------------------------------- 1 | # 开启markdown评论 2 | 3 | ## 后台配置 4 | ![开启markdown评论](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/typecho/20230226201258.png) 5 | 6 | ## 配置标签 7 | ``` 8 |



    • 9 | ``` 10 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/fonticon.md: -------------------------------------------------------------------------------- 1 | # 字体图标库 2 | 3 | 本主题使用的图标库为阿里巴巴矢量图标库 [iconfont](https://www.iconfont.cn/)。 4 | 5 | ## 拓展图标 6 | 大家可以在 iconfont 生成自己的图标库,生成方法参考[官方教程](https://www.iconfont.cn/help/detail?spm=a313x.7781069.1998910419.13&helptype=about) 。 7 |
      获取样式地址后按照下面示例方式添加到配置中. 8 | 9 | !> 扩展图表只适用于在配置文件中配置的icon图标,如侧边栏`navList` 10 | 11 | ```javascript 12 | window.cnblogsConfig = { 13 | fontIconExtend: "//at.alicdn.com/t/font_xxxxxxxxx.css", 14 | } 15 | ``` 16 | 17 | ## 内置图标 18 | 19 | > 内置图标分为基本图标和文章图标, 两则加载的文件和位置均不同; 20 | 21 | ### 基本图标 22 | 23 | ?> 用于主题基本图标的配置,默认以CSS方式进行加载,主题初始化时就会加载; 24 | 25 | 32 | 33 | ### 文章图标 34 | 35 | ?> 用于文章标题前的修饰,默认以JS方式进行加载,只会在文章页进行加载; 36 | 37 | 44 | 45 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/hook.md: -------------------------------------------------------------------------------- 1 | # 钩子 2 | 3 | 用于用户在主题处理周期中扩展自己的行为。 4 | 5 | ## 配置方式 6 | 7 | 示例配置: 8 | 9 | ```javascript 10 | 11 | window.cnblogsConfig = { 12 | // ... 主配置 13 | }; 14 | 15 | // 钩子配置 16 | window.cnblogsConfig.hooks = { 17 | 18 | beforeCode: () => { 19 | // console.log('code 渲染开始前'); 20 | }, 21 | afterCode: () => { 22 | // console.log('code 渲染结束后'); 23 | }, 24 | beforeLoading: () => { 25 | // console.log('loading 开始前'); 26 | }, 27 | afterLoading: () => { 28 | // console.log('loading 结束后'); 29 | }, 30 | dayNightControl: (type) => { 31 | // console.log(type); 32 | // console.log('日/夜间模式'); 33 | }, 34 | }; 35 | 36 | ``` 37 | 38 | ## 钩子方法 39 | 40 | |**方法**|**参数**|**描述**| 41 | |:-----:|:-----:|:-----:| 42 | |**beforeCode**|()|code 渲染开始前调用此方法| 43 | |**afterCode**|()|code 渲染结束后调用此方法| 44 | |**beforeLoading**|()|loading 开始前调用此方法| 45 | |**afterLoading**|()|loading 结束后调用此方法| 46 | |**dayNightControl**|(type)|日/夜间模式切换调用此方法| 47 | 48 | ## 关于参数"$." 49 | 50 | 里面包含了主题渲染使用的配置、工具方法、页面状态、事件监听等。 51 | 52 | ### 查看/修改配置 53 | 54 | 当前主题渲染使用的配置都在 ` $.__config` 中,可以查看当前配置,也可以直接修改使用的配置。 55 | 56 | ### 调用主题公共方法 57 | 58 | 当前主题公共方法都在 ` $.__tools` 中,关于所有的公共方法可查看[此文件](https://github.com/wangyang0210/cnblogs-theme/blob/v2/src/utils/tools.js) 59 | 60 | ### 查看页面状态信息 61 | 62 | 当前主题渲染使用的配置都在 ` $.__status` 中。 63 | 64 | ### 查看/触发事件 65 | 66 | 当前主题公共事件处理都在 ` $.__event` 中,目前只有滚动事件和窗口大小事件的监听处理,源码可参考[此文件](https://github.com/wangyang0210/cnblogs-theme/blob/v2/src/components/event/event.js) 。 67 | 68 | * 触发事件 69 | 70 | 只能触发已经注册的事件,根据主题加载,会陆续注册进来新的事件处理handle。 71 | 72 | 示例: 73 | 74 | ```javascript 75 | $.__event.handle.scroll(); // 触发滚动处理 76 | $.__event.handle.resize(); // 触发窗口大小变化处理 77 | ``` 78 | 79 | * 添加新的事件处理 80 | 81 | 示例: 82 | 83 | ```javascript 84 | $.__event.scroll.handle.push(() => { 85 | console.log('当页面滚动时,我被执行!'); 86 | }); 87 | ``` 88 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/links.md: -------------------------------------------------------------------------------- 1 | # 友链 2 | 3 | 样式参考:[友联样式](https://www.oyo.cool/index.php/archives/27/) 4 | 5 | ## 配置方式 6 | 7 | ### 标识页面为友链页面 8 | 9 | 首先需要创建一个文章,在文章内容众加入以下代码,来标识该页面为友链页面: 10 | 11 | ```html 12 | 13 | ``` 14 | 15 | ### 配置友链数据 16 | 17 | ```javascript 18 | window.cnblogsConfig = { 19 | links: { 20 | page: [ 21 | { 22 | title: '友情链接', // 标题 23 | icon: 'icon-lianjie', // iconfont 24 | style: 'color: #a78bfa;', 25 | links: [ 26 | { 27 | name: '思索', // 昵称 28 | introduction: 'IT技术类博客', // 简介 29 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 30 | url: 'https://cnblogs.com/wangyang0210' // 友链地址 31 | }, 32 | { 33 | name: '王洋', // 昵称 34 | introduction: 'IT技术类博客', // 简介 35 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 36 | url: 'https://www.oyo.cool' // 友链地址 37 | }, 38 | ] 39 | }, 40 | { 41 | title: '网站', 42 | icon: 'icon-website', 43 | style: 'color: #a78bfa;', 44 | links: [ 45 | { 46 | name: '测试', // 昵称 47 | introduction: 'IT技术类博客', // 简介 48 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 49 | url: 'https://cnblogs.com/wangyang0210' // 友链地址 50 | }, 51 | { 52 | name: 'helloWorld', // 昵称 53 | introduction: 'IT技术类博客', // 简介 54 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 55 | url: 'https://cnblogs.com/wangyang0210' // 友链地址 56 | }, 57 | ] 58 | }, 59 | ], 60 | }, 61 | } 62 | ``` 63 | 64 | 此配置可以单独出来。例如: 65 | 66 | ```javascript 67 | 68 | // 正常配置 69 | window.cnblogsConfig = { 70 | links: {}, 71 | }; 72 | 73 | // 友链配置 74 | window.cnblogsConfig.links.page = [ 75 | { 76 | title: '友情链接', 77 | icon: 'icon-lianjie', 78 | style: 'color: #a78bfa;', 79 | links: [ 80 | { 81 | name: '思索', // 昵称 82 | introduction: 'IT技术类博客', // 简介 83 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 84 | url: 'https://cnblogs.com/wangyang0210' // 友链地址 85 | }, 86 | { 87 | name: '王洋', // 昵称 88 | introduction: 'IT技术类博客', // 简介 89 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 90 | url: 'https://www.oyo.cool' // 友链地址 91 | }, 92 | ] 93 | }, 94 | { 95 | title: '网站', 96 | icon: 'icon-website', 97 | style: 'color: #a78bfa;', 98 | links: [ 99 | { 100 | name: '测试', // 昵称 101 | introduction: 'IT技术类博客', // 简介 102 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 103 | url: 'https://cnblogs.com/wangyang0210' // 友链地址 104 | }, 105 | { 106 | name: 'helloWorld', // 昵称 107 | introduction: 'IT技术类博客', // 简介 108 | avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 109 | url: 'https://cnblogs.com/wangyang0210' // 友链地址 110 | }, 111 | ] 112 | }, 113 | ]; 114 | ``` 115 | 116 | ?> 请按照此格式配置。 117 | 118 | |**Key**|**Description**| 119 | |:-----:|:-----:| 120 | |**name**|昵称| 121 | |**introduction**|简介| 122 | |**avatar**|头像| 123 | |**url**|友链地址| 124 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/loading.md: -------------------------------------------------------------------------------- 1 | # Loading 2 | 3 | Loading 使用开源项目:[claudiocalautti/spring-loaders](https://github.com/claudiocalautti/spring-loaders) 4 | 5 | 大家可以根据该项目文档修改```window.cnblogsConfig.loading```的配置。 6 | 7 | ## 关于网页快照显示空白页 8 | 9 | ?> 此方案由网友 [蓝天上的云℡](https://www.cnblogs.com/yucloud/) 提供。 10 | 11 | !> 应用此方案,会导致进入网页有闪屏的现象,大家自己权衡使用。 12 | 13 | 在页首HTML里添加 14 | 15 | ```html 16 | 20 | ``` 21 | 22 | 即可关闭Loading,然后在全局配置里添加 23 | 24 | ```html 25 | 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/player.md: -------------------------------------------------------------------------------- 1 | # 播放器 2 | 3 | 播放器使用开源项目:[metowolf/MetingJS](https://github.com/metowolf/MetingJS) 4 | 5 | 如需使用播放器,请根据配置文档`aplayer`配置项进行配置。 6 | 7 | ?> 榜单ID获取 | 默认配置为热歌榜 8 | 9 | ![img](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/cnblogs/20221217233703.png) 10 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/reprinted.md: -------------------------------------------------------------------------------- 1 | # 转载文章 2 | 3 | 关于转载文章在文章中加入如下代码来指定文章作者和来源: 4 | 5 | ```html 6 | 7 | 8 | ``` 9 | 10 | 11 | ## 富文本编辑器 12 | 13 | ![reprinted_01](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/cnblogs/reprinted_01.png) 14 | 15 | ## Markdown 16 | 17 | 直接拷贝到文本即可。 18 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/rewrite.md: -------------------------------------------------------------------------------- 1 | # 伪静态 2 | 3 | !> 伪静态配置主要分为两部分,请务必按着以下方法进行配置 4 | 5 | ## nginx 6 | 7 | > 将以下配置复制到nginx的`server`配置中; 8 | 9 | ``` 10 | location / { 11 | if (!-e $request_filename) { 12 | rewrite ^(.*)$ /index.php$1 last; 13 | } 14 | } 15 | ``` 16 | 17 | ## 开启伪静态 18 | 19 | > 在后台配置中启用`地址重写`功能 20 | 21 | ![开启伪静态](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/easybe/rewrite.png) 22 | 23 | ## 伪静态效果 24 | 25 | 原地址: https://dev.wangyangyang.vip/index.php/archives/30/ 26 | 伪静态地址: https://dev.wangyangyang.vip/archives/30/ 27 | -------------------------------------------------------------------------------- /docs/v2/Docs/Customization/statistical.md: -------------------------------------------------------------------------------- 1 | # 网站统计 2 | 3 | ## 搭建自己的网站流量分析统计工具 4 | 5 | ?>如果你不想搭建,又想体验统计功能,那可以使用我搭建的 umami 平台
      [传送门](https://umami.oyo.cool/) 6 | 7 | [网站统计——利用开源的网站流量分析统计工具](https://www.cnblogs.com/wangyang0210/p/16504237.html) 8 | 9 | !> 如果不需要集成到博皮,推荐直接使用 docker 安装,启动后按着官方文档去添加网址,获取到统计地址放入全局配置即可; 10 | 11 | ## 主题配置 12 | 13 | ?> 这一块可能会存在两种情况即集成博皮和不集成博皮; 14 | 15 | ### 基础配置 16 | 17 | > 无论是否集成博皮都需要接入统计代码 18 | 19 | #### 添加站点 20 | 21 | !> 如果你想集成到博皮,在博皮上进行数据的展示,这里请务必勾选“启用共享链接”。 22 | 23 | ![添加站点](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/easybe/2.gif) 24 | 25 | #### 添加统计代码 26 | 27 | ![接入统计代码](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/easybe/3.gif) 28 | 29 | #### 验证是否成功 30 | 31 | ![验证](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/easybe/4.gif) 32 | 33 | !> 到这里,不集成到博皮的配置就完成了,你可以愉快的去玩耍了,如果你还想集成到博皮里那就继续往下跟着操作吧~ 34 | 35 | #### 获取共享 ID 36 | 37 | ![共享ID](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/easybe/5.gif) 38 | 39 | #### 博皮配置 40 | 41 | ```js 42 | window.cnblogsConfig = { 43 | umami: { 44 | url: 'https://umami.wangyangyang.vip', 45 | shareId: '0uuvzPh5', 46 | }, 47 | } 48 | ``` 49 | 50 | ![博皮配置](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/easybe/6.gif) 51 | 52 | #### 集成效果 53 | 54 | | 字段 | 解释 | 55 | | --------- | -------------------------------- | 56 | | Online | 当前在线人数 | 57 | | Today | 今天的数据 pv/uv/平均访问时长(s) | 58 | | Yesterday | 昨天的数据 pv/uv/平均访问时长(s) | 59 | 60 | ![效果展示](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/project/easybe/20230414185822.png) 61 | -------------------------------------------------------------------------------- /docs/v2/Docs/GettingStarted/install.md: -------------------------------------------------------------------------------- 1 | # 安装配置 2 | 3 | !> 本文为 v2 版本的安装配置教程,请核对使用版本!
      博客请务必开启伪静态,具体可参考[配置文件](https://wangyang0210.github.io/EasyBe/v2/#/Docs/Customization/rewrite) 4 | 5 | ## 获取需要使用的版本 6 | 7 | 进入主题仓库:[GitHub](https://github.com/wangyang0210/EasyBe) 8 | 9 | > 选择最新版本将`easybe`目录上传到`typecho`的主题目录下,然后进入到后台进行主题的配置; 10 | 11 | ![statistical_01](https://cdn.jsdelivr.net/gh/wangyang0210/pic/imgs/install_01.gif) 12 | 13 | ## 博客设置 14 | 15 | > MySQL 需要 DDL 权限,请注意给予对应的权限; 16 | 17 | ### JQuery CDN 18 | 19 | ``` 20 | //lf26-cdn-tos.bytecdntp.com/cdn/expire-1-y/jquery/3.6.0/jquery.min.js 21 | ``` 22 | 23 | ### EasyBe JS CDN 24 | 25 | !> 国内推荐使用自身站点资源或者国内的 npm 地址 26 | 27 | ``` 28 | //<域名>/usr/themes/easybe/simple-memory.js 29 | ``` 30 | 31 | ### 全局配置 32 | 33 | ```html 34 | 43 | ``` 44 | 45 | 详细配置参考相关[文档](https://wangyang0210.github.io/EasyBe/v2/#/Docs/Customization/config) 。 46 | 47 | --- 48 | 49 | > CDN`jsdelivr` 的 URL, 详细规则参考[官方网站](https://www.jsdelivr.com/)
      50 | 51 | !> 版本 >= 2.1.2 支持 npm 包 CDN 加速 52 | 53 | > CDN`unpkg`的 URL, 详细规则参考[官方网站](https://www.unpkg.com/) 54 | -------------------------------------------------------------------------------- /docs/v2/Docs/GettingStarted/versionSwitch.md: -------------------------------------------------------------------------------- 1 | # 版本切换 2 | 3 | !> 注意:任何版本的切换,最好都更新一下对应版本的 css 样式,不然可能会发生兼容性问题! 4 | 5 | ## v2.\*.\* 之间切换版本 6 | 7 | ### 使用 jsdelivr 加载资源 8 | 9 | 只需要更改 simple-memory.js 文件引入的版本。 10 | 11 | 例如: 12 | 13 | ```html 14 | 18 | ``` 19 | 20 | 变为 21 | 22 | ```html 23 | 27 | ``` 28 | 29 | 版本变更: `v2.1.6` >>> `v2.1.7` 30 | 31 | ### 使用自己的云资源 32 | 33 | 如果你的资源是托管到自己的云资源上或 CDN 加速节点节点上。 34 | 35 | #### 随机参方式更新加载资源 36 | 37 | > 减少浏览器缓存造成的不生效或生效慢问题 | 推荐这种方式来更新加载资源。 38 | 39 | 例如: 40 | 41 | ```html 42 | 46 | ``` 47 | 48 | 变为 49 | 50 | ```html 51 | 55 | ``` 56 | -------------------------------------------------------------------------------- /docs/v2/Docs/GettingStarted/writtenForm.md: -------------------------------------------------------------------------------- 1 | # 书写规范 2 | 3 | !> 编辑器建议使用`Markdown`编辑器,扩展语法默认只提供markdown书写的格式 4 | 5 | ## markdown语法 6 | [markdown 语法简介](https://www.cnblogs.com/wangyang0210/p/10954213.html) 7 | 8 | 9 | ## 搏皮扩展语法 10 | |**类型**|**Markdown**|备注| 11 | |:-----|:-----|:-----| 12 | |**代码对比**|\``` diff
      + 这是新增的内容
      - 这是删除的内容
      ```| 代码高亮插件自带| 13 | |**重要/警告引用**|`!>`| | 14 | |**普通/信息引用**|```?>```| | 15 | |**代码折叠**| `
      代码 // 空一行 代码块内容 // 空一行
      `| | 16 | |**手绘下划线**|`内容`| `~u u~` | 17 | |**手绘圆圈**|`内容`| `~c c~`| 18 | |**手绘盒子**|`内容`| `~b b~` | 19 | |**手绘高亮**|`内容`| `~h h~`| 20 | |**大括号**|`内容`|`~bk bk~` | 21 | |**删除线**|`内容`| `~s s~`| 22 | |**划掉**|`内容`| `~x x~`| 23 | |**摘要**|`:::空格 空格:::`|`:::必须要有空格`| 24 | -------------------------------------------------------------------------------- /docs/v2/Docs/changelog.md: -------------------------------------------------------------------------------- 1 | # 2023.8.4 - v2.1.13 2 | 3 | - 滚动条 hover 宽度增加 4 | - 修复 loading 效果 5 | - 文档更新 6 | 7 | # 2023.4.2 - v2.1.12 8 | 9 | - 搭建对外的 umami 平台 10 | - 增加自定义摘要的语法 11 | - 后台配置增加主题 JS 文件配置 12 | - 文章标题打字机效果优化 13 | - loading 动画效果优化 14 | 15 | # 2023.3.21 - v2.1.11 16 | 17 | - 适配 umami 最新版本 18 | - 优化关注博主和打赏博主交互 19 | - 修复首次评论不显示 20 | - 优化评论相关代码 21 | 22 | # 2023.3.16 - v2.1.10 23 | 24 | - 独立页面适配 25 | - 修复文章内容页有序列表和无序列表展示 26 | - 优化文章内容页分类/标签显示 27 | - 优化 titleMsg 展示 28 | - 书单页增加影单字段 29 | - 默认配置中去除部分表情 30 | 31 | # 2023.2.9 - v2.1.8 32 | 33 | - 新增评论显示地理位置信息和浏览器及系统信息 34 | - 新增文章置顶,在文章编辑页面开启置顶即可 35 | 新增配置`articleContent.commentBackground`,评论框背景图片(修图贼费时间,不能浪费这里也用下吧) 36 | - 新增评论表情配置`articleContent.owo`,来自[DIYgod/OwO](https://github.com/DIYgod/OwO) 37 | - 新增评论打字特效,来自[activate-power-mode](https://github.com/disjukr/activate-power-mode) 38 | - 新增后台配置,用于配置 gavatar 头像服务器镜像和缓存时间 39 | - 新增后台配置,用于备份主题配置和恢复主题配置 40 | - 新增后台配置,用于侧边栏相关菜单配置 41 | - 新增后台配置,用于 jquery CDN 配置 42 | - 新增文章底部增加声援博主信息 43 | - 新增文档增加伪静态配置教程 44 | - 新增文档开启 markdown 评论 45 | - 新增文章点赞特效 46 | - 新增文章踩功能 47 | - 新增推荐排行列表 48 | - 修复博客状态显示功能 49 | - 优化版权信息 50 | - 优化 404 页面 51 | - 优化评论关闭样式 52 | - 优化直接私信功能 53 | - 优化点赞/推荐功能 54 | - 优化文章加密输入密码 55 | - 优化增加默认全局配置 56 | - 优化默认展示网站名称 57 | - 优化自动配置侧边栏底部导航 58 | - 优化评论问题[校验必填信息|邮箱|名称|评论内容|气泡提示语] 59 | - 删除微博分享,收藏本文按钮 60 | - 删除博客园相关的关注模块 61 | 62 | # 2023.2.7 - v2.1.7 63 | 64 | - 新增配置`roughNotation`,配置手绘风格的图画 65 | - 新增控制台版本更新提示 66 | - 新增配置`articleContent.iconfontArr`,配置 iconfont 图标 67 | - 新增配置`default`,外部静态资源使用字节跳动和 elementCDN 引入 68 | - 新增配置`footer.aplayer`来设置音乐播放器 69 | - 新增配置`sidebar.blogStatus`,设置是否显示博客状态 70 | - 修复 h1-h6 出现特殊字符是不是渲染不了 71 | - 修复默认输出的 github 仓库信息 72 | - 修复 particles 图片引用错误 73 | - 修复导航选中样式丢失问题 74 | - 优化友联页面限制最多支持 12 个汉+字,超出会自动省略 75 | - 优化 simple-memory.css 压缩输出 76 | - 优化重写文档内容,增加相应图片示例 77 | - 优化代码和打包流程 78 | 79 | # 2022.10.24 - v2.1.6 80 | 81 | - 新增备案信息配置项 82 | - 优化 iconfont 使用 CDN 资源 83 | - 优化谷歌字体适用 CDN 资源 84 | - 优化使用 fetch 代替 request 85 | - 优化编译统一使用 webpack 86 | 87 | # 2022.10.05 - v2.1.5 88 | 89 | - 优化 bubble 优先级调整 90 | - 优化 season 优先级调整 91 | - 优化 mo.js 优先级调整 92 | - 优化文章内容 Id 适配 93 | - 优化 mo.js 移动端样式适配 94 | 95 | # 2022.09.12 - v2.1.4 96 | 97 | - 代码优化 98 | - npm 依赖优化升级 99 | - 谷歌字体本地化 100 | - gulp 开启 gzip 压缩 101 | - 今日诗词 API 调整 102 | - 资源文件按需加载 103 | - 背景特效配置聚合 | 新增特效 104 | - 新增`season`背景特效 105 | - 背景特效`backgroundMouse`改为`particles` 106 | - 鼠标特效配置聚合 | 新增特效 107 | - 引入`mo.js`,自定义鼠标点击特效 108 | - 新增`bubble`鼠标移动效果 109 | - 新增配置`articleContent.iconfont`文章标题前 ICON 110 | - 修复移动端展示问题 111 | - 修复日夜模式切换问题 112 | - 脚注显示优化 113 | - 文档更新 114 | 115 | # 2022.09.01 - v2.1.3 116 | 117 | - 首次评论不展示 118 | - 修复六级标题没生成目录 119 | - 新增配置`banner.text`控制 banner 文本是否可选 120 | - 修复文章 imgbox 会包含底部头像 121 | - 优化表格展示 122 | - 滚动条优化 123 | 124 | # 2022.09.01 - v2.1.2 125 | 126 | - 依赖升级 127 | - 自动发布 npm 128 | - CDN 可使用[unpkg](https://www.unpkg.com/) 129 | 130 | # 2022.08.30 - v2.1.1 131 | 132 | - webpack 配置调整 133 | - 代码高亮展示优化 134 | - 隐藏滚动条 135 | - 打赏关注显示优化 136 | 137 | # 2022.08.24 - v2.1.0 138 | 139 | - 修复配置参数 position 140 | - 修复侧边栏无法搜索 141 | - 文章阅读排行 142 | - 文章评论排行 143 | - 文章微博分享 144 | - 文章点赞推荐 145 | - 文章打赏功能 146 | - 新增配置`articleSuffix.copyText`,复制时增加版权信息 147 | - 评论优化 148 | - 文档更新 149 | 150 | # 2022.08.23 - v2.0.0 151 | 152 | - v2 版本完成 153 | - 文档更新 154 | -------------------------------------------------------------------------------- /docs/v2/README.md: -------------------------------------------------------------------------------- 1 | # EasyBe 2 | 3 | 名字是`easy`和`beautiful`的结合,意味着这个主题是一个简单且美观的博客主题,`EasyBe`基于[Cnblogs-Theme](https://github.com/wangyang0210/Cnblogs-Theme/)和 typecho 的默认主题开发。 4 | 5 | - `EasyBe`以阅读为核心,尽可能的美化博客的显示效果,提高用户体验。 6 | - 支持响应,尺寸分别为:(1200px,∞px),(960px,1200px],(720px,960px],(0px,720px] 7 | - 页面效果[EasyBe](https://oyo.cool) 8 | 9 | # Docs 10 | 11 | [永久地址](https://wangyang0210.github.io/EasyBe/v2/#/) 12 | 13 | > 推荐大家使用最新版本,新版本的发布往往代表着功能的完善和 bug 的修复! 14 | >
      文档的源文件在 /docs 目录,大家有更完善的文档或建议可以 Pull Request 或 Issues 给我。 15 | >
      文档我已经禁止浏览器缓存,但仍可能存在缓存,大家可以尝试强制刷新下(ctrl+f5 / command+shift+r) 16 | 17 | # Author 18 | 19 | **Cnblogs-Theme** © [wangyang0210](https://github.com/wangyang0210), Released under the [MIT](./LICENSE) License.
      20 | 21 | > Blog [@Blog](https://oyo.cool/) · GitHub [@GitHub](https://github.com/wangyang0210) · Email i@oyo.cool 22 | -------------------------------------------------------------------------------- /docs/v2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Document 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 38 | 39 | 40 | 41 | 49 |
      50 | 74 | 75 | 76 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /docs/v2/sidebar.md: -------------------------------------------------------------------------------- 1 | - [简介](/) 2 | 3 | - 入门 4 | 5 | - [安装使用](Docs/GettingStarted/install.md) 6 | - [书写规范](Docs/GettingStarted/writtenForm.md) 7 | - [版本切换](Docs/GettingStarted/versionSwitch.md) 8 | 9 | - 定制化 10 | 11 | - [配置项](Docs/Customization/config.md) 12 | - [转载文章](Docs/Customization/reprinted.md) 13 | - [字体图标库](Docs/Customization/fonticon.md) 14 | - [Loading](Docs/Customization/loading.md) 15 | - [书单](Docs/Customization/bookList.md) 16 | - [钩子](Docs/Customization/hook.md) 17 | - [友链](Docs/Customization/links.md) 18 | 19 | - 扩展 20 | - [伪静态配置](Docs/Customization/rewrite.md) 21 | - [markdown评论](Docs/Customization/commentMd.md) 22 | - [播放器](Docs/Customization/player.md) 23 | - [网站统计](Docs/Customization/statistical.md) 24 | 25 | - [Changelog](Docs/changelog.md) 26 | -------------------------------------------------------------------------------- /easybe/404.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 |
      4 |
      5 |
      6 |
      7 |
      8 |
      9 |
      10 |
      11 | 12 |
      13 |
      14 |
      15 |
      16 |
      17 |
      18 |
      19 |
      20 |
      21 |
      22 |
      23 |
      24 |
      25 |
      26 |
      27 | 28 |
      29 |
      30 |
      o_o ....
      31 |
      你竟然来到了无人区
      32 |
      33 | 34 | 35 | 36 |
      37 |
      38 | 39 |
      40 | 41 | 57 | need('sidebar.php'); ?> 58 | need('footer.php'); ?> 59 | -------------------------------------------------------------------------------- /easybe/archive.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 |
      4 |
      5 |

      6 | archiveTitle(array( 7 | 'category' => _t('文章分类 - %s'), 8 | 'search' => _t('关键字 - %s'), 9 | 'tag' => _t('标签 - %s '), 10 | 'author' => _t('作者 - %s') 11 | ), '', ''); ?> 12 |

      13 | have()): ?> 14 | next()): ?> 15 |
      16 |
      17 |
      18 | 23 |
      24 | author(); ?> date("Y-m-d H:i:s"); ?> 25 | 阅读() 26 | 评论(commentsNum('%d'); ?>) 27 | user->hasLogin()) : ?> 28 | 编辑 29 | 30 |
      31 |
      32 |
      33 |
      34 | 35 | 36 |
      37 |
      38 |
      39 |
      40 | 44 |
      45 |
      46 |
      47 | need('sidebar.php'); ?> 48 | need('footer.php'); ?> 49 | -------------------------------------------------------------------------------- /easybe/header.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <?php $this->archiveTitle( 12 | array( 13 | 'category' => _t('分类 - %s'), 14 | 'search' => _t('关键字 - %s'), 15 | 'tag' => _t('标签 - %s'), 16 | 'author' => _t('作者 - %s') 17 | ), 18 | '', 19 | ' - ' 20 | ); ?><?php $this->options->title(); ?> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | header(); ?> 32 | 33 | 34 | 35 | 36 | 37 |
      38 | 59 |
      -------------------------------------------------------------------------------- /easybe/index.php: -------------------------------------------------------------------------------- 1 | need('header.php'); 14 | ?> 15 | 16 |
      17 |
      18 | 19 | currentPage, $this->options->pageSize); ?> 20 | push($post); 22 | 23 | ?> 24 |
      25 |
      26 | 27 | [置顶] 28 | 29 | 30 |
      31 |
      32 |
      33 | 摘要:user->hasLogin()) ? '文章被加密了,不可以偷看哦🍉' : (getAbstract($res['text'], '/:::(.*):::/') ?: preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0}((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,200}).*#s', '$1', $res['text'])); ?> 34 | 阅读全文 35 |
      36 |
      37 |
      38 |
      posted @ 39 | author(); ?> 40 | 阅读() 41 | 评论() 42 | 43 | 推荐() 44 |
      45 |
      46 |
      47 | 48 |
      49 | 53 |
      54 |
      55 |
      56 | 57 | 58 | need('sidebar.php'); ?> 59 | need('footer.php'); ?> 60 | -------------------------------------------------------------------------------- /easybe/page.php: -------------------------------------------------------------------------------- 1 | 2 | cid) exit( strval(digg($this->cid)) ); ?> 3 | cid) exit( strval(bury($this->cid)) ); ?> 4 | need('header.php'); ?> 5 |
      6 |
      7 |
      8 | 9 |
      10 |
      11 |

      12 | 13 | title() ?> 14 | 15 |

      16 |
      17 |
      18 |
      19 | content() ?> 20 |
      21 |
      22 | 52 |
      53 |
      54 |
      55 |
      56 | need('comments.php'); ?> 57 |
      58 |
      59 | 60 | 61 | need('sidebar.php'); ?> 62 | need('footer.php'); ?> 63 | -------------------------------------------------------------------------------- /easybe/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/screenshot.png -------------------------------------------------------------------------------- /easybe/script/article-code.11ac8a98.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[139],{9474:function(o,e,i){i.a(o,(async function(o,n){try{i.r(e),i.d(e,{default:function(){return d}});var c=i(6445),t=i(4316);function d(){let o=$("#main pre");function e(){if(!$.__config.code.options.line)return!0;let o=$("code-box pre code");$.each(o,(function(e){let i=$(o[e]),n=i.html().replace(/\/g,"\n").split("\n"),c=[];$.each(n,(o=>{(n[o].trim()||o"!==n[o]&&c.push(''+n[o])})),i.html(c.join("\n")),i.addClass("code-pre-line")}))}(0,c.A)(),$.each(o,(function(e){let i=$(o[e]),n="code-"+$.__tools.randomString(6);i.wrap(''),i.attr("boxid",n)})),(()=>{if($.__config.code.options.macStyle){let o=$("code-box");$.each(o,(function(e){$(o[e]).prepend('
      ')}))}else o.css("border-radius","4px")})(),(()=>{let o=$("code-box");$.each(o,(function(e){let i=$(o[e]),n=i.attr("id"),c='';i.prepend(c)})),$("code-box .code-copay-btn").click((function(){$(this).find("i").removeClass("icon-fuzhi").addClass("icon-right"),setTimeout("$('code-box button[boxid='"+$(this).attr("boxid")+"'] i').removeClass('icon-right').addClass('icon-fuzhi')",1500)})),o.on({mouseover:function(){$(this).find(".code-copay-btn").css({opacity:1,visibility:"visible"})},mouseout:function(){$(this).find(".code-copay-btn").css({opacity:0,visibility:"hidden"})}}),new ClipboardJS(".clipboard")})(),$.__config.code.options.maxHeight&&$("code-box pre").css("max-height",$.__config.code.options.maxHeight),"hljs"===$.__config.code.type.toLowerCase()?i.e(596).then(i.bind(i,8564)).then((o=>{(0,o.default)(e)})):(o.css("background","#f5f5fa"),$("code-box .code-tools").css("background","#f5f5fa"),$("pre .hljs").css({background:"none",border:"0","border-radius":"0",padding:"0"}),e()),(0,t.A)()}await $.__tools.dynamicLoadingJs($.__config.default.clipboard).catch((o=>console.error("clipboard.js",o))),n()}catch(a){n(a)}}),1)},4316:function(o,e,i){function n(){"function"==typeof $.__config.hooks.afterCode&&$.__config.hooks.afterCode()}i.d(e,{A:function(){return n}})},6445:function(o,e,i){function n(){"function"==typeof $.__config.hooks.beforeCode&&$.__config.hooks.beforeCode()}i.d(e,{A:function(){return n}})}}]); -------------------------------------------------------------------------------- /easybe/script/background-particles.e29c708f.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[673],{7655:function(e,a){a.A='
      '},1525:function(e,a,t){t.a(e,(async function(e,c){try{t.r(a),t.d(a,{default:function(){return l}});var i=t(7655);function l(e){$("#footer").after(i.A);let a=document.getElementById("particles"),t=[{el:a.querySelector(".particles-layer--1"),opacity:.07,speed:.06},{el:a.querySelector(".particles-layer--2"),opacity:.07,speed:.04},{el:a.querySelector(".particles-layer--3"),opacity:.07,speed:.05}];t.forEach((e=>{gsap.to(e.el,.6,{delay:Math.random(),opacity:e.opacity})})),document.addEventListener("mousemove",(function(e){let a={x:window.innerWidth/2,y:window.innerHeight/2},c={x:e.clientX||e.pageX,y:e.clientY||e.pageY},i={x:a.x-c.x,y:a.y-c.y};t.forEach((e=>{gsap.to(e.el,1,{x:i.x*e.speed,y:i.y*e.speed})}))}))}await $.__tools.dynamicLoadingJs($.__config.default.gsap).catch((e=>console.error("gsap.js",e))),c()}catch(r){c(r)}}),1)}}]); -------------------------------------------------------------------------------- /easybe/script/background-season.a0972c6c.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[951],{6097:function(t,e,n){function i(t){let e,n=new Image;n.src=t.img;let i=t.size;function s(t,e,n,i,s){this.x=t,this.y=e,this.s=n,this.r=i,this.fn=s}function r(t){let e,n;switch(t){case"x":e=Math.random()*window.innerWidth;break;case"y":e=Math.random()*window.innerHeight;break;case"s":e=Math.random();break;case"r":e=6*Math.random();break;case"fnx":n=-.5+Math.random(),e=function(t,e){return t+.5*n-1.7};break;case"fny":n=1.5+.7*Math.random(),e=function(t,e){return e+n};break;case"fnr":n=.03*Math.random(),e=function(t){return t+n}}return e}s.prototype.draw=function(t){t.save(),t.translate(this.x,this.y),t.rotate(this.r),t.drawImage(n,0,0,i*this.s,i*this.s),t.restore()},s.prototype.update=function(){this.x=this.fn.x(this.x,this.y),this.y=this.fn.y(this.y,this.y),this.r=this.fn.r(this.r),(this.x>window.innerWidth||this.x<0||this.y>window.innerHeight||this.y<0)&&(this.r=r("fnr"),Math.random()>.4?(this.x=r("x"),this.y=0,this.s=r("s"),this.r=r("r")):(this.x=window.innerWidth,this.y=r("y"),this.s=r("s"),this.r=r("r")))},e=function(){this.list=[]},e.prototype.push=function(t){this.list.push(t)},e.prototype.update=function(){for(let t=0,e=this.list.length;t{!function(n){if(!s){function a(t,n){t.appendChild(n),gsap.to(t,{...d,y:-1*document.getElementById(e).offsetHeight}).then((function(){t.children[0].remove(),gsap.to(t,{duration:0,y:0})}))}function c(t,n){t.prepend(n),gsap.to(t,{duration:0,y:-1*document.getElementById(e).offsetHeight}),gsap.to(t,{...d,y:0}).then((function(){t.children[1].remove(),s=!1}))}s=!0,o+n<0?o=t.length-1:o+n>=t.length?o=0:o+=n;for(let l in i){let r=i[l],u=document.createElement("div");u.className="section";let m=document.createElement("img");m.src=t[o],u.appendChild(m),(l-Math.max(0,n))%2?c(r,u):a(r,u)}}}(c)}),a)}n.r(t),n.d(t,{default:function(){return c}}),await $.__tools.dynamicLoadingJs($.__config.default.gsap).catch((e=>console.error("gsap.js",e))),a()}catch(o){a(o)}}),1)}}]); -------------------------------------------------------------------------------- /easybe/script/circle-magic.489bf3d3.js: -------------------------------------------------------------------------------- 1 | (self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[261],{2020:function(){var e;(e=jQuery).fn.circleMagic=function(t){let o,n,a,l,i=!0,r=[],s=e.extend({color:"rgba(255,255,255,.5)",radius:10,density:.3,clearOffset:.2},t),d=this[0];function h(){i=!(document.body.scrollTop>n)}function c(){o=d.clientWidth,n=d.clientHeight,d.height=n+"px",a.width=o,a.height=n}function f(){if(i){l.clearRect(0,0,o,n);for(let e in r)r[e].draw()}requestAnimationFrame(f)}function p(){let e=this;function t(){e.pos.x=Math.random()*o,e.pos.y=n+100*Math.random(),e.alpha=.1+Math.random()*s.clearOffset,e.scale=.1+.3*Math.random(),e.speed=Math.random(),"random"===s.color?e.color="rgba("+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", "+Math.random().toPrecision(2)+")":e.color=s.color}e.pos={},t(),this.draw=function(){e.alpha<=0&&t(),e.pos.y-=e.speed,e.alpha-=5e-4,l.beginPath(),l.arc(e.pos.x,e.pos.y,e.scale*s.radius,0,2*Math.PI,!1),l.fillStyle=e.color,l.fill(),l.closePath()}}!function(){o=d.offsetWidth,n=d.offsetHeight,function(){let e=document.createElement("canvas");e.id="homeTopCanvas",d.appendChild(e),e.parentElement.style.overflow="hidden"}(),a=document.getElementById("homeTopCanvas"),a.width=o,a.height=n,a.style.position="absolute",a.style.left="0",a.style.bottom="0",a.style.zIndex="1",l=a.getContext("2d");for(let e=0;e/g,"\n"),l.css({padding:0}),l.text(l.text()),t&&l.css("background","#f5f5fa"),hljs.highlightElement(s),$(".clipboard[boxid="+l.attr("boxid")+"]").addClass("hljs-comment")}));$.__timeIds.hljsCodeTId=window.setInterval((()=>{$("pre code.hljs").length>0&&($("code-box").css("background",$("pre code.hljs").css("background")).prepend(''),(()=>{let e=$("code-box");$.each(e,(function(s,o){let t=$(e[s]),l=$("pre code")[s].result?.language;l&&t.find(".code-hljs-len").text(l).css("visibility","visible")}))})(),$.__tools.clearIntervalTimeId($.__timeIds.hljsCodeTId))}),1e3),e()}o.r(s),o.d(s,{default:function(){return l}}),await $.__tools.dynamicLoadingJs($.__config.default.highlight).catch((e=>console.error("hightlight.js",e))),t()}catch(c){t(c)}}),1)}}]); -------------------------------------------------------------------------------- /easybe/script/com-after.763f9028.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/script/com-after.763f9028.js.gz -------------------------------------------------------------------------------- /easybe/script/com-before.d59f2a5b.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/script/com-before.d59f2a5b.js.gz -------------------------------------------------------------------------------- /easybe/script/day-night.2405df8b.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[866],{7630:function(e,s,u){u.r(s)}}]); -------------------------------------------------------------------------------- /easybe/script/gf-blink.11ba95cd.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[489],{451:function(e,s,u){u.r(s)}}]); -------------------------------------------------------------------------------- /easybe/script/google-fonts.bc250a9d.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[999],{9269:function(e,s,u){u.r(s)}}]); -------------------------------------------------------------------------------- /easybe/script/iconfont.4d8182cd.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[287],{8765:function(e,s,u){u.r(s)}}]); -------------------------------------------------------------------------------- /easybe/script/mouse-bubble.dbf57e27.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[987],{527:function(e,t,n){function l(e){let t=document.createElement("canvas");t.id="bubble",$("#home").after(t);let n=document.getElementById("bubble"),l=n.getContext("2d");n.width=window.innerWidth,n.height=window.innerHeight,n.style.position="fixed",n.style.left="0",n.style.bottom="0",n.style.zIndex="999999999999999999999999999999999999999999",n.style.pointerEvents="none";let i=[],o=e.live,s=e.colors;window.addEventListener("mousemove",(function(t){for(let n=0;n{if(t.position.x>this.area.width||t.position.y>this.area.height)return this.circles.splice(i,1);t.move()})),0==this.circles.length&&(this.stop=!0)}draw(){this.circles.forEach((t=>t.draw()))}}(new class{constructor(){this.computerCanvas=document.createElement("canvas"),this.renderCanvas=document.createElement("canvas"),this.computerContext=this.computerCanvas.getContext("2d"),this.renderContext=this.renderCanvas.getContext("2d"),this.globalWidth=window.innerWidth,this.globalHeight=window.innerHeight,this.booms=[],this.running=!1}handleMouseDown(t){const n=new i({origin:{x:t.clientX,y:t.clientY},context:this.computerContext,area:{width:this.globalWidth,height:this.globalHeight}});n.init(),this.booms.push(n),this.running||this.run()}handlePageHide(){this.booms=[],this.running=!1}init(){const t=this.renderCanvas.style;t.position="fixed",t.top=t.left=0,t.zIndex="999999999999999999999999999999999999999999",t.pointerEvents="none",t.width=this.renderCanvas.width=this.computerCanvas.width=this.globalWidth,t.height=this.renderCanvas.height=this.computerCanvas.height=this.globalHeight,document.body.append(this.renderCanvas),window.addEventListener("mousedown",this.handleMouseDown.bind(this)),window.addEventListener("pagehide",this.handlePageHide.bind(this))}run(){this.running=!0,0!=this.booms.length?(requestAnimationFrame(this.run.bind(this)),this.computerContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.renderContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.booms.forEach(((t,i)=>{if(t.stop)return this.booms.splice(i,1);t.move(),t.draw()})),this.renderContext.drawImage(this.computerCanvas,0,0,this.globalWidth,this.globalHeight)):this.running=!1}}).init()}n.r(i),n.d(i,{default:function(){return e}})}}]); -------------------------------------------------------------------------------- /easybe/script/mouse-mo.cd0eb2f5.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[677],{6053:function(e,n,t){function s(e){$.__tools.dynamicLoadingJs($.__config.default.mojs).then((()=>{const n=new mojs.Burst({left:0,top:0,...e});n.el.style.zIndex=999999,document.addEventListener("click",(function(e){n.tune({x:e.pageX,y:e.pageY}).setSpeed(3).replay()}))})).catch((e=>console.error("mo.js: ",e)))}t.r(n),t.d(n,{default:function(){return s}})}}]); -------------------------------------------------------------------------------- /easybe/script/mouse-mouse.13b346d6.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[74],{3326:function(e,t,n){n.a(e,(async function(e,o){try{function s(e){const t=document.createElement("div");t.className="cursor";const n=document.createElement("div");n.className="cursor-f";let o,s,c=0,a=0,i=0,d=0,l=e.size,u=e.sizeF;function r(e,t,n){return(1-n)*e+n*t}document.body.appendChild(t),document.body.appendChild(n),"ontouchstart"in window&&(t.style.display="none",n.style.display="none"),t.style.setProperty("--size",l+"px"),n.style.setProperty("--size",u+"px"),window.addEventListener("mousemove",(function(e){i=e.pageX,d=e.pageY,t.style.top=d-l/2+"px";let n=i-l/2,o=document.body.offsetWidth;n=n<0?0:o-l=40&&(p=!1,o=null,s=null)}window.addEventListener("mousedown",f,!1),window.addEventListener("touchstart",f,!1),window.addEventListener("touchmove",(function(e){p&&(s=e.touches[0].clientY||e.targetTouches[0].clientY)}),!1),window.addEventListener("touchend",y,!1),window.addEventListener("mouseup",y,!1)}n.r(t),n.d(t,{default:function(){return s}}),await $.__tools.dynamicLoadingJs($.__config.default.gsap).catch((e=>console.error("gsap.js",e))),o()}catch(c){o(c)}}),1)}}]); -------------------------------------------------------------------------------- /easybe/script/nh-banner-animation.b1e06e50.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[381],{6763:function(e,s,u){u.r(s)}}]); -------------------------------------------------------------------------------- /easybe/script/owo-css.e7b022f1.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[282],{2128:function(e,s,u){u.r(s)}}]); -------------------------------------------------------------------------------- /easybe/script/owo-js.102751ad.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[472],{7152:function(t,e,s){s.r(e);e.default=new class{constructor(){const t={container:$(".OwO")[0],target:$("textarea")[0],position:"down",width:"383px",maxHeight:"250px",data:$.__config.articleContent.owo.options};this.container=t.container,this.target=t.target,this.init(t)}init(t){this.area=t.target,this.packages=Object.keys(t.data);let e=`\n \n
      `;for(let s=0;s`;let a=t.data[this.packages[s]].container;for(let t=0;t${a[t].icon}`;e+=""}e+='\n
      \n
        ';for(let t=0;t${this.packages[t]}`;e+="\n
      \n
      \n
      \n ",this.container.innerHTML=e,this.logo=this.container.getElementsByClassName("OwO-logo")[0],this.logo.addEventListener("click",(()=>{this.toggle()})),this.container.getElementsByClassName("OwO-body")[0].addEventListener("click",(t=>{let e=null;if(t.target.classList.contains("OwO-item")?e=t.target:t.target.parentNode.classList.contains("OwO-item")&&(e=t.target.parentNode),e){const t=this.area.selectionEnd;let s=this.area.value;this.area.value=s.slice(0,t)+e.innerHTML+s.slice(t),this.area.focus(),this.toggle()}})),this.packagesEle=this.container.getElementsByClassName("OwO-packages")[0];for(let t=0;t{this.packagesEle.children[t].addEventListener("click",(()=>{this.tab(e)}))})(t);this.tab(0)}toggle(){this.container.classList.contains("OwO-open")?this.container.classList.remove("OwO-open"):this.container.classList.add("OwO-open")}tab(t){const e=this.container.getElementsByClassName("OwO-items-show")[0];e&&e.classList.remove("OwO-items-show"),this.container.getElementsByClassName("OwO-items")[t].classList.add("OwO-items-show");const s=this.container.getElementsByClassName("OwO-package-active")[0];s&&s.classList.remove("OwO-package-active"),this.packagesEle.getElementsByTagName("li")[t].classList.add("OwO-package-active")}}}}]); -------------------------------------------------------------------------------- /easybe/script/page-article.ef0b9807.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[551],{9928:function(t,a,n){n.a(t,(async function(t,e){try{function o(){setTimeout((()=>{let t=$("#cnblogs_post_body img").length-1;if(!t)return;let a=$("#cnblogs_post_body"),n=$(`#cnblogs_post_body img:lt(${t})`),e=$(".feedbackCon img"),o=[];$.each(n,(function(t){o.push(n[t])})),$.each(e,(function(t){o.push(e[t])})),a.length>0&&o.length>0&&$.each(o,(t=>{let a=$(o[t]);if(!a.hasClass("code_img_closed")&&!a.hasClass("code_img_opened")){let t=a.attr("width"),n=a.attr("height"),e=a.attr("alt")??"",o=a.attr("style")??"";a.after('${e}`),a.remove()}}))}),800)}n.d(a,{A:function(){return o}}),await $.__tools.dynamicLoadingCss($.__config.default.fancyboxcss),await $.__tools.dynamicLoadingJs($.__config.default.fancybox).catch((t=>console.error("fancybox.js",t))),e()}catch(c){e(c)}}),1)},2684:function(t,a,n){n.a(t,(async function(t,e){try{n.r(a),n.d(a,{default:function(){return i}});var o=n(508),c=n(9928),s=t([o,c]);function i(){(0,o.default)(),n.e(139).then(n.bind(n,9474)).then((t=>{(0,t.default)()})),(0,c.A)()}[o,c]=s.then?(await s)():s,await $.__tools.dynamicLoadingJs($.__config.default.iconfont).catch((t=>console.error("iconfont.js",t))),e()}catch(l){e(l)}}),1)}}]); -------------------------------------------------------------------------------- /easybe/script/page-books.7573bb62.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[111],{3478:function(e,a){a.A='
      ##name##
      ##scoreHtml##
      ##infoHtml##
      ##readDate## ##readPercentage##
      '},5736:function(e,a,t){t.a(e,(async function(e,s){try{t.r(a),t.d(a,{default:function(){return c}});var n=t(3478),i=t(2650),o=t(508),r=e([i,o]);function c(){(0,o.default)(),(()=>{if($.__config.bookList.length){t.e(489).then(t.bind(t,451));let e=$("#cnblogs_post_body"),a="";$.each($.__config.bookList,(e=>{let t=$.__config.bookList[e];t.title&&(a+="

      "+t.title+"

      "),a+='
      ',$.each(t.books,(e=>{let s=n.A,i=t.books[e],o="";void 0!==i.score&&i.score>0?(o+=''.repeat(parseInt(i.score)),i.score>parseInt(i.score)&&(o+=''),o+=''.repeat(parseInt(5-i.score))):o+=''.repeat(5);let r="";const c=e=>{r+=`原 名:${e}
      `},l=e=>{r+=`作 者:${e}
      `},p=e=>{r+=`译 者:${e}
      `},d=e=>{r+=`出版社:${e}
      `},b=e=>{r+=`出版年:${e}
      `},f=e=>{r+=`编 剧: ${e}
      `},v=e=>{r+=`主 演: ${e}
      `},u=e=>{r+=`类 型: ${e}
      `},g=e=>{r+=`制片国家/地区: ${e}
      `},m=e=>{r+=`语 言: ${e}
      `},y=e=>{r+=`上映日期: ${e}
      `},h=e=>{r+=`片 长: ${e}
      `},k=e=>{r+=`别 名: ${e}
      `};i?.formerName&&c(i.formerName),i?.author&&l(i.author),i?.translator&&p(i.translator),i?.press&&d(i.press),i?.year&&b(i.year),i?.scenarist&&f(i.scenarist),i?.star&&v(i.star),i?.type&&u(i.type),i?.productionCountry&&g(i.productionCountry),i?.language&&m(i.language),i?.releaseDate&&y(i.releaseDate),i?.filmLength&&h(i.filmLength),i?.alias&&k(i.alias);let _=void 0!==i.readDate?i.readDate:"",D=_?"initial;":"none",P=void 0!==i.readPercentage?i.readPercentage:"",L=P?"initial;":"none";s=$.__tools.batchTempReplacement(s,[["cover",void 0!==i.cover?i.cover:""],["name",void 0!==i.name?i.name:""],["readDate",_],["readDateStyle",D],["readPercentage",P],["readPercentageStyle",L],["scoreHtml",o],["infoHtml",r]]),a+=s})),a+="
      "}));let s=$(".articleSuffix-flg");s.length?s.before(a):e.append(a)}})(),(0,i.A)()}[i,o]=r.then?(await r)():r,s()}catch(l){s(l)}}))}}]); -------------------------------------------------------------------------------- /easybe/script/page-common-com-article.17d7553b.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/script/page-common-com-article.17d7553b.js.gz -------------------------------------------------------------------------------- /easybe/script/page-home.72454154.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[390],{206:function(t,e,n){function i(t){return(t=>{let e=t.replace(/[\r\n]/g,""),n=$("#digg_count"),i=e.match(/.*posted\s*@\s*([0-9\-:\s]{16}).*阅读\s*\((\d*)\).*评论\s*\((\d*)\).*推荐\s*\((\d*)\).*/)||e.match(/.*posted\s*@\s*([0-9\-:\s]{16}).*阅读\s*\((\d*)\).*评论\s*\((\d*)\).*/)||e.match(/.*posted\s*@\s*([0-9\-:\s]{16}).*/);return{date:void 0===i[1]?"1970-01-01 00:00":i[1],vnum:void 0===i[2]?"0":i[2],cnum:void 0===i[3]?"0":i[3],tnum:void 0===i[4]?n.length?n.text():"0":i[4]}})(t)}n.d(e,{A:function(){return i}})},4819:function(t,e,n){n.r(e),n.d(e,{default:function(){return s}});var i=n(206),o=n(6879);function s(){(()=>{$("#homeTopTitle span").text($.__config.info.name),$.__config.animate.infoName.enable&&$("#homeTopTitle span").hover((function(){$("#homeTopTitle span").css("animation","pageTitleText 2s infinite"),$("#homeTopTitle span").css("-webkit-animation","pageTitleText 1s infinite")}),(function(){$("#homeTopTitle span").css("animation","none"),$("#homeTopTitle span").css("-webkit-animation","none")}));let t=$.__config.banner.home.title,e=$("#hitokoto");if($.isArray(t)&&t.length>0){let n=$.__tools.randomNum(0,t.length-1);return e.html(t[n]).css("display","-webkit-box"),$.__tools.setDomHomePosition(),!0}if("string"==typeof t&&""!==t)return e.html(t).css("display","-webkit-box"),$.__tools.setDomHomePosition(),!0;let n=["当你凝视深渊时,深渊也在凝视着你。","有的人25岁就死了,只是到75岁才埋葬"];function i(t){if("success"===t?.status){let n=t?.note||t.data.content,i=t?.content||`《${t.data.origin.title}》 - ${t.data.origin.dynasty} - ${t.data.origin.author}`;e.html(n).css("display","-webkit-box"),$("#hitokotoAuthor").text(i).show()}else{let t=$.__tools.randomNum(0,n.length-1);e.html(n[t]).css("display","-webkit-box")}$.__tools.setDomHomePosition()}"one"===$.__config.banner.home.titleSource&&(0,o.E)("https://api.wangyangyang.vip/").then((t=>i(t))),"jinrishici"===$.__config.banner.home.titleSource&&(0,o.E)("https://v2.jinrishici.com/one.json").then((t=>i(t)))})(),$(".scroll-down").click((function(){let t;t=$("#home").offset().top+10,$.__tools.actScroll(t,500)})),(()=>{let t=$("#main .c_b_p_desc_readmore"),e=$("#main .postTitle");function n(t){let e=(0,i.A)(t);return'"}t.text("阅读全文 »"),$.each(e,(t=>{let i=$(e[t]),o=i.text(),s=i.nextAll(".postDesc:eq(0)").text();i.after(n(s)),/\[置顶\]/.test(o)&&i.append('置顶'),i.find("a").text(o.replace("[置顶]",""))})),e=$("#main .entrylistPosttitle"),$.each(e,(t=>{let i=$(e[t]),o=i.nextAll(".entrylistItemPostDesc:eq(0)").text();i.after(n(o))}))})(),(()=>{let t=$(".c_b_p_desc");$.each(t,(e=>{let n=$(t[e]),i=n.find("img.desc_img");if(i.length>0){let t=i.attr("src");i.hide(),n.css("width","60%"),n.parent("div").css("min-height","150px");let e='
      ";n.after(e)}}))})(),$.__config.animate.homeBanner.enable&&n.e(261).then(n.t.bind(n,2020,23)).then((t=>{$(".main-header").circleMagic($.__config.animate.homeBanner.options)}))}}}]); -------------------------------------------------------------------------------- /easybe/script/page-links.dd9c93a8.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkeasybe=self.webpackChunkeasybe||[]).push([[510],{709:function(i,n){n.A=' '},6775:function(i,n,a){a.a(i,(async function(i,t){try{a.r(n),a.d(n,{default:function(){return o}});var e=a(508),l=a(709),s=a(2650),c=i([e,s]);function o(){(0,e.default)(),(()=>{if($.__config.links.page.length){a.e(489).then(a.bind(a,451));let i=$("#cnblogs_post_body"),n="";$.each($.__config.links.page,(i=>{let a=$.__config.links.page[i];a.title&&(n+='

      '+a.title+"

      "),n+='"}));let t=$(".articleSuffix-flg");t.length?t.before(n):i.append(n)}})(),(0,s.A)()}[e,s]=c.then?(await c)():c,t()}catch(f){t(f)}}))}}]); -------------------------------------------------------------------------------- /easybe/simple-memory.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/simple-memory.js.gz -------------------------------------------------------------------------------- /easybe/style/background-particles.5ee14091.css: -------------------------------------------------------------------------------- 1 | #particles{height:100vh;left:0;opacity:.6;overflow:hidden;pointer-events:none;position:fixed;top:0;width:100vw;z-index:-2}#particles .particles-layer{background-position:50%;background-repeat:repeat;display:block;height:110%;left:-5%;opacity:0;position:absolute;top:-5%;width:110%}#particles .particles-layer--1{background-image:url(https://oyo.cool/usr/uploads/2024/12/1797160230.svg)}#particles .particles-layer--2{background-image:url(https://oyo.cool/usr/uploads/2024/12/1073548180.svg)}#particles .particles-layer--3{background-image:url(https://oyo.cool/usr/uploads/2024/12/3842676930.svg)}@media (max-width:767px){#particles{display:none}} -------------------------------------------------------------------------------- /easybe/style/com-before.56837d37.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/style/com-before.56837d37.css.gz -------------------------------------------------------------------------------- /easybe/style/gf-blink.0cc7f6e2.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/style/gf-blink.0cc7f6e2.css.gz -------------------------------------------------------------------------------- /easybe/style/google-fonts.66c39700.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/style/google-fonts.66c39700.css.gz -------------------------------------------------------------------------------- /easybe/style/iconfont.cfd96386.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:iconfont;src:url(//at.alicdn.com/t/c/font_3634484_hos8l5ffkw7.woff2?t=1671345294162) format("woff2"),url(//at.alicdn.com/t/c/font_3634484_hos8l5ffkw7.woff?t=1671345294162) format("woff"),url(//at.alicdn.com/t/c/font_3634484_hos8l5ffkw7.ttf?t=1671345294162) format("truetype")}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon{height:1em;vertical-align:-.15em;width:1em;fill:currentColor;margin-right:5px;overflow:hidden}.icon-update-2:before{content:"\e621"}.icon-update-1:before{content:"\e823"}.icon-update:before{content:"\e7d2"}.icon-fuzhi:before{content:"\e60d"}.icon-browse-fill:before{content:"\e6e4"}.icon-brush-fill:before{content:"\e6e5"}.icon-document-fill:before{content:"\e6f3"}.icon-label-fill:before{content:"\e706"}.icon-right:before{content:"\e721"}.icon-task-fill:before{content:"\e732"}.icon-marketing-fill:before{content:"\e74b"}.icon-comments:before{content:"\e617"}.icon-interactive:before{content:"\e63b"}.icon-code:before{content:"\e6f2"}.icon-browse:before{content:"\e745"}.icon-collection-fill:before{content:"\e79d"}.icon-flashlight-fill:before{content:"\efa3"}.icon-dianzan:before{content:"\e674"}.icon-time-fill:before{content:"\e632"}.icon-buzan:before{content:"\fa78"}.icon-unfollower:before{content:"\e616"}.icon-fanhui:before{content:"\e60e"}.icon-zhiding:before{content:"\e739"}.icon-follower:before{content:"\e841"}.icon-lianjie:before{content:"\e60f"}.icon-website:before{content:"\e61a"}.icon-cnblogs:before{content:"\e607"}.icon-mulu:before{content:"\e609"}.icon-fenxiang:after{content:"\e614"}.icon-dashang:before{content:"\e691"}.icon-close:before{content:"\e73e"}.icon-youjiantou:before{content:"\e68c"}.icon-fenleicur:before{content:"\e629"}.icon-sousuo:before{content:"\e62f"}.icon-shezhi-fill:before{content:"\e8b8"}.icon-article:before{content:"\e612"}.icon-guangbo:before{content:"\e6ae"}.icon-yuan:before{content:"\eb99"}.icon-xinlv:before{content:"\e610"}.icon-blog:before{content:"\e633"}.icon-fenlei:before{content:"\e613"}.icon-yongyan:before{content:"\e600"}.icon-facebook:before{content:"\e601"}.icon-dingyue:before{content:"\e602"}.icon-qq-fill:before{content:"\e603"}.icon-github:before{content:"\e604"}.icon-weiruan:before{content:"\e605"}.icon-schedule:before{content:"\ecec"}.icon-home:before{content:"\e65c"}.icon-csdn:before{content:"\e60a"}.icon-book:before{content:"\e67c"}.icon-shezhi:before{content:"\e611"}.icon-kafei:before{content:"\e60b"}.icon-zhifeiji:before{content:"\e6a0"}.icon-home-fill:before{content:"\e702"}.icon-twitter:before{content:"\e7a6"}.icon-markdown:before{content:"\e6f5"}.icon-google:before{content:"\e6b2"}.icon-instagram:before{content:"\e6b6"}.icon-youtube:before{content:"\e6b7"}.icon-wordpress:before{content:"\e72f"}.icon-pinterest:before{content:"\e658"}.icon-tux:before{content:"\e65d"}.icon-npm:before{content:"\e74e"}.icon-erweima:before{content:"\e631"}.icon-gitee-fill:before{content:"\e686"}.icon-apple:before{content:"\e681"}.icon-aliyun:before{content:"\e62a"}.icon-gitlab:before{content:"\e62c"}.icon-dingding:before{content:"\e62d"}.icon-baidu:before{content:"\e62b"}.icon-qq:before{content:"\e676"}.icon-weibo:before{content:"\e6b0"}.icon-wechat:before{content:"\e6b1"}.icon-star-full:before{content:"\e9a1"}.icon-star:before{content:"\e9a2"}.icon-star-half:before{content:"\e9a3"}.icon-gmail:before{content:"\e606"}.icon-linkedin:before{content:"\e608"}.icon-html5:before{content:"\e8b6"}.icon-wechat-fill:before{content:"\e9e6"}.icon-tengxunyun:before{content:"\ee49"}.icon-bilibili:before{content:"\e7d6"}.icon-hot:before{content:"\e618"}.icon-keaide:before{content:"\e60c"}.icon-like-fill:before{content:"\e668"} -------------------------------------------------------------------------------- /easybe/style/mouse-mouse.5e68e4e5.css: -------------------------------------------------------------------------------- 1 | .cursor{background:#333;border-radius:50%}.cursor-f{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='47' height='47' fill='none'%3E%3Cpath stroke='%23000' d='M42.42 42.42C38.84 46 33.36 46 23.5 46S8.16 46 4.58 42.42 1 33.36 1 23.5 1 8.16 4.58 4.58 13.64 1 23.5 1s15.34 0 18.92 3.58S46 13.64 46 23.5s0 15.34-3.58 18.92Z'/%3E%3C/svg%3E");background-size:cover;left:0;opacity:.7;top:0}.cursor,.cursor-f{height:var(--size);pointer-events:none;position:absolute;width:var(--size);z-index:999} -------------------------------------------------------------------------------- /easybe/style/nh-banner-animation.7ff7a955.css: -------------------------------------------------------------------------------- 1 | #nhBannerAnimation{height:100%;position:absolute;width:100%;z-index:1}#nhBannerAnimation .circles{height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}#nhBannerAnimation .circles li{animation:nhBannerAnimation 25s linear infinite;background:hsla(0,0%,100%,.2);bottom:-150px;display:block;height:20px;list-style:none;position:absolute;width:20px}#nhBannerAnimation .circles li:first-child{animation-delay:0s;height:80px;left:25%;width:80px}#nhBannerAnimation .circles li:nth-child(2){animation-delay:2s;animation-duration:12s;height:20px;left:10%;width:20px}#nhBannerAnimation .circles li:nth-child(3){animation-delay:4s;height:20px;left:70%;width:20px}#nhBannerAnimation .circles li:nth-child(4){animation-delay:0s;animation-duration:18s;height:60px;left:40%;width:60px}#nhBannerAnimation .circles li:nth-child(5){animation-delay:0s;height:20px;left:65%;width:20px}#nhBannerAnimation .circles li:nth-child(6){animation-delay:3s;height:110px;left:75%;width:110px}#nhBannerAnimation .circles li:nth-child(7){animation-delay:7s;height:150px;left:35%;width:150px}#nhBannerAnimation .circles li:nth-child(8){animation-delay:15s;animation-duration:45s;height:25px;left:50%;width:25px}#nhBannerAnimation .circles li:nth-child(9){animation-delay:2s;animation-duration:35s;height:15px;left:20%;width:15px}#nhBannerAnimation .circles li:nth-child(10){animation-delay:0s;animation-duration:11s;height:150px;left:85%;width:150px}@keyframes nhBannerAnimation{0%{border-radius:0;opacity:1;transform:translateY(0) rotate(0deg)}to{border-radius:50%;opacity:0;transform:translateY(-1000px) rotate(2turn)}} -------------------------------------------------------------------------------- /easybe/style/owo-css.01842b6b.css: -------------------------------------------------------------------------------- 1 | .OwO{user-select:none}.OwO:hover .OwO-logo{color:#444}.OwO.OwO-open .OwO-logo{border-bottom:none;border-radius:4px 4px 0 0;color:#444}.OwO.OwO-open .OwO-body{display:block}.OwO .OwO-logo{box-sizing:border-box;color:#888;cursor:pointer;display:inline-block;font-size:20px;line-height:16px;padding:2px 5px;position:relative;z-index:2}.OwO .OwO-logo:hover span{animation:my-face 5s ease-in-out infinite;display:inline-block}.OwO .OwO-body{background:#fff;border:1px solid #ddd;border-radius:0 4px 4px 4px;display:none;margin-top:10px;position:absolute;width:400px;z-index:3}.OwO .OwO-body .OwO-items{display:none;font-size:0;margin:0;overflow:scroll;padding:10px;user-select:none}.OwO .OwO-body .OwO-items .OwO-item{background:#f7f7f7;border-radius:5px;cursor:pointer;display:inline-block;font-size:12px;line-height:14px;list-style-type:none;margin:0 10px 12px 0;padding:5px 10px;transition:.3s}.OwO .OwO-body .OwO-items .OwO-item:hover{animation:my-face 5s ease-in-out infinite;background:#eee;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}.OwO .OwO-body .OwO-items-emoji .OwO-item{font-size:20px;line-height:19px}.OwO .OwO-body .OwO-items-image .OwO-item{box-sizing:border-box;max-width:calc(25% - 10px)}.OwO .OwO-body .OwO-items-image .OwO-item img{max-width:100%}.OwO .OwO-body .OwO-items-show{display:block}.OwO .OwO-body .OwO-bar{background:#fff;border-radius:0 0 4px 4px;border-top:1px solid #ddd;color:#444;height:30px;width:100%}.OwO .OwO-body .OwO-bar .OwO-packages{font-size:0;margin:0;padding:0}.OwO .OwO-body .OwO-bar .OwO-packages li{cursor:pointer;display:inline-block;font-size:14px;line-height:30px;list-style-type:none;margin-right:3px;padding:0 10px}.OwO .OwO-body .OwO-bar .OwO-packages li:first-child{border-radius:0 0 0 3px}.OwO .OwO-body .OwO-bar .OwO-packages li:hover{background:#eee}.OwO .OwO-body .OwO-bar .OwO-packages .OwO-package-active{background:#eee;transition:.3s}@keyframes my-face{2%{transform:translateY(1.5px) rotate(1.5deg)}4%{transform:translateY(-1.5px) rotate(-.5deg)}6%{transform:translateY(1.5px) rotate(-1.5deg)}8%{transform:translateY(-1.5px) rotate(-1.5deg)}10%{transform:translateY(2.5px) rotate(1.5deg)}12%{transform:translateY(-.5px) rotate(1.5deg)}14%{transform:translateY(-1.5px) rotate(1.5deg)}16%{transform:translateY(-.5px) rotate(-1.5deg)}18%{transform:translateY(.5px) rotate(-1.5deg)}20%{transform:translateY(-1.5px) rotate(2.5deg)}22%{transform:translateY(.5px) rotate(-1.5deg)}24%{transform:translateY(1.5px) rotate(1.5deg)}26%{transform:translateY(.5px) rotate(.5deg)}28%{transform:translateY(.5px) rotate(1.5deg)}30%{transform:translateY(-.5px) rotate(2.5deg)}32%{transform:translateY(1.5px) rotate(-.5deg)}34%{transform:translateY(1.5px) rotate(-.5deg)}36%{transform:translateY(-1.5px) rotate(2.5deg)}38%{transform:translateY(1.5px) rotate(-1.5deg)}40%{transform:translateY(-.5px) rotate(2.5deg)}42%{transform:translateY(2.5px) rotate(-1.5deg)}44%{transform:translateY(1.5px) rotate(.5deg)}46%{transform:translateY(-1.5px) rotate(2.5deg)}48%{transform:translateY(-.5px) rotate(.5deg)}50%{transform:translateY(.5px) rotate(.5deg)}52%{transform:translateY(2.5px) rotate(2.5deg)}54%{transform:translateY(-1.5px) rotate(1.5deg)}56%{transform:translateY(2.5px) rotate(2.5deg)}58%{transform:translateY(.5px) rotate(2.5deg)}60%{transform:translateY(2.5px) rotate(2.5deg)}62%{transform:translateY(-.5px) rotate(2.5deg)}64%{transform:translateY(-.5px) rotate(1.5deg)}66%{transform:translateY(1.5px) rotate(-.5deg)}68%{transform:translateY(-1.5px) rotate(-.5deg)}70%{transform:translateY(1.5px) rotate(.5deg)}72%{transform:translateY(2.5px) rotate(1.5deg)}74%{transform:translateY(-.5px) rotate(.5deg)}76%{transform:translateY(-.5px) rotate(2.5deg)}78%{transform:translateY(-.5px) rotate(1.5deg)}80%{transform:translateY(1.5px) rotate(1.5deg)}82%{transform:translateY(-.5px) rotate(.5deg)}84%{transform:translateY(1.5px) rotate(2.5deg)}86%{transform:translateY(-1.5px) rotate(-1.5deg)}88%{transform:translateY(-.5px) rotate(2.5deg)}90%{transform:translateY(2.5px) rotate(-.5deg)}92%{transform:translateY(.5px) rotate(-.5deg)}94%{transform:translateY(2.5px) rotate(.5deg)}96%{transform:translateY(-.5px) rotate(1.5deg)}98%{transform:translateY(-1.5px) rotate(-.5deg)}0%,to{transform:translate(0) rotate(0deg)}} -------------------------------------------------------------------------------- /easybe/style/page-books.0865330e.css: -------------------------------------------------------------------------------- 1 | .book-cards{display:grid;grid-template-columns:repeat(2,49%);grid-column-gap:20px;grid-row-gap:15px;margin:5px;position:relative}@media only screen and (max-width:960px){.book-cards{grid-template-columns:repeat(1,100%);grid-column-gap:15px;grid-row-gap:10px}}.book-card{background-color:#fff;border-radius:4px;box-shadow:0 4px 11px -2px rgba(37,44,97,.1),0 1px 3px 0 rgba(93,100,148,.15);color:#8b939c;cursor:pointer;display:flex;flex-direction:column;margin:10px 0;padding:0 15px 15px;position:relative}.book-cards .book-rate i{font-size:13px;margin-right:1px}.book-cards .book-card-img{border-bottom:1px solid #dcddde;border-radius:2px;box-shadow:0 1px 7px 2px #c7c9d3;margin-bottom:20px;margin-top:-35px;object-fit:cover;transition:.3s ease;width:160px}.book-cards .book-card-img:hover{transform:scale(1.04)}.card-content{color:#3d4954;overflow:hidden;padding:20px 30px;position:relative}.book-cards .book-name{font-family:ZCOOL XiaoWei,serif;font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book-cards .book-by{bottom:6px;color:#bbb;font-size:13px;margin-top:4px;position:absolute;right:10px}.book-cards .book-by i{display:none;font-size:14px;margin:0 4px}.book-cards .book-rate>label{color:#ccc}.book-cards .rate{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.book-rate:not(:checked)>label:hover,.book-rate:not(:checked)>label:hover~label,.book-rate>input:checked+label:hover,.book-rate>input:checked~label,.book-rate>input:checked~label:hover,.book-rate>input:checked~label:hover~label,.book-rate>label:hover~input:checked~label{color:#ff9700}.book-cards .card-sum,.book-cards .card-vote{color:#8b939c;font-size:13px}.book-cards .card-sum{line-height:1.6em;-webkit-line-clamp:4;margin-top:15px}.book-cards .content-wrapper{display:flex;position:relative}.book-cards .book-rate i{color:#ff9700;font-size:14px;font-weight:700} -------------------------------------------------------------------------------- /easybe/style/page-common-com-article.d201bb8b.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/easybe/style/page-common-com-article.d201bb8b.css.gz -------------------------------------------------------------------------------- /easybe/style/page-links.6794df20.css: -------------------------------------------------------------------------------- 1 | #links-box{display:grid;grid-template-columns:repeat(3,30%);grid-column-gap:30px;grid-row-gap:10px;margin:5px;position:relative}@media only screen and (max-width:960px){#links-box{grid-template-columns:repeat(2,50%)}}@media only screen and (max-width:720px){#links-box{grid-template-columns:repeat(1,100%)}}#links-box .links-item{align-items:center;background-color:#fff;border-radius:6px;box-shadow:0 1px 7px 2px #c7c9d3;color:#6b7280;cursor:pointer;display:flex;height:70px;justify-self:center;margin:10px 5px;max-width:100%;padding:0 6px;position:relative;width:250px}#links-box .links-item:hover{transform:scale(1.04)}#links-box .links-item>img{border-radius:6px;display:block;height:60px;vertical-align:middle;width:60px}#links-box .links-item .links-info{margin-left:10px;width:180px}#links-box .links-item .links-info .links-info-name{color:#777aaf;font-size:18px;font-weight:700;position:relative;top:-2px}#links-box .links-item .links-info .links-info-text{font-family:ZCOOL XiaoWei,serif;font-size:14px;font-style:oblique;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}#links-box .links-item .links-info span{display:block}#links-box .links-item .links-icon{align-items:center;animation:rotation 3s linear infinite;-moz-animation:rotation 3s linear infinite;-webkit-animation:rotation 3s linear infinite;-o-animation:rotation 3s linear infinite;border-radius:6px;box-shadow:0 1px 7px 2px #c7c9d3;display:flex;height:22px;margin-right:-8px;margin-top:-7px;position:absolute;right:0;top:0;-webkit-transform:rotate(1turn);transition:.3s ease;width:22px}#links-box .links-item:nth-child(3n+0) .links-icon{background-color:#34d399}#links-box .links-item:nth-child(3n+1) .links-icon{background-color:#a78bfa}#links-box .links-item:nth-child(3n+2) .links-icon{background-color:#f87171}#links-box .links-item .links-icon a{color:#fff;--transform-rotate:-45deg;transform:rotate(-45deg)}#links-box .links-item .links-icon a i.icon-zhifeiji{font-size:14px;left:2px;position:relative;top:3px}#links-box .links-item .links-icon a i.icon-flashlight-fill,#links-box .links-item .links-icon a i.icon-like-fill{font-size:14px;left:3px;position:relative;top:4px}@-webkit-keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "easybe", 3 | "version": "2.1.13", 4 | "description": "
      ", 5 | "main": "index.js", 6 | "files": [ 7 | "src", 8 | "easybe" 9 | ], 10 | "directories": { 11 | "doc": "docs" 12 | }, 13 | "scripts": { 14 | "test": "echo \"Error: no test specified\" && exit 1", 15 | "dev": "webpack --mode development", 16 | "build": "webpack --mode production && npx postcss ./src/style/simple-memory.css > ./easybe/simple-memory.css", 17 | "analyz": "webpack --profile --json > stats.json && webpack-bundle-analyzer --port 9090 ./easybe/stats.json" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/wangyang0210/easybe.git" 22 | }, 23 | "keywords": [], 24 | "author": "", 25 | "license": "ISC", 26 | "bugs": { 27 | "url": "https://github.com/wangyang0210/easybe/issues" 28 | }, 29 | "homepage": "https://github.com/wangyang0210/easybe#readme", 30 | "devDependencies": { 31 | "@popperjs/core": "^2.11.8", 32 | "compression-webpack-plugin": "^10.0.0", 33 | "css-loader": "^5.2.7", 34 | "css-minimizer-webpack-plugin": "^5.0.1", 35 | "cssnano": "^6.1.2", 36 | "cssnano-preset-advanced": "^5.3.10", 37 | "exports-loader": "^2.0.0", 38 | "filemanager-webpack-plugin": "^7.0.0", 39 | "html-loader": "^2.1.2", 40 | "imports-loader": "^2.0.0", 41 | "json5": "^2.2.3", 42 | "mini-css-extract-plugin": "^1.6.2", 43 | "postcss": "^8.4.49", 44 | "postcss-cli": "^10.1.0", 45 | "sass": "^1.83.0", 46 | "sass-loader": "^13.3.3", 47 | "style-loader": "^2.0.0", 48 | "toml": "^3.0.0", 49 | "webpack": "^5.97.1", 50 | "webpack-bundle-analyzer": "^4.10.2", 51 | "webpack-cli": "^4.10.0", 52 | "webpack-dev-server": "^4.15.2" 53 | }, 54 | "browserslist": { 55 | "development": [ 56 | "last 1 chrome version", 57 | "last 1 firefox version", 58 | "last 1 safari version" 59 | ], 60 | "production": [ 61 | ">0.2%", 62 | "not dead", 63 | "nop op_mini all" 64 | ] 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('cssnano')({ 4 | preset: ['default', { 5 | discardComments: { 6 | removeAll: true, 7 | }, 8 | }] 9 | }), 10 | ], 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/articleSuffix/articleSuffix.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:18 6 | * ---------------------------------------------- 7 | * @describe: 文章后缀处理 8 | */ 9 | import '../../style/articleSuffix.css'; 10 | import suffixTemp from '../../template/articleSuffix.html'; 11 | 12 | export default function main() { 13 | // 图片 14 | let imgUrl = $.__config.articleSuffix.imgUrl 15 | ? $.__config.articleSuffix.imgUrl 16 | : $.__config.info.avatar 17 | ? $.__config.info.avatar 18 | : $.__config.default.avatar; 19 | 20 | // 本文作者 & 本文链接 21 | let articleAuthor = $('#articleAuthor'); 22 | let articleSource = $('#articleSource'); 23 | let author = articleAuthor.length ? articleAuthor.val() : $.__config.info.name, 24 | source = articleSource.length ? articleSource.val() : $.__status.url, 25 | homeUrl = articleSource.length ? articleSource.val() : $.__status.homeUrl, 26 | origin = articleAuthor.length || articleSource.length ? '原' : '本'; 27 | 28 | // 关于博主 29 | let aboutHtml = $.__config.articleSuffix.aboutHtml 30 | ? $.__config.articleSuffix.aboutHtml 31 | : '评论和私信会在第一时间回复。或者直接私信我。'; 32 | 33 | // 版权声明 34 | let copyrightHtml = $.__config.articleSuffix.copyrightHtml 35 | ? $.__config.articleSuffix.copyrightHtml 36 | : '本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!'; 37 | 38 | // 声援博主 39 | let supportHtml = $.__config.articleSuffix.supportHtml 40 | ? $.__config.articleSuffix.supportHtml 41 | : '如果您觉得文章对您有帮助,可以点击文章下方推荐一下。'; 42 | 43 | let re = [ 44 | ['origin', origin], 45 | ['imgUrl', imgUrl], 46 | ['homeUrl', homeUrl], 47 | ['author', author], 48 | ['source', source], 49 | ['aboutHtml', aboutHtml], 50 | ['copyrightHtml', copyrightHtml], 51 | ['supportHtml', supportHtml], 52 | ]; 53 | let suffixHtml = $.__tools.batchTempReplacement(suffixTemp, re); 54 | 55 | $('#cnblogs_post_body').append(suffixHtml); 56 | 57 | // 版权声明 - COPY 58 | (() => { 59 | if ($.__config.articleSuffix.copyText.enable) { 60 | let textLength = $.__config.articleSuffix.copyText.length || 30; 61 | let copyrightText = $.__config.articleSuffix.copyText.copyright || copyrightHtml; 62 | document.body.addEventListener('copy', function (e) { 63 | if (window.getSelection().toString() && window.getSelection().toString().length > textLength) 64 | setClipboardText(e); 65 | }); 66 | function setClipboardText(event) { 67 | let clipboardData = event.clipboardData || window.clipboardData; 68 | if (clipboardData) { 69 | event.preventDefault(); 70 | let htmlData = 71 | window.getSelection().toString() + 72 | '

      ————————————————————————————————————————————————
      ' + 73 | `${copyrightText}
      ` + 74 | `作者:${author}
      ` + 75 | `原文链接:${source}
      `; 76 | 77 | let textData = 78 | window.getSelection().toString() + 79 | '\n\n ———————————————————————————————————————————————— \n' + 80 | `${copyrightText.replace(/<\/?.+?>/g, '').replace(/ /g, '')} \n` + 81 | `作者:${author} \n` + 82 | `原文链接:${source} \n`; 83 | 84 | clipboardData.setData('text/html', htmlData); 85 | clipboardData.setData('text/plain', textData); 86 | } 87 | } 88 | } 89 | })(); 90 | } 91 | -------------------------------------------------------------------------------- /src/components/background/particles.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:23 6 | * ---------------------------------------------- 7 | * @describe: 背景鼠标滚动动画 8 | */ 9 | import particlesTemp from '../../template/particles.html'; 10 | import '../../style/particles.css'; 11 | await $.__tools.dynamicLoadingJs($.__config.default.gsap).catch((e) => console.error('gsap.js', e)); 12 | export default function main(options) { 13 | $('#footer').after(particlesTemp); 14 | let wrapper = document.getElementById('particles'), 15 | ela = wrapper.querySelector('.particles-layer--1'), 16 | elb = wrapper.querySelector('.particles-layer--2'), 17 | elc = wrapper.querySelector('.particles-layer--3'), 18 | particlesList = [ 19 | { el: ela, opacity: 0.07, speed: 0.06 }, 20 | { el: elb, opacity: 0.07, speed: 0.04 }, 21 | { el: elc, opacity: 0.07, speed: 0.05 }, 22 | ]; 23 | particlesList.forEach((l) => { 24 | gsap.to(l.el, 0.6, { delay: Math.random(), opacity: l.opacity }); 25 | }); 26 | document.addEventListener('mousemove', particlesMousemove); 27 | function particlesMousemove(t) { 28 | let e = { x: window.innerWidth / 2, y: window.innerHeight / 2 }, 29 | n = { x: t.clientX || t.pageX, y: t.clientY || t.pageY }, 30 | r = { x: e.x - n.x, y: e.y - n.y }; 31 | particlesList.forEach((l) => { 32 | gsap.to(l.el, 1, { x: r.x * l.speed, y: r.y * l.speed }); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/components/banner/banner.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:19 6 | * ---------------------------------------------- 7 | * @describe: banner背景图片处理 8 | */ 9 | import bannerTemp from '../../template/banner.html'; 10 | 11 | export default function main() { 12 | $('#sidebar_news').prepend(bannerTemp); 13 | 14 | /** 15 | * 设置banner背景图片,初始化高度 16 | * (该处理需在loading结束之前处理) 17 | */ 18 | (() => { 19 | let mainHeader = $('#main-header'); 20 | let topImg, bgImg, height; 21 | 22 | // 设置图片 23 | if ($.__status.pageType === 'home') { 24 | topImg = 25 | $.__config.banner.home.background.length > 0 26 | ? $.__config.banner.home.background 27 | : ['https://www.oyo.cool/usr/uploads/imgs/o_220917053600_wallhaven-6k3oox.webp']; 28 | } else { 29 | topImg = 30 | $.__config.banner.article.background.length > 0 31 | ? $.__config.banner.article.background 32 | : ['https://www.oyo.cool/usr/uploads/imgs/o_220917053937_wallhaven-j5mz95.webp']; 33 | height = '40vh'; 34 | $('#homeTopTitle').hide(); 35 | $('.scroll-down').hide(); 36 | $('#home').css('margin-top', '40vh'); 37 | $('#cb_post_title_url').addClass('post-del-title'); 38 | } 39 | 40 | // 设置高度 41 | if (height) mainHeader.css('height', height); 42 | 43 | // banner动效 44 | if ($.__config.animate.bannerImages?.enable) { 45 | // 开启图片自动切换 46 | import(/* webpackChunkName: "banner-images" */ '../bannerImages/bannerImages').then((module) => { 47 | let bannerImages = module.default; 48 | bannerImages( 49 | 'main-header', 50 | topImg, 51 | $.__config.animate.bannerImages.options.itemNum, 52 | $.__config.animate.bannerImages.options.time, 53 | $.__config.animate.bannerImages.options.sort, 54 | $.__config.animate.bannerImages.options.current < 0 55 | ? $.__tools.randomNum(0, topImg.length - 1) 56 | : $.__config.animate.bannerImages.options.current 57 | ); 58 | }); 59 | } else { 60 | // 随机指定一个图片 61 | 62 | if (topImg.length > 1) bgImg = topImg[$.__tools.randomNum(0, topImg.length - 1)]; 63 | else bgImg = topImg[0] || ''; 64 | 65 | mainHeader.css({ 66 | background: "#222 url('" + encodeURI(bgImg) + "') center center no-repeat", 67 | 'background-size': 'cover', 68 | }); 69 | } 70 | 71 | // Banner文字是否可选 72 | if (!$.__config.banner.text) $('.main-header-content.inner').addClass('textUnselect'); 73 | })(); 74 | 75 | // 添加事件监听 76 | $.__event.scroll.handle.push(() => { 77 | let openButton = $('#open-button'); 78 | 79 | if ( 80 | $.__event.scroll.temScroll < $.__event.scroll.docScroll && 81 | $.__event.scroll.homeScroll <= $.__event.scroll.docScroll && 82 | !openButton.hasClass('menu-button-scroll') 83 | ) { 84 | // 向下滚动 85 | openButton.addClass('menu-button-scroll'); 86 | openButton.text(''); 87 | } 88 | 89 | if ( 90 | $.__event.scroll.temScroll > $.__event.scroll.docScroll && 91 | $.__event.scroll.homeScroll >= $.__event.scroll.docScroll && 92 | openButton.hasClass('menu-button-scroll') 93 | ) { 94 | // 滚入头图 95 | openButton.removeClass('menu-button-scroll'); 96 | openButton.text('MENU'); 97 | } 98 | }); 99 | } 100 | -------------------------------------------------------------------------------- /src/components/bannerImages/bannerImages.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:19 6 | * ---------------------------------------------- 7 | * @describe: banner背景切换处理 8 | */ 9 | 10 | await $.__tools.dynamicLoadingJs($.__config.default.gsap).catch((e) => console.error('gsap.js', e)); 11 | export default function main(id, images, cols, time, sort, current) { 12 | let bgMain = document.getElementById(id); 13 | let parts = []; // 列容器对象 14 | let playing = false; // 是否执行动画 15 | 16 | // 生成图片对象 17 | for (let i in images) { 18 | new Image().src = images[i]; 19 | } 20 | 21 | // 生成列dom 22 | for (let col = 0; col < cols; col++) { 23 | let part = document.createElement('div'); 24 | part.className = 'part'; 25 | let el = document.createElement('div'); 26 | el.className = 'section'; 27 | let img = document.createElement('img'); 28 | img.src = images[current]; 29 | el.appendChild(img); 30 | part.style.setProperty('--x', (-100 / cols) * col + 'vw'); 31 | part.appendChild(el); 32 | bgMain.appendChild(part); 33 | parts.push(part); 34 | } 35 | 36 | // 动画配置 37 | let animOptions = { 38 | duration: 2.3, 39 | ease: Power4.easeInOut, 40 | }; 41 | 42 | function go(dir) { 43 | if (!playing) { 44 | playing = true; 45 | if (current + dir < 0) current = images.length - 1; 46 | else if (current + dir >= images.length) current = 0; 47 | else current += dir; 48 | 49 | function up(part, next) { 50 | part.appendChild(next); 51 | gsap.to(part, { ...animOptions, y: document.getElementById(id).offsetHeight * -1 }).then(function () { 52 | part.children[0].remove(); 53 | gsap.to(part, { duration: 0, y: 0 }); 54 | }); 55 | } 56 | 57 | function down(part, next) { 58 | part.prepend(next); 59 | gsap.to(part, { duration: 0, y: document.getElementById(id).offsetHeight * -1 }); 60 | gsap.to(part, { ...animOptions, y: 0 }).then(function () { 61 | part.children[1].remove(); 62 | playing = false; 63 | }); 64 | } 65 | 66 | for (let p in parts) { 67 | let part = parts[p]; 68 | let next = document.createElement('div'); 69 | next.className = 'section'; 70 | let img = document.createElement('img'); 71 | img.src = images[current]; 72 | next.appendChild(img); 73 | 74 | if ((p - Math.max(0, dir)) % 2) { 75 | down(part, next); 76 | } else { 77 | up(part, next); 78 | } 79 | } 80 | } 81 | } 82 | 83 | // 定时执行 84 | window.setInterval(() => { 85 | go(sort); 86 | }, time); 87 | } 88 | -------------------------------------------------------------------------------- /src/components/blogIcon/blogIcon.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:19 6 | * ---------------------------------------------- 7 | * @describe: 网站图标处理 8 | */ 9 | export default function main() { 10 | let shortcutIcon = $('link[rel="shortcut icon"]'); 11 | if ($.__config.info.blogIcon && shortcutIcon.length) shortcutIcon.attr('href', $.__config.info.blogIcon); 12 | if ($.__config.info.blogIcon && !shortcutIcon.length) { 13 | let linkObject = document.createElement('link'); 14 | linkObject.rel = 'shortcut icon'; 15 | linkObject.href = $.__config.info.blogIcon; 16 | document.getElementsByTagName('head')[0].appendChild(linkObject); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/components/code/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:20 6 | * ---------------------------------------------- 7 | * @describe: 代码高亮处理 8 | */ 9 | import beforeCode from '../../hooks/beforeCode'; 10 | import afterCode from '../../hooks/afterCode'; 11 | await $.__tools.dynamicLoadingJs($.__config.default.clipboard).catch((e) => console.error('clipboard.js', e)); 12 | export default function main() { 13 | let preList = $('#main pre'); 14 | beforeCode(); 15 | 16 | /** 17 | * 初始化代码结构 18 | */ 19 | (() => { 20 | $.each(preList, function (i) { 21 | let pre = $(preList[i]); 22 | let boxId = 'code-' + $.__tools.randomString(6); 23 | 24 | // 设置外部标签 25 | pre.wrap(''); 26 | pre.attr('boxid', boxId); 27 | }); 28 | })(); 29 | 30 | /** 31 | * 工具条 32 | */ 33 | (() => { 34 | if ($.__config.code.options.macStyle) { 35 | let codeBox = $('code-box'); 36 | $.each(codeBox, function (i) { 37 | $(codeBox[i]).prepend('
      '); 38 | }); 39 | } else { 40 | preList.css('border-radius', '4px'); 41 | } 42 | })(); 43 | 44 | /** 45 | * 复制代码 46 | */ 47 | (() => { 48 | let codeBox = $('code-box'); 49 | $.each(codeBox, function (i) { 50 | let code = $(codeBox[i]); 51 | let boxId = code.attr('id'); 52 | let copyHtml = 53 | ''; 58 | code.prepend(copyHtml); 59 | }); 60 | 61 | // 点击效果 62 | $('code-box .code-copay-btn').click(function () { 63 | $(this).find('i').removeClass('icon-fuzhi').addClass('icon-right'); 64 | setTimeout( 65 | "$('code-box button[boxid='" + 66 | $(this).attr('boxid') + 67 | "'] i').removeClass('icon-right').addClass('icon-fuzhi')", 68 | 1500 69 | ); 70 | }); 71 | // 显示/隐藏 72 | codeBox.on({ 73 | mouseover: function () { 74 | $(this).find('.code-copay-btn').css({ 75 | opacity: 1, 76 | visibility: 'visible', 77 | }); 78 | }, 79 | mouseout: function () { 80 | $(this).find('.code-copay-btn').css({ 81 | opacity: 0, 82 | visibility: 'hidden', 83 | }); 84 | }, 85 | }); 86 | 87 | new ClipboardJS('.clipboard'); 88 | })(); 89 | 90 | /** 91 | * 限制代码框高度 92 | */ 93 | (() => { 94 | if ($.__config.code.options.maxHeight) $('code-box pre').css('max-height', $.__config.code.options.maxHeight); 95 | })(); 96 | 97 | /** 98 | * 渲染代码 99 | */ 100 | (() => { 101 | let codeType = $.__config.code.type.toLowerCase(); 102 | if (codeType === 'hljs') { 103 | import(/* webpackChunkName: "code-hljs" */ './lib/hljs').then((module) => { 104 | const codeMain = module.default; 105 | codeMain(setCodeLine); 106 | }); 107 | } else { 108 | preList.css('background', '#f5f5fa'); 109 | $('code-box .code-tools').css('background', '#f5f5fa'); 110 | $('pre .hljs').css({ 111 | background: 'none', 112 | border: '0', 113 | 'border-radius': '0', 114 | padding: '0', 115 | }); 116 | setCodeLine(); 117 | } 118 | afterCode(); 119 | })(); 120 | 121 | /** 122 | * 设置代码行号 123 | */ 124 | function setCodeLine() { 125 | if (!$.__config.code.options.line) return true; 126 | 127 | let preListLine = $('code-box pre code'); 128 | $.each(preListLine, function (i) { 129 | let pre = $(preListLine[i]); 130 | let codeLine = pre 131 | .html() 132 | .replace(/\/g, '\n') 133 | .split('\n'); 134 | let code = []; 135 | 136 | $.each(codeLine, (j) => { 137 | if (codeLine[j].trim() || j < codeLine.length - 1) { 138 | codeLine[j] !== '' && 139 | code.push('' + codeLine[j]); 140 | } 141 | }); 142 | 143 | pre.html(code.join('\n')); 144 | pre.addClass('code-pre-line'); 145 | }); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /src/components/code/lib/hljs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:20 6 | * ---------------------------------------------- 7 | * @describe: hljs渲染代码 8 | */ 9 | await $.__tools.dynamicLoadingJs($.__config.default.highlight).catch((e) => console.error('hightlight.js', e)); 10 | export default function main(setCodeLine) { 11 | let theme = $.__config.code.options.hljs.theme.toLowerCase(); 12 | $.__tools.dynamicLoadingCss(`${$.__config.default.hljscss + theme}.min.css`); 13 | let code = $('code-box pre code'); 14 | let bgFlg = 15 | $.inArray(theme, [ 16 | 'github-gist', 17 | 'googlecode', 18 | 'grayscale', 19 | 'idea', 20 | 'isbl-editor-light', 21 | 'qtcreator_light', 22 | 'tomorrow', 23 | 'vs', 24 | 'xcode', 25 | 'arduino-light', 26 | 'ascetic', 27 | 'color-brewer', 28 | 'lightfair', 29 | ]) !== -1; 30 | 31 | /** 32 | * 渲染代码 33 | */ 34 | (() => { 35 | // 语言范围设置 36 | if ($.__config.code.options.hljs.languages.length) { 37 | hljs.configure({ 38 | languages: $.__config.code.options.hljs.languages, 39 | }); 40 | } 41 | 42 | // 渲染代码 43 | $.each(code, function (i, e) { 44 | let obj = $(code[i]); 45 | // 做一次换行兼容处理/padding处理 46 | obj.css('white-space', 'pre') 47 | .html() 48 | .replace(/\/g, '\n'); 49 | obj.css({ padding: 0 }); 50 | // 清除代码原有样式 51 | obj.text(obj.text()); 52 | // 替换白色背景的主题 53 | bgFlg && obj.css('background', '#f5f5fa'); 54 | // 开始渲染代码 55 | hljs.highlightElement(e); 56 | // 设置复制按钮颜色 57 | $('.clipboard[boxid=' + obj.attr('boxid') + ']').addClass('hljs-comment'); 58 | }); 59 | })(); 60 | 61 | /** 62 | * 显示自动识别语言 63 | */ 64 | let setCodeHljsLen = () => { 65 | let codeBox = $('code-box'); 66 | $.each(codeBox, function (i, e) { 67 | let obj = $(codeBox[i]); 68 | let language = $('pre code')[i].result?.language; 69 | if (language) obj.find('.code-hljs-len').text(language).css('visibility', 'visible'); 70 | }); 71 | }; 72 | 73 | /** 74 | * 设置工具条背景色 & 添加语言标签 75 | */ 76 | (() => { 77 | $.__timeIds.hljsCodeTId = window.setInterval(() => { 78 | let preHljs = $('pre code.hljs'); 79 | if (preHljs.length > 0) { 80 | $('code-box') 81 | .css('background', $('pre code.hljs').css('background')) 82 | .prepend(''); 83 | setCodeHljsLen(); 84 | $.__tools.clearIntervalTimeId($.__timeIds.hljsCodeTId); 85 | } 86 | }, 1000); 87 | })(); 88 | 89 | /** 90 | * 设置行号 91 | */ 92 | (() => { 93 | setCodeLine(); 94 | })(); 95 | } 96 | -------------------------------------------------------------------------------- /src/components/comment/comment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:20 6 | * ---------------------------------------------- 7 | * @describe: 评论处理 8 | */ 9 | 10 | export default function main() { 11 | // 评论打字特效 12 | if ($.__config.articleContent.commentTyping.enable) { 13 | const POWERMODE = require('./commentTyping/commentTyping'); 14 | POWERMODE.colorful = $.__config.articleContent.commentTyping.options.colorful; 15 | POWERMODE.shake = $.__config.articleContent.commentTyping.options.shake; 16 | document.body.addEventListener('input', POWERMODE); 17 | } 18 | 19 | // 表情 20 | if ($.__config.articleContent.owo.enable) { 21 | import(/* webpackChunkName: "owo-css" */ '../../style/owo.scss'); 22 | import(/* webpackChunkName: "owo-js" */ './owo/owo'); 23 | } 24 | let setComment = () => { 25 | let feedbackItem = $('.feedbackItem'); 26 | if (feedbackItem.length > 0) { 27 | $(feedbackItem[0]).css('padding-top', '0'); 28 | $(feedbackItem[feedbackItem.length - 1]).css('padding-bottom', '0'); 29 | $.__config.animate.avatar.enable && $('.feedbackAvatar').addClass('img-rounded'); 30 | } 31 | }; 32 | 33 | setComment(); 34 | 35 | $(document).ajaxSuccess(function (event, xhr, settings) { 36 | if (settings.url.includes('archive')) setComment(); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /src/components/comment/commentTyping/commentTyping.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: https://github.com/disjukr/activate-power-mode 5 | * @Date 2023-02-19 12:54 6 | * ---------------------------------------------- 7 | * @describe: POWERMODE 8 | */ 9 | 10 | let canvas = document.createElement('canvas'); 11 | canvas.width = window.innerWidth; 12 | canvas.height = window.innerHeight; 13 | canvas.style.cssText = 'position:fixed;top:0;left:0;pointer-events:none;z-index:999999'; 14 | window.addEventListener('resize', function () { 15 | canvas.width = window.innerWidth; 16 | canvas.height = window.innerHeight; 17 | }); 18 | document.body.appendChild(canvas); 19 | let context = canvas.getContext('2d'); 20 | let particles = []; 21 | let particlePointer = 0; 22 | let rendering = false; 23 | 24 | POWERMODE.shake = true; 25 | 26 | function getRandom(min, max) { 27 | return Math.random() * (max - min) + min; 28 | } 29 | 30 | function getColor(el) { 31 | if (POWERMODE.colorful) { 32 | let u = getRandom(0, 360); 33 | return 'hsla(' + getRandom(u - 10, u + 10) + ', 100%, ' + getRandom(50, 80) + '%, ' + 1 + ')'; 34 | } else { 35 | return window.getComputedStyle(el).color; 36 | } 37 | } 38 | 39 | function getCaret() { 40 | let el = document.activeElement; 41 | let bcr; 42 | if (el.tagName === 'TEXTAREA' || 43 | (el.tagName === 'INPUT' && el.getAttribute('type') === 'text')) { 44 | let offset = require('./textareaCaretPosition')(el, el.selectionEnd); 45 | bcr = el.getBoundingClientRect(); 46 | return { 47 | x: offset.left + bcr.left, 48 | y: offset.top + bcr.top, 49 | color: getColor(el) 50 | }; 51 | } 52 | let selection = window.getSelection(); 53 | if (selection.rangeCount) { 54 | let range = selection.getRangeAt(0); 55 | let startNode = range.startContainer; 56 | if (startNode.nodeType === document.TEXT_NODE) { 57 | startNode = startNode.parentNode; 58 | } 59 | bcr = range.getBoundingClientRect(); 60 | return { 61 | x: bcr.left, 62 | y: bcr.top, 63 | color: getColor(startNode) 64 | }; 65 | } 66 | return { x: 0, y: 0, color: 'transparent' }; 67 | } 68 | 69 | function createParticle(x, y, color) { 70 | return { 71 | x: x, 72 | y: y, 73 | alpha: 1, 74 | color: color, 75 | velocity: { 76 | x: -1 + Math.random() * 2, 77 | y: -3.5 + Math.random() * 2 78 | } 79 | }; 80 | } 81 | 82 | function POWERMODE() { 83 | { // spawn particles 84 | let caret = getCaret(); 85 | let numParticles = 5 + Math.round(Math.random() * 10); 86 | while (numParticles--) { 87 | particles[particlePointer] = createParticle(caret.x, caret.y, caret.color); 88 | particlePointer = (particlePointer + 1) % 500; 89 | } 90 | } 91 | { // shake screen 92 | if (POWERMODE.shake) { 93 | let intensity = 1 + 2 * Math.random(); 94 | let x = intensity * (Math.random() > 0.5 ? -1 : 1); 95 | let y = intensity * (Math.random() > 0.5 ? -1 : 1); 96 | document.body.style.marginLeft = x + 'px'; 97 | document.body.style.marginTop = y + 'px'; 98 | setTimeout(function() { 99 | document.body.style.marginLeft = ''; 100 | document.body.style.marginTop = ''; 101 | }, 75); 102 | } 103 | } 104 | if(!rendering){ 105 | requestAnimationFrame(loop); 106 | } 107 | }; 108 | POWERMODE.colorful = false; 109 | 110 | function loop() { 111 | rendering = true; 112 | context.clearRect(0, 0, canvas.width, canvas.height); 113 | let rendered = false; 114 | let rect = canvas.getBoundingClientRect(); 115 | for (let i = 0; i < particles.length; ++i) { 116 | let particle = particles[i]; 117 | if (particle.alpha <= 0.1) continue; 118 | particle.velocity.y += 0.075; 119 | particle.x += particle.velocity.x; 120 | particle.y += particle.velocity.y; 121 | particle.alpha *= 0.96; 122 | context.globalAlpha = particle.alpha; 123 | context.fillStyle = particle.color; 124 | context.fillRect( 125 | Math.round(particle.x - 1.5) - rect.left, 126 | Math.round(particle.y - 1.5) - rect.top, 127 | 3, 3 128 | ); 129 | rendered = true; 130 | } 131 | if(rendered){ 132 | requestAnimationFrame(loop); 133 | }else{ 134 | rendering = false; 135 | } 136 | } 137 | 138 | module.exports = POWERMODE; 139 | -------------------------------------------------------------------------------- /src/components/common/comAfter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:20 6 | * ---------------------------------------------- 7 | * @describe: 后置公共处理 8 | */ 9 | import progress from '../progress/progress'; 10 | import title from '../title/title'; 11 | import footer from '../footer/footer'; 12 | import rtMenu from '../rtMenu/rtMenu'; 13 | import blogIcon from '../blogIcon/blogIcon'; 14 | import dayNight from '../dayNight/dayNight'; 15 | import console from '../console/console'; 16 | 17 | export default function main() { 18 | /** 19 | * 页脚 20 | */ 21 | (() => { 22 | footer(); 23 | })(); 24 | 25 | /** 26 | * 右下角菜单 27 | */ 28 | (() => { 29 | rtMenu(); 30 | })(); 31 | 32 | /** 33 | * 日/夜模式 34 | */ 35 | (() => { 36 | dayNight(); 37 | })(); 38 | 39 | /** 40 | * 进度条 41 | */ 42 | (() => { 43 | progress(); 44 | })(); 45 | 46 | /** 47 | * 背景动效 48 | */ 49 | (() => { 50 | let obj = $.__config.animate.background; 51 | for (let key in obj) { 52 | if (obj[key].enable) { 53 | import(/* webpackChunkName: "background-[request]" */ `../background/${key}`).then((module) => { 54 | let background = module.default; 55 | background(obj[key]?.options); 56 | }); 57 | } 58 | } 59 | })(); 60 | 61 | /** 62 | * 鼠标动效 63 | */ 64 | (() => { 65 | let obj = $.__config.animate.mouse; 66 | for (let key in obj) { 67 | if (obj[key].enable) { 68 | import(/* webpackChunkName: "mouse-[request]" */ `../mouse/${key}`).then((module) => { 69 | let mouse = module.default; 70 | mouse(obj[key]?.options); 71 | }); 72 | } 73 | } 74 | })(); 75 | 76 | /** 77 | * 网站图标 78 | */ 79 | (() => { 80 | blogIcon(); 81 | })(); 82 | 83 | /** 84 | * 页面title 85 | */ 86 | (() => { 87 | title(); 88 | })(); 89 | 90 | /** 91 | * 控制台输出 92 | */ 93 | (() => { 94 | console(); 95 | })(); 96 | } 97 | -------------------------------------------------------------------------------- /src/components/common/comBefore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:20 6 | * ---------------------------------------------- 7 | * @describe: 前置公共处理 8 | */ 9 | 10 | import sidebar from '../sidebar/sidebar'; 11 | import banner from '../banner/banner'; 12 | import event from '../event/event'; 13 | await $.__tools.dynamicLoadingJs($.__config.default.jqueryrotate).catch((e) => console.error('jqueryrotate.js', e)); 14 | import loading from '../loading/loading'; 15 | 16 | export default function main() { 17 | let loadingObject = loading(); 18 | 19 | // 默认字体图标库 20 | import(/* webpackChunkName: "iconfont" */ '../../style/iconfont.css'); 21 | 22 | // 谷歌字体 23 | import(/* webpackChunkName: "google-fonts" */ '../../style/google-fonts.css'); 24 | 25 | // 开启loading 26 | (() => { 27 | loadingObject.start(); 28 | })(); 29 | 30 | /** 31 | * 国家公祭日和自定义重要的缅怀的日子 32 | */ 33 | (() => { 34 | if ($.__tools.getTodayDate() == '12-13' || $.__config.memorialDays.includes($.__tools.getTodayDate())) 35 | $('html').addClass('htmlGray'); 36 | })(); 37 | 38 | /** 39 | * 定时清除全部计时器 40 | */ 41 | (() => { 42 | setTimeout(() => { 43 | $.each($.__timeIds, (e) => { 44 | null != $.__timeIds[e] && window.clearInterval($.__timeIds[e]); 45 | }); 46 | }, 30000); 47 | })(); 48 | 49 | /** 50 | * 事件绑定 51 | */ 52 | (() => { 53 | event.init(); 54 | })(); 55 | 56 | /** 57 | * 侧边栏 58 | */ 59 | (() => { 60 | sidebar(); 61 | })(); 62 | 63 | /** 64 | * 头图 65 | */ 66 | (() => { 67 | banner(); 68 | })(); 69 | 70 | /** 71 | * 添加扩展字体图标库 72 | */ 73 | (() => { 74 | if ($.__config.fontIconExtend !== '') $.__tools.dynamicLoadingCss($.__config.fontIconExtend, 1); 75 | })(); 76 | 77 | // 关闭loading 78 | (() => { 79 | loadingObject.stop(); 80 | })(); 81 | } 82 | -------------------------------------------------------------------------------- /src/components/console/console.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:21 6 | * ---------------------------------------------- 7 | * @describe: 控制台输出处理 8 | */ 9 | 10 | export default function main() { 11 | // 输出默认版权信息 12 | let github = [ 13 | '\n %c %c %c EasyBe GitHub %c %c https://github.com/wangyang0210/EasyBe %c \n\n', 14 | 'background: #fadfa3; padding:5px 0;', 15 | 'background: #fadfa3; padding:5px 0;', 16 | 'color: #fadfa3; background: #030307; padding:5px 0;', 17 | 'background: #fadfa3; padding:5px 0;', 18 | 'background: #FCEDC9; color:#030307; padding:5px 0;', 19 | 'background: #fadfa3; padding:5px 0;', 20 | ], 21 | version = [ 22 | `\n %c %c %c EasyBe Version %c %c ${$.__config.default.version} %c \n\n`, 23 | 'background: #fadfa3; padding:5px 0;', 24 | 'background: #fadfa3; padding:5px 0;', 25 | 'color: #fadfa3; background: #030307; padding:5px 0;', 26 | 'background: #fadfa3; padding:5px 0;', 27 | 'background: #FCEDC9; color:#030307; padding:5px 0;', 28 | 'background: #fadfa3; padding:5px 0;', 29 | ]; 30 | window.console.log.apply(console, github); 31 | window.console.log.apply(console, version); 32 | 33 | // 输出用户配置信息 34 | if ($.__config.consoleList.length) { 35 | $.each($.__config.consoleList, function (i) { 36 | let fl = $.__config.consoleList[i]; 37 | console.log( 38 | '\n' + ' %c ' + fl[0] + ' %c ' + fl[1] + ' ' + '\n', 39 | 'color: #fadfa3; background: #030307; padding:5px 0;', 40 | 'background: #fadfa3; color:#000;padding:5px 0;' 41 | ); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/components/dayNight/dayNight.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:21 6 | * ---------------------------------------------- 7 | * @describe: 日夜间模式处理 8 | */ 9 | import dayNightTemp from '../../template/dayNight.html'; 10 | import dayNightControl from '../../hooks/dayNightControl'; 11 | 12 | export default function main() { 13 | if (!$.__config.switchDayNight.enable) return true; 14 | 15 | let h = parseInt(new Date().getHours()), 16 | cookieKey = 'cnblogs_config_isNight', 17 | exp = 4 * 3600, 18 | daySwitch; 19 | $.__status.dayNightCssHref = ''; // 夜间模式css样式文件路径,用于记录webpack打包后路径 20 | 21 | /** 22 | * 评论框背景 23 | * @param status {string} 日夜模式 24 | */ 25 | let commentBackground = (status) => { 26 | $.__config.articleContent.commentBackground.enable && $.__tools.setCommentBackground(status); 27 | }; 28 | 29 | /** 30 | * 判断当前日/夜模式 31 | */ 32 | (() => { 33 | switch ($.__tools.getCookie(cookieKey)) { 34 | case 'day': 35 | daySwitch = 'daySwitch'; 36 | break; 37 | case 'night': 38 | daySwitch = ''; 39 | break; 40 | default: 41 | daySwitch = $.__config.switchDayNight.auto.enable 42 | ? h >= $.__config.switchDayNight.auto.nightHour 43 | ? '' 44 | : h >= $.__config.switchDayNight.auto.dayHour 45 | ? 'daySwitch' 46 | : '' 47 | : 'daySwitch'; 48 | break; 49 | } 50 | })(); 51 | 52 | /** 53 | * 判断是否强制夜间 54 | */ 55 | (() => { 56 | if ($.__config.switchDayNight.nightMode) daySwitch = ''; 57 | })(); 58 | 59 | /** 60 | * 设置基础模版 61 | */ 62 | (() => { 63 | $('body').prepend($.__tools.tempReplacement(dayNightTemp, 'daySwitch', daySwitch)); 64 | })(); 65 | 66 | /** 67 | * 初始化样式 68 | */ 69 | (() => { 70 | if (!daySwitch) loadDarkCss(); 71 | })(); 72 | 73 | /** 74 | * 设置评论框背景 75 | */ 76 | (() => { 77 | daySwitch ? commentBackground('day') : commentBackground('night'); 78 | })(); 79 | 80 | /** 81 | * 模式切换事件 82 | */ 83 | (() => { 84 | $('#dayNightSwitch .onOff').click(function () { 85 | if ($(this).hasClass('daySwitch')) { 86 | // 夜间 87 | $.__tools.setCookie(cookieKey, 'night', exp); 88 | $(this).removeClass('daySwitch'); 89 | loadDarkCss(); 90 | dayNightControl('night'); 91 | commentBackground('night'); 92 | } else { 93 | // 日间 94 | $.__tools.setCookie(cookieKey, 'day', exp); 95 | $(this).addClass('daySwitch'); 96 | $('head link#baseDarkCss').remove(); 97 | dayNightControl('day'); 98 | commentBackground('day'); 99 | } 100 | }); 101 | })(); 102 | 103 | /** 104 | * 加载夜间模式样式文件 105 | * 第一次初始化使用 import 加载并记录路径 106 | * 第二次及以后使用标签构建文件加载 107 | */ 108 | function loadDarkCss() { 109 | if ($.__status.dayNightCssHref) { 110 | $('head').append( 111 | '' 112 | ); 113 | } else { 114 | import(/* webpackChunkName: "day-night" */ '../../style/base.dark.css'); 115 | 116 | setTimeout(function () { 117 | let links = $('head link'); 118 | for (let i = links.length - 1; i > 0; i--) { 119 | let obj = $(links[i]); 120 | let href = obj.attr('href'); 121 | if (/^.*\/day-night\.[a-z0-9]{8}\.css$/.test(href)) { 122 | $.__status.dayNightCssHref = href; 123 | obj.attr('id', 'baseDarkCss'); 124 | break; 125 | } 126 | } 127 | }, 500); 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /src/components/event/event.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:21 6 | * ---------------------------------------------- 7 | * @describe: 事件监听 8 | */ 9 | 10 | export default { 11 | init() { 12 | // 滚动监听 13 | $.__event.scroll = {}; 14 | $.__event.scroll.handle = []; 15 | $.__event.scroll.temScroll = 0; // 上一次页面滚动位置 16 | $.__event.scroll.docScroll = $(document).scrollTop(); // 当前滚动位置 17 | $.__event.scroll.homeScroll = $('#home').offset().top - 40; // 主体滚动 18 | $(window).scroll(() => { 19 | $.__event.scroll.docScroll = $(document).scrollTop(); 20 | $.__event.scroll.homeScroll = $('#home').offset().top - 40; 21 | this.handle.scroll(); 22 | $.__event.scroll.temScroll = $.__event.scroll.docScroll; 23 | }); 24 | // 窗口大小监听 25 | $.__event.resize = {}; 26 | $.__event.resize.handle = []; 27 | $(window).resize(() => { 28 | this.handle.resize(); 29 | }); 30 | }, 31 | handle: { 32 | scroll: () => { 33 | for (let i = 0; i < $.__event.scroll.handle.length; i++) { 34 | $.__event.scroll.handle[i](); 35 | } 36 | }, 37 | resize: () => { 38 | for (let i = 0; i < $.__event.resize.handle.length; i++) { 39 | $.__event.resize.handle[i](); 40 | } 41 | $.__tools.setDomHomePosition(); 42 | }, 43 | }, 44 | }; 45 | -------------------------------------------------------------------------------- /src/components/greenChannel/greenChannel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:22 6 | * ---------------------------------------------- 7 | * @describe: 文章底部信息按钮处理 8 | */ 9 | import '../../style/customBtn.css'; 10 | 11 | export default function main() { 12 | /** 13 | * 好文要顶 14 | */ 15 | (() => { 16 | $.__timeIds.greenChannelDiggTId = window.setInterval(() => { 17 | let greenChannelDigg = $('#green_channel_digg'); 18 | if (greenChannelDigg.length) { 19 | greenChannelDigg.after( 20 | '' 24 | ); 25 | $.__tools.clearIntervalTimeId($.__timeIds.greenChannelDiggTId); 26 | } 27 | }, 1000); 28 | })(); 29 | 30 | /** 31 | * 关注我 32 | */ 33 | (() => { 34 | $.__timeIds.greenChannelFollowTId = window.setInterval(() => { 35 | let greenChannelFollow = $('#green_channel_follow'); 36 | if (greenChannelFollow.length) { 37 | greenChannelFollow.after( 38 | '' 41 | ); 42 | $.__tools.clearIntervalTimeId($.__timeIds.greenChannelFollowTId); 43 | } 44 | }, 1000); 45 | })(); 46 | 47 | /** 48 | * 打赏博主 49 | */ 50 | (() => { 51 | $.__timeIds.greenChannelWechatTId = window.setInterval(() => { 52 | let greenChannelWechat = $('#green_channel_wechat'); 53 | if (greenChannelWechat.length) { 54 | greenChannelWechat.after( 55 | '' 58 | ); 59 | $.__tools.clearIntervalTimeId($.__timeIds.greenChannelWechatTId); 60 | } 61 | }, 1000); 62 | })(); 63 | } 64 | -------------------------------------------------------------------------------- /src/components/imgBox/imgBox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:22 6 | * ---------------------------------------------- 7 | * @describe: 图片灯箱处理 8 | */ 9 | await $.__tools.dynamicLoadingCss($.__config.default.fancyboxcss); 10 | await $.__tools.dynamicLoadingJs($.__config.default.fancybox).catch((e) => console.error('fancybox.js', e)); 11 | export default function main() { 12 | setTimeout(() => { 13 | let imgLength = $('#cnblogs_post_body img').length - 1; 14 | if (!imgLength) return; 15 | 16 | let cpb = $('#cnblogs_post_body'), 17 | imgList = $(`#cnblogs_post_body img:lt(${imgLength})`), 18 | comImgList = $('.feedbackCon img'), 19 | data = []; 20 | 21 | $.each(imgList, function (i) { 22 | data.push(imgList[i]); 23 | }); 24 | 25 | $.each(comImgList, function (i) { 26 | data.push(comImgList[i]); 27 | }); 28 | 29 | if (cpb.length > 0 && data.length > 0) { 30 | $.each(data, (i) => { 31 | let tem = $(data[i]); 32 | if (!tem.hasClass('code_img_closed') && !tem.hasClass('code_img_opened')) { 33 | let width = tem.attr('width'); 34 | let height = tem.attr('height'); 35 | let alt = tem.attr('alt') ?? ''; 36 | let style = tem.attr('style') ?? ''; 37 | tem.after( 38 | '${alt}' 47 | ); 48 | tem.remove(); 49 | } 50 | }); 51 | } 52 | }, 800); 53 | } 54 | -------------------------------------------------------------------------------- /src/components/loading/loading.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:22 6 | * ---------------------------------------------- 7 | * @describe: loading 处理 8 | */ 9 | import { rebound, Spinner } from 'exports-loader?exports=rebound,Spinner!../../vendor/loading/loading'; 10 | import beforeLoading from '../../hooks/beforeLoading'; 11 | import afterLoading from '../../hooks/afterLoading'; 12 | 13 | export default function main() { 14 | let loading = function () { 15 | let that = this; 16 | 17 | this.config = $.__config.loading; 18 | this.spring = null; 19 | this.spinner = null; 20 | 21 | /** 22 | * Initialize Rebound.js with settings. 23 | * Rebound is used to generate a spring which 24 | * is then used to animate the spinner. 25 | * See more: http://facebook.github.io/rebound-js/docs/rebound.html 26 | */ 27 | this.initRebound = () => { 28 | let settings = that.config.rebound; 29 | 30 | let springSystem = new rebound.SpringSystem(); 31 | 32 | that.spring = springSystem.createSpring(settings.tension, settings.friction); 33 | }; 34 | 35 | /** 36 | * Initialize Spinner with settings. 37 | */ 38 | this.initSpinner = () => { 39 | let settings = that.config.spinner; 40 | 41 | that.spinner = new Spinner(settings); 42 | }; 43 | 44 | /** 45 | * 开启 loading 46 | */ 47 | this.start = () => { 48 | beforeLoading(); 49 | $('#blog-news').prepend('
      '); 50 | that.initRebound(); 51 | that.initSpinner(); 52 | that.spinner.init(that.spring, true); 53 | }; 54 | 55 | /** 56 | * 结束 loading 57 | */ 58 | this.stop = () => { 59 | $('body').css('overflow', 'auto'); 60 | that.spinner.setComplete(); 61 | $('div#loading').hide(); 62 | $('a[name="top"]').hide(); 63 | afterLoading(); 64 | }; 65 | }; 66 | 67 | return new loading(); 68 | } 69 | -------------------------------------------------------------------------------- /src/components/mouse/bubble.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-09-02 23:05 6 | * ---------------------------------------------- 7 | * @describe: 鼠标移动汽包粒子效果 8 | */ 9 | 10 | export default function main(options) { 11 | let canvasElement = document.createElement('canvas'); 12 | canvasElement.id = 'bubble'; 13 | $('#home').after(canvasElement); 14 | let canvas = document.getElementById('bubble'); 15 | let ctx = canvas.getContext('2d'); 16 | canvas.width = window.innerWidth; 17 | canvas.height = window.innerHeight; 18 | canvas.style.position = 'fixed'; 19 | canvas.style.left = '0'; 20 | canvas.style.bottom = '0'; 21 | canvas.style.zIndex = '999999999999999999999999999999999999999999'; 22 | canvas.style.pointerEvents = 'none'; 23 | let points = []; 24 | let live = options.live; 25 | let colors = options.colors; 26 | 27 | window.addEventListener('mousemove', function (evt) { 28 | for (let i = 0; i < options.quantity; i++) { 29 | points.push({ 30 | sx: evt.x, 31 | sy: evt.y, 32 | vx: 0.5 - Math.random(), 33 | vy: 0.5 - Math.random(), 34 | life: live, //存活周期 35 | color: colors[parseInt(Math.random() * colors.length)], 36 | size: Math.random() * options.size, 37 | }); 38 | } 39 | }); 40 | 41 | function drawpoints() { 42 | ctx.clearRect(0, 0, canvas.width, canvas.height); 43 | for (let i = 0; i < points.length; i++) { 44 | let point = points[i]; 45 | ctx.beginPath(); 46 | ctx.arc(point.sx, point.sy, point.size, Math.PI * 2, false); 47 | ctx.fillStyle = 'rgba(' + point.color + ',' + point.life / live + ')'; 48 | ctx.fill(); 49 | point.life--; 50 | if (point.life <= 0) { 51 | points.splice(i, 1); 52 | } 53 | point.sx += point.vx * 3; 54 | point.sy += point.vy * 3; 55 | } 56 | } 57 | 58 | setInterval(drawpoints, 20); 59 | } 60 | -------------------------------------------------------------------------------- /src/components/mouse/mo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-09-04 19:36 6 | * ---------------------------------------------- 7 | * @describe: 使用mo.js实现各种效果 8 | */ 9 | 10 | export default function main(options) { 11 | $.__tools 12 | .dynamicLoadingJs($.__config.default.mojs) 13 | .then(() => { 14 | const burst = new mojs.Burst({ 15 | left: 0, 16 | top: 0, 17 | ...options, 18 | }); 19 | burst.el.style.zIndex = 999999; 20 | document.addEventListener('click', function (e) { 21 | burst.tune({ x: e.pageX, y: e.pageY }).setSpeed(3).replay(); 22 | }); 23 | }) 24 | .catch((e) => console.error('mo.js: ', e)); 25 | } 26 | -------------------------------------------------------------------------------- /src/components/mouse/mouse.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:23 6 | * ---------------------------------------------- 7 | * @describe: 鼠标移动/点击效果 8 | */ 9 | import '../../style/mouse.css'; 10 | await $.__tools.dynamicLoadingJs($.__config.default.gsap).catch((e) => console.error('gsap.js', e)); 11 | export default function main(options) { 12 | const cursor = document.createElement('div'); 13 | cursor.className = 'cursor'; 14 | 15 | const cursorF = document.createElement('div'); 16 | cursorF.className = 'cursor-f'; 17 | 18 | let cursorX = 0; 19 | let cursorY = 0; 20 | let pageX = 0; 21 | let pageY = 0; 22 | let size = options.size; 23 | let sizeF = options.sizeF; 24 | let followSpeed = 0.16; 25 | 26 | document.body.appendChild(cursor); 27 | document.body.appendChild(cursorF); 28 | 29 | if ('ontouchstart' in window) { 30 | cursor.style.display = 'none'; 31 | cursorF.style.display = 'none'; 32 | } 33 | 34 | cursor.style.setProperty('--size', size + 'px'); 35 | cursorF.style.setProperty('--size', sizeF + 'px'); 36 | 37 | window.addEventListener('mousemove', function (e) { 38 | pageX = e.pageX; 39 | pageY = e.pageY; 40 | cursor.style.top = pageY - size / 2 + 'px'; 41 | let cursorLeft = pageX - size / 2; 42 | let offsetWidth = document.body.offsetWidth; 43 | cursorLeft = cursorLeft < 0 ? 0 : offsetWidth - size < cursorLeft ? offsetWidth - size : cursorLeft; 44 | cursor.style.left = cursorLeft + 'px'; 45 | }); 46 | 47 | function lerp(start, end, amount) { 48 | return (1 - amount) * start + amount * end; 49 | } 50 | 51 | function loop() { 52 | cursorX = lerp(cursorX, pageX, followSpeed); 53 | cursorY = lerp(cursorY, pageY, followSpeed); 54 | cursorF.style.top = cursorY - sizeF / 2 + 'px'; 55 | let cursorFLeft = cursorX - sizeF / 2; 56 | let offsetWidth = document.body.offsetWidth; 57 | cursorFLeft = cursorFLeft < 0 ? 0 : offsetWidth - sizeF < cursorFLeft ? offsetWidth - sizeF : cursorFLeft; 58 | cursorF.style.left = cursorFLeft + 'px'; 59 | 60 | requestAnimationFrame(loop); 61 | } 62 | 63 | loop(); 64 | 65 | let startY; 66 | let endY; 67 | let clicked = false; 68 | 69 | function mousedown(e) { 70 | gsap.to(cursor, { scale: 4.5 }); 71 | gsap.to(cursorF, { scale: 0.4 }); 72 | 73 | clicked = true; 74 | startY = e.clientY || e.touches[0].clientY || e.targetTouches[0].clientY; 75 | } 76 | 77 | function mouseup(e) { 78 | gsap.to(cursor, { scale: 1 }); 79 | gsap.to(cursorF, { scale: 1 }); 80 | 81 | endY = e.clientY || endY; 82 | if (clicked && startY && Math.abs(startY - endY) >= 40) { 83 | clicked = false; 84 | startY = null; 85 | endY = null; 86 | } 87 | } 88 | 89 | window.addEventListener('mousedown', mousedown, false); 90 | window.addEventListener('touchstart', mousedown, false); 91 | window.addEventListener( 92 | 'touchmove', 93 | function (e) { 94 | if (clicked) endY = e.touches[0].clientY || e.targetTouches[0].clientY; 95 | }, 96 | false 97 | ); 98 | window.addEventListener('touchend', mouseup, false); 99 | window.addEventListener('mouseup', mouseup, false); 100 | } 101 | -------------------------------------------------------------------------------- /src/components/postMeta/postMeta.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:23 6 | * ---------------------------------------------- 7 | * @describe: 文章信息 8 | */ 9 | 10 | export default function main(postDescText) { 11 | let getPostMetaInfo = (postDescInfo) => { 12 | let postDescRep = postDescInfo.replace(/[\r\n]/g, ''); 13 | 14 | let postMetaRex = /.*posted\s*@\s*([0-9\-:\s]{16}).*阅读\s*\((\d*)\).*评论\s*\((\d*)\).*推荐\s*\((\d*)\).*/, 15 | postMetaRex2 = /.*posted\s*@\s*([0-9\-:\s]{16}).*阅读\s*\((\d*)\).*评论\s*\((\d*)\).*/, 16 | postMetaRex3 = /.*posted\s*@\s*([0-9\-:\s]{16}).*/, 17 | diggCount = $('#digg_count'), 18 | info = postDescRep.match(postMetaRex) || postDescRep.match(postMetaRex2) || postDescRep.match(postMetaRex3), 19 | date = typeof info[1] === 'undefined' ? '1970-01-01 00:00' : info[1], 20 | vnum = typeof info[2] === 'undefined' ? '0' : info[2], 21 | cnum = typeof info[3] === 'undefined' ? '0' : info[3], 22 | tnum = typeof info[4] === 'undefined' ? (diggCount.length ? diggCount.text() : '0') : info[4]; 23 | 24 | return { 25 | date: date, 26 | vnum: vnum, 27 | cnum: cnum, 28 | tnum: tnum, 29 | }; 30 | }; 31 | 32 | return getPostMetaInfo(postDescText); 33 | } 34 | -------------------------------------------------------------------------------- /src/components/progress/progress.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:23 6 | * ---------------------------------------------- 7 | * @describe: 头部进度条处理 8 | */ 9 | 10 | export default function main() { 11 | $.__tools 12 | .dynamicLoadingJs($.__config.default.toprogress) 13 | .then((r) => { 14 | $('#blog-news').prepend('
      '); 15 | let progressBar = ToProgress && new window.ToProgress($.__config.progressBar, '#progressBar'); 16 | 17 | // 添加事件监听 18 | $.__event.scroll.handle.push(() => { 19 | progressBar.setProgress($.__tools.getScrollPercent()); 20 | }); 21 | }) 22 | .catch((e) => console.log('toprogress.js', e)); 23 | } 24 | -------------------------------------------------------------------------------- /src/components/sidebar/lib/classie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:24 6 | * ---------------------------------------------- 7 | * @describe: 侧边栏处理 8 | */ 9 | export default function main() { 10 | function classReg(className) { 11 | return new RegExp('(^|\\s+)' + className + '(\\s+|$)'); 12 | } 13 | 14 | // classList support for class management 15 | // altho to be fair, the api sucks because it won't accept multiple classes at once 16 | let hasClass, addClass, removeClass; 17 | 18 | if ('classList' in document.documentElement) { 19 | hasClass = function (elem, c) { 20 | return elem.classList.contains(c); 21 | }; 22 | addClass = function (elem, c) { 23 | elem.classList.add(c); 24 | }; 25 | removeClass = function (elem, c) { 26 | elem.classList.remove(c); 27 | }; 28 | } else { 29 | hasClass = function (elem, c) { 30 | return classReg(c).test(elem.className); 31 | }; 32 | addClass = function (elem, c) { 33 | if (!hasClass(elem, c)) { 34 | elem.className = elem.className + ' ' + c; 35 | } 36 | }; 37 | removeClass = function (elem, c) { 38 | elem.className = elem.className.replace(classReg(c), ' '); 39 | }; 40 | } 41 | 42 | function toggleClass(elem, c) { 43 | var fn = hasClass(elem, c) ? removeClass : addClass; 44 | fn(elem, c); 45 | } 46 | 47 | return { 48 | // full names 49 | hasClass: hasClass, 50 | addClass: addClass, 51 | removeClass: removeClass, 52 | toggleClass: toggleClass, 53 | // short names 54 | has: hasClass, 55 | add: addClass, 56 | remove: removeClass, 57 | toggle: toggleClass, 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /src/components/sidebar/lib/main4.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:24 6 | * ---------------------------------------------- 7 | * @describe: 侧边栏处理 8 | */ 9 | import cla from './classie'; 10 | await $.__tools.dynamicLoadingJs($.__config.default.snapsvg).catch((e) => console.error('snapsvg-cjs.js', e)); 11 | await $.__tools.dynamicLoadingJs($.__config.default.optiscroll).catch((e) => console.log('optiscroll.js', e)); 12 | await $.__tools.dynamicLoadingCss($.__config.default.optiscrollcss); 13 | export default function main() { 14 | let bodyEl = document.body, 15 | content = document.querySelector('.content-wrap'), 16 | openbtn = document.getElementById('open-button'), 17 | closebtn = document.getElementById('close-button'), 18 | isOpen = false, 19 | classie = cla(), 20 | morphEl = document.getElementById('morph-shape'), 21 | s = Snap(morphEl.querySelector('svg')), 22 | path = s.select('path'), 23 | initialPath = path.attr('d'), 24 | isAnimating = false; 25 | 26 | let myOptiscrollInstance; 27 | 28 | function init() { 29 | initEvents(); 30 | 31 | // 初始化滚动条 32 | myOptiscrollInstance = new Optiscroll(document.querySelector('#menuWrap'), { 33 | preventParentScroll: true, 34 | forceScrollbars: true, 35 | }); 36 | } 37 | 38 | function initEvents() { 39 | openbtn.addEventListener('click', toggleMenu); 40 | if (closebtn) closebtn.addEventListener('click', toggleMenu); 41 | 42 | // close the menu element if the target it麓s not the menu element or one of its descendants.. 43 | content.addEventListener('click', function (ev) { 44 | let target = ev.target; 45 | if (isOpen && target !== openbtn) toggleMenu(); 46 | }); 47 | } 48 | 49 | function toggleMenu() { 50 | $('.menu-wrap').show(); 51 | 52 | if (isOpen) { 53 | $(bodyEl).removeClass('show-menu'); 54 | 55 | $('#content-wrap').fadeOut(300); 56 | $(bodyEl).css('overflow', 'auto'); 57 | $('#mainContent').off('touchmove'); 58 | 59 | path.attr('d', initialPath); 60 | isAnimating = false; 61 | } else { 62 | classie.add(bodyEl, 'show-menu'); 63 | 64 | $('#content-wrap').show(); 65 | $('body').css('overflow', 'hidden'); 66 | 67 | // 初始化滚动条到顶部位置 68 | myOptiscrollInstance.scrollTo(false, 'top'); 69 | } 70 | isOpen = !isOpen; 71 | } 72 | 73 | init(); 74 | 75 | return { 76 | myOptiscrollInstance: myOptiscrollInstance, 77 | }; 78 | } 79 | -------------------------------------------------------------------------------- /src/components/status/status.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:24 6 | * ---------------------------------------------- 7 | * @describe: 博客基础信息抓取处理 8 | */ 9 | 10 | let status = { 11 | url: '', 12 | user: '', 13 | pageType: '', 14 | articleId: '', 15 | }; 16 | status.url = window.location.href; 17 | let tmp = status.url.split('/'); 18 | status.homeUrl = [tmp[0], tmp[1], tmp[2]].join('/'); 19 | let topics = $('#topics').length; 20 | status.user = !topics ? $('title').text() : $('title').text().split('- ')[1]; 21 | status.pageType = !topics 22 | ? 'home' 23 | : $('#bookListFlg').length 24 | ? 'books' 25 | : $('#linkListFlg').length 26 | ? 'links' 27 | : 'article'; 28 | if (topics) status.articleId = tmp[tmp.length - 2]; 29 | 30 | export default status; 31 | -------------------------------------------------------------------------------- /src/components/title/title.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:25 6 | * ---------------------------------------------- 7 | * @describe: 页面title处理 8 | */ 9 | 10 | export default function main() { 11 | let RelTitle = document.title, 12 | hidden, 13 | visibilityChange, 14 | timer, 15 | onblur = $.__config.title.onblur, 16 | onblurTime = $.__config.title.onblurTime, 17 | focus = $.__config.title.focus, 18 | focusTime = $.__config.title.focusTime; 19 | 20 | if (typeof document.hidden !== 'undefined') { 21 | hidden = 'hidden'; 22 | visibilityChange = 'visibilitychange'; 23 | } 24 | if (typeof document.mozHidden !== 'undefined') { 25 | // Firefox up to v17 26 | hidden = 'mozHidden'; 27 | visibilityChange = 'mozvisibilitychange'; 28 | } 29 | 30 | if (typeof document.webkitHidden !== 'undefined') { 31 | // Chrome up to v32, Android up to v4.4, Blackberry up to v10 32 | hidden = 'webkitHidden'; 33 | visibilityChange = 'webkitvisibilitychange'; 34 | } 35 | 36 | let handleVisibilityChange = () => { 37 | if (timer) clearTimeout(timer); 38 | 39 | if (document[hidden] && onblurTime >= 0) { 40 | timer = setTimeout(() => { 41 | document.title = onblur + ' - ' + RelTitle.split(' - ')[0]; 42 | }, onblurTime); 43 | } 44 | 45 | if (!document[hidden] && focusTime >= 0) { 46 | document.title = focus; 47 | timer = setTimeout(() => { 48 | document.title = RelTitle; 49 | }, focusTime); 50 | } 51 | 52 | if (!document[hidden] && focusTime < 0) { 53 | document.title = RelTitle; 54 | } 55 | }; 56 | if (typeof document.addEventListener !== 'undefined' || typeof document[hidden] !== 'undefined') { 57 | document.addEventListener(visibilityChange, handleVisibilityChange, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/hooks/afterCode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:25 6 | * ---------------------------------------------- 7 | * @describe: code 渲染结束后 8 | */ 9 | 10 | export default function main() { 11 | if (typeof $.__config.hooks.afterCode === 'function') $.__config.hooks.afterCode(); 12 | } 13 | -------------------------------------------------------------------------------- /src/hooks/afterLoading.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:25 6 | * ---------------------------------------------- 7 | * @describe: loading 结束后 8 | */ 9 | 10 | export default function main() { 11 | if (typeof $.__config.hooks.afterLoading === 'function') $.__config.hooks.afterLoading(); 12 | } 13 | -------------------------------------------------------------------------------- /src/hooks/beforeCode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:25 6 | * ---------------------------------------------- 7 | * @describe: code 渲染开始前 8 | */ 9 | 10 | export default function main() { 11 | if (typeof $.__config.hooks.beforeCode === 'function') $.__config.hooks.beforeCode(); 12 | } 13 | -------------------------------------------------------------------------------- /src/hooks/beforeLoading.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:25 6 | * ---------------------------------------------- 7 | * @describe: loading 开始前 8 | */ 9 | 10 | export default function main() { 11 | if (typeof $.__config.hooks.beforeLoading === 'function') $.__config.hooks.beforeLoading(); 12 | } 13 | -------------------------------------------------------------------------------- /src/hooks/dayNightControl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:26 6 | * ---------------------------------------------- 7 | * @describe: 日夜间模式切换时 8 | */ 9 | 10 | export default function main(type) { 11 | if (typeof $.__config.hooks.dayNightControl === 'function') $.__config.hooks.dayNightControl(type); 12 | } 13 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:26 6 | * ---------------------------------------------- 7 | * @describe: 主程序文件 8 | */ 9 | import defaultConfig from './components/config/config.json5'; 10 | import status from './components/status/status'; 11 | import tools from './utils/tools'; 12 | import event from './components/event/event'; 13 | 14 | $(document).ready(function () { 15 | // 初始化 16 | $.__config = $.extend(true, defaultConfig, window?.cnblogsConfig || {}); // 配置信息 17 | $.__status = status; // 页面状态信息 18 | $.__tools = tools; // 公共处理工具 19 | $.__timeIds = {}; // 定时器 20 | $.__event = {}; // 事件 21 | $.__config.info.name ||= $.__status.user; 22 | $.__tools 23 | .dynamicLoadingJs($.__config.default.moment) 24 | .then((r) => { 25 | import( 26 | /* webpackChunkName: "page-[request]" */ /* webpackPreload: true */ `./page/${$.__status.pageType}` 27 | ).then((module) => { 28 | const page = module.default; 29 | 30 | // 前置公共处理 31 | import( 32 | /* webpackChunkName: "com-before" */ /* webpackPreload: true */ './components/common/comBefore' 33 | ).then((beforeModule) => { 34 | const comBefore = beforeModule.default; 35 | comBefore(); 36 | 37 | // 页面逻辑处理 38 | page(); 39 | 40 | // 后置公共处理 41 | import( 42 | /* webpackChunkName: "com-after" */ /* webpackPreload: true */ './components/common/comAfter' 43 | ).then((afterModule) => { 44 | const comAfter = afterModule.default; 45 | comAfter(); 46 | (() => { 47 | $.__tools.setDomHomePosition(); // 文章主体位置修正 48 | event.handle.scroll(); // 触发滚动处理 49 | event.handle.resize(); // 触发窗口大小变化处理 50 | })(); 51 | }); 52 | }); 53 | }); 54 | }) 55 | .catch((e) => console.error('moment.js', e)); 56 | }); 57 | -------------------------------------------------------------------------------- /src/page/article.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:26 6 | * ---------------------------------------------- 7 | * @describe: 文章页处理 8 | */ 9 | import comArticle from './common/com-article'; 10 | import imgBox from '../components/imgBox/imgBox'; 11 | await $.__tools.dynamicLoadingJs($.__config.default.iconfont).catch((e) => console.error('iconfont.js', e)); 12 | 13 | export default function main() { 14 | /** 15 | * 文章页公共处理 16 | */ 17 | (() => { 18 | comArticle(); 19 | })(); 20 | 21 | /** 22 | * 代码高亮处理 23 | */ 24 | (() => { 25 | // 异步处理防止影响loading结束 26 | import(/* webpackChunkName: "article-code" */ '../components/code/code').then((module) => { 27 | const code = module.default; 28 | code(); 29 | }); 30 | })(); 31 | 32 | /** 33 | * 图片灯箱处理 34 | */ 35 | (() => { 36 | imgBox(); 37 | })(); 38 | } 39 | -------------------------------------------------------------------------------- /src/page/common/com-article.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:26 6 | * ---------------------------------------------- 7 | * @describe: 文章页公共处理部分 8 | * 由于书单页、友链页等部分页面基础是文章页,所以共通部分提取至此来处理 9 | */ 10 | import articleInfo from '../../components/articleInfo/articleInfo'; 11 | import comment from '../../components/comment/comment'; 12 | import articleSuffix from '../../components/articleSuffix/articleSuffix'; 13 | import articleDirectory from '../../components/articleDirectory/articleDirectory'; 14 | import greenChannel from '../../components/greenChannel/greenChannel'; 15 | 16 | export default function main() { 17 | /** 18 | * 设置文章banner动效 19 | */ 20 | (() => { 21 | if ($.__config.animate.articleBanner.enable) 22 | import(/* webpackChunkName: "nh-banner-animation" */ '../../style/nhBannerAnimation.css'); 23 | })(); 24 | 25 | /** 26 | * 清除文章页冲突样式 27 | */ 28 | (() => { 29 | for (let i = 0; i <= 10; i++) { 30 | setTimeout(function timer() { 31 | let postMain = $('#main'); 32 | postMain.find('.cnblogs-markdown').removeClass('cnblogs-markdown'); 33 | postMain.find('.cnblogs-post-body').removeClass('cnblogs-post-body'); 34 | }, i * 500); 35 | } 36 | })(); 37 | 38 | /** 39 | * 设置文章信息 40 | */ 41 | (() => { 42 | articleInfo(); 43 | })(); 44 | 45 | /** 46 | * 设置文章目录 47 | */ 48 | (() => { 49 | $.__status.pageType !== 'books' && articleDirectory(); 50 | })(); 51 | 52 | /** 53 | * 设置文章底部信息按钮 54 | */ 55 | (() => { 56 | greenChannel(); 57 | })(); 58 | 59 | /** 60 | * 设置文章后缀 61 | */ 62 | (() => { 63 | articleSuffix(); 64 | })(); 65 | 66 | /** 67 | * 设置评论框 68 | */ 69 | (() => { 70 | comment(); 71 | })(); 72 | } 73 | -------------------------------------------------------------------------------- /src/page/links.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:27 6 | * ---------------------------------------------- 7 | * @describe: 友链页处理 8 | */ 9 | import comArticle from './common/com-article'; 10 | import '../style/links.css'; 11 | import linksTemp from '../template/links.html'; 12 | import articleDirectory from '../components/articleDirectory/articleDirectory'; 13 | 14 | export default function main() { 15 | /** 16 | * 文章页公共处理 17 | */ 18 | (() => { 19 | comArticle(); 20 | })(); 21 | 22 | /** 23 | * 添加友链 24 | */ 25 | (() => { 26 | if ($.__config.links.page.length) { 27 | import(/* webpackChunkName: "gf-blink" */ '../style/gf-blink.css'); 28 | 29 | let postBody = $('#cnblogs_post_body'), 30 | html = ''; 31 | 32 | $.each($.__config.links.page, (i) => { 33 | let list = $.__config.links.page[i]; 34 | if (list.title) 35 | html += 36 | '

      ' + list.title + '

      '; 37 | 38 | html += ''; 59 | }); 60 | 61 | // 插入模版 62 | let articleSuffixFlg = $('.articleSuffix-flg'); 63 | articleSuffixFlg.length ? articleSuffixFlg.before(html) : postBody.append(html); 64 | } 65 | })(); 66 | 67 | /** 68 | * 设置文章目录 69 | */ 70 | (() => { 71 | articleDirectory(); 72 | })(); 73 | } 74 | -------------------------------------------------------------------------------- /src/style/articleDirectory.css: -------------------------------------------------------------------------------- 1 | #articleDirectory { 2 | position: absolute; 3 | top: calc(40vh + 5px); 4 | right: 0; 5 | width: 260px; 6 | z-index: 1; 7 | max-height: 55vh; 8 | overflow: auto; 9 | box-shadow: 0 4px 11px -2px rgb(37 44 97 / 15%), 0 1px 3px 0 rgb(93 100 148 / 20%); 10 | background: rgba(255, 255, 255, .9); 11 | } 12 | 13 | #articleDirectory.articleDirectoryFixed { 14 | position: fixed; 15 | max-height: 95vh; 16 | top: 5px !important; 17 | } 18 | 19 | #articleDirectory ul { 20 | margin: 0; 21 | padding: 10px 10px 10px 5px; 22 | } 23 | 24 | #articleDirectory ul li { 25 | list-style: none; 26 | text-align: left; 27 | text-overflow: ellipsis; 28 | white-space: nowrap; 29 | margin: 0; 30 | padding: 2px 0; 31 | height: 24px; 32 | cursor: pointer; 33 | } 34 | 35 | .articleDirectory-overflow { 36 | overflow: hidden; 37 | } 38 | 39 | #articleDirectory ul li a { 40 | color: #000; 41 | padding: 0 0 0 10px; 42 | display: inline-block; 43 | width: 100%; 44 | height: 100%; 45 | position: relative; 46 | text-overflow: ellipsis; 47 | white-space: nowrap; 48 | } 49 | 50 | #articleDirectory ul li a:hover, #articleDirectory ul li a.active { 51 | background: rgba(80, 80, 80, .04); 52 | color: #807dd4; 53 | } 54 | 55 | #articleDirectory ul li a:hover::after, #articleDirectory ul li a.active:after { 56 | content: ""; 57 | z-index: 1; 58 | top: 0; 59 | right: 0; 60 | width: 100%; 61 | height: 100%; 62 | position: absolute; 63 | left: 0; 64 | bottom: 0; 65 | display: inline-block; 66 | border-left: 3px solid #807dd4; 67 | } 68 | -------------------------------------------------------------------------------- /src/style/articleSuffix.css: -------------------------------------------------------------------------------- 1 | #articleSuffix { 2 | background-image: linear-gradient(180deg,#fff,#f5f5fa); 3 | box-shadow: 0 4px 11px 0 rgb(37 44 97 / 10%), 0 1px 3px 0 rgb(93 100 148 / 13%); 4 | position: relative; 5 | overflow: hidden; 6 | cursor: pointer; 7 | margin: 0 5px; 8 | color: #3a416f; 9 | border-radius: 4px; 10 | } 11 | 12 | .essaySuffix-eof { 13 | font-weight: 700; 14 | font-size: 16px; 15 | text-align: center; 16 | color: #ddd; 17 | text-indent: 0 18 | } 19 | 20 | #articleSuffix .articleSuffix-bg { 21 | position: absolute; 22 | right: -22px; 23 | top: 0; 24 | bottom: 0; 25 | height: 240px; 26 | margin-top: -23px; 27 | width: 210px; 28 | opacity: .5; 29 | } 30 | 31 | #articleSuffix .articleSuffix-left { 32 | max-width: 140px; 33 | float: left; 34 | padding: 12px; 35 | } 36 | 37 | #articleSuffix .articleSuffix-left img { 38 | width: 128px; 39 | height: 128px; 40 | border: 1px solid #ddd; 41 | padding: 6px; 42 | margin: 0; 43 | display: block; 44 | border-radius: 4px; 45 | } 46 | 47 | #articleSuffix .articleSuffix-right { 48 | height: 160px; 49 | width: calc(100% - 170px); 50 | float: right; 51 | } 52 | 53 | #articleSuffix .articleSuffix-right item { 54 | display:inline-block; 55 | position:absolute; 56 | top: 50%; 57 | transform: translate(0, -50%); 58 | padding-top: 8px; 59 | } 60 | 61 | #articleSuffix .articleSuffix-right li { 62 | list-style: none; 63 | line-height: 1.35em; 64 | } 65 | 66 | #articleSuffix .articleSuffix-right li b { 67 | font-weight: bold; 68 | } -------------------------------------------------------------------------------- /src/style/books.css: -------------------------------------------------------------------------------- 1 | .book-cards { 2 | display: grid; 3 | grid-template-columns: repeat(2, 49%); 4 | grid-column-gap: 20px; 5 | grid-row-gap: 15px; 6 | margin: 5px; 7 | position: relative; 8 | } 9 | 10 | @media only screen and (max-width: 960px) { 11 | .book-cards { 12 | grid-template-columns: repeat(1, 100%); 13 | grid-column-gap: 15px; 14 | grid-row-gap: 10px; 15 | } 16 | } 17 | 18 | .book-card { 19 | margin: 10px 0; 20 | background-color: #fff; 21 | box-shadow: 0 4px 11px -2px rgb(37 44 97 / 10%), 0 1px 3px 0 rgb(93 100 148 / 15%); 22 | border-radius: 4px; 23 | display: flex; 24 | flex-direction: column; 25 | cursor: pointer; 26 | padding: 0 15px 15px 15px; 27 | color: #8b939c; 28 | position: relative; 29 | } 30 | 31 | .book-cards .book-rate i { 32 | margin-right: 1px; 33 | font-size: 13px; 34 | } 35 | 36 | .book-cards .book-card-img { 37 | width: 160px; 38 | margin-top: -35px; 39 | border-radius: 2px; 40 | box-shadow: 0px 1px 7px 2px #c7c9d3; 41 | border-bottom: 1px solid #dcddde; 42 | object-fit: cover; 43 | margin-bottom: 20px; 44 | transition: 0.3s ease; 45 | } 46 | .book-cards .book-card-img:hover { 47 | transform: scale(1.04); 48 | } 49 | 50 | .card-content { 51 | color: #3d4954; 52 | padding: 20px 30px; 53 | overflow: hidden; 54 | position: relative; 55 | } 56 | 57 | .book-cards .book-name { 58 | font-weight: 500; 59 | text-overflow: ellipsis; 60 | overflow: hidden; 61 | white-space: nowrap; 62 | font-family: 'ZCOOL XiaoWei',serif; 63 | font-size: 16px; 64 | } 65 | 66 | .book-cards .book-by { 67 | font-size: 13px; 68 | color: #bbb; 69 | margin-top: 4px; 70 | position: absolute; 71 | bottom: 6px; 72 | right: 10px; 73 | } 74 | 75 | .book-cards .book-by i { 76 | font-size: 14px; 77 | margin: 0 4px; 78 | display: none; 79 | } 80 | 81 | .book-cards .book-rate > label { 82 | color: #cccccc; 83 | } 84 | 85 | .book-cards .rate { 86 | display: inline-block; 87 | white-space: nowrap; 88 | overflow: hidden; 89 | text-overflow: ellipsis; 90 | width: 100%; 91 | } 92 | 93 | .book-rate > input:checked ~ label, 94 | .book-rate:not(:checked) > label:hover, 95 | .book-rate:not(:checked) > label:hover ~ label { 96 | color: #ff9700; 97 | } 98 | 99 | .book-rate > input:checked + label:hover, 100 | .book-rate > input:checked ~ label:hover, 101 | .book-rate > label:hover ~ input:checked ~ label, 102 | .book-rate > input:checked ~ label:hover ~ label { 103 | color: #ff9700; 104 | } 105 | 106 | .book-cards .card-vote { 107 | color: #8b939c; 108 | font-size: 13px; 109 | } 110 | 111 | .book-cards .card-sum { 112 | color: #8b939c; 113 | font-size: 13px; 114 | line-height: 1.6em; 115 | -webkit-line-clamp: 4; 116 | margin-top: 15px; 117 | } 118 | 119 | .book-cards .content-wrapper { 120 | display: flex; 121 | position: relative; 122 | } 123 | 124 | .book-cards .book-rate i { 125 | color: #ff9700; 126 | font-size: 14px; 127 | font-weight: bold; 128 | } -------------------------------------------------------------------------------- /src/style/links.css: -------------------------------------------------------------------------------- 1 | #links-box { 2 | display: grid; 3 | grid-template-columns: repeat(3,30%); 4 | grid-column-gap: 30px; 5 | grid-row-gap: 10px; 6 | margin: 5px; 7 | position: relative; 8 | } 9 | 10 | @media only screen and (max-width: 960px) { 11 | #links-box { 12 | grid-template-columns: repeat(2, 50%); 13 | } 14 | } 15 | 16 | @media only screen and (max-width: 720px) { 17 | #links-box { 18 | grid-template-columns: repeat(1, 100%); 19 | } 20 | } 21 | 22 | #links-box .links-item { 23 | width: 250px; 24 | position: relative; 25 | padding: 0 6px; 26 | max-width: 100%; 27 | height: 70px; 28 | align-items: center; 29 | display: flex; 30 | border-radius: 6px; 31 | background-color: #fff; 32 | margin: 10px 5px; 33 | color: rgba(107,114,128,1); 34 | cursor:pointer; 35 | justify-self: center; 36 | box-shadow: 0 1px 7px 2px #c7c9d3; 37 | } 38 | 39 | #links-box .links-item:hover { 40 | transform: scale(1.04); 41 | } 42 | 43 | #links-box .links-item > img { 44 | width: 60px; 45 | height: 60px; 46 | border-radius: 6px; 47 | display: block; 48 | vertical-align: middle; 49 | } 50 | 51 | #links-box .links-item .links-info { 52 | margin-left: 10px; 53 | width: 180px; 54 | } 55 | 56 | #links-box .links-item .links-info .links-info-name { 57 | font-weight: bold; 58 | color: #777aaf; 59 | font-size: 18px; 60 | position: relative; 61 | top: -2px; 62 | } 63 | 64 | #links-box .links-item .links-info .links-info-text { 65 | font-style: oblique; 66 | font-size: 14px; 67 | font-family: ZCOOL XiaoWei,serif; 68 | text-overflow: ellipsis; 69 | overflow: hidden; 70 | white-space: nowrap; 71 | width: 100%; 72 | } 73 | 74 | #links-box .links-item .links-info span { 75 | display: block; 76 | } 77 | 78 | #links-box .links-item .links-icon { 79 | width: 22px; 80 | height: 22px; 81 | position: absolute; 82 | top: 0; 83 | right: 0; 84 | margin-right: -8px; 85 | margin-top: -7px; 86 | align-items: center; 87 | display: flex; 88 | border-radius: 6px; 89 | -webkit-transform: rotate(360deg); 90 | animation: rotation 3s linear infinite; 91 | -moz-animation: rotation 3s linear infinite; 92 | -webkit-animation: rotation 3s linear infinite; 93 | -o-animation: rotation 3s linear infinite; 94 | box-shadow: 0 1px 7px 2px #c7c9d3; 95 | transition: .3s ease; 96 | } 97 | 98 | #links-box .links-item:nth-child(3n+0) .links-icon { 99 | background-color: rgba(52,211,153,1); 100 | } 101 | 102 | #links-box .links-item:nth-child(3n+1) .links-icon { 103 | background-color: rgba(167,139,250,1); 104 | } 105 | 106 | #links-box .links-item:nth-child(3n+2) .links-icon { 107 | background-color: #f87171; 108 | } 109 | 110 | #links-box .links-item .links-icon a { 111 | color: #fff; 112 | --transform-rotate: -45deg; 113 | transform: rotate(-45deg); 114 | } 115 | 116 | #links-box .links-item .links-icon a i.icon-zhifeiji { 117 | position: relative; 118 | top: 3px; 119 | left: 2px; 120 | font-size: 14px; 121 | } 122 | 123 | #links-box .links-item .links-icon a i.icon-like-fill, 124 | #links-box .links-item .links-icon a i.icon-flashlight-fill { 125 | position: relative; 126 | top: 4px; 127 | left: 3px; 128 | font-size: 14px; 129 | } 130 | 131 | @-webkit-keyframes rotation { 132 | from {-webkit-transform: rotate(0deg);} 133 | to {-webkit-transform: rotate(360deg);} 134 | } 135 | -------------------------------------------------------------------------------- /src/style/mouse.css: -------------------------------------------------------------------------------- 1 | .cursor { 2 | border-radius: 50%; 3 | background: #333; 4 | } 5 | 6 | .cursor-f { 7 | top: 0; 8 | left: 0; 9 | background-image: url("data:image/svg+xml,%3Csvg width='47' height='47' viewBox='0 0 47 47' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M42.4202 42.4202C38.8403 46 33.3594 46 23.5 46C13.6406 46 8.15966 46 4.57983 42.4202C1 38.8403 1 33.3594 1 23.5C1 13.6406 1 8.15966 4.57983 4.57983C8.15966 1 13.6406 1 23.5 1C33.3594 1 38.8403 1 42.4202 4.57983C46 8.15966 46 13.6406 46 23.5C46 33.3594 46 38.8403 42.4202 42.4202Z' stroke='black'/%3E%3C/svg%3E%0A"); 10 | background-size: cover; 11 | opacity: 0.7; 12 | } 13 | 14 | .cursor, .cursor-f { 15 | width: var(--size); 16 | height: var(--size); 17 | position: absolute; 18 | z-index: 999; 19 | pointer-events: none; 20 | } -------------------------------------------------------------------------------- /src/style/nhBannerAnimation.css: -------------------------------------------------------------------------------- 1 | #nhBannerAnimation { 2 | width: 100%; 3 | height: 100%; 4 | position: absolute; 5 | z-index: 1; 6 | } 7 | 8 | #nhBannerAnimation .circles { 9 | position: absolute; 10 | top: 0; 11 | left: 0; 12 | width: 100%; 13 | height: 100%; 14 | overflow: hidden; 15 | } 16 | 17 | #nhBannerAnimation .circles li { 18 | position: absolute; 19 | display: block; 20 | list-style: none; 21 | width: 20px; 22 | height: 20px; 23 | background: rgba(255, 255, 255, 0.2); 24 | animation: nhBannerAnimation 25s linear infinite; 25 | bottom: -150px; 26 | 27 | } 28 | 29 | #nhBannerAnimation .circles li:nth-child(1) { 30 | left: 25%; 31 | width: 80px; 32 | height: 80px; 33 | animation-delay: 0s; 34 | } 35 | 36 | 37 | #nhBannerAnimation .circles li:nth-child(2) { 38 | left: 10%; 39 | width: 20px; 40 | height: 20px; 41 | animation-delay: 2s; 42 | animation-duration: 12s; 43 | } 44 | 45 | #nhBannerAnimation .circles li:nth-child(3) { 46 | left: 70%; 47 | width: 20px; 48 | height: 20px; 49 | animation-delay: 4s; 50 | } 51 | 52 | #nhBannerAnimation .circles li:nth-child(4) { 53 | left: 40%; 54 | width: 60px; 55 | height: 60px; 56 | animation-delay: 0s; 57 | animation-duration: 18s; 58 | } 59 | 60 | #nhBannerAnimation .circles li:nth-child(5) { 61 | left: 65%; 62 | width: 20px; 63 | height: 20px; 64 | animation-delay: 0s; 65 | } 66 | 67 | #nhBannerAnimation .circles li:nth-child(6) { 68 | left: 75%; 69 | width: 110px; 70 | height: 110px; 71 | animation-delay: 3s; 72 | } 73 | 74 | #nhBannerAnimation .circles li:nth-child(7) { 75 | left: 35%; 76 | width: 150px; 77 | height: 150px; 78 | animation-delay: 7s; 79 | } 80 | 81 | #nhBannerAnimation .circles li:nth-child(8) { 82 | left: 50%; 83 | width: 25px; 84 | height: 25px; 85 | animation-delay: 15s; 86 | animation-duration: 45s; 87 | } 88 | 89 | #nhBannerAnimation .circles li:nth-child(9) { 90 | left: 20%; 91 | width: 15px; 92 | height: 15px; 93 | animation-delay: 2s; 94 | animation-duration: 35s; 95 | } 96 | 97 | #nhBannerAnimation .circles li:nth-child(10) { 98 | left: 85%; 99 | width: 150px; 100 | height: 150px; 101 | animation-delay: 0s; 102 | animation-duration: 11s; 103 | } 104 | 105 | 106 | @keyframes nhBannerAnimation { 107 | 108 | 0% { 109 | transform: translateY(0) rotate(0deg); 110 | opacity: 1; 111 | border-radius: 0; 112 | } 113 | 114 | 100% { 115 | transform: translateY(-1000px) rotate(720deg); 116 | opacity: 0; 117 | border-radius: 50%; 118 | } 119 | 120 | } -------------------------------------------------------------------------------- /src/style/particles.css: -------------------------------------------------------------------------------- 1 | #particles { 2 | position: fixed; 3 | left: 0; 4 | top: 0; 5 | width: 100vw; 6 | height: 100vh; 7 | overflow: hidden; 8 | opacity: .6; 9 | z-index: -2; 10 | pointer-events: none 11 | } 12 | 13 | #particles .particles-layer { 14 | position: absolute; 15 | top: -5%; 16 | left: -5%; 17 | width: 110%; 18 | height: 110%; 19 | background-repeat: repeat; 20 | background-position: center center; 21 | opacity: 0; 22 | display: block 23 | } 24 | 25 | #particles .particles-layer--1 { 26 | background-image: url('https://oyo.cool/usr/uploads/2024/12/1797160230.svg') 27 | } 28 | 29 | #particles .particles-layer--2 { 30 | background-image: url('https://oyo.cool/usr/uploads/2024/12/1073548180.svg') 31 | } 32 | 33 | #particles .particles-layer--3 { 34 | background-image: url('https://oyo.cool/usr/uploads/2024/12/3842676930.svg') 35 | } 36 | 37 | @media (max-width: 767px) { 38 | #particles { 39 | display: none; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/template/articleDirectory.html: -------------------------------------------------------------------------------- 1 |
      2 | 7 |
      -------------------------------------------------------------------------------- /src/template/articleSuffix.html: -------------------------------------------------------------------------------- 1 | 2 |

      __EOF__

      3 |
      4 |
      5 | 6 | 7 | 8 |
      9 |
      10 | 11 |
      12 |
      13 | 14 |
    • 15 | ##origin##文作者: 16 | ##author## 17 |
    • 18 |
    • 19 | ##origin##文链接: 20 | ##source## 21 |
    • 22 |
    • 23 | 关于博主: 24 | ##aboutHtml## 25 |
    • 26 |
    • 27 | 版权声明: 28 | ##copyrightHtml## 29 |
    • 30 |
    • 31 | 声援博主: 32 | ##supportHtml## 33 |
    • 34 |
      35 |
      36 |
      37 |
      38 |
      39 | -------------------------------------------------------------------------------- /src/template/banner.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
        4 |
      • 5 |
      • 6 |
      • 7 |
      • 8 |
      • 9 |
      • 10 |
      • 11 |
      • 12 |
      • 13 |
      • 14 |
      15 |
      16 |
      17 |
      18 |

      19 |

      20 |

      21 |

      22 | 23 | 24 |

      25 | 26 |
      27 |
      28 | 32 |
      -------------------------------------------------------------------------------- /src/template/books.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 | 4 |
      5 |
      ##name##
      6 |
      7 |
      8 | ##scoreHtml## 9 |
      10 | 11 | ##infoHtml## 12 | 13 |
      14 |
      15 |
      16 |
      17 | ##readDate## 18 | ##readPercentage## 19 |
      20 |
      -------------------------------------------------------------------------------- /src/template/dayNight.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
      4 |
      5 |
      6 |
      7 |
      8 |
      9 |
      10 |
      11 |
      12 |
      13 |
      14 |
      15 |
      16 |
      17 |
      -------------------------------------------------------------------------------- /src/template/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
      4 | 5 |
      6 |
      7 |
      8 |
      9 |
      10 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/template/links.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /src/template/particles.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
      4 |
      5 |
      -------------------------------------------------------------------------------- /src/template/sidebarNav.html: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /src/typecho/404.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 |
      4 |
      5 |
      6 |
      7 |
      8 |
      9 |
      10 |
      11 | 12 |
      13 |
      14 |
      15 |
      16 |
      17 |
      18 |
      19 |
      20 |
      21 |
      22 |
      23 |
      24 |
      25 |
      26 |
      27 | 28 |
      29 |
      30 |
      o_o ....
      31 |
      你竟然来到了无人区
      32 |
      33 | 34 | 35 | 36 |
      37 |
      38 | 39 |
      40 | 41 | 57 | need('sidebar.php'); ?> 58 | need('footer.php'); ?> 59 | -------------------------------------------------------------------------------- /src/typecho/archive.php: -------------------------------------------------------------------------------- 1 | 2 | need('header.php'); ?> 3 |
      4 |
      5 |

      6 | archiveTitle(array( 7 | 'category' => _t('文章分类 - %s'), 8 | 'search' => _t('关键字 - %s'), 9 | 'tag' => _t('标签 - %s '), 10 | 'author' => _t('作者 - %s') 11 | ), '', ''); ?> 12 |

      13 | have()): ?> 14 | next()): ?> 15 |
      16 |
      17 |
      18 | 23 |
      24 | author(); ?> date("Y-m-d H:i:s"); ?> 25 | 阅读() 26 | 评论(commentsNum('%d'); ?>) 27 | user->hasLogin()) : ?> 28 | 编辑 29 | 30 |
      31 |
      32 |
      33 |
      34 | 35 | 36 |
      37 |
      38 |
      39 |
      40 | 44 |
      45 |
      46 |
      47 | need('sidebar.php'); ?> 48 | need('footer.php'); ?> 49 | -------------------------------------------------------------------------------- /src/typecho/header.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <?php $this->archiveTitle( 12 | array( 13 | 'category' => _t('分类 - %s'), 14 | 'search' => _t('关键字 - %s'), 15 | 'tag' => _t('标签 - %s'), 16 | 'author' => _t('作者 - %s') 17 | ), 18 | '', 19 | ' - ' 20 | ); ?><?php $this->options->title(); ?> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | header(); ?> 32 | 33 | 34 | 35 | 36 | 37 |
      38 | 59 |
      -------------------------------------------------------------------------------- /src/typecho/index.php: -------------------------------------------------------------------------------- 1 | need('header.php'); 14 | ?> 15 | 16 |
      17 |
      18 | 19 | currentPage, $this->options->pageSize); ?> 20 | push($post); 22 | 23 | ?> 24 |
      25 |
      26 | 27 | [置顶] 28 | 29 | 30 |
      31 |
      32 |
      33 | 摘要:user->hasLogin()) ? '文章被加密了,不可以偷看哦🍉' : (getAbstract($res['text'], '/:::(.*):::/') ?: preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0}((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,200}).*#s', '$1', $res['text'])); ?> 34 | 阅读全文 35 |
      36 |
      37 |
      38 |
      posted @ 39 | author(); ?> 40 | 阅读() 41 | 评论() 42 | 43 | 推荐() 44 |
      45 |
      46 |
      47 | 48 |
      49 | 53 |
      54 |
      55 |
      56 | 57 | 58 | need('sidebar.php'); ?> 59 | need('footer.php'); ?> 60 | -------------------------------------------------------------------------------- /src/typecho/page.php: -------------------------------------------------------------------------------- 1 | 2 | cid) exit( strval(digg($this->cid)) ); ?> 3 | cid) exit( strval(bury($this->cid)) ); ?> 4 | need('header.php'); ?> 5 |
      6 |
      7 |
      8 | 9 |
      10 |
      11 |

      12 | 13 | title() ?> 14 | 15 |

      16 |
      17 |
      18 |
      19 | content() ?> 20 |
      21 |
      22 | 52 |
      53 |
      54 |
      55 |
      56 | need('comments.php'); ?> 57 |
      58 |
      59 | 60 | 61 | need('sidebar.php'); ?> 62 | need('footer.php'); ?> 63 | -------------------------------------------------------------------------------- /src/typecho/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyang0210/EasyBe/b0a92ebee84ccc29c58d57d01d2f88db430c66b8/src/typecho/screenshot.png -------------------------------------------------------------------------------- /src/utils/request.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/wangyang0210 3 | * https://www.cnblogs.com/wangyang0210/ 4 | * @author: WangYang, i@oyo.cool 5 | * @Date 2022-08-25 15:28 6 | * ---------------------------------------------- 7 | * @describe: fetch封装 8 | */ 9 | 10 | export async function request(url = '', method = 'GET', data = {}, headers = {}) { 11 | let options = { 12 | method: method, 13 | mode: 'cors', 14 | redirect: 'follow', 15 | referrerPolicy: 'no-referrer', 16 | }; 17 | if (Object.keys(headers).length) { 18 | options.headers = headers; 19 | } 20 | if (Object.keys(data).length) { 21 | options.body = JSON.stringify(data); 22 | } 23 | const response = await fetch(url, options); 24 | return response.json(); 25 | } 26 | -------------------------------------------------------------------------------- /src/vendor/circleMagic/circleMagic.js: -------------------------------------------------------------------------------- 1 | ;(function ($) { 2 | $.fn.circleMagic = function (options) { 3 | 4 | let width, height, canvas, ctx, animateHeader = true; 5 | let circles = []; 6 | 7 | let settings = $.extend({ 8 | color: 'rgba(255,255,255,.5)', 9 | radius: 10, 10 | density: 0.3, 11 | clearOffset: 0.2 12 | }, options); 13 | 14 | let container = this['0']; 15 | initContainer(); 16 | addListeners(); 17 | 18 | function initContainer() { 19 | width = container.offsetWidth; 20 | height = container.offsetHeight; 21 | 22 | initCanvas(); 23 | canvas = document.getElementById('homeTopCanvas'); 24 | canvas.width = width; 25 | canvas.height = height; 26 | canvas.style.position = 'absolute'; 27 | canvas.style.left = '0'; 28 | canvas.style.bottom = '0'; 29 | canvas.style.zIndex = '1'; 30 | ctx = canvas.getContext('2d'); 31 | 32 | for (let x = 0; x < width * settings.density; x++) { 33 | let c = new Circle(); 34 | circles.push(c); 35 | } 36 | animate(); 37 | } 38 | 39 | function initCanvas() { 40 | let canvasElement = document.createElement('canvas'); 41 | canvasElement.id = 'homeTopCanvas'; 42 | container.appendChild(canvasElement); 43 | canvasElement.parentElement.style.overflow = 'hidden'; 44 | 45 | } 46 | 47 | function addListeners() { 48 | window.addEventListener('scroll', scrollCheck, false); 49 | window.addEventListener('resize', resize, false); 50 | } 51 | 52 | function scrollCheck() { 53 | document.body.scrollTop > height ? animateHeader = false : animateHeader = true; 54 | } 55 | 56 | function resize() { 57 | width = container.clientWidth; 58 | height = container.clientHeight; 59 | container.height = height + 'px'; 60 | canvas.width = width; 61 | canvas.height = height; 62 | } 63 | 64 | function animate() { 65 | if (animateHeader) { 66 | ctx.clearRect(0, 0, width, height); 67 | for (let i in circles) { 68 | circles[i].draw(); 69 | } 70 | } 71 | requestAnimationFrame(animate); 72 | } 73 | 74 | function randomColor() { 75 | let r = Math.floor(Math.random() * 255); 76 | let g = Math.floor(Math.random() * 255); 77 | let b = Math.floor(Math.random() * 255); 78 | let alpha = Math.random().toPrecision(2); 79 | return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')'; 80 | } 81 | 82 | function Circle() { 83 | let that = this; 84 | (function () { 85 | that.pos = {}; 86 | init(); 87 | })(); 88 | 89 | function init() { 90 | that.pos.x = Math.random() * width; 91 | that.pos.y = height + Math.random() * 100; 92 | that.alpha = 0.1 + Math.random() * settings.clearOffset; 93 | that.scale = 0.1 + Math.random() * 0.3; 94 | that.speed = Math.random(); 95 | settings.color === 'random' ? that.color = randomColor() : that.color = settings.color; 96 | } 97 | 98 | this.draw = function () { 99 | if (that.alpha <= 0) init(); 100 | that.pos.y -= that.speed; 101 | that.alpha -= 0.0005; 102 | ctx.beginPath(); 103 | ctx.arc(that.pos.x, that.pos.y, that.scale * settings.radius, 0, 2 * Math.PI, false); 104 | ctx.fillStyle = that.color; 105 | ctx.fill(); 106 | ctx.closePath(); 107 | }; 108 | } 109 | } 110 | })(jQuery); 111 | -------------------------------------------------------------------------------- /src/vendor/consoleText/consoleText.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UPDATES AND DOCS AT: https://github.com/BNDong 3 | * https://www.cnblogs.com/bndong/ 4 | * @author: BNDong, dbnuo@foxmail.com 5 | * @param words [] 循环文字数组 6 | * @param id string 文字domId 7 | * @param containerId string 符合domId 8 | * @param isCycle boolean 是否循环 9 | * @param callback fun 每个文字设置后回调 10 | */ 11 | export default function main(words, id, containerId, isCycle) { 12 | let textIndex = 0; 13 | let visible = true; 14 | let containerElement = document.getElementById(containerId); 15 | let targetElement = document.getElementById(id); 16 | containerElement.innerHTML = '_'; 17 | 18 | const deleteText = () => { 19 | targetElement.innerHTML = targetElement.innerHTML.slice(0, -1) 20 | if (targetElement.innerHTML.length > 0) { 21 | setTimeout(deleteText, 200) 22 | } else { 23 | textIndex = 0 24 | setTimeout(typeWriter, 200) 25 | } 26 | } 27 | const typeWriter = () => { 28 | targetElement.innerHTML += words[textIndex++] 29 | if (textIndex < words.length) { 30 | setTimeout(typeWriter, 200) 31 | } else if (isCycle) { 32 | setTimeout(() => { deleteText() }, 1000) 33 | } 34 | } 35 | 36 | window.setInterval(() => { 37 | if (visible) { 38 | containerElement.style.visibility = 'hidden'; 39 | visible = false; 40 | } else { 41 | containerElement.style.visibility = 'visible'; 42 | visible = true; 43 | } 44 | }, 400); 45 | setTimeout(typeWriter, 200); 46 | } 47 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const json5 = require('json5'); 3 | const terserPlugin = require('terser-webpack-plugin'); 4 | const fileManagerPlugin = require('filemanager-webpack-plugin'); 5 | const miniCssExtractPlugin = require('mini-css-extract-plugin'); 6 | const cssMinimizerPlugin = require('css-minimizer-webpack-plugin'); 7 | const CompressionPlugin = require('compression-webpack-plugin'); 8 | // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 9 | 10 | module.exports = { 11 | mode: 'development', 12 | entry: './src/main.js', 13 | output: { 14 | filename: 'simple-memory.js', 15 | chunkFilename: 'script/[name].[contenthash:8].js', 16 | path: path.resolve(__dirname, 'easybe'), 17 | clean: true, 18 | pathinfo: false, 19 | }, 20 | experiments: { 21 | topLevelAwait: true, 22 | }, 23 | plugins: [ 24 | // new BundleAnalyzerPlugin({ 25 | // analyzerMode: 'disabled', 26 | // generateStatsFile: true, 27 | // }), 28 | new fileManagerPlugin({ 29 | events: { 30 | onEnd: { 31 | copy: [{ source: './src/typecho/', destination: './easybe/' }], 32 | }, 33 | }, 34 | }), 35 | new miniCssExtractPlugin({ 36 | filename: 'style/[name].[contenthash:8].css', 37 | chunkFilename: 'style/[name].[contenthash:8].css', 38 | ignoreOrder: true, 39 | }), 40 | ], 41 | // devtool: 'inline-source-map', 42 | optimization: { 43 | minimize: true, 44 | minimizer: [ 45 | new terserPlugin({ 46 | parallel: true, 47 | extractComments: false, 48 | }), 49 | new cssMinimizerPlugin(), 50 | new CompressionPlugin({ 51 | algorithm: 'gzip', 52 | test: /\.js$|\.html$|\.css$/, 53 | minRatio: 1, 54 | threshold: 10240, 55 | deleteOriginalAssets: false, 56 | }), 57 | ], 58 | }, 59 | module: { 60 | rules: [ 61 | { 62 | test: /\.css$/i, 63 | use: [ 64 | { 65 | loader: miniCssExtractPlugin.loader, 66 | options: { 67 | publicPath: '../', 68 | }, 69 | }, 70 | 'css-loader', 71 | ], 72 | }, 73 | { 74 | test: /\.s[ac]ss$/i, 75 | use: [ 76 | { 77 | loader: miniCssExtractPlugin.loader, 78 | options: { 79 | publicPath: '../', 80 | }, 81 | }, 82 | 'css-loader', 83 | 'sass-loader', 84 | ], 85 | }, 86 | { 87 | test: /\.(png|svg|jpg|jpeg|gif|webp)$/i, 88 | type: 'asset/resource', 89 | generator: { 90 | filename: 'images/[contenthash][ext][query]', 91 | }, 92 | }, 93 | { 94 | test: /\.(eot|ttf|woff|woff2)$/, 95 | type: 'asset/resource', 96 | generator: { 97 | filename: 'iconfont/[contenthash][ext][query]', 98 | }, 99 | }, 100 | { 101 | test: /\.json5$/i, 102 | type: 'json', 103 | parser: { 104 | parse: json5.parse, 105 | }, 106 | }, 107 | { 108 | test: /\.html$/i, 109 | loader: 'html-loader', 110 | options: { 111 | minimize: true, 112 | }, 113 | }, 114 | ], 115 | }, 116 | }; 117 | --------------------------------------------------------------------------------