Google Card-Style UI

Greatly Beautify Google UI!

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Google Card-Style UI
// @description Greatly Beautify Google UI!
// @author      Fei Sun
// @version     2.0.3
// @include       *://*.google.*/search*
// @namespace https://greasyfork.org/users/35010
// ==/UserScript==
/*jshint multistr: true */
let CSSBlock = document.createElement("style");
let commonCSSText = `
.vt6azd,.g,.tF2Cxc.asEBEc {
  margin-bottom:5px;
}
.cu-container {
  display: none;
}
.srp {
--center-width: 692px;
}
.hlcw0c .MjjYud {
padding:0;
box-shadow:none;
}
.HnP70e,.Ww4FFb {
  background:transparent;
}
.hpfc8d,.hlcw0c {
  padding:0;
}
`;
let darkCSSText = `
.dG2XIf,.sG4Xue,g-inner-card, .euDXsc .rmxqbe {
  background:transparent;
}
.MjjYud,.hlcw0c{
  padding:20px;
  background-color:#2d3137;
  margin-bottom:20px;
  border-radius:24px;
}
.k8XOCe {
background:#26272a;
}
.FalWJb {
background:transparent;
}
`;
let lightCSSText = `
.MjjYud,.hlcw0c{
  padding:20px;
  background-color:#fff;
  margin-bottom:20px;
  border-radius:24px;
  box-shadow:2px 2px 15px rgba(0,0,0,.08);
}`;
(function () {
  CSSBlock.innerHTML = commonCSSText;
  if (getComputedStyle(document.body)["background-color"] != "rgb(255, 255, 255)") {
    CSSBlock.innerHTML += darkCSSText;
  }
  else {
    CSSBlock.innerHTML += lightCSSText;
  }
  document.body.appendChild(CSSBlock);
})();