☰

V2EX πŸ˜†

Replace ❀️ with πŸ˜† in v2ex

2022-11-05 κΈ°μ€€ λ²„μ „μž…λ‹ˆλ‹€. μ΅œμ‹  버전을 ν™•μΈν•˜μ„Έμš”.

이 슀크립트λ₯Ό μ„€μΉ˜ν•˜λ €λ©΄ Tampermonkey, Greasemonkey λ˜λŠ” Violentmonkey와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

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

이 슀크립트λ₯Ό μ„€μΉ˜ν•˜λ €λ©΄ Tampermonkey λ˜λŠ” Violentmonkey와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 슀크립트λ₯Ό μ„€μΉ˜ν•˜λ €λ©΄ Tampermonkey λ˜λŠ” Userscripts와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 슀크립트λ₯Ό μ„€μΉ˜ν•˜λ €λ©΄ Tampermonkey와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 슀크립트λ₯Ό μ„€μΉ˜ν•˜λ €λ©΄ μœ μ € 슀크립트 κ΄€λ¦¬μž ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

(이미 μœ μ € 슀크립트 κ΄€λ¦¬μžκ°€ μ„€μΉ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ„€μΉ˜λ₯Ό μ§„ν–‰ν•©λ‹ˆλ‹€!)

이 μŠ€νƒ€μΌμ„ μ„€μΉ˜ν•˜λ €λ©΄ Stylus와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 μŠ€νƒ€μΌμ„ μ„€μΉ˜ν•˜λ €λ©΄ Stylus와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 μŠ€νƒ€μΌμ„ μ„€μΉ˜ν•˜λ €λ©΄ Stylus와 같은 ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 μŠ€νƒ€μΌμ„ μ„€μΉ˜ν•˜λ €λ©΄ μœ μ € μŠ€νƒ€μΌ κ΄€λ¦¬μž ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 μŠ€νƒ€μΌμ„ μ„€μΉ˜ν•˜λ €λ©΄ μœ μ € μŠ€νƒ€μΌ κ΄€λ¦¬μž ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

이 μŠ€νƒ€μΌμ„ μ„€μΉ˜ν•˜λ €λ©΄ μœ μ € μŠ€νƒ€μΌ κ΄€λ¦¬μž ν™•μž₯ ν”„λ‘œκ·Έλž¨μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

(이미 μœ μ € μŠ€νƒ€μΌ κ΄€λ¦¬μžκ°€ μ„€μΉ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ„€μΉ˜λ₯Ό μ§„ν–‰ν•©λ‹ˆλ‹€!)

// ==UserScript==
// @name         V2EX πŸ˜†
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Replace ❀️ with πŸ˜† in v2ex
// @author       iyeatse
// @license      WTFPL
// @match        https://*.v2ex.com/t/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=v2ex.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = `
/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 40px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}
    `;
    document.getElementsByTagName('head')[0].appendChild(style);

    const likes = document.querySelectorAll('#Main .box .cell .small.fade');
    for (const like of likes) {
        const emoji = document.createElement('div');
        emoji.className = 'tooltip';
        emoji.innerHTML = 'πŸ˜†';

        const toolTip = document.createElement('span');
        toolTip.className = 'tooltiptext';
        toolTip.innerHTML = '+' + like.innerText.trim();

        emoji.appendChild(toolTip);
        like.parentNode.replaceChild(emoji, like);
    }
})();