Emojipedia Minimal

Minor fixes and clutter removal

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript== 
// @name        Emojipedia Minimal
// @namespace   org.emojipedia.minimal
// @description Minor fixes and clutter removal
// @match       *://emojipedia.org/*
// @icon        data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7wn5OZPC90ZXh0Pjwvc3ZnPgo=
// @version     23.04
// @license     Public Domain
// ==/UserScript==

// TODO search bar
// https://emojipedia.org/search/?q=
// https://pagedart.com/blog/how-to-add-a-search-bar-in-html/


let
  item,
  cssSelectors = [
    '.ad',
    '.ad-sidebar',
    '.emoji-navbar-header',
    '.page-header-part',
    '.sidebar',
    '.sponsor',
    '.topMainAd',
    '.vendor-list',
    'footer',
    'form.short-link',
    'li > p',
    'script',
    'section'
  ];

for (const item of document.querySelectorAll('li > h2')) {
  item.style.fontSize = 'xx-large';
  item.style.paddingBottom = '5%';
}

if (document.querySelector('h1')) {
  item = document.querySelector('h1');
  item.style.fontSize = 'xxx-large';
  item.style.paddingBottom = '5%';
}

if (document.querySelector('.search-multilang-button')) {
  item = document.querySelector('.search-multilang-button');
  item.textContent = 'Change language';
  item.style.position = 'absolute';
  item.style.right = 0;
  item.remove();
  document.body.append(item);
}

//if (document.querySelector('.emoji-navbar-search-form')) {
item = document.querySelector('.emoji-navbar-search-form');
item.style.position = 'fixed';
item.style.right = 0;
item.style.left = 0;
item.style.top = 0;
item.action='/search/?q=';
item.querySelector('input').name = 'q';
//item.querySelector('input').removeAttribute('placeholder');
item.querySelector('input').placeholder = 'Search Emojis';
document.body.append(item);
//}

document.querySelector('.sidebar').style.display = 'unset';

for (let i = 0; i < cssSelectors.length; i++) {
  for (const item of document.querySelectorAll(cssSelectors[i])) {
    item.remove();
  }
}