Cool Jazz Font

Applies Cool Jazz font to web pages

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Cool Jazz Font
// @namespace    http://tampermonkey.net/ (or your personal URL)
// @version      1.1
// @description  Applies Cool Jazz font to web pages
// @author       You (or your name/handle)
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Create a style element
    const style = document.createElement('style');

    // Define the CSS rules
    // Note: @match *://*/* applies this font globally, which might not always be desired.
    // Consider restricting @match or adding @exclude rules if needed.
    style.textContent = `
        /* Import the Cool Jazz font */
        @import url('https://fonts.cdnfonts.com/css/cool-jazz-2');

        /* Apply the font to the entire page body */
        body {
            /* Use Cool Jazz, falling back to Arial, then generic sans-serif */
            font-family: 'Cool Jazz', Arial, sans-serif !important;
        }
    `;

    // Append the style element to the document's head
    document.head.appendChild(style);

})();