kone
소미소프트

소미소프트

썸네일 크기조절 스크립트

06/01/2025, 08:33:19
유틸
2782 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
다키스트 던전 Anaertailin 몬스터 컬렉션/NPC NSFW 모음
유틸
삐뉴
07/28/25 10991 27
미리보기 관련 유저스크립트
유틸
cloud67p
07/28/25 2494 3
Base64 링크 자동번역 확장 프로그램
유틸
blacklink
07/25/25 6094 15
카린 전용치트 Karryn's Prison 전용치트 ver1.4d
유틸
4HHHH
07/22/25 18525 22
이제 다운받은 망가도 히토미를 보듯이!
유틸
blacklink
07/21/25 8366 17
RPG MV 치트 플러그인 개조 버전 v2.1
유틸
4HHHH
07/19/25 21641 30
[노모이미지파일만] 카바씨네의 즐거운 투병 생활UC
유틸
미스터장
07/17/25 9027 23
goodbyedpi
유틸
unkown453645
07/15/25 6087 23
mpv(영상플레이어)
유틸
unkown453645
07/15/25 4327 9
로케일 에뮬
유틸
unkown453645
07/15/25 4712 15
아랄트랜스
유틸
unkown453645
07/15/25 3857 12
투투컨
유틸
unkown453645
07/15/25 4376 11
간단한 자동 RJ/VJ 코드 링커
유틸
traffica9
07/15/25 4373 7
webp -> jpg 이미지 변환기
유틸
anaweak
07/15/25 3213 13
루저메이커 뷰지 모델링
유틸
vneldzhffk
07/14/25 3921 3
드래곤 콩키스타 스탠딩 일러스트 가슴 흔들림 모드 번역
유틸
미스터장
07/11/25 11245 49
다키스트 세일 기념 NSFW 스킨/모드
유틸
삐뉴
07/11/25 8258 27
시니시스타2 모드 관련 편집 모드툴?
유틸
무슨소리니
07/11/25 5522 13
한여름의 절정 캐릭터 공유2
유틸
mola245
07/10/25 11075 30
요즘 애용하고있는 랜덤 파일 선택기
유틸
skdyd
07/07/25 4267 13
한여름의 절정 공홈에서 퍼온 캐릭터카드
유틸
ㅇㅇ
07/05/25 7841 15
MaidenSnowEve 메이든스노우이브 어느 전야제, 보이스팩 + 양덕모드
유틸
eyjafjalia
07/04/25 5232 13
[2026-01-11] 히토미 다운로더 코네용
유틸
kts
07/03/25 22432 66
Sexbound(스타바운드)통팩 V0.2 ,Lustiest Lair 1.6 메가-커스텀 팩(2025.09.30까지)
유틸
파에톤1호팬
07/02/25 15036 24
[업뎃] base64 자동 복호화 1.4.15
유틸
arcjay
07/01/25 18690 35
개념글 앞에 ⭐️ 붙이기 스크립트
유틸
963
06/30/25 4029 13
[복구]+@ 시니시스타 2 모드 모음(1.07)
유틸
sims9876
06/29/25 38058 39
웨일 브라우저 로컬 저장소 이미지 번역용 로컬 서버
유틸
LRMGC
06/29/25 3735 10
구버전 알만툴 게임에 더 나은 전체화면 적용 시키는 유틸리티
유틸
jpjp112
06/22/25 4817 11
[업뎃] base64 자동복호화
유틸
arcjay
06/15/25 16217 29