다모앙
댓글 · 대댓글 색상 변경
커널패닉

Lv.1 커널패닉 (119.♡.59.225)

2024년 11월 30일 PM 05:54 · 수정됨(21:26)

조회 1,122 공감 0

댓글 및 대댓글 색상을 변경합니다. 기본 색상은 무지개 색을 사용하며 선호하는 색상으로 변경할 수 있습니다.

글쓴이가 동일하거나 자신이 작성한 댓글의 해더는 변경되지 않습니다.


[code=javascript]// ==UserScript==

// @name 대댓글 색상 변경

// @namespace Violentmonkey Scripts

// @match *://damoang.net/*

// @grant none

// @version 1.0

// @author 커널패닉

// @description 11/30/2024, 5:43:50 PM

// ==/UserScript==


document.querySelectorAll('[id^="c_"]').forEach(element => {

const numericValue = parseInt(getComputedStyle(element).marginLeft.match(/[\d]+/)[0] / 16, 10);

  const target = element.querySelector('.d-flex.align-items-center.border-top.bg-body-tertiary.py-1.px-3');

if (numericValue === 1) {

if(target) target.style.setProperty('background-color', 'rgba(255, 0, 0, 0.25)', 'important');

} else if (numericValue === 2) {

if(target) target.style.setProperty('background-color', 'rgba(255, 165, 0, 0.25)', 'important');

} else if (numericValue === 3) {

if(target) target.style.setProperty('background-color', 'rgba(255, 255, 0, 0.25)', 'important');

} else if (numericValue === 4) {

if(target) target.style.setProperty('background-color', 'rgba(0, 128, 0, 0.25)', 'important');

} else if (numericValue === 5) {

if(target) target.style.setProperty('background-color', 'rgba(0, 0, 255, 0.25)', 'important');

} else if (numericValue === 6) {

if(target) target.style.setProperty('background-color', 'rgba(75, 0, 130, 0.25)', 'important');

} else if (numericValue === 7) {

if(target) target.style.setProperty('background-color', 'rgba(238, 130, 238, 0.25)', 'important');

}

});[/code]


Tampermonkey 또는 Violetmonkey에 추가하시면 애드온 설치/업데이트가 완료됩니다~​


=== 2025년 7월 기준 ===

다모앙에서 해당 기능을 공식적으로 지원합니다.

마이메뉴➔개인화면설정➔레이아웃 에서 기능을 활성화할 수 있습니다.

댓글 (1)

  • 커널패닉

    커널패닉 Lv.1 작성자

    24.11.30 · 172.♡.95.29

    === 알려진 이슈 (24/11/30 21:26 기준) ===
    1. 여러개의 댓글 페이지가 존재할 경우, 처음 로드된 페이지에만 적용되며 댓글 페이지를 변경할 경우 작동하지 않습니다.
    2. 댓글 정렬을 변경할 경우 작동하지 않습니다.
    3. 하나의 스레드(댓글)에 대댓글 인덴트가 7개를 초과한 댓글은 무시됩니다.

댓글을 작성하려면 이 필요합니다.