kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2785 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
로컬LLM(Ollama) 이용한 파이썬 MV 번역 코드
유틸
샤쿠
04/04 21857 21
[RJ01389782] [AI 번역] 비밀 노출 마나카 커스텀 미션 번역 [SekiMissions 8.5]
유틸
bunta_expert
04/04 11401 21
자동소미 해적판
유틸
buttercookie
04/03 7765 21
kio transfer 비번 자동입력
유틸
20250508
04/03 5170 22
Kone base64 auto-decoder
유틸
wef4r2
04/03 3633 6
코이카츠 버튜버 캐릭터 공유(v2)
유틸
pst0025
04/02 11993 53
눈동자 다운로더 GUI (아마도 최신버전)
유틸
하이바라
04/02 6118 16
[미번] 로제리움 ver.1.04 [RJ01515630] 회상방 버그 패치파일
유틸
awsdw
04/02 6450 12
코이카츠 야스씬 공유 - (홍차)
유틸
pst0025
04/01 13519 37
코이카츠 벽람 프리셋 공유(v2)
유틸
pst0025
04/01 15300 46
코이카츠 (?) 프리셋 공유
유틸
pst0025
04/01 16011 33
[Hoi Hoi Hoi]NTR은 모험에서 흔한 일이다 모바일 패치
유틸
qqwqq6666
03/31 5570 8
디코드 클릭하기 귀찮아서 만든 확장프로그램
유틸
20250508
03/31 10881 57
FontForge-2025-10-09-Windows-x64.exe + FontForgeBuilds 한글화.7z
유틸
ㅇㅇ
03/30 9463 6
RPGM VXA 스크립트) ▼ 素材(Materials) ## ゲーム画面倍率切替 - 멀티 모니터 대응 개선판.rb
유틸
ㅇㅇ
03/30 4839 2
celsector 탄약 치트 및 무기, 옷 해금 세이브
유틸
arcabuz
03/30 3515 11
Base 64 Encode Decode 확장 프로그램 업데이트 및 유저스크립트 방식 지원
유틸
shinyiro18
03/29 5349 12
PixivNavi - 픽시브 한손 탐색 스크립트
유틸
oroshinashi9
03/29 4481 7
(빅파이 개조만) 평범한 현실 남매 IN 섹스하지 않으면 나올 수 없는 방.[RJ01332822]
유틸
123551
03/29 8349 15
Base 64 Encode Decode 확장 프로그램 만들어 봤습니다.
유틸
shinyiro18
03/28 6555 18
코하루인가 이거 AI 이미지 번역기 괜찮은 것 같아서 링크 가져와봄
유틸
밀로아
03/28 4966 14
아오이짱 BepInEx 번역플러그인 잘리던거 해결봤다...
유틸
lalalala000
03/28 24227 59
(코이카츠) 시니시스타2 캐릭터 공유 - [리리아]
유틸
pst0025
03/27 19770 40
Deliriumベア@NTR 씬 공유 글에서 빠진 모드 추가
유틸
pst0025
03/27 4469 11
(코이카츠) 원신 캐릭터 공유
유틸
pst0025
03/27 10241 33
(코이카츠) 붕스 캐릭터 공유
유틸
pst0025
03/27 9980 38
데이터 클리너) czkawka - 크로키에트, windows_krokiet_on_windows_skia_opengl.exe
유틸
ㅇㅇ
03/27 10811 21
파이어 엠블렘 인게이지 - 모드 통합(+ 노모) 모드 만 있음
유틸
cumtree
03/27 3817 8
(RGVsaXJpdW3jg5njgqJATlRS) 코이카츠 씬 공유, 캐릭 포함
유틸
pst0025
03/26 9337 16
[후타]pernio의 후타나리 시리즈 노모패치 모음
유틸
레가토
03/26 5711 9