kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2778 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
Sign in to comment
06/01/25
너비아니
06/15/25
참 좋은데 맨 아래쪽 게시글 한두개는 100%기준 아래가 짤리네요
Sign in to comment
서브,게시글 차단, UI추가 유저스크립트
유틸
cloud67p
10/05/25 2666 11
카린즈 프리즌 cc모드 기계번역해옴
유틸
고추보집물
10/03/25 8727 39
무기력 천사 추가 렉 개선 패치 (a.k.a 쯔꾸르는 최적화 쓰레기가 분명하다)
유틸
erukajihx
10/02/25 6664 65
번역 플러긴용 일본 이름 정리
유틸
kumarin
10/02/25 2246 10
Aideal Helper plugin v1.0.2.0
유틸
kumarin
09/30/25 2265 10
3시간 만에 만든 방주 중복 정리기
유틸
asdf1243
09/30/25 3036 8
팔성제(八星帝) ssg 파일
유틸
hdddie
09/28/25 2878 7
다키스트던전 Deovolente 에디션
유틸
doyoulikekim
09/27/25 9683 29
[v10] 자동 소미 Auto Somi 개조판
유틸
마나난
09/26/25 14300 22
좀더! 불꽃의 시리즈 붉은화면 수정패치
유틸
adsv42
09/23/25 3733 15
도나도나 미검열 CG 오류들 수정
유틸
riel64
09/23/25 17297 77
SW_Decensor v0.7.4.1
유틸
kumarin
09/21/25 9481 38
base64 자동 디코딩 크롬 확장 프로그램 입니다.
유틸
qqwe1234
09/18/25 10012 80
내가 dl 검색할 때 귀찮아서 만든 프로그램
유틸
boya058
09/17/25 2980 10
코네 서브/게시글/댓글/유저 필터, 차단 스크립트 v1.3
유틸
공승아
09/14/25 4401 8
XUnity.AutoTranslator 5.6.1_kr 번역 플러그인 한국형 비공식 버전
유틸
kumarin
09/13/25 10952 41
게시글 제목 필터 스크립트
유틸
cloud67p
09/13/25 1810 5
후타)무표정한 후타나리는 착정 생물과의 교미에 절대 매료되지 않는다 노모패치 + 이전 작품 노모패치 복구
유틸
레가토
09/12/25 10399 26
다키스트 던전 NSFW 완전판 [Npc 리텍 / 영웅 리텍 / 이쁜이쁜 영웅 모드 / 몬스터 리텍]
유틸
삐뉴
09/10/25 17705 95
[복구] +@ 시니시스타 2 모드 모음 (1.10)
유틸
sims9876
09/10/25 13197 26
야겜아님,미번) RJ01432103 MACHINE CHILD (머신 차일드) 일본어판
유틸
AND
09/09/25 7506 25
둘만의 생활 세이브 에디터
유틸
அறியப்பட்ட🔧
09/07/25 15497 14
코네 이미지 뷰어 개선 스크립트
유틸
Ghost
09/06/25 4221 10
[버그수정용] 검은정복왕 우클릭 팅김 버그수정
유틸
Ghost
09/06/25 5844 24
히토미 시리즈를 통합시키는 프로그램을 만들어 보았습니다.
유틸
ariantganada
09/06/25 5360 11
스텔라블레이드 릴리 누드모드 복구+추가함
유틸
konekat
09/03/25 9876 19
.RPGMVP .PNG_ 파일 썸네일 제공 DLL 보안 업데이트
유틸
moomin
09/02/25 4776 22
카린즈 프리즌 Karryn's Prison 치트 모드
유틸
qpspql
09/01/25 15271 21
webp.zip 파일 자동으로 jpg 로 변환 후 재 압축 프로그램 만듬 (2025.12.10 업데이트)
유틸
noname
08/31/25 2237 12
유니티 신버전 자동번역기
유틸
김머시기
08/31/25 8597 31