kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2981 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%기준 아래가 짤리네요
모레스트레인 발매돼서 해봤는데
일반
fkfnebwk
05/24 2186 0
마나카 모드 질문
질문
ㅇㅇ
05/24 3183 0
조이플 처음써봤는데
일반
d4cddd
05/24 1226 -2
던브 급 현타오네
질문
auo-cast-off
05/24 1846 0
상황묘사 폭력 적임 ) 옛날게임 질문드립니다
질문
rebake
05/24 1918 0
Snake:Byte 1.10[TAG:노출,퍼리(파충류),구속,상태이상]
미번
에테르반
05/24 9812 4
FORTUNE BRIDE 12스테이지 목표액.....
일반
스케베가 뭐 어때서
05/24 1661 0
[복구요청] 사람들 앞에서 예쁘게 자위 할 수 있을까? ~사육사 누나에게 공개 조교 당하면서 수컷 실격 마조 자위
요청
1241542141
05/24 2752 0
쩍벌
야짤
duckuu12
05/24 9460 25
어릴적 충격 먹은 낚시야짤
야짤
머겅머겅
05/24 7107 4
비월선행록 공덕 대체 어케 모으란거임
질문
flatune
05/24 2797 0
능욕계 추천해주실 수 있나요
질문
yammisho
05/24 2125 0
릴리스...나 뇌가 아파...
일반
리안온
05/24 2950 0
[복구요청] 소장의 욕망증 시리즈
요청
dfgtewkwg
05/24 3500 5
남주는 개고생할때 여주는 즐기는 NTR물 추천점
질문
yiyulife
05/24 2619 0
개인적으로 좀 아쉬운 서클
일반
katress
05/24 2263 3
[구매보급]RJ01603334 僕の悲惨人生~初恋編~
미번
stringa
05/24 11924 52
키오스크 v3 v4 관련 질문
질문
napata
05/24 3389 -2
비월선행록 스토리 갓겜임??
질문
tmtsssss123
05/24 2728 0
[복구요청] 히유키 & 에이메스 & 데니아 (명조)
요청
alishs
05/24 3266 3
[복구요청] [ST2261050] for the queen
요청
masker
05/24 11545 2
[복구요청][RJ227638]나의 H한 여름의 추억 ~누나들과 보낸 8월~
요청
1q2w3e4r123456
05/24 1956 3
[미번] (RJ01586007)레이나와 그녀의 이상적인 동거
미번
Madeon
05/24 7496 33
스팀판 야리몬 4.0패치 어떻게 하는건가요?
질문
mongomeri
05/24 2432 0
구매보급, 청아) 이타즈러브 후속작, 시이코러브
미번
dashorn
05/24 8976 31
타락신관 루비 훔치기 질문좀
질문
d33d33
05/24 3115 0
FORTUNE BRIDE ~절정개안의 의식~ 노모 패치
유틸
미스터장
05/24 6453 33
FORTUNE BRIDE 미번 제보용
피드백
미스터장
05/24 3200 3
..... 비상!! 비상!!
일반
sinbiru
05/24 2633 4
하체 빵빵한 농겜 추천 좀
질문
koegami
05/24 2489 1