Greasy Fork

Greasy Fork is available in English.

Yandex 搜索结果双列显示

将 Yandex 搜索结果以双列方式排列,提高可读性与信息密度

目前为 2025-04-25 提交的版本,查看 最新版本

// @author       You
// @license      MIT
// @match        *://*/*
// @grant        none
// ==UserScript==
// @name         Yandex 搜索结果双列显示
// @namespace    http://greasyfork.icu/users/your-username
// @version      1.0
// @description  将 Yandex 搜索结果以双列方式排列,提高可读性与信息密度
// @author       你的名字或昵称
// @match        https://ya.ru/*
// @match        https://yandex.com/search/*
// @match        https://yandex.ru/search/*
// @icon         https://yandex.com/favicon.ico
// @license      MIT
// @grant        none
// ==/UserScript==
(function () {
  'use strict';

  const style = document.createElement('style');
  style.textContent = `
    /* Make search result list into a flexible grid */
    #search-result {
      display: flex !important;
      flex-wrap: wrap !important;
      gap: 20px !important;
      justify-content: space-between;
    }

    /* Each search item gets 48% width to fit two columns */
    #search-result > li.hpJPCzuY0DtEt {
      width: 48% !important;
      box-sizing: border-box !important;
      border-radius: 8px;
      padding: 8px;
      background-color: #f9f9f9;
    }

    /* Responsive fallback */
    @media (max-width: 900px) {
      #search-result > li.hpJPCzuY0DtEt {
        width: 100% !important;
      }
    }
  `;
  document.head.appendChild(style);
})();