kone
소미소프트

소미소프트

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

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

(청아)your mom 용 vrm 파일 2개
유틸
hamellton1144
01/08 11079 24
동급생2 리메이크 *DL Version* v1.0.2.0 크랙
유틸
핏짜허엇
01/07 10990 30
starmaker(스타메이커) 갤러리 모드
유틸
horseking94
01/04 35649 53
(01.07수정됨)슬레이 더 스파이어 (Slay the Spire) R18 모드 - Echidna (Ai 번역 + 손번역)
유틸
고기사장님
01/04 20431 60
언홀리 메이든 폭탄 증가패치
유틸
yuri88
01/04 14050 18
멀웨어 검사 스크립트 - 편집증 모드 추가 (DLL 전수조사)
유틸
moomin
01/03 8037 23
🔞 슬레이 더 스파이어 NSFW 모드 모음집 + 디펙트 리플레이서
유틸
Rasmodia
01/03 24670 56
⚠️⚠️멀웨어 탐지 스크립트⚠️⚠️ - 260104 수정
유틸
moomin
01/03 33073 128
카린즈 프리즌 개인모드공유
유틸
보바도사
12/31/25 18895 12
타락신관 조이플 언어설정+이미지 오류 해결파일
유틸
kimchi1234
12/31/25 10144 2
우리아이 판타지아 cGFzc2ZpbGU=
유틸
askted
12/30/25 4019 6
하급생리메이크 1.0.1패치+크랙
유틸
쿠로
12/28/25 14784 41
모카 러브 ReLive♪ ~진심 순애 거리에서의 절정 표정 관찰 + 귀여운 미소에 폭발 분사 애니메이션~ 노모파일
유틸
미스터장
12/27/25 19384 80
Anaertailin 작가의 Slay the Spire 일부 모드만
유틸
oobd69
12/26/25 16737 15
[후타]pernio의 후타나리 시리즈 노모패치 모음 + 복구 제한 안 두기로 했음
유틸
레가토
12/24/25 9658 20
darkest dungeon 성전사(crusader) 스킨
유틸
ine158cm
12/24/25 4461 11
음혈조복토에하 천박한 한글 데칼 공유
유틸
kkkkcccc
12/23/25 13978 46
언홀리 메이든 스탠딩 일러 노예 마스크 수정해 봄
유틸
5dk2io1
12/23/25 14553 30
[유틸] RJ01497368 라스트 스탠드 기번세트
유틸
Ghost
12/21/25 15524 34
용사 파티 무너뜨리기(Hero Party Must Fall) 0.6 회상방 개선 모드
유틸
이드씬
12/21/25 14267 31
시니시스타2 모드 노모 덮어쓰기 툴
유틸
sims9876
12/20/25 13930 15
통합노모모드 시니시스타2 (SiNiSistar2) 1.2.1 마지막... (25.12.24)
유틸
크로우
12/20/25 44059 131
[요청복구] 감옥용사 조이플 구동 패치
유틸
감비아
12/20/25 4775 9
ai로 만든 히토미 다운로더 kemono
유틸
skybleu
12/19/25 8684 9
신문고 인증) Brotli 텍스트 압축 및 해제 도구 사이트 소개
유틸
ㅇㅇ
12/17/25 4734 1
슬레이 더 스파이어 (Slay The Spire) R18 패치 복구 + 2 모드
유틸
cirial
12/15/25 28185 42
[유틸] RJ01389782 비밀 노출 -배덕의 달콤함에 물든 마나카 커스텀 미션 번역
유틸
kdhehejd
12/14/25 18447 25
촉수로 세뇌 1.00 CG버그 수정파일
유틸
Bulchevik
12/14/25 5250 13
윈도우 폴더 검색용 bat 파일
유틸
asdawv123
12/13/25 4131 -6
후타)[복구]잠꾸러기 후타나리의 착정던전 구출기 노모패치
유틸
레가토
12/03/25 5371 5