kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2902 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
06/01/25
너비아니
06/15/25
참 좋은데 맨 아래쪽 게시글 한두개는 100%기준 아래가 짤리네요
[노모파일, AI] 파치몬 -8bit MONSTER-
유틸
soxocel777
04/29 20414 56
[야애니/알림] 음오옥 똰지 3~4화 업 알림
영상
공승아
04/29 19463 44
(구매보급/자막판) 3종 영역전개
소리
Ghost
04/29 22212 108
4월 영상 2개 [FHD] (누드버전)
영상
브레머튼
04/29 22128 107
[Okinaga Umanosuke] 좀도둑 유부녀 참교육하는 이야기
동인
ㅇㅇ
04/29 36908 111
(구매보급) 【한국어 자막판】 인큐버스 제국의 NTR 정책 - 느긋한 아내 편 -
소리
Ghost
04/29 17118 73
[Doji Ro] 앗군 싫어!
동인
ㅇㅇ
04/29 45760 178
[Homunculus] 봄을 쫒다
동인
ㅇㅇ
04/29 31070 113
오타쿠인 내가 일진 갸루와 사귀기까지의 이야기 ONA 1화
영상
argoklarke
04/29 30861 185
루시아 - 새로운 발견 (ZZZ)
영상
브레머튼
04/29 21531 91
[요청복구] 미궁도시 어사일럼 Motion Anime
영상
argoklarke
04/29 25285 111
[복구] 복구 영상 5개
영상
브레머튼
04/29 23804 75
AI, 셀레스포니아) 아마네가 운동할 뿐인 짤
야짤
miso5
04/29 18531 64
Church of Disires 손번역 착수
작업현황
sesv3030
04/29 9783 24
직번)[Gonza] 옆집 유부녀(35) 〜나이 차이 따위(상)〜
동인
dresss
04/29 26983 94
RJ01603799 프린세스 티처! ~세상 물정 모르는 공주님과 다소 쓰레기 같은 가정교사~ Ver 1.1
미번
제로콜라라이트
04/29 16274 67
[AI] 요즘 AI 성능을 알아보자
야짤
highblue
04/29 13189 19
스압] 암호화 게임파일 체크목록지
정보
katress
04/29 13960 19
야심한밤 메카미 시프티
영상
a27627142
04/29 30855 113
[직번][Nako sir][하드플] 내 성벽을 엉망진창으로 만들어 놓고 결혼하는 전섹파와 섹스 이야기
동인
qlkjrnd
04/29 61830 365
[구매보급,번역요청] RJ437704 교장이니까!
미번
wjdtpwls
04/29 13507 23
Omocha Shoujo Mugen Zecchou ni Naku | 완구소녀 무한절정에 울다
동인
yuoaijs
04/29 18167 66
[구매보급]섹스 전문가에게 섹스를 걸어버린 이야기
소리
이름뭐하지
04/29 17599 75
[AI번역] 미오쨩의 여름방학
번역
미식이네
04/29 40599 132
애들 이름은 긴데 이름표 공간은 좁디좁다...이미지 번역 다듬는 중
작업현황
argoklarke
04/29 9148 16
90일) RJ01311424 [Akari Blast!] 후타리나X익스플로러-번역3차.rar
복구
ㅇㅇ
04/29 20517 63
(노모) [Tamabon] 어른이 되는 여름
동인
04/29 58341 324
【ハメ撮り動画追加チャンス?!】おちんぽ係に任命します!【5時間半】【ご入学おめでとうセット
소리
정실은스쿨드
04/29 14765 96
길다,스압] json파일 암호화된 이유를 찾다가 알아낸 정보
정보
katress
04/29 14542 32
[구매보급][번역요청] RJ01544753 モブ顔でドスケベボディなおねえちゃん 모브 얼굴인데 엄청 야한 몸매의 누나
미번
Liye
04/29 12716 45