kone
소미소프트

소미소프트

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

09/06/2025, 08:00:40
유틸
4372 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.

AI, 셀레스포니아) 러브 리버티의 가르침
야짤
miso5
05/03 11455 125
요청 복구) RJ01244412 NTR레슨 1.92 + DLC RJ01309333 (26.05.03 17:00 수정)
복구
딸ㄱ기맛
05/03 36183 79
내가 좋아하는 그아이는 시즌2 1화 2k
영상
nuguge
05/03 24604 89
[shunjou suusuke]친구 엄마는 음란한 숙녀
동인
qpsjcb00
05/03 21244 56
네노토리 개발자 진짜 인문학적 변태네ㅋㅋㅋ
후기 및 공략
전여친
05/03 11205 31
[미번/Terasu Mc] 슬랙스만 고집하던 소꿉친구가 어느 날…
동인
미식이네
05/03 25390 68
⚠️마야 미션 보안 분석 결과
정보
moomin
05/03 14079 46
아리아드네 MZ 이식 90일 차
창작
Code_Max
05/03 13670 95
[손번역] Kurukuru 고향 납정(精) ~학생 편~
동인
fhfhfghdr453
05/03 48518 262
청아, AI번역) [직번] 기뢰의 시간 (Umiyamasoze)
동인
rapbit
05/03 16347 65
ai, 이터널 리턴) 바니걸 아비게일의 VVIP 전용 서비스
야짤
kjh9304
05/03 14436 89
[내용추가] 마야인지 먼지 일단 받지말어라
일반
doonle
05/03 9400 29
마야 미션 0.7 기번 한패 (완결)
번역
maksani
05/02 36772 97
하네스 엔지니어링을 사용한 "능력 있는 후배 아오이짱!" 번역 후기
후기 및 공략
coupon
05/02 3676 15
[AKIRE][컬러/노모] 나만의 응석을 받아주는 거유JK아내를 다른남자에게 안기게 해봤다 1~12
동인
프로베스트캣
05/02 24039 162
(RJ01578853)세상물정 모르는 고양이 에르샤 ver1.03 기번 [팀 발번역 1.0.0]
번역
쿠츄쿠츄
05/02 63645 400
나는 여러분의 번역 평가를 믿지 않음
일반
루미네순애
05/02 6123 25
[さるら] 수치의 목욕탕중계 그 후
동인
bender
05/02 17667 47
[기번/완전노모] IV?AV!! -2nd Girl- ver.1.2.0
번역
ilillilllilil
05/02 67331 345
靑夏 시리즈
소리
정실은스쿨드
05/02 15626 58
[Mizu no Uro] 시골 여동생과 무지의 유혹 2
동인
카오스
05/02 50812 342
[Mizu no Uro] 시골 여동생과 무지의 유혹
동인
카오스
05/02 52772 313
번역 용어의 정의와 가이드라인에 대한 개인적인 주관
정보
미스터장
05/02 7582 47
[요청복구] RJ087520 아이리스 액션+RJ01140283 아이리스☆크로니클
복구
blackmalangcalf
05/02 30952 92
(청아) 꾸준 연필 31주차
창작
지나가던사람
05/02 13922 29
[S2l0b3UgUmlqaWNobw] 내가 좋아하는 그아이는
영상
vereeeev
05/02 32366 134
【밀착 음란한 말 속삭임】 초 VIP님 한정 회원제 비밀 클럽 『최○오나홀 천국』 ~강○인권 양도로 자지 아첨 복종 봉사 하렘~【KU100】
소리
키리안
05/02 19919 115
청아, AI번역) [직번] 방심한 여동생 유즈쨩!
동인
rapbit
05/02 29345 166
[Kitou Rijicho] [미번] 내가 좋아하는 그아이는 걸레였다 시즌 2 2~9화
영상
snowingtown1122
05/02 45004 200
야심한 새벽 메카미 시프티
영상
a27627142
05/02 31657 104