百度样式修改器

Modify Baidu search results page style

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         百度样式修改器
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Modify Baidu search results page style
// @author       皮長蹊
// @match        https://www.baidu.com/s?wd=*
// @match        https://www.baidu.com/s?&&wd=*
// @match        https://www.baidu.com/s?ie=*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 创建样式元素
    const style = document.createElement('style');

    // 定义样式
    const styleContent = `
        .head-wrapper, #head, .head-container {
            background-color: rgba(255,255,255, 0.1)!important;
            backdrop-filter: blur(10px)!important;
            -webkit-backdrop-filter: blur(10px)!important;
            box-shadow: 0 1px 20px rgba(0, 0, 0, 0.2)!important; /* 添加阴影效果 */
        }
    `;

    // 添加样式到文档头部
    style.textContent = styleContent;
    document.head.appendChild(style);
})();