禁用烦人的掘金标题动画

102 阅读1分钟

禁用烦人的标题动画

阅读障碍患者的苦恼

每次在掘金看到本文这种样式的文章对我来说都是一种折磨,注意力总被这个标题的动画吸引,遇到想看的文章只能手动把标题动画给禁了,实在忍无可忍,写了个小脚本给自动禁用了。

juejin-head.gif

使用

  1. 安装 Tampermonkey

  2. 脚本发布到了 Greasy Fork,可以直接去 Greasy Fork 安装。

  3. 安装完后打开一个掘金文章详情页,正常启用的话,插件图标会如图所示。

截屏2023-04-15 00.27.07.png

  1. 看看标题的动画是不是已经不蹦跶了。

代码

代码很简单,就是插入了一段 style 把标题的 animation 给禁了。

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://juejin.cn/post/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=juejin.cn
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
    const style = document.createElement('style');
    document.body.appendChild(style);
    style.innerText = `.article-content h3::after, .article-content h3::before { animation: null !important }`;
})();