kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2787 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
조이플 오류 및 패치 + 유틸
유틸
yeppi
03/04 12024 34
야식메뉴판 Plus 만들어왔음 - 게임 방주 관리 데스크톱 앱
유틸
qqoro
03/04 15059 77
이터넘 0.9 옛날 버전 브금 모드
유틸
외않되
03/04 3855 5
RJ01389782 비밀 노출 마나카 커스텀 미션 번역2
유틸
ㅇㅇ
03/03 14264 18
렌파이 전용 언락커 ( 갤러리 언락가능 )
유틸
하이바라
03/03 5047 12
ai번역)RJ01389782 비밀 노출 마나카 모드와 미션 여러 가지
유틸
kkkktrrr
03/02 16621 45
지난번에 만든 (케모노,히토미,X,유튜브 등등 downloader gallery-dl, yt-dlp 활용) 다운로더 GUI 버전으로 만들어봄
유틸
noname
03/01 15983 56
하츠네 미쿠 (코이카츠) 프리셋 공유
유틸
pst0025
02/28 13744 32
유니티 클뜯 assetstudio 후속 animestudio
유틸
xcandle
02/28 8745 19
Sizer.7z
유틸
ㅇㅇ
02/27 8194 13
RJ01279319 네토라레 히로인 백설 1.1 백로그등 편의성 개조 파일(패치파일만)
유틸
apelzl011
02/25 6784 13
Digital Contents Library Tool 1.1.7.2 (구 DLsite 퀵 뷰어)
유틸
ll-lllllllll
02/24 92335 70
시니시스타2 1.2.1 폭유 모드
유틸
무슨소리니
02/24 19105 39
어떤 여자 상사의 비밀 마사지 가게 ver.1.0.6 DRM 해제 실행파일
유틸
미스터장
02/23 10021 11
감금된 채 딥키스 여성주도~페라 포함~ 노모패치만
유틸
미스터장
02/23 7529 6
MZ 엔진 index 치트 유틸
유틸
전적노트
02/22 7436 4
[MySonar] 소수를 위한 오디오 플레이어
유틸
hustlyn
02/22 16965 77
RJ01389782 비밀 노출 마나카 커스텀 미션 번역
유틸
ㅇㅇ
02/21 13165 25
마메32 신버전
유틸
a123456789
02/21 40128 191
RJ 미리보기 서포트 (Tempermonkey 기반)
유틸
sss-com
02/21 7920 14
복호화 밑 품번 링크 생성기 사이트
유틸
vOwOv
02/20 9263 11
nursecall 치트
유틸
nekoplug
02/20 6936 5
26.04.18, 90일, 자동 줄바꿈) RJ01540816 ver.1.0.0 js (2).7z
유틸
ㅇㅇ
02/19 22610 13
RJ01438167 여동생과 함께살자 노모 Bepinex 파일
유틸
joaja
02/18 16066 24
시니시스타2 1.2.1 Slit(가터벨트) 아웃핏 노모 모드
유틸
tongpa
02/18 17603 12
수정 Agent17 0.26.6 cheat mod 버전+ 안티치트,추가치트
유틸
a123456789
02/17 15439 10
GameDB 2
유틸
심심한개발자
02/17 13943 8
Agent17 겨울동화 삽 강화 버그 픽스
유틸
AKGH
02/17 16442 13
[후타]pernio의 후타나리 시리즈 노모패치 모음
유틸
레가토
02/17 11860 12
렌파이 공용 치트엔진+agent17 치트 쓰는 법
유틸
high-hope
02/16 27403 38