PageSourceSearch

https://faceweb.ai/assets/js/components/logo.js

js faceweb.ai collected 2026-10-05 15:33:17 UTC 2,522 bytes, 86 lines download raw bytes

1/**
2 * Logo Language Module
3 * 언어에 따라 로고를 변경하는 모듈
4 * - 한국어(ko): 페이스웹 한글 문구 포함 로고
5 * - 다른 언어(en, ja, zh): 한글 문구 없는 로고
6 */
7
8const LogoManager = (function() {
9    'use strict';
10
11    // 로고 파일명 설정
12    const LOGO_FILES = {
13        ko: {
14            white: 'logo.svg',
15            black: 'black-logo.svg'
16        },
17        other: {
18            white: 'logo-en.svg',
19            black: 'black-logo-en.svg'
20        }
21    };
22
23    /**
24     * 로고가 흰색인지 검은색인지 확인
25     */
26    function isBlackLogo(imgElement) {
27        const src = imgElement.getAttribute('src') || '';
28        return src.includes('black-logo');
29    }
30
31    /**
32     * 현재 src에서 기본 경로 추출 (파일명 제외)
33     */
34    function getBasePath(src) {
35        const lastSlash = src.lastIndexOf('/');
36        return lastSlash >= 0 ? src.substring(0, lastSlash + 1) : '';
37    }
38
39    /**
40     * 언어에 따라 로고 업데이트
41     * @param {string} lang - 언어 코드 (ko, en, ja, zh)
42     */
43    function updateLogoByLanguage(lang) {
44        const logos = document.querySelectorAll('.logo img');
45        const langFiles = (lang === 'ko') ? LOGO_FILES.ko : LOGO_FILES.other;
46
47        logos.forEach(function(logo) {
48            const currentSrc = logo.getAttribute('src') || '';
49            const basePath = getBasePath(currentSrc);
50            const newFileName = isBlackLogo(logo) ? langFiles.black : langFiles.white;
51            const newSrc = basePath + newFileName;
52            
53            // 현재 src와 다를 때만 변경 (불필요한 리로드 방지)
54            if (currentSrc !== newSrc) {
55                logo.setAttribute('src', newSrc);
56            }
57        });
58    }
59
60    /**
61     * 초기화 - 현재 언어에 맞게 로고 설정
62     */
63    function init() {
64        // localStorage에서 저장된 언어 가져오기
65        const savedLang = localStorage.getItem('faceweb_language') || 'ko';
66        updateLogoByLanguage(savedLang);
67
68        // 언어 변경 이벤트 리스너 등록
69        document.addEventListener('faceweb:languageupdated', function(event) {
70            const lang = event.detail.lang;
71            updateLogoByLanguage(lang);
72        });
73    }
74
75    // Public API
76    return {
77        init: init,
78        updateLogoByLanguage: updateLogoByLanguage
79    };
80})();
81
82// DOM 로드 후 초기화
83document.addEventListener('DOMContentLoaded', function() {
84    LogoManager.init();
85});
86

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.