kone
소미소프트

소미소프트

코네 이미지 뷰어 개선 스크립트

09/06/2025, 08:00:40
유틸
4247 views · 10 likes

코네 자체 이미지 뷰어에 전체화면이 없어서 간단하게 AI 사용해서 만들어봤음

이미지 완전 전체화면 + 마우스(한손)으로 모든 조작 or 키보드로 조작 가능


사용법:

0. Tampermonkey 확장프로그램 설치 후, + 버튼으로 아래 내용 복붙


1. 이미지 클릭해서 기존처럼 뷰어열기

2. 우상단 전체화면 버튼 or 키보드 I키 누르기로 전체화면

1

3. 우상단 X버튼 클릭 or I키로 전체화면 및 이미지뷰어 탈출

1


방향키, 마우스 휠로 이미지 이동 가능


aHR0cHM6Ly9raW8uYWMvYy9kMml2bk1FR25EUTV6X3RQcWpoUEti



코드 보기
// ==UserScript==
// @name         Kone.gg 뷰어 확장 기능
// @namespace    https://kone.gg/
// @version      1.9
// @description  'i' 키/버튼으로 뷰어/전체화면 제어, 전체화면 나가기 버튼으로 뷰어 동시 닫기, 이미지 전환 애니메이션 제거 기능을 제공합니다.
// @author       AI Assistant & User
// @match        https://kone.gg/*
// @grant        GM_addStyle
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const SCRIPT_ID = 'konegg-ui-toggle-script';

    // === 스타일 주입 ===
    GM_addStyle(`
        /* UI 숨김 스타일 */
        .viewer-container.ui-hidden .viewer-header,
        .viewer-container.ui-hidden .viewer-footer {
            display: none !important;
        }

        /* Swiper 뷰어 슬라이드 애니메이션 제거 */
        .swiper-wrapper {
            transition-duration: 0.001s !important;
        }

        /* 전체화면 나가기 버튼 스타일 */
        #exit-fullscreen-button {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 2147483647;
            display: none;
            width: 48px;
            height: 48px;
            background-color: rgba(0, 0, 0, 0.4);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            cursor: pointer;
            align-items: center;
            justify-content: center;
        }
        #exit-fullscreen-button:hover {
            background-color: rgba(0, 0, 0, 0.7);
        }
    `);

    // === 기능 함수 ===
    const toggleUI = (container) => {
        if (container) {
            container.classList.toggle('ui-hidden');
        }
    };

    const setupViewer = (viewerContainer) => {
        if (viewerContainer.dataset.uiToggleSetup === 'true') return;
        viewerContainer.dataset.uiToggleSetup = 'true';
        viewerContainer.classList.add('viewer-container');

        const header = viewerContainer.querySelector('div.flex.w-full.justify-end');
        if (!header) return;

        header.classList.add('viewer-header');
        const footer = viewerContainer.querySelector('div.flex.flex-col.md\\:flex-row');
        if (footer) footer.classList.add('viewer-footer');

        // 전체화면 버튼 추가 (이미 있다면 추가하지 않음)
        if (!header.querySelector('.fullscreen-btn')) {
            const closeButton = header.querySelector('button:last-child');
            if (closeButton) {
                const fullscreenButton = document.createElement('button');
                fullscreenButton.className = `${closeButton.className} fullscreen-btn`;
                fullscreenButton.innerHTML = ``;
                fullscreenButton.onclick = (e) => {
                    e.stopPropagation();
                    if (!document.fullscreenElement) {
                        document.documentElement.requestFullscreen();
                    }
                };
                header.insertBefore(fullscreenButton, closeButton);
            }
        }

        // UI 토글 버튼 이벤트 설정
        const gridButton = header.querySelector('button');
        if (gridButton && !gridButton.dataset.uiToggleEvent) {
             gridButton.dataset.uiToggleEvent = 'true';
             gridButton.addEventListener('click', (e) => {
                e.preventDefault();
                e.stopPropagation();
                toggleUI(viewerContainer);
            }, true);
        }
    };

    // === 스크립트 초기 실행 로직 ===
    if (document.getElementById(SCRIPT_ID)) return;

    const scriptMarker = document.createElement('div');
    scriptMarker.id = SCRIPT_ID;
    scriptMarker.style.display = 'none';
    document.body.appendChild(scriptMarker);

    if (!document.getElementById('exit-fullscreen-button')) {
        const exitFullscreenButton = document.createElement('button');
        exitFullscreenButton.id = 'exit-fullscreen-button';
        exitFullscreenButton.innerHTML = ``;

        // [수정됨] 'X' 버튼 클릭 시 전체화면 해제 및 뷰어 닫기
        exitFullscreenButton.onclick = () => {
            if (document.fullscreenElement) {
                // 1. 전체화면 해제
                document.exitFullscreen();

                // 2. 뷰어를 찾아 닫기 버튼을 클릭
                const viewer = document.querySelector('.viewer-container');
                if (viewer) {
                    const closeButton = viewer.querySelector('.viewer-header button:last-child');
                    if (closeButton) {
                        closeButton.click();
                    }
                }
            }
        };
        document.body.appendChild(exitFullscreenButton);
    }


    // === 이벤트 리스너 ===
    const observer = new MutationObserver((mutationsList) => {
        for (const mutation of mutationsList) {
            if (mutation.addedNodes.length) {
                const viewerContainer = document.querySelector('div.fixed.z-50 div.swiper')?.closest('div.fixed.z-50');
                if (viewerContainer) {
                    setupViewer(viewerContainer);
                }
            }
        }
    });

    document.addEventListener('keydown', (e) => {
        const activeElement = document.activeElement;
        const isTyping = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
        if (isTyping) return;

        if (e.key.toLowerCase() === 'i') {
            e.preventDefault();
            const viewer = document.querySelector('.viewer-container:not([style*="display: none"])');

            if (viewer) { // 뷰어가 열려있을 때
                if (document.fullscreenElement) {
                    document.exitFullscreen();
                    const closeButton = viewer.querySelector('.viewer-header button:last-child');
                    if (closeButton) closeButton.click();
                } else {
                    document.documentElement.requestFullscreen();
                }
            } else { // 뷰어가 닫혀있을 때
                 const openViewerButton = Array.from(document.querySelectorAll('div[role="menuitem"]'))
                                             .find(item => item.textContent.trim() === '뷰어 열기');
                if (openViewerButton) {
                    openViewerButton.click();
                    setTimeout(() => {
                         if (!document.fullscreenElement) {
                             document.documentElement.requestFullscreen().catch(err => {});
                         }
                    }, 100);
                }
            }
        }
    });

    document.addEventListener('fullscreenchange', () => {
        const currentViewer = document.querySelector('.viewer-container');
        const exitBtn = document.getElementById('exit-fullscreen-button');

        if (document.fullscreenElement) {
            if (currentViewer) currentViewer.classList.add('ui-hidden');
            if (exitBtn) exitBtn.style.display = 'flex';
        } else {
            if (currentViewer) currentViewer.classList.remove('ui-hidden');
            if (exitBtn) exitBtn.style.display = 'none';
        }
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();




10
12 comments
09/06/25
09/06/25
모바일은 확장 프로그램 못쓰는게 슬플 따름...
09/06/25 Edited 09/06/25
모바일도 안드로이드 쓰면 확프나 유저스크립트 쓸 수 있어!
04/27 Edited 04/27

Deleted comment.

04/27 Edited 04/27

Deleted comment.

04/27 Edited 04/27

Deleted comment.

미끼치한수사관 리나 꼭지 맞추기 게임 개선(?) 모드 v0.2.1
유틸
ltony
05/13 10636 12
(수정 기능 추가) 동인지 볼 때 쓰려고 만든 자동 스크롤 뷰어???
유틸
ATTAA
05/12 15779 6
비월선행록 CommonEvents.js 누락 수정 패치
유틸
kangjang
05/12 10444 14
QW1wbGVjdGVk 블렌더 파일 공유 두번째 4.72GB
유틸
hannanas
05/12 9316 13
QW1wbGVjdGVk 블렌더 파일 공유 첫번째 9.74GB
유틸
hannanas
05/12 15603 21
이미지 다운로더 만들어봄
유틸
lordofcinder
05/11 7856 34
[LM Studio + RPG Maker MVMZ] LMTranslator [쯔꾸르 다국어 번역기]
유틸
전적노트
05/11 13989 9
코캇 명조 히유키 프리셋 2종류
유틸
pst0025
05/09 15953 24
(코이카츠) 씬 카드 공유
유틸
pst0025
05/09 9179 44
시니시스타2 안대 금발녀 모드 1.2.1 ver
유틸
cascastu
05/08 14470 37
[후타]pernio의 후타나리 시리즈 노모패치 모음(요청복구)
유틸
레가토
05/07 4587 6
자동소미 해적판X2 1.0.4업데이트 알림
유틸
스눕제이크
05/07 6456 18
[★추천] 무료 망가 번역기★
유틸
mybest
05/07 27760 127
(코이카츠) 소전 캐릭 2명 프리셋
유틸
pst0025
05/06 6791 21
(코이카츠) 명조 신캐 둘 프리셋
유틸
pst0025
05/06 6352 37
미끼 치한 수사관 리나 유저 모드 (직접 만듬)
유틸
a2343212
05/06 8093 14
Unity Texture Changer v1.0
유틸
kumarin
05/05 7569 34
90일) VX, VXA 개선용 스크립트 +@
유틸
ㅇㅇ
05/05 3862 8
(코이카츠) 버튜버 프리셋 공유
유틸
pst0025
05/05 17009 79
염월선행록 translation-cache.log 5월10일자 갱신 마지막
유틸
보바도사
05/04 8843 39
배덕의 달콤함에 물든 마나카 FansChat 마개조 및 번역 모드 WIP Manaka
유틸
sco0815
05/04 12123 57
파일 구글 or LM 번역기) AI_kr_tr_9.pyw, AI_kr_tr_8.pyw
유틸
ㅇㅇ
05/03 11498 20
⚠️⚠️멀웨어 탐지 스크립트 (신종 RAT) - 260502⚠️⚠️
유틸
moomin
05/02 17466 103
RPG Maker MV/MZ 실시간 번역기 3.1 (구동휘정3 대응 -3)
유틸
mrpls
04/30 17217 36
[오류패치] 섬홍의 아리에스 1.21 db 오류에 대한 패치 (패치만 있음)
유틸
aquapre
04/30 4391 12
게임을 윈도우 샌드박스 안에서 실행하는 스크립트 (악성코드 대책)
유틸
mrpls
04/30 7229 19
[노모파일, AI] 파치몬 -8bit MONSTER-
유틸
soxocel777
04/29 20422 56
동음 폴더 정리기
유틸
안리체
04/28 7084 7
자동 소미 해적판의 해적판의 해적판 (260503 13:58 v1.3.5 업데이트)
유틸
bellbell
04/28 13533 38
사신상관 치트앤진 치트 테이블(수정3)
유틸
ㅇㅇ
04/28 10748 7