kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2783 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
[복구] 란스03 노모패치
유틸
imakotou
04/28 15921 28
REC 리듬게임 추가 MOD
유틸
kunarin
04/28 7569 12
MZ MV data 복호화 실행기
유틸
미요포
04/27 13662 38
90일, RJ01540816 한정 복호화 도구) RMMZ JSON 통합 복호화 도구.pyw + RJ01540816 복호화.7z
유틸
ㅇㅇ
04/27 6543 6
제품 코드 추출기, 제품 코드 중복 찾기
유틸
ㅇㅇ
04/27 8446 18
MMD 모션,음악 통팩 공유
유틸
pst0025
04/26 9066 56
(코이카츠) 솔O티엘 작가 프리셋 통팩 공유
유틸
pst0025
04/25 12140 73
(코이카츠) 에러난 파일 복구 및 빠진거 보완
유틸
pst0025
04/25 10698 31
RPG MV/MZ 치트 플러그인 웹 딸깍 설치 오픈
유틸
mrpls
04/25 11373 28
자동소미 해적판의 해적판 업데이트
유틸
스눕제이크
04/23 8165 12
RPG MV/MZ 안실시간 미리번역 업데이트
유틸
mrpls
04/23 7773 27
파일 구글 번역기) kr_tr_7.pyw
유틸
ㅇㅇ
04/22 12257 9
(코이카츠) - "큰거"
유틸
pst0025
04/22 16059 66
(코이카츠) 큰거 올리기 전에 작은거
유틸
pst0025
04/22 18935 62
(코이카츠) - 최신 프리셋 일부 공유 [v2]
유틸
pst0025
04/22 10918 45
마나카 모드들
유틸
kkkktrrr
04/22 17159 33
(코이카츠) - 최신 프리셋 일부 공유
유틸
pst0025
04/21 10758 48
유틸) RJ코드 이미지 검색 용 기능추가
유틸
ATTAA
04/20 11928 9
VXA 스크립트) ▼ 素材(Materials) ## 한영이름 입력 스크립트.rb
유틸
ㅇㅇ
04/20 8693 7
RPG MV/MZ 실시간 번역기 딸깍 설치 웹사이트 오픈 (2.3 번역 주위 짤림)
유틸
mrpls
04/19 33299 106
(코이카츠) - グラフ 통팩 공유
유틸
pst0025
04/19 23160 56
유틸)유저스크립트-썸네일&본문 이미지 허용/비허용
유틸
cloud67p
04/19 7752 4
RPG MV/MZ 실시간 번역기 1.10 (루나와 음욕의 함정 던전, 젬마4)
유틸
mrpls
04/18 24735 35
VX or VXA 풀스크린 스크립트) ## VX Fullscreen++ Multi-Monitor.rb + ## VXA Fullscreen++ Multi-Monitor v2.32.rb
유틸
ㅇㅇ
04/18 8919 5
[노모패치, AI] 한 번만이라도 좋으니까, 나랑 해줘!
유틸
soxocel777
04/17 15245 29
자동 소미 해적판의 해적판
유틸
스눕제이크
04/17 9521 9
[복구]SecretFlasher.VoicePack-Plus 마나카 음성모드 개인수정(로우튠 등)
유틸
leedi
04/16 13135 7
( 코이카츠 ) - Anna anon 씬카드 공유
유틸
pst0025
04/16 24308 63
자동소미 해적판 업데이트
유틸
buttercookie
04/16 9440 12
[요청복구]스타바운드 통팩 모드만[구버전, 2024.06.17)
유틸
liberty
04/15 9694 1