kone
소미소프트

소미소프트

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

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

[직번][sanatuki]개변태아이돌♥ 에로에로세뇌라이브시작이야♥
동인
돋돋돋돋돋
05/10 24012 90
[업로드 갱신안내] [PC-모바일-Linux-macOS] [공식한글]-존재감 없는 여동생과의 소박한 일상 1.02
번역
Ghost
05/10 35357 82
[복구] 복구된지 오래된 용량 적은 게임 5개
복구
몬스터가아니다신이다
05/10 34854 81
[AI번역+검수] 후타) [Fence 14]자지가 생겨버린 우등생짱
동인
vereeeev
05/10 31564 183
버) RVNWaWRlb01ha2Vy 2026.02~04
영상
xjabdks
05/10 31837 139
[Minamihama Yoriko] 교배 라이선스 ~인기 없는 내가 최강 유전자?!~
동인
1uF
05/10 30248 185
[Itohana] 건방진 소꿉친구가 나를 빼앗으러 오는 승리 √
동인
1uF
05/10 32984 136
26.05.12, 90일) 1-2. RJ310786 ReBF v2.0. 개선 26.05.12.7z
복구
ㅇㅇ
05/10 18369 60
[Takeda Aranobu] 치처녀 풍기위원의 모두에게 말할수없는 음미한 부탁 9
동인
1uF
05/10 16670 55
[mahouya] 패배 엔드에서 레오나 공주가 범해지는 이야기
동인
고전발굴
05/10 20278 24
[후타주의] 후원보급,Br@n) 네로짱 + 통합편집
영상
비밀봉투
05/10 19332 77
[さるら] 축제에서 의상이 풀려버리는 만화
동인
bender
05/10 16594 42
[직번] [armadillo daiji] 갸루 모녀의 돈버는 방법2
동인
maha1004
05/10 35744 165
Nⓐjⓐr 41개 모음
영상
darkunicorn
05/10 22221 96
[구매보급][한국어자막판] 거유 메스○키 마왕님과 마족 메이드장이 더러운 자○에 아양 떨며 봉사하게 되는 이야기♪
소리
이름뭐하지
05/10 19804 68
[버전업알림] 교칙은 절대적이다
번역
rack11
05/10 40638 73
Br@n)벽람항로 임플래커블 + 통합편집
영상
비밀봉투
05/10 15802 80
[구매보급/미번/이종간/촉수] 서큐버스 헤븐
미번
루파조아
05/10 21412 32
AI, 셀레스포니아) 마카이 지구의 주민
야짤
miso5
05/10 11281 101
에바네시아 (스타레일)
영상
브레머튼
05/10 22020 101
[번역요청] Abyss Of Pleasure 0.2.6
미번
0000p
05/10 15811 48
AI) 무인도 사원 여행기 시즈하 첫H장면
야짤
zerocoke
05/10 8291 33
[구매보급/공식번역] RJ01567096 교칙은 절대적이다
번역
rack11
05/10 52690 183
[구매보급] RJ01605925 고대의 기사와 제물의 무녀 26.05.10
미번
gkqisq
05/10 15639 74
후원보급,Br@n)버튜버 시온,보탄 + 통합편집
영상
비밀봉투
05/10 22177 86
도트/움짤 교배 프레스
야짤
angkimozzi
05/10 19255 45
[구매보급] [버전업] RJ01582213 라스티 던전 2 ver1.0?? 26.05.10
미번
gkqisq
05/10 9486 51
[aI번역-노모] 거유 여성이 둘 없으면 발기하지 못하는 남편을 위해 친구를 데려온 아내 -총집편
동인
mybest
05/10 30750 125
미번) 할 수 있는 후배 아오이 짱! ~2인 동거 시작해버렸습니다~ (できる後輩アオイちゃん! ~二人ぐらし始まっちゃいました~)
미번
darkunicorn
05/10 12265 33
미번) 나츠이로 레슨 v1.1.0b (なついろレッスン~the last summer time)
미번
darkunicorn
05/10 15616 25