kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2791 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
[일부 노모패치] 서큐버스 & 매직 (청아,언버스짤 있음)
유틸
OTGie
11/02/25 5573 26
[노모패치]신인마왕과 100명의 연인들
유틸
아르
11/02/25 10644 35
Anaertailin 작가의 Slay the Spire 모음집
유틸
삐뉴
11/01/25 26361 42
[노모 + 텍스쳐 패치] 여신 메르의 만지작 동거 성활 v1.0
유틸
털털털털털털털털
11/01/25 11394 67
무료 BGM 모음집 2025.11.01.
유틸
날개 로봇
11/01/25 4839 15
다시 돌아온 다키스트 던전 NSFW 완전판 [Npc 리텍 / 영웅 리텍 / 이쁜이쁜 영웅 모드 / 몬스터 리텍] + 새 모드!
유틸
삐뉴
10/30/25 21709 122
[노모패치] PRIMITIVE HEARTS (DMM판O, 스팀판X)
유틸
마나난
10/29/25 2310 7
슬레이 더 스파이어 (Slay The Spire) R18 패치 모드
유틸
cirial
10/28/25 27087 43
미끼 치한 수사관 리나 모드
유틸
happy123
10/27/25 10044 17
렌파이 갤러리 강제 오픈 스크립트
유틸
난민1호
10/27/25 2761 9
일라이자의 비약 노모(Decensor) 패치
유틸
이브라브
10/26/25 4568 25
압축파일 썸네일 확장
유틸
h-aszzcb
10/24/25 1773 9
코네 추천순 정렬 스크립트 업데이트
유틸
ducktail
10/24/25 12769 38
추출된 *.txt 파일 번역툴 ( 파워셀 코드)
유틸
lovesccubus
10/23/25 1965 5
코네 추천 컷 & 추천순 정렬 스크립트
유틸
ducktail
10/20/25 10500 59
[폰트파일] 네노토리 2.0에 들어있던 MsNanumGothicWK 폰트파일
유틸
katress
10/19/25 3040 6
MV/MZ 실시간 번역기 0.3 업데이트
유틸
moveit
10/18/25 6267 47
동인 런처 db활용 딸각 방주 이름 정리기 GUI판
유틸
asdf1243
10/16/25 3141 11
[노모이미지만][청아] 호문쿨루스와의 성생활 노모패치
유틸
Ghost
10/16/25 8716 64
RPG Maker MV, nwjs 프로필 오류 프레임 드랍 해결방법
유틸
rinsor
10/15/25 3334 14
동인런처 db 백업 기능을 활용한 방주이름 딸깍 정리기
유틸
asdf1243
10/14/25 2122 3
기번 누락 대사 검수 보조 툴 (Tsukuru Extractor 보조 툴)
유틸
bermuda
10/14/25 2107 11
오토소미 autosomi업뎃함
유틸
김머시기
10/13/25 8623 61
방주정리기 (파일명정리 프로그램) v1.16 (26.04.04)
유틸
알비노
10/12/25 14014 54
RPG Maker MV/MZ 실시간 번역기 (DeepL) - 셀레스포니아 3in1 외 기타등등 가능
유틸
moveit
10/11/25 11921 36
쯔꾸르[MV]MOG플러그인[MZ]SOR배틀링 파일 교환용 플러그인-1.3
유틸
brothers
10/11/25 1281 5
감옥용사 조이플 오류 패치파일
유틸
감비아
10/11/25 5445 6
자작 암호화된 링크 새탭으로 띄워주는 크롬 확장프로그램 공유
유틸
cx7175
10/11/25 1929 13
자작 히토미 다운로더 헬퍼 크롬 확장프로그램 공유
유틸
cx7175
10/10/25 4513 4
도나도나 미검열 CG 오류 수정 최종완성본final최종2
유틸
riel64
10/06/25 14810 77