kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2908 views · 4 likes

챗지피티로 만들었는데 오류 생길수있음 문제시 글삭


1

ㄴ 기존 썸네일 크기


1

ㄴ 스크립트 작동 후 썸네일 크기


1

ㄴ 썸네일 너비 설정 클릭

1

너비 숫자만 쓰고 (뒤에 px는 자동으로 써짐) 확인 누르면


1

높이는 대충 4:3 비율로 계산되고 다시 확인 누르기 >> 새로고침


초기 기본 너비 : 500

초기 기본 높이 : 375


아래는 스크립트입니다


// ==UserScript==
// @name         kone.gg 썸네일 크기 조절 (너비만 입력)
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  kone.gg 미리보기 썸네일 크기를 너비만 입력해 간편하게 조절합니다.
// @match        https://kone.gg/*
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function () {
    'use strict';

    const defaultWidth = '500px';
    const defaultHeight = '375px'; // 초기 기본 높이, 계산용 참고

    const width = GM_getValue('thumbnailWidth', defaultWidth);
    const height = GM_getValue('thumbnailHeight', defaultHeight);

    function normalizeSize(input) {
        if (!input) return null;
        input = input.trim();
        if (/^\d+$/.test(input)) {
            return input + 'px';
        }
        return input; // 이미 단위 포함되어 있는 경우
    }

    function extractPixels(value) {
        const match = /^(\d+)(px)?$/.exec(value.trim());
        return match ? parseInt(match[1], 10) : null;
    }

    function updateThumbnailSize() {
        const newWidthRaw = prompt('썸네일 너비를 입력하세요 (예: 500 또는 100%)', width);
        const newWidth = normalizeSize(newWidthRaw);

        if (!newWidth) return;

        let newHeight;

        // 비율 계산 (숫자일 경우에만 적용)
        const widthNum = extractPixels(newWidth);
        if (widthNum !== null) {
            const heightNum = Math.round(widthNum * 0.75); // 4:3 비율
            newHeight = heightNum + 'px';
        } else {
            newHeight = 'auto'; // 퍼센트나 auto 같은 경우
        }

        GM_setValue('thumbnailWidth', newWidth);
        GM_setValue('thumbnailHeight', newHeight);

        alert(`썸네일 크기 변경:\n너비: ${newWidth}\n높이: ${newHeight}\n\n페이지를 새로고침하면 적용됩니다.`);
    }

    function applyThumbnailStyle(w, h) {
        const style = document.createElement('style');
        style.id = 'custom-thumbnail-style';
        style.textContent = `
            img.max-w-50.max-h-40 {
                max-width: ${w} !important;
                max-height: ${h} !important;
            }
        `;
        document.head.appendChild(style);
    }

    GM_registerMenuCommand('썸네일 너비 설정 (높이는 자동 계산)', updateThumbnailSize);
    applyThumbnailStyle(width, height);
})();
4
2 comments
06/01/25
너비아니
06/15/25
참 좋은데 맨 아래쪽 게시글 한두개는 100%기준 아래가 짤리네요
솔루이 미니 학교편 무서워?
질문
oimasage
05/25 1957 1
고블린 월드 중도포기하고 쓰는 후기(부제 : 평점이 그따구인 이유)
후기 및 공략
chrispypie
05/25 3213 10
직번) ※보추주의 [Brother Pierrot] 갸루 낭자애 수사관과 자지 쥠초밥
동인
qlalfsla
05/25 14878 39
소년 용사 켄은 하면 할수록 진짜 안타깝다
일반
익명
05/25 2642 0
[복구요청][3D/여주/노출][버전업/한글지원/노모] 비밀 노출 -배덕의 달콤함에 물든 마나카- v1.13 업적 100% 세이브파일
요청
altmrhkdaud
05/25 3406 0
여름 전에 나오는 갓겜
정보
aemeath
05/25 10076 52
시퀄 시리즈 플레이하고 재밌었던 순
후기 및 공략
futajomusa
05/25 1863 4
언홀메 극초반 질문
질문
oohyo
05/25 2081 0
[미번/이종간/촉수] 태양의 기사 에리카 0.1.9.1 핫픽스버전 (치트판)
미번
루파조아
05/25 13678 71
처녀막 검사하기 직전
야짤
ㅇㅇ
05/25 6168 12
[복구요청] [RJ01131276] 흡혈귀○○일기
요청
NightHawk
05/25 1992 0
던브 1회차 완료했는데 주차플레이 필요없을듯
일반
fusbriwidhei32
05/25 1854 0
하 씨발 치유계 누나한테 시코시코 받고 싶다
일반
인생좆망함
05/25 2637 0
의술사 ㅅㅂ..
일반
ajsskend
05/25 2524 0
mmd - 비스크돌 코스프레 실루엣 야스댄스 - Thumbs Up
영상
madrush
05/25 31973 260
머야 페트론에 태양의 기사 에리카 0.1.9언제 올라왓데
일반
루파조아
05/25 1784 1
형님들 그....섹스 종류중하나였는데 동인지에서 봤던거같은데...섹스 이름이 기억이안나요...
질문
jdhdgcxds
05/25 2942 5
의술사 질문 하나만..
질문
paddackmon
05/25 2529 0
의슬사 서브퀘 하나 뭔지 모르겠음
질문
rummy
05/25 2512 0
JJJJJ가 적는 카린형무소 후기 및 계획표
후기 및 공략
gooddaytodie
05/25 3325 5
[요청 복구]For the queen
복구
오우즉시반말
05/25 20587 64
[요청복구] 장탈기사 님포리아 v1.07
복구
zadvoskoi
05/25 11878 33
의술사 이거 초반부터 심상치않은데(스포)
후기 및 공략
paddackmon
05/25 3156 2
35살 처녀 마법사 속편근황
정보
sorbe123
05/25 6255 16
(스포주의) 세븐데이즈 클리어 했습니다
후기 및 공략
oolloojr
05/25 2369 9
[복구요청] 블루스킨의 숲 ぶるーすきんの森
요청
로켓드릴킥
05/25 2182 0
비월선행록 유리탑 질문
질문
ㅇㅇ
05/25 1671 0
Madruga3D 복구 요청 합니다!
요청
zadvoskoi
05/25 1921 0
[복구 요청] 척영의 늑대 0.7.8.3 한글판
요청
raccoonramen
05/25 3161 0
[요청복구] RJ211777 복수의 오크
복구
zadvoskoi
05/25 18421 57