@yui540/comimi 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/components/arrow-buttons.d.ts +8 -0
- package/dist/components/arrow-buttons.d.ts.map +1 -0
- package/dist/components/arrow-buttons.styles.d.ts +2 -0
- package/dist/components/arrow-buttons.styles.d.ts.map +1 -0
- package/dist/components/center-message.d.ts +4 -0
- package/dist/components/center-message.d.ts.map +1 -0
- package/dist/components/center-message.styles.d.ts +2 -0
- package/dist/components/center-message.styles.d.ts.map +1 -0
- package/dist/components/controls-dock.d.ts +44 -0
- package/dist/components/controls-dock.d.ts.map +1 -0
- package/dist/components/controls-dock.styles.d.ts +2 -0
- package/dist/components/controls-dock.styles.d.ts.map +1 -0
- package/dist/components/error-icon.d.ts +3 -0
- package/dist/components/error-icon.d.ts.map +1 -0
- package/dist/components/error-icon.styles.d.ts +2 -0
- package/dist/components/error-icon.styles.d.ts.map +1 -0
- package/dist/components/icons.d.ts +3 -0
- package/dist/components/icons.d.ts.map +1 -0
- package/dist/components/icons.styles.d.ts +2 -0
- package/dist/components/icons.styles.d.ts.map +1 -0
- package/dist/components/inputs.d.ts +36 -0
- package/dist/components/inputs.d.ts.map +1 -0
- package/dist/components/inputs.styles.d.ts +2 -0
- package/dist/components/inputs.styles.d.ts.map +1 -0
- package/dist/components/loading-icon.d.ts +3 -0
- package/dist/components/loading-icon.d.ts.map +1 -0
- package/dist/components/loading-icon.styles.d.ts +2 -0
- package/dist/components/loading-icon.styles.d.ts.map +1 -0
- package/dist/components/menu-panel.d.ts +36 -0
- package/dist/components/menu-panel.d.ts.map +1 -0
- package/dist/components/menu-panel.styles.d.ts +2 -0
- package/dist/components/menu-panel.styles.d.ts.map +1 -0
- package/dist/components/notifications.d.ts +3 -0
- package/dist/components/notifications.d.ts.map +1 -0
- package/dist/components/notifications.styles.d.ts +2 -0
- package/dist/components/notifications.styles.d.ts.map +1 -0
- package/dist/components/page-layout.d.ts +15 -0
- package/dist/components/page-layout.d.ts.map +1 -0
- package/dist/components/page-stage.d.ts +28 -0
- package/dist/components/page-stage.d.ts.map +1 -0
- package/dist/components/page-stage.styles.d.ts +2 -0
- package/dist/components/page-stage.styles.d.ts.map +1 -0
- package/dist/components/rabbit-mascot.d.ts +2 -0
- package/dist/components/rabbit-mascot.d.ts.map +1 -0
- package/dist/components/rabbit-mascot.styles.d.ts +2 -0
- package/dist/components/rabbit-mascot.styles.d.ts.map +1 -0
- package/dist/components/settings-panel.d.ts +28 -0
- package/dist/components/settings-panel.d.ts.map +1 -0
- package/dist/components/settings-panel.styles.d.ts +2 -0
- package/dist/components/settings-panel.styles.d.ts.map +1 -0
- package/dist/components/splash-screen.d.ts +3 -0
- package/dist/components/splash-screen.d.ts.map +1 -0
- package/dist/components/splash-screen.styles.d.ts +2 -0
- package/dist/components/splash-screen.styles.d.ts.map +1 -0
- package/dist/components/tooltip.styles.d.ts +2 -0
- package/dist/components/tooltip.styles.d.ts.map +1 -0
- package/dist/components/view-mode-switcher.d.ts +16 -0
- package/dist/components/view-mode-switcher.d.ts.map +1 -0
- package/dist/components/view-mode-switcher.styles.d.ts +2 -0
- package/dist/components/view-mode-switcher.styles.d.ts.map +1 -0
- package/dist/components/viewer-root.d.ts +5 -0
- package/dist/components/viewer-root.d.ts.map +1 -0
- package/dist/components/viewer-root.styles.d.ts +2 -0
- package/dist/components/viewer-root.styles.d.ts.map +1 -0
- package/dist/core/asset-loader.d.ts +7 -0
- package/dist/core/asset-loader.d.ts.map +1 -0
- package/dist/core/event-emitter.d.ts +8 -0
- package/dist/core/event-emitter.d.ts.map +1 -0
- package/dist/core/manga-viewer-core.d.ts +41 -0
- package/dist/core/manga-viewer-core.d.ts.map +1 -0
- package/dist/defaults.d.ts +9 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/i18n/i18n.d.ts +9 -0
- package/dist/i18n/i18n.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1820 -0
- package/dist/manga-viewer.global.js +2344 -0
- package/dist/renderer/renderer-callbacks.d.ts +18 -0
- package/dist/renderer/renderer-callbacks.d.ts.map +1 -0
- package/dist/renderer/viewer-renderer.d.ts +51 -0
- package/dist/renderer/viewer-renderer.d.ts.map +1 -0
- package/dist/storage/indexed-db-storage.d.ts +23 -0
- package/dist/storage/indexed-db-storage.d.ts.map +1 -0
- package/dist/store/reducer.d.ts +3 -0
- package/dist/store/reducer.d.ts.map +1 -0
- package/dist/store/store.d.ts +11 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/styles/media.d.ts +13 -0
- package/dist/styles/media.d.ts.map +1 -0
- package/dist/styles/style-registry.d.ts +2 -0
- package/dist/styles/style-registry.d.ts.map +1 -0
- package/dist/types.d.ts +163 -0
- package/dist/types.d.ts.map +1 -0
- package/docs/USAGE.md +248 -0
- package/locales/en.json +37 -0
- package/locales/ja.json +37 -0
- package/package.json +42 -0
|
@@ -0,0 +1,2344 @@
|
|
|
1
|
+
var MangaViewer=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={locale:`ja`,hasCover:!0,readingDirection:`rtl`,pageTurnMode:`single`,layoutMode:`inline`,autoPageTurnIntervalMs:5e3,pageTurnAnimation:!0,zoom:{min:1,max:4,step:.25}};function n(e,t,n=0){let r=i(n,e.pages.length);return{manga:e,currentPageIndex:r,visiblePageIndexes:o(r,e.pages.length,t),overlayVisible:!1,autoPageTurnEnabled:!1,zoomScale:1,panX:0,panY:0,settings:t,layout:{mode:t.layoutMode},notifications:[],panel:`none`}}function r(e,t){return{...e,...t,zoom:{...e.zoom,...t?.zoom}}}function i(e,t){return t<=0?0:Math.min(Math.max(Math.round(e),0),t-1)}function a(e,t){return e.pageTurnMode===`single`||e.hasCover&&t===0?1:2}function o(e,t,n){let r=new Set,i=Math.max(0,e-1),a=Math.min(t-1,e+1);for(let e=i;e<=a;e+=1)r.add(e);if(n.pageTurnMode===`spread`&&!(n.hasCover&&e===0)){let i=n.hasCover&&e>0?e+(e%2==1?1:-1):e+(e%2==0?1:-1);i>=0&&i<t&&r.add(i)}return[...r].sort((e,t)=>e-t)}var s={"overlay.autoPageTurn":`Auto play`,"overlay.layout":`Layout`,"overlay.settings":`Settings`,"overlay.menu":`Menu`,"overlay.centerHint.desktop":`Click the center to close`,"overlay.centerHint.mobile":`Tap the center to close`,"splash.loading":`Starting viewer`,"autoplay.start":`Auto play started`,"autoplay.stop":`Auto play stopped`,"pageMode.single":`Single`,"pageMode.spread":`Spread`,"layout.inline":`Standard`,"layout.theater":`Wide`,"layout.browserFullscreen":`Fullscreen`,"settings.title":`Settings`,"settings.cover":`Has cover`,"settings.direction":`Page turn direction`,"settings.interval":`Auto play interval`,"settings.interval.unit":`s`,"settings.animation":`Page turn animation`,"settings.direction.rtl":`Right to left`,"settings.direction.ltr":`Left to right`,"menu.openShortcuts":`Keyboard shortcuts`,"menu.openPages":`Page list`,"menu.back":`Back`,"shortcut.section.page":`Page navigation`,"shortcut.section.viewMode":`View mode`,"shortcut.section.general":`General`,"shortcut.moveLeft":`Move left`,"shortcut.moveRight":`Move right`,"shortcut.autoPageTurnLabel":`Auto play`,"shortcut.pageModeToggle":`Toggle spread`,"seek.previewAlt":`Preview of page {{page}}`,loading:`Loading`,"error.pageRequestFailed":`Request failed for page {{page}}`},c={"overlay.autoPageTurn":`自動再生`,"overlay.layout":`表示モード`,"overlay.settings":`設定`,"overlay.menu":`メニュー`,"overlay.centerHint.desktop":`閉じるには画面中央をクリック`,"overlay.centerHint.mobile":`閉じるには画面中央をタップ`,"splash.loading":`ビューワーを起動中`,"autoplay.start":`自動再生を開始`,"autoplay.stop":`自動再生を停止`,"pageMode.single":`1ページ`,"pageMode.spread":`見開き`,"layout.inline":`標準`,"layout.theater":`ワイド`,"layout.browserFullscreen":`全画面`,"settings.title":`設定`,"settings.cover":`表紙あり`,"settings.direction":`ページ移動方向`,"settings.interval":`自動再生の秒数`,"settings.interval.unit":`秒`,"settings.animation":`ページ移動アニメーション`,"settings.direction.rtl":`右`,"settings.direction.ltr":`左`,"menu.openShortcuts":`キーボードショートカット`,"menu.openPages":`ページ一覧`,"menu.back":`もどる`,"shortcut.section.page":`ページ移動`,"shortcut.section.viewMode":`表示モード`,"shortcut.section.general":`全般`,"shortcut.moveLeft":`左に移動`,"shortcut.moveRight":`右に移動`,"shortcut.autoPageTurnLabel":`自動再生`,"shortcut.pageModeToggle":`見開き切り替え`,"seek.previewAlt":`{{page}}ページのプレビュー`,loading:`読み込み中`,"error.pageRequestFailed":`{{page}}ページのリクエストに失敗しました`},l=class{locale;translations;constructor(e,t){this.locale=e,this.translations={ja:c,en:s},t&&(this.translations[e]={...this.translations[e]??{},...t})}setLocale(e){this.locale=e}t(e,t={}){return(this.translations[this.locale]?.[e]??this.translations.ja[e]??e).replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}};function u(e,t){switch(e){case`arrow`:return d(`0 0 20 20`,[f(`M7.28685 6.64194L10.7742 10.0838L7.3011 13.3098C7.06547 13.5391 6.9336 13.8467 6.9336 14.1669C6.9336 14.4871 7.06547 14.7945 7.3011 15.0239C7.41902 15.1378 7.55971 15.2282 7.7149 15.29C7.87009 15.3517 8.03669 15.3835 8.20498 15.3835C8.37328 15.3835 8.53987 15.3517 8.69506 15.29C8.85025 15.2282 8.99095 15.1378 9.10887 15.0239L13.4787 10.9746C13.7134 10.7475 13.845 10.4422 13.845 10.1243C13.845 9.80629 13.7134 9.50107 13.4787 9.27399L9.10886 4.96826C8.86878 4.74159 8.54377 4.61426 8.20498 4.61426C7.86619 4.61426 7.54118 4.74159 7.3011 4.96826C7.18102 5.08007 7.08568 5.2134 7.02057 5.36056C6.95546 5.50772 6.92188 5.6657 6.92188 5.82528C6.92188 5.98487 6.95546 6.14293 7.02057 6.29009C7.08568 6.43725 7.18102 6.57058 7.3011 6.68239L7.28685 6.64194Z`)],t);case`default`:return d(`0 0 20 20`,[p(`1`,`4`,`18`,`12`,`3`)],t);case`wide`:return d(`0 0 20 20`,[p(`1`,`2.5`,`18`,`15`,`3`),f(`M5.5719 6.31811C5.88754 6.00907 6.39381 6.01422 6.70294 6.3298C7.01206 6.64539 7.00674 7.15165 6.69124 7.46084L5.06993 9.04896L14.7642 9.16988L13.1761 7.54857C12.867 7.23293 12.8722 6.72667 13.1878 6.41754C13.5034 6.10841 14.0096 6.11374 14.3188 6.42923L17.2579 9.42977C17.5671 9.7454 17.5619 10.2516 17.2462 10.5608L14.2457 13.4999C13.93 13.809 13.4238 13.8038 13.1146 13.4882C12.8055 13.1726 12.8109 12.6664 13.1263 12.3572L14.7477 10.7691L5.0534 10.6481L6.64152 12.2695C6.95055 12.5851 6.94541 13.0914 6.62982 13.4005C6.31424 13.7096 5.80797 13.7043 5.49879 13.3888L2.55967 10.3883C2.2505 10.0726 2.25573 9.5664 2.57136 9.25723L5.5719 6.31811Z`)],t);case`fullscreen`:return d(`0 0 20 20`,[p(`1`,`1`,`18`,`18`,`3`),f(`M8.69922 3.7002C9.14096 3.7003 9.49902 4.05824 9.49902 4.5C9.49902 4.94176 9.14096 5.2997 8.69922 5.2998H6.42969L14.6992 13.5693V11.2998C14.6993 10.8581 15.0573 10.5 15.499 10.5C15.9408 10.5 16.2987 10.8581 16.2988 11.2998V15.5C16.2988 15.9418 15.9409 16.2998 15.499 16.2998H11.2988C10.8571 16.2997 10.499 15.9418 10.499 15.5C10.499 15.0582 10.8571 14.7003 11.2988 14.7002H13.5684L5.29883 6.43066V8.7002C5.29872 9.14193 4.94079 9.5 4.49902 9.5C4.05726 9.5 3.69932 9.14193 3.69922 8.7002V4.5C3.69922 4.05817 4.0572 3.7002 4.49902 3.7002H8.69922Z`)],t);case`one`:return d(`0 0 20 20`,[p(`1`,`2`,`18`,`16`,`3`),ee(`6`,`4`,`8`,`12`,`1.5`)],t);case`two`:return d(`0 0 20 20`,[p(`1`,`2`,`18`,`16`,`3`),f(`M3 5.5C3 4.67157 3.67157 4 4.5 4H9.5V16H4.5C3.67157 16 3 15.3284 3 14.5V5.5Z`),f(`M10.5 4H15.5C16.3284 4 17 4.67157 17 5.5V14.5C17 15.3284 16.3284 16 15.5 16H10.5V4Z`)],t);case`play`:return d(`0 0 20 20`,[f(`M17.0385 7.78428L6.49809 1.19667C4.68077 0.190227 2.5 1.37966 2.5 3.48403V16.5678C2.5 18.5806 4.68077 19.8616 6.49809 18.7636L17.0385 12.176C18.7649 11.1696 18.7649 8.79072 17.0385 7.78428Z`)],t);case`pause`:return d(`0 0 20 20`,[f(`M6.14289 18.3332H4.68573C3.47144 18.3332 2.5 17.3332 2.5 16.0832V3.9165C2.5 2.6665 3.47144 1.6665 4.68573 1.6665H6.14289C7.35718 1.6665 8.32862 2.6665 8.32862 3.9165V15.9998C8.40957 17.3332 7.43814 18.3332 6.14289 18.3332Z`),f(`M15.3138 18.3332H13.8555C12.6402 18.3332 11.668 17.3332 11.668 16.0832V3.9165C11.668 2.6665 12.6402 1.6665 13.8555 1.6665H15.3138C16.5291 1.6665 17.5013 2.6665 17.5013 3.9165V15.9998C17.5013 17.3332 16.5291 18.3332 15.3138 18.3332Z`)],t);case`settings`:return d(`0 0 24 24`,[f(`M10.0144 1.34782C11.2164 0.658798 12.6836 0.658798 13.8856 1.34782C13.8947 1.35299 13.9036 1.35831 13.9125 1.36376L20.1001 5.17383C21.3211 5.88071 22 7.15791 22 8.54376V15.56C22 16.9 21.3552 18.2127 20.1836 18.8369L14.0125 22.6368C14.0036 22.6423 13.9947 22.6476 13.9856 22.6527C12.7836 23.3418 11.3164 23.3418 10.1144 22.6527C10.1053 22.6476 10.0964 22.6423 10.0875 22.6368L3.89984 18.8267C2.67884 18.1198 2 16.8426 2 15.4568V8.54376C2 7.15919 2.6776 5.88306 3.8965 5.17578L9.98139 1.36758C9.99225 1.36078 10.0032 1.35419 10.0144 1.34782ZM11.0006 3.14323L4.91861 6.94964C4.90775 6.95644 4.89675 6.96302 4.88564 6.96939C4.31578 7.29605 4 7.87148 4 8.54376V15.4568C4 16.1291 4.31578 16.7045 4.88564 17.0312C4.89466 17.0364 4.9036 17.0417 4.91246 17.0471L11.0978 20.8558C11.6895 21.1893 12.4105 21.1893 13.0022 20.8558L19.1875 17.0471C19.2088 17.034 19.2306 17.0217 19.2528 17.0103C19.6582 16.8011 20 16.2698 20 15.56V8.54376C20 7.87148 19.6842 7.29605 19.1144 6.96939C19.1053 6.96422 19.0964 6.95891 19.0875 6.95346L12.9022 3.14482C12.3115 2.8118 11.5918 2.81127 11.0006 3.14323ZM12 9.8851C10.8402 9.8851 9.89999 10.8552 9.89999 12.0519C9.89999 13.2486 10.8402 14.2187 12 14.2187C13.1598 14.2187 14.1 13.2486 14.1 12.0519C14.1 10.8552 13.1598 9.8851 12 9.8851ZM7.89999 12.0519C7.89999 9.7155 9.73563 7.8215 12 7.8215C14.2644 7.8215 16.1 9.7155 16.1 12.0519C16.1 14.3883 14.2644 16.2823 12 16.2823C9.73563 16.2823 7.89999 14.3883 7.89999 12.0519Z`)],t);case`menu`:return m(t);case`close`:return te(t)}}function d(e,t,n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);return r.setAttribute(`viewBox`,e),r.setAttribute(`fill`,`none`),r.classList.add(`comimi-icon`),n&&r.classList.add(n),r.append(...t),r}function f(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return t.setAttribute(`d`,e),t.classList.add(`comimi-icon-fill`),t}function p(e,t,n,r,i){let a=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);return a.setAttribute(`x`,e),a.setAttribute(`y`,t),a.setAttribute(`width`,n),a.setAttribute(`height`,r),a.setAttribute(`rx`,i),a.classList.add(`comimi-icon-stroke`),a}function ee(e,t,n,r,i){let a=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);return a.setAttribute(`x`,e),a.setAttribute(`y`,t),a.setAttribute(`width`,n),a.setAttribute(`height`,r),a.setAttribute(`rx`,i),a.classList.add(`comimi-icon-fill`),a}function m(e){let t=document.createElement(`span`);t.className=`comimi-menu-svg ${e??``}`.trim();for(let e=0;e<3;e+=1)t.append(document.createElement(`span`));return t}function te(e){let t=document.createElement(`span`);return t.className=`comimi-close-svg ${e??``}`.trim(),t.append(document.createElement(`span`),document.createElement(`span`)),t}function h({state:e,callbacks:t}){let n=document.createElement(`div`);return n.className=`comimi-arrows`,n.dataset.overlay=String(e.overlayVisible),n.append(g(`prev`,()=>_(e,t,`left`)),g(`next`,()=>_(e,t,`right`))),n}function g(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=`comimi-arrow-button comimi-arrow-${e}`,n.setAttribute(`aria-label`,e===`next`?`Next page`:`Previous page`),n.addEventListener(`click`,e=>{e.stopPropagation(),t()});let r=document.createElement(`span`);r.className=`comimi-arrow-inner`;let i=document.createElement(`span`);i.className=`comimi-arrow-bg`;let a=u(`arrow`);return a.classList.add(`comimi-arrow-icon`),r.append(i,a),n.append(r),n}function _(e,t,n){v(n,e.settings.readingDirection)?t.nextPage():t.previousPage()}function v(e,t){return t===`rtl`?e===`left`:e===`right`}function ne(e,t){let n=document.createElement(`div`);n.className=`comimi-center-message`,n.dataset.overlay=String(e.overlayVisible);let r=document.createElement(`div`);r.className=`comimi-center-message-text comimi-center-message-desktop`,r.textContent=t.t(`overlay.centerHint.desktop`);let i=document.createElement(`div`);return i.className=`comimi-center-message-text comimi-center-message-mobile`,i.textContent=t.t(`overlay.centerHint.mobile`),n.append(r,i),n}function y(){let e=document.createElement(`div`);return e.className=`comimi-rabbit`,e.innerHTML=`<svg viewBox="0 0 50 42" fill="none" xmlns="http://www.w3.org/2000/svg" class="comimi-rabbit-svg">
|
|
2
|
+
<mask id="comimi-rabbit-mask" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="50" height="42">
|
|
3
|
+
<rect width="50" height="42" fill="#D9D9D9"/>
|
|
4
|
+
</mask>
|
|
5
|
+
<g mask="url(#comimi-rabbit-mask)">
|
|
6
|
+
<path d="M3 33V42H47L48 38.5L47.5 33.5L46 28L42.5 24V21.5L43 15L41 6L36 2.5L29 4L25 8.5L21 4L15 2.5L9.5 6L7.5 14L7 25L3 33Z" fill="white"/>
|
|
7
|
+
<path d="M44.4296 22.6958C44.6658 21.2364 44.8262 19.5939 44.9287 17.6301C45.1827 12.7786 44.6212 8.87326 43.2531 6.01234C41.4929 2.32572 38.3601 0.259256 34.1979 0.0405582C30.3119 -0.155823 27.1881 1.20546 24.9822 4.0396C22.3752 0.562755 18.828 -0.129044 16.0027 0.0182422C11.5152 0.254792 4.09982 2.85685 4.87077 17.6301C4.98218 19.759 5.1426 21.4372 5.37433 22.9011C1.8984 26.6592 0 31.3143 0 36.1301C0 38.2814 0.374332 40.4103 1.11854 42.4589C1.44831 43.365 2.30392 43.9318 3.21301 43.9318C3.46702 43.9318 3.72103 43.8872 3.97504 43.7979C5.13369 43.3784 5.73084 42.0974 5.31194 40.937C4.74599 39.3793 4.46078 37.7636 4.46078 36.1301C4.46078 32.1534 6.18984 28.2838 9.32709 25.2399C9.87077 24.7087 10.1114 23.9411 9.95989 23.1957C9.65241 21.6827 9.46078 19.8929 9.32709 17.398C9.16667 14.3005 8.67202 4.87422 16.2433 4.47699C19.3717 4.31185 21.4349 5.80703 22.7139 9.1589V19.4689C22.7139 20.7008 23.7121 21.7005 24.9421 21.7005C26.172 21.7005 27.1702 20.7008 27.1702 19.4689V9.18122C28.5294 5.82042 30.6907 4.32971 33.9706 4.49931C36.5107 4.63321 38.1863 5.72669 39.2424 7.94045C40.2807 10.1185 40.6996 13.2963 40.4857 17.398C40.3699 19.6608 40.1604 21.4952 39.8529 23.0038C39.697 23.7581 39.9465 24.5436 40.5036 25.0703C43.7522 28.1454 45.5392 32.073 45.5392 36.1301C45.5392 37.7592 45.254 39.3793 44.6881 40.937C44.2692 42.0974 44.8663 43.3739 46.025 43.7979C47.1836 44.2174 48.4581 43.6194 48.8815 42.4589C49.6212 40.4103 50 38.2814 50 36.1301C50 31.2161 48.0348 26.4896 44.4385 22.6958H44.4296Z" fill="#E0E0E0"/>
|
|
8
|
+
<path d="M15.6152 37.4779C17.0919 37.4779 18.289 36.279 18.289 34.8C18.289 33.321 17.0919 32.1221 15.6152 32.1221C14.1385 32.1221 12.9414 33.321 12.9414 34.8C12.9414 36.279 14.1385 37.4779 15.6152 37.4779Z" fill="#E0E0E0"/>
|
|
9
|
+
<path d="M29.6113 37.4779C31.088 37.4779 32.2851 36.279 32.2851 34.8C32.2851 33.321 31.088 32.1221 29.6113 32.1221C28.1346 32.1221 26.9375 33.321 26.9375 34.8C26.9375 36.279 28.1346 37.4779 29.6113 37.4779Z" fill="#E0E0E0"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>`,e}var b=class{root;constructor(e){this.root=document.createElement(`button`),this.root.type=`button`,this.root.className=`comimi-toggle-switch`,this.root.dataset.checked=`false`;let t=document.createElement(`span`);t.className=`comimi-toggle-track`;let n=document.createElement(`span`);n.className=`comimi-toggle-knob`,t.append(n);let r=document.createElement(`span`);r.className=`comimi-toggle-label-wrap`;let i=document.createElement(`span`);i.className=`comimi-toggle-label-inner`;let a=document.createElement(`span`);a.className=`comimi-toggle-label comimi-toggle-label-on`,a.textContent=`ON`;let o=document.createElement(`span`);o.className=`comimi-toggle-label comimi-toggle-label-off`,o.textContent=`OFF`,i.append(a,o),r.append(i),this.root.append(t,r),this.root.addEventListener(`click`,t=>{t.stopPropagation(),e(this.root.dataset.checked!==`true`)})}setChecked(e){this.root.dataset.checked=String(e)}getElement(){return this.root}},x=class{root;select;label;options=[];constructor(e){this.root=document.createElement(`div`),this.root.className=`comimi-selectbox`;let t=document.createElement(`span`);t.className=`comimi-selectbox-bg`,this.select=document.createElement(`select`),this.select.className=`comimi-selectbox-select`,this.select.addEventListener(`change`,()=>{let t=this.options.find(e=>String(e.value)===this.select.value);t&&e(t.value)}),this.label=document.createElement(`span`),this.label.className=`comimi-selectbox-label`;let n=u(`arrow`);n.classList.add(`comimi-selectbox-arrow`),this.root.append(t,this.select,this.label,n)}setOptions(e){let t=this.select.value;this.options=e,this.select.replaceChildren();for(let t of e){let e=document.createElement(`option`);e.value=String(t.value),e.textContent=t.label,this.select.append(e)}t&&this.setValue(t)}setValue(e){this.select.value=String(e);let t=this.options.find(t=>String(t.value)===String(e));this.label.textContent=t?.label??``}getElement(){return this.root}},S=class{root;input;fill;valueLabel;unit=``;min=0;max=100;constructor(e){this.root=document.createElement(`div`),this.root.className=`comimi-range-slider`;let t=document.createElement(`div`);t.className=`comimi-range-slider-wrap`;let n=document.createElement(`div`);n.className=`comimi-range-slider-track`,this.fill=document.createElement(`div`),this.fill.className=`comimi-range-slider-fill`,this.fill.style.width=`0%`,n.append(this.fill),this.input=document.createElement(`input`),this.input.className=`comimi-range-slider-input`,this.input.type=`range`,this.input.addEventListener(`input`,()=>e(Number(this.input.value))),t.append(n,this.input),this.valueLabel=document.createElement(`span`),this.valueLabel.className=`comimi-range-slider-value`,this.root.append(t,this.valueLabel)}setRange(e,t,n=1){this.min=e,this.max=t,this.input.min=String(e),this.input.max=String(t),this.input.step=String(n)}setUnit(e){this.unit=e,this.refreshLabel()}setValue(e){this.input.value=String(e);let t=this.max===this.min?0:(e-this.min)/(this.max-this.min)*100;this.fill.style.width=`${Math.min(Math.max(t,0),100)}%`,this.refreshLabel()}refreshLabel(){this.valueLabel.textContent=`${this.input.value}${this.unit}`}getElement(){return this.root}},re=class{callbacks;i18n;root;body;inner;titleEl;localeLabel;coverLabel;directionLabel;animationLabel;intervalLabel;localeSelect;coverToggle;directionSelect;animationToggle;intervalSlider;constructor(e,t){this.callbacks=e,this.i18n=t,this.root=document.createElement(`div`),this.root.className=`comimi-settings-panel`,this.root.dataset.open=`false`,this.root.setAttribute(`role`,`dialog`),this.root.addEventListener(`click`,e=>e.stopPropagation()),this.body=document.createElement(`div`),this.body.className=`comimi-settings-panel-body`,this.inner=document.createElement(`div`),this.inner.className=`comimi-settings-panel-inner`,this.titleEl=document.createElement(`div`),this.titleEl.className=`comimi-settings-panel-title`,this.localeSelect=new x(e=>this.callbacks.updateSettings({locale:String(e)})),this.coverToggle=new b(e=>this.callbacks.updateSettings({hasCover:e})),this.directionSelect=new x(e=>this.callbacks.updateSettings({readingDirection:e})),this.animationToggle=new b(e=>this.callbacks.updateSettings({pageTurnAnimation:e})),this.intervalSlider=new S(e=>this.callbacks.updateSettings({autoPageTurnIntervalMs:Math.max(1,e)*1e3})),this.intervalSlider.setRange(3,30,1),this.localeLabel=this.createLabel(),this.coverLabel=this.createLabel(),this.directionLabel=this.createLabel(),this.animationLabel=this.createLabel(),this.intervalLabel=this.createLabel(),this.inner.append(this.titleEl,this.section(this.localeLabel,this.localeSelect.getElement()),this.section(this.coverLabel,this.coverToggle.getElement()),this.section(this.directionLabel,this.directionSelect.getElement()),this.section(this.animationLabel,this.animationToggle.getElement()),this.section(this.intervalLabel,this.intervalSlider.getElement())),this.body.append(this.inner),this.root.append(this.body)}update(e){this.titleEl.textContent=this.i18n.t(`settings.title`),this.localeLabel.textContent=`Language`,this.coverLabel.textContent=this.i18n.t(`settings.cover`),this.directionLabel.textContent=this.i18n.t(`settings.direction`),this.animationLabel.textContent=this.i18n.t(`settings.animation`),this.intervalLabel.textContent=this.i18n.t(`settings.interval`),this.localeSelect.setOptions([{label:`日本語`,value:`ja`},{label:`English`,value:`en`}]),this.directionSelect.setOptions([{label:this.i18n.t(`settings.direction.rtl`),value:`rtl`},{label:this.i18n.t(`settings.direction.ltr`),value:`ltr`}]),this.intervalSlider.setUnit(this.i18n.t(`settings.interval.unit`)),this.localeSelect.setValue(e.settings.locale),this.coverToggle.setChecked(e.settings.hasCover),this.directionSelect.setValue(e.settings.readingDirection),this.animationToggle.setChecked(e.settings.pageTurnAnimation),this.intervalSlider.setValue(Math.round(e.settings.autoPageTurnIntervalMs/1e3)),this.root.dataset.open=String(e.panel===`settings`),this.scheduleHeightUpdate()}getElement(){return this.root}createLabel(){let e=document.createElement(`div`);return e.className=`comimi-settings-label`,e}section(e,t){let n=document.createElement(`div`);return n.className=`comimi-settings-section`,n.append(e,t),n}scheduleHeightUpdate(){let e=()=>{this.root.style.setProperty(`--comimi-settings-height`,`${this.body.offsetHeight}px`)};typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>requestAnimationFrame(e)):setTimeout(e,0)}},C=class{callbacks;i18n;root;seekCurrent;seekTotal;seekBar;seekFill;seekInput;autoplayContainer;autoplayButton;autoplaySlider;autoplayTooltip;autoplayProgress;autoplayProgressBar;side;pageMode;pageModeSingleBtn;pageModeSpreadBtn;pageModeSingleIcon;pageModeSpreadIcon;pageModeSingleTooltip;pageModeSpreadTooltip;settings;settingsContainer;settingsButton;settingsIcon;settingsTooltip;prevPageTurnMode;constructor(e,t){this.callbacks=e,this.i18n=t,this.root=document.createElement(`div`),this.root.className=`comimi-controls-dock`,this.root.dataset.overlay=`false`,this.root.dataset.autoplay=`false`;let n=document.createElement(`div`);n.className=`comimi-controls-bg`,this.root.append(n,this.buildSeek(),this.buildRow(),y())}getElement(){return this.root}update(e,t){this.root.dataset.autoplay=String(e.autoPageTurnEnabled);let n=e.manga.pages.length,r=Math.max(1,n),i=e.currentPageIndex+1,a=n<=1?0:e.currentPageIndex/(n-1);this.seekCurrent.textContent=String(i),this.seekTotal.textContent=` / ${r}`,this.seekFill.style.width=`${a*100}%`,this.seekBar.dataset.direction=e.settings.readingDirection,this.seekInput.max=String(Math.max(0,n-1)),document.activeElement!==this.seekInput&&(this.seekInput.value=String(e.currentPageIndex)),this.seekInput.dataset.direction=e.settings.readingDirection,this.autoplaySlider.dataset.active=String(e.autoPageTurnEnabled);let o=this.i18n.t(`overlay.autoPageTurn`);this.autoplayButton.setAttribute(`aria-label`,o),this.autoplayTooltip.textContent=o,e.autoPageTurnEnabled?(this.autoplayProgress||(this.autoplayProgress=document.createElement(`div`),this.autoplayProgress.className=`comimi-autoplay-progress`,this.autoplayProgressBar=document.createElement(`span`),this.autoplayProgressBar.className=`comimi-autoplay-progress-bar`,this.autoplayProgress.append(this.autoplayProgressBar),this.autoplayContainer.append(this.autoplayProgress)),this.autoplayProgressBar.style.animationDuration=`${e.settings.autoPageTurnIntervalMs}ms`):this.autoplayProgress&&(this.autoplayProgress.remove(),this.autoplayProgress=void 0,this.autoplayProgressBar=void 0);let s=e.settings.pageTurnMode===`spread`;if(this.pageModeSingleBtn.dataset.selected=String(!s),this.pageModeSpreadBtn.dataset.selected=String(s),this.prevPageTurnMode!==void 0&&this.prevPageTurnMode!==e.settings.pageTurnMode){let e=s?this.pageModeSpreadIcon:this.pageModeSingleIcon;this.applyPopAnimation(e)}this.pageModeSingleTooltip.textContent=this.i18n.t(`pageMode.single`),this.pageModeSpreadTooltip.textContent=this.i18n.t(`pageMode.spread`),this.pageMode.style.display=t?`none`:``;let c=this.i18n.t(`overlay.settings`);this.settingsButton.setAttribute(`aria-label`,c),this.settingsTooltip.textContent=c,this.settingsContainer.dataset.open=String(e.panel===`settings`),this.settings.update(e),this.prevPageTurnMode=e.settings.pageTurnMode}buildSeek(){let e=document.createElement(`div`);e.className=`comimi-seek`;let t=document.createElement(`div`);t.className=`comimi-seek-text`,this.seekCurrent=document.createElement(`span`),this.seekCurrent.className=`comimi-seek-current`,this.seekTotal=document.createElement(`span`),this.seekTotal.className=`comimi-seek-total`,t.append(this.seekCurrent,this.seekTotal),this.seekBar=document.createElement(`div`),this.seekBar.className=`comimi-seek-bar`,this.seekBar.dataset.direction=`rtl`;let n=document.createElement(`div`);return n.className=`comimi-seek-track`,this.seekFill=document.createElement(`div`),this.seekFill.className=`comimi-seek-fill`,this.seekFill.style.width=`0%`,n.append(this.seekFill),this.seekInput=document.createElement(`input`),this.seekInput.className=`comimi-seek-input`,this.seekInput.type=`range`,this.seekInput.min=`0`,this.seekInput.max=`0`,this.seekInput.step=`1`,this.seekInput.value=`0`,this.seekInput.setAttribute(`aria-label`,`Seek bar`),this.seekInput.addEventListener(`input`,()=>{this.callbacks.goToPage(Number(this.seekInput.value))}),this.seekBar.append(n,this.seekInput),e.append(t,this.seekBar),e}buildRow(){let e=document.createElement(`div`);return e.className=`comimi-controls-row`,e.append(this.buildAutoplay(),this.buildSide()),e}buildAutoplay(){this.autoplayContainer=document.createElement(`div`),this.autoplayContainer.className=`comimi-autoplay`,this.autoplayButton=document.createElement(`button`),this.autoplayButton.type=`button`,this.autoplayButton.className=`comimi-autoplay-button comimi-has-tooltip`,this.autoplayButton.addEventListener(`click`,e=>{e.stopPropagation(),this.callbacks.toggleAutoPageTurn()});let e=document.createElement(`span`);e.className=`comimi-autoplay-window`,this.autoplaySlider=document.createElement(`span`),this.autoplaySlider.className=`comimi-autoplay-slider`,this.autoplaySlider.dataset.active=`false`;let t=u(`play`);t.classList.add(`comimi-autoplay-icon`,`comimi-autoplay-icon-play`);let n=u(`pause`);return n.classList.add(`comimi-autoplay-icon`,`comimi-autoplay-icon-pause`),this.autoplaySlider.append(t,n),e.append(this.autoplaySlider),this.autoplayTooltip=document.createElement(`span`),this.autoplayTooltip.className=`comimi-tooltip`,this.autoplayButton.append(e,this.autoplayTooltip),this.autoplayContainer.append(this.autoplayButton),this.autoplayContainer}buildSide(){this.side=document.createElement(`div`),this.side.className=`comimi-controls-side`,this.pageMode=document.createElement(`div`),this.pageMode.className=`comimi-page-mode`;let e=document.createElement(`div`);return e.className=`comimi-page-mode-wrapper`,[this.pageModeSingleBtn,this.pageModeSingleIcon,this.pageModeSingleTooltip]=this.buildPageModeButton(`single`,`one`),[this.pageModeSpreadBtn,this.pageModeSpreadIcon,this.pageModeSpreadTooltip]=this.buildPageModeButton(`spread`,`two`),e.append(this.pageModeSingleBtn,this.pageModeSpreadBtn),this.pageMode.append(e),[this.settingsContainer,this.settingsButton,this.settingsIcon,this.settingsTooltip]=this.buildSettings(),this.settings=new re(this.callbacks,this.i18n),this.settingsContainer.append(this.settings.getElement()),this.side.append(this.pageMode,this.settingsContainer),this.side}buildPageModeButton(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=`comimi-page-mode-button comimi-has-tooltip`,n.dataset.selected=`false`,n.addEventListener(`click`,t=>{t.stopPropagation(),this.callbacks.updateSettings({pageTurnMode:e})});let r=u(t);r.classList.add(`comimi-page-mode-icon`);let i=document.createElement(`span`);return i.className=`comimi-tooltip`,n.append(r,i),[n,r,i]}buildSettings(){let e=document.createElement(`div`);e.className=`comimi-settings`,e.dataset.open=`false`;let t=document.createElement(`button`);t.type=`button`,t.className=`comimi-settings-button comimi-has-tooltip`,t.addEventListener(`click`,t=>{t.stopPropagation();let n=e.dataset.open===`true`;this.callbacks.setPanel(n?`none`:`settings`)});let n=u(`settings`);n.classList.add(`comimi-settings-icon`);let r=document.createElement(`span`);return r.className=`comimi-tooltip`,t.append(n,r),e.append(t),[e,t,n,r]}applyPopAnimation(e){e.classList.remove(`comimi-pop-animate`),e.offsetWidth,e.classList.add(`comimi-pop-animate`)}},ie=class{callbacks;i18n;root;titleEl;authorEl;bottomEl;viewMenu;viewShortcut;viewPageList;pageListInner;pageListCacheKey;currentState;currentView=`menu`;i18nTexts=[];constructor(e,t){this.callbacks=e,this.i18n=t,this.root=document.createElement(`div`),this.root.className=`comimi-menu-panel`,this.root.setAttribute(`role`,`dialog`),this.root.dataset.open=`false`,this.root.dataset.view=`menu`,this.root.dataset.overlay=`false`;let n=document.createElement(`div`);n.className=`comimi-menu-bg`;let r=this.buildTop();[this.titleEl,this.authorEl]=this.findTitleNodes(r),this.bottomEl=document.createElement(`div`),this.bottomEl.className=`comimi-menu-bottom`,this.bottomEl.style.height=`0px`;let i=document.createElement(`div`);i.className=`comimi-menu-border`,this.viewMenu=this.buildMenuView(),this.viewShortcut=this.buildShortcutView(),[this.viewPageList,this.pageListInner]=this.buildPageListView(),this.bottomEl.append(i,this.viewMenu,this.viewShortcut,this.viewPageList),this.root.append(n,r,this.bottomEl,y())}getElement(){return this.root}bindI18nText(e,t){e.textContent=this.i18n.t(t),this.i18nTexts.push({el:e,key:t})}refreshI18nTexts(){for(let{el:e,key:t}of this.i18nTexts)e.textContent=this.i18n.t(t)}update(e){let t=e.panel===`menu`||e.panel===`pages`||e.panel===`shortcuts`,n=e.panel===`pages`?`pageList`:e.panel===`shortcuts`?`shortcut`:`menu`;this.root.dataset.open=String(t),this.root.dataset.view=n,this.root.dataset.overlay=String(e.overlayVisible),this.titleEl.textContent=e.manga.title,e.manga.author?(this.authorEl.textContent=`@${e.manga.author}`,this.authorEl.style.display=``):(this.authorEl.textContent=``,this.authorEl.style.display=`none`),this.refreshI18nTexts(),this.refreshPageList(e),this.applyHeight(t,n),this.currentState=e,this.currentView=n}applyHeight(e,t){if(!e){this.bottomEl.style.height=`0px`;return}let n=(t===`menu`?this.viewMenu:t===`shortcut`?this.viewShortcut:this.viewPageList).offsetHeight;this.bottomEl.style.height=`${n}px`}refreshPageList(e){let t=`${e.manga.id}:${e.manga.pages.length}`;this.pageListCacheKey!==t&&(this.pageListCacheKey=t,this.pageListInner.replaceChildren(),e.manga.pages.forEach((e,t)=>{let n=document.createElement(`button`);n.type=`button`,n.className=`comimi-page-list-item`,n.addEventListener(`click`,e=>{e.stopPropagation(),this.callbacks.goToPage(t),this.callbacks.setPanel(`none`)});let r=document.createElement(`span`);if(r.className=`comimi-page-list-thumb`,e.type===`image`){let n=document.createElement(`img`);n.alt=e.alt??e.label??this.i18n.t(`seek.previewAlt`,{page:t+1}),n.draggable=!1,n.src=e.thumbnailSrc??e.src,r.append(n)}let i=document.createElement(`span`);i.className=`comimi-page-list-text`,i.textContent=e.label??String(t+1),n.append(r,i),this.pageListInner.append(n)}))}buildTop(){let e=document.createElement(`button`);e.type=`button`,e.className=`comimi-menu-top`,e.addEventListener(`click`,e=>{e.stopPropagation();let t=this.currentState,n=t?.panel===`menu`||t?.panel===`pages`||t?.panel===`shortcuts`;this.callbacks.setPanel(n?`none`:`menu`)});let t=document.createElement(`span`);t.className=`comimi-menu-button`;let n=document.createElement(`span`);n.className=`comimi-menu-button-inner`,n.append(u(`menu`),u(`close`)),t.append(n);let r=document.createElement(`span`);r.className=`comimi-menu-title-wrap`;let i=document.createElement(`span`);i.className=`comimi-menu-title`;let a=document.createElement(`span`);return a.className=`comimi-menu-author`,r.append(i,a),e.append(t,r),e}findTitleNodes(e){let t=e.querySelector(`.comimi-menu-title`),n=e.querySelector(`.comimi-menu-author`);if(!t||!n)throw Error(`MenuPanel title nodes missing`);return[t,n]}buildMenuView(){let e=document.createElement(`div`);e.className=`comimi-menu-view comimi-menu-view-menu`;let t=document.createElement(`div`);return t.className=`comimi-menu-list`,t.append(this.renderMenuLink(`menu.openPages`,()=>this.callbacks.setPanel(`pages`)),this.renderMenuLink(`menu.openShortcuts`,()=>this.callbacks.setPanel(`shortcuts`))),e.append(t),e}renderMenuLink(e,t){let n=document.createElement(`button`);n.type=`button`,n.className=`comimi-menu-link`,n.addEventListener(`click`,e=>{e.stopPropagation(),t()});let r=document.createElement(`span`);r.className=`comimi-menu-link-text`,this.bindI18nText(r,e);let i=document.createElement(`span`);return i.className=`comimi-menu-link-arrow`,i.append(u(`arrow`)),n.append(r,i),n}buildShortcutView(){let e=document.createElement(`div`);e.className=`comimi-menu-view comimi-menu-view-shortcut`;let t=document.createElement(`div`);return t.className=`comimi-shortcut-inner`,t.append(this.shortcutSection(`shortcut.section.page`,[[[`←`,`Space`],`shortcut.moveLeft`],[[`→`,`Space + Shift`],`shortcut.moveRight`],[[`A`],`shortcut.autoPageTurnLabel`]]),this.shortcutSection(`shortcut.section.viewMode`,[[[`N`],`layout.inline`],[[`W`],`layout.theater`],[[`F`],`layout.browserFullscreen`]],!0),this.shortcutSection(`shortcut.section.general`,[[[`M`],`overlay.menu`],[[`P`],`shortcut.pageModeToggle`],[[`S`],`overlay.settings`]],!0)),e.append(t,this.renderBackButton()),e}buildPageListView(){let e=document.createElement(`div`);e.className=`comimi-menu-view comimi-menu-view-page-list`;let t=document.createElement(`div`);return t.className=`comimi-page-list-inner`,e.append(t,this.renderBackButton()),[e,t]}shortcutSection(e,t,n=!1){let r=document.createElement(`div`);r.className=`comimi-shortcut-section`;let i=document.createElement(`div`);i.className=`comimi-shortcut-heading`,this.bindI18nText(i,e);let a=document.createElement(`div`);a.className=n?`comimi-shortcut-column`:`comimi-shortcut-list`;for(let[e,n]of t)a.append(this.shortcutItem(e,n));return r.append(i,a),r}shortcutItem(e,t){let n=document.createElement(`div`);n.className=`comimi-shortcut-item`;let r=document.createElement(`span`);r.className=`comimi-shortcut-badge`,e.forEach((e,t)=>{if(t>0){let e=document.createElement(`span`);e.className=`comimi-shortcut-or`,r.append(e)}let n=document.createElement(`span`);n.className=`comimi-shortcut-key`,n.textContent=e,r.append(n)});let i=document.createElement(`span`);return i.className=`comimi-shortcut-label`,this.bindI18nText(i,t),n.append(r,i),n}renderBackButton(){let e=document.createElement(`button`);e.type=`button`,e.className=`comimi-back-button`,e.addEventListener(`click`,e=>{e.stopPropagation(),this.callbacks.setPanel(`menu`)});let t=document.createElement(`span`);t.className=`comimi-back-inner`;let n=document.createElement(`span`);n.className=`comimi-back-bg`;let r=document.createElement(`span`);r.className=`comimi-back-text`,this.bindI18nText(r,`menu.back`);let i=document.createElement(`span`);return i.className=`comimi-back-arrow`,i.append(u(`arrow`)),t.append(n,r,i),e.append(t),e}},ae=class{callbacks;i18n;root;indicator;tooltip;entries;prevMode;constructor(e,t){this.callbacks=e,this.i18n=t,this.root=document.createElement(`div`),this.root.className=`comimi-view-switcher comimi-has-tooltip`,this.root.dataset.overlay=`false`,this.indicator=document.createElement(`span`),this.indicator.className=`comimi-view-switcher-indicator`,this.indicator.style.transform=`translateX(0px)`,this.root.append(this.indicator);let n=[[`inline`,`layout.inline`,`default`],[`theater`,`layout.theater`,`wide`],[`browserFullscreen`,`layout.browserFullscreen`,`fullscreen`]];this.entries=n.map(([e,n,r])=>{let i=document.createElement(`button`);i.type=`button`,i.className=`comimi-view-switcher-button`,i.dataset.selected=`false`,i.addEventListener(`click`,t=>{t.stopPropagation(),this.callbacks.setLayoutMode(e)});let a=document.createElement(`span`);a.className=`comimi-view-switcher-icon-wrap`;let o=u(r);o.classList.add(`comimi-view-switcher-icon`),a.append(o);let s=document.createElement(`span`);return s.className=`comimi-view-switcher-label`,s.textContent=t.t(n),i.append(a,s),this.root.append(i),{mode:e,iconName:r,labelKey:n,button:i,iconWrap:a}}),this.tooltip=document.createElement(`span`),this.tooltip.className=`comimi-tooltip`,this.tooltip.textContent=t.t(`overlay.layout`),this.root.append(this.tooltip)}getElement(){return this.root}update(e){this.root.dataset.overlay=String(e.overlayVisible);let t=Math.max(0,this.entries.findIndex(t=>t.mode===e.layout.mode));this.indicator.style.transform=`translateX(${t*60}px)`;let n=this.prevMode!==void 0&&this.prevMode!==e.layout.mode;for(let t of this.entries){let r=t.mode===e.layout.mode;t.button.dataset.selected=String(r),t.iconWrap.classList.toggle(`comimi-pop-animate`,n&&r),t.button.querySelector(`.comimi-view-switcher-label`).textContent=this.i18n.t(t.labelKey)}this.tooltip.textContent=this.i18n.t(`overlay.layout`),this.prevMode=e.layout.mode}};function w(e,t){return j(e,e.currentPageIndex,t)}function T(e,t,n){let r=w(e,n),i=t===`previous`?Math.min(...r)-1:Math.max(...r)+1;return i<0||i>=e.manga.pages.length?[]:j(e,i,n)}function E(e,t){let n=[];for(let r=1;r>=1;--r){let i=A(e,`previous`,r,t);i.length>0&&n.push({indexes:i,placement:`previous`,offset:D(e,`previous`,r)})}n.push({indexes:w(e,t),placement:`current`,offset:0});for(let r=1;r<=1;r+=1){let i=A(e,`next`,r,t);i.length>0&&n.push({indexes:i,placement:`next`,offset:D(e,`next`,r)})}return n}function D(e,t,n){let r=e.settings.readingDirection===`rtl`?-1:1;return(t===`next`?r:-r)*n}function O(e,t){if(t===`current`)return`center`;let n=e.settings.readingDirection===`rtl`?`left`:`right`;return t===`next`?n:n===`left`?`right`:`left`}function k(e,t){return t===`rtl`?e>0:e<0}function A(e,t,n,r){let i=w(e,r);for(let a=0;a<n;a+=1){let n=t===`previous`?Math.min(...i)-1:Math.max(...i)+1;if(n<0||n>=e.manga.pages.length)return[];i=j(e,n,r)}return i}function j(e,t,n){let{manga:r,settings:i}=e;if(n||i.pageTurnMode!==`spread`||i.hasCover&&t===0)return[t];let a=[t,oe(e,t)].filter(e=>e>=0&&e<r.pages.length),o=[...new Set(a)].sort((e,t)=>e-t);return i.readingDirection===`rtl`?o.reverse():o}function oe(e,t){return e.settings.hasCover?t%2==1?t+1:t-1:t%2==0?t+1:t-1}var M=`
|
|
12
|
+
<svg viewBox="0 0 112.19 99.01" class="comimi-error-svg" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<g>
|
|
14
|
+
<path class="comimi-error-stroke" d="M17.43,53.54c-7.74,7.51-12.43,17.29-12.43,27.99,0,4.34.78,8.53,2.21,12.48" />
|
|
15
|
+
<path class="comimi-error-stroke" d="M104.98,94.01c1.43-3.95,2.21-8.14,2.21-12.48,0-10.91-4.87-20.85-12.87-28.42" />
|
|
16
|
+
<path class="comimi-error-stroke comimi-error-mimi comimi-error-mimi-left" d="M55.79,43.81v-24.02c3.43-9.18,9.81-15.08,20.52-14.52,16.12.84,20.31,15.9,19.35,34.15-.25,4.75-.69,9.25-1.51,13.3" />
|
|
17
|
+
<path class="comimi-error-stroke comimi-error-mimi comimi-error-mimi-right" d="M55.79,43.62v-24.02c-3.25-9.2-9.34-15.11-19.78-14.56-16.53.87-21.21,15.95-20.25,34.2.26,4.91.67,9.56,1.51,13.72" />
|
|
18
|
+
<path fill="#fff" d="M80.44,49.41H31.46c-12.97,6.71-21.6,18.57-21.6,32.1,0,5.8,1.59,11.3,4.43,16.21h83.34c2.83-4.92,4.43-10.41,4.43-16.21,0-13.53-8.63-25.4-21.6-32.1Z" />
|
|
19
|
+
<g class="comimi-error-eyes">
|
|
20
|
+
<path class="comimi-error-eye" d="M45.85,75.85c1.92,1.92,1.92,5.05,0,6.97s-5.05,1.92-6.97,0l-1.74-1.74-1.74,1.74c-1.92,1.92-5.05,1.92-6.97,0-1.92-1.92-1.92-5.05,0-6.97l1.74-1.74-1.74-1.74c-1.92-1.92-1.92-5.05,0-6.97s5.05-1.92,6.97,0l1.74,1.74,1.74-1.74c1.92-1.92,5.05-1.92,6.97,0,1.93,1.92,1.93,5.05,0,6.97l-1.74,1.74,1.74,1.74Z" />
|
|
21
|
+
<path class="comimi-error-eye" d="M77.89,75.85c1.92,1.92,1.92,5.05,0,6.97-1.92,1.92-5.05,1.92-6.97,0l-1.74-1.74-1.74,1.74c-1.92,1.92-5.05,1.92-6.97,0-1.92-1.92-1.92-5.05,0-6.97l1.74-1.74-1.74-1.74c-1.92-1.92-1.92-5.05,0-6.97,1.92-1.92,5.05-1.92,6.97,0l1.74,1.74,1.74-1.74c1.92-1.92,5.05-1.92,6.97,0,1.92,1.92,1.92,5.05,0,6.97l-1.74,1.74,1.74,1.74Z" />
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|
|
25
|
+
`;function N(e,t){let n=document.createElement(`div`);n.className=`comimi-error-icon`;let r=document.createElement(`div`);r.className=`comimi-error-icon-svg`,r.innerHTML=M;let i=document.createElement(`div`);return i.className=`comimi-error-icon-text`,i.textContent=e.t(`error.pageRequestFailed`,{page:t}),n.append(r,i),n}var P=`
|
|
26
|
+
<svg viewBox="0 0 112.19 99.01" class="comimi-loading-svg" xmlns="http://www.w3.org/2000/svg">
|
|
27
|
+
<g>
|
|
28
|
+
<path class="comimi-loading-stroke" d="M17.43,53.54c-7.74,7.51-12.43,17.29-12.43,27.99,0,4.34.78,8.53,2.21,12.48" />
|
|
29
|
+
<path class="comimi-loading-stroke" d="M104.98,94.01c1.43-3.95,2.21-8.14,2.21-12.48,0-10.91-4.87-20.85-12.87-28.42" />
|
|
30
|
+
<path class="comimi-loading-stroke comimi-loading-mimi comimi-loading-mimi-left" d="M55.79,43.81v-24.02c3.43-9.18,9.81-15.08,20.52-14.52,16.12.84,20.31,15.9,19.35,34.15-.25,4.75-.69,9.25-1.51,13.3" />
|
|
31
|
+
<path class="comimi-loading-stroke comimi-loading-mimi comimi-loading-mimi-right" d="M55.79,43.62v-24.02c-3.25-9.2-9.34-15.11-19.78-14.56-16.53.87-21.21,15.95-20.25,34.2.26,4.91.67,9.56,1.51,13.72" />
|
|
32
|
+
<path fill="#fff" d="M80.44,49.41H31.46c-12.97,6.71-21.6,18.57-21.6,32.1,0,5.8,1.59,11.3,4.43,16.21h83.34c2.83-4.92,4.43-10.41,4.43-16.21,0-13.53-8.63-25.4-21.6-32.1Z" />
|
|
33
|
+
<g class="comimi-loading-eyes">
|
|
34
|
+
<circle class="comimi-loading-eye" cx="40.17" cy="78.21" r="6" />
|
|
35
|
+
<circle class="comimi-loading-eye" cx="71.58" cy="78.21" r="6" />
|
|
36
|
+
</g>
|
|
37
|
+
</g>
|
|
38
|
+
</svg>
|
|
39
|
+
`,F=3e3;function I(e){let t=document.createElement(`div`);t.className=`comimi-loading-icon`;let n=document.createElement(`div`);n.className=`comimi-loading-icon-svg`,n.innerHTML=P;let r=document.createElement(`div`);r.className=`comimi-loading-icon-text`,r.append(document.createTextNode(e.t(`loading`)));for(let e=0;e<3;e+=1){let e=document.createElement(`span`);e.textContent=`.`,r.append(e)}t.append(n,r);let i=window.setInterval(()=>{if(!t.isConnected){window.clearInterval(i);return}n.innerHTML=P},F);return t}var L=class{options;root;imageSources=new Map;resolvePromises=new Map;slots=new Map;constructor(e){this.options=e,this.root=document.createElement(`div`),this.root.className=`comimi-stage`}getElement(){return this.root}setDragOffset(e,t=!1){this.root.dataset.dragging=t?`false`:String(e!==0),this.root.style.transform=e===0?``:`translateX(${e}px)`}snapTransform(){this.root.dataset.dragging=`false`,this.root.style.transition=`none`,this.root.style.transform=``,typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>{this.root.style.transition=``}):this.root.style.transition=``}update(e,t){let n=E(e,t),r=[];for(let t of n){let n=document.createElement(`div`);n.className=`comimi-page-group`,n.dataset.placement=t.placement,n.dataset.side=O(e,t.placement),n.style.transform=`translateX(${t.offset*100}%)`;let i=t.indexes.length>1;for(let[r,a]of t.indexes.entries()){let t=e.manga.pages[a];if(!t)continue;let o=this.getOrBuildSlot(e,t,a);o.slot.dataset.spread=String(i),o.slot.dataset.position=i?r===0?`left`:`right`:`single`,o.slot.dataset.pageIndex=String(a),o.img&&(o.img.style.transform=R(e)),n.append(o.slot)}r.push(n)}this.root.replaceChildren(...r)}getOrBuildSlot(e,t,n){let r=this.slots.get(t.id);if(r)return r;let i=this.buildSlot(e,t,n);return this.slots.set(t.id,i),i}buildSlot(e,t,n){let r=document.createElement(`div`);if(r.className=`comimi-page`,t.type===`html`){let n=document.createElement(`div`);return n.className=`comimi-html-page`,n.innerHTML=t.html,n.style.transform=R(e),r.append(n),{slot:r,img:null}}let i=document.createElement(`img`);i.alt=t.alt??t.label??`${n+1}`,i.draggable=!1,i.style.transform=R(e),i.addEventListener(`error`,()=>{r.replaceChildren(N(this.options.i18n,n+1))}),r.append(i);let a=`${e.manga.id}:${t.id}`,o=this.imageSources.get(a);if(o)return i.src=o,{slot:r,img:i};let s=I(this.options.i18n);r.append(s),i.style.visibility=`hidden`;let c=this.resolvePromises.get(a);return c||(c=this.options.assetLoader.resolveImageSource(e.manga.id,t),this.resolvePromises.set(a,c),c.then(e=>{this.imageSources.set(a,e)}).finally(()=>{this.resolvePromises.delete(a)})),c.then(e=>{i.addEventListener(`load`,()=>{i.style.visibility=``,s.remove()},{once:!0}),i.src=e}).catch(()=>{s.remove(),r.replaceChildren(N(this.options.i18n,n+1))}),{slot:r,img:i}}};function R(e){return`translate(${e.panX}px, ${e.panY}px) scale(${e.zoomScale})`}function z(e){let t=document.createElement(`div`);t.className=`comimi-notifications`;for(let n of e.notifications){let e=document.createElement(`div`);e.className=`comimi-toast`,e.dataset.tone=n.tone??`info`;let r=document.createElement(`span`);r.className=`comimi-toast-dot`;let i=document.createElement(`span`);i.className=`comimi-toast-text`,i.textContent=n.message,e.append(r,i),t.append(e)}return t}var B=`http://www.w3.org/2000/svg`;function V(e){let t=document.createElement(`div`);t.className=`comimi-splash`;let n=document.createElement(`div`);n.className=`comimi-splash-logo-wrap`;let r=document.createElement(`div`);r.className=`comimi-splash-logo`,r.append(H(),U());let i=document.createElement(`div`);i.className=`comimi-splash-text`,i.append(document.createTextNode(e.t(`splash.loading`)));for(let e=0;e<3;e+=1){let e=document.createElement(`span`);e.textContent=`.`,i.append(e)}return n.append(r,i),t.append(n),t}function H(){let e=document.createElementNS(B,`svg`);e.setAttribute(`viewBox`,`0 0 112.19 99.01`),e.setAttribute(`class`,`comimi-splash-symbol`),W(e,`M17.43,53.54c-7.74,7.51-12.43,17.29-12.43,27.99,0,4.34.78,8.53,2.21,12.48`),W(e,`M104.98,94.01c1.43-3.95,2.21-8.14,2.21-12.48,0-10.91-4.87-20.85-12.87-28.42`),W(e,`M55.79,43.81v-24.02c3.43-9.18,9.81-15.08,20.52-14.52,16.12.84,20.31,15.9,19.35,34.15-.25,4.75-.69,9.25-1.51,13.3`,`comimi-splash-mimi comimi-splash-mimi-left`),W(e,`M55.79,43.62v-24.02c-3.25-9.2-9.34-15.11-19.78-14.56-16.53.87-21.21,15.95-20.25,34.2.26,4.91.67,9.56,1.51,13.72`,`comimi-splash-mimi comimi-splash-mimi-right`);let t=document.createElementNS(B,`path`);t.setAttribute(`d`,`M80.44,49.41H31.46c-12.97,6.71-21.6,18.57-21.6,32.1,0,5.8,1.59,11.3,4.43,16.21h83.34c2.83-4.92,4.43-10.41,4.43-16.21,0-13.53-8.63-25.4-21.6-32.1Z`),t.setAttribute(`fill`,`#e0e0e0`),e.append(t);let n=document.createElementNS(B,`g`);n.setAttribute(`class`,`comimi-splash-eyes`);for(let e of[`40.17`,`71.58`]){let t=document.createElementNS(B,`circle`);t.setAttribute(`class`,`comimi-splash-eye`),t.setAttribute(`cx`,e),t.setAttribute(`cy`,`78.21`),t.setAttribute(`r`,`6`),t.setAttribute(`fill`,`#fff`),n.append(t)}return e.append(n),e}function U(){let e=document.createElement(`div`);e.className=`comimi-splash-typo-wrap`;let t=document.createElementNS(B,`svg`);t.setAttribute(`viewBox`,`0 0 227.74 38.52`),t.setAttribute(`class`,`comimi-splash-typo`);for(let e of[`M12.53,14.42c-3.15,3.27-3.15,8.45,0,11.6,1.58,1.58,3.6,2.36,5.74,2.36,2.25,0,4.28-.79,5.86-2.36,1.91-1.91,5.18-1.91,7.21,0,1.91,2.03,1.91,5.18,0,7.21-3.49,3.49-8.11,5.29-13.07,5.29s-9.46-1.8-12.95-5.29C-1.77,26.02-1.77,14.42,5.32,7.32,12.53.11,24.13.11,31.34,7.32c1.91,1.91,1.91,5.18,0,7.1-2.03,2.03-5.29,2.03-7.21,0-3.15-3.15-8.45-3.15-11.6,0Z`,`M76.15,20.27c0,10.02-8.22,18.25-18.36,18.25-4.96,0-9.57-1.8-12.95-5.29-3.49-3.49-5.41-8.11-5.41-12.95,0-10.14,8.22-18.36,18.36-18.36s18.36,8.22,18.36,18.36ZM66.01,20.27c0-4.5-3.72-8.22-8.22-8.22s-8.22,3.72-8.22,8.22c0,2.14.9,4.17,2.36,5.74,1.58,1.58,3.6,2.36,5.86,2.36,4.5,0,8.22-3.6,8.22-8.11Z`,`M131.42,15.88v17.57c0,2.82-2.25,5.07-5.07,5.07s-5.07-2.25-5.07-5.07V15.88c0-2.36-2.03-4.39-4.51-4.39-1.13,0-2.25.45-3.15,1.24-.79.9-1.24,2.03-1.24,3.15v14.57c0,2.82-2.25,5.07-5.07,5.07s-5.07-2.25-5.07-5.07v-14.57c0-2.36-2.03-4.39-4.5-4.39s-4.39,1.92-4.39,4.39v17.68c0,2.7-2.25,4.96-5.07,4.96s-5.07-2.25-5.07-5.07V15.88c0-8,6.53-14.53,14.53-14.53,3.72,0,6.98,1.35,9.57,3.49,2.59-2.25,5.97-3.49,9.46-3.49,8.11,0,14.64,6.53,14.64,14.53Z`,`M150.98,5.07v28.38c0,2.82-2.25,5.07-5.07,5.07s-5.07-2.25-5.07-5.07V5.07c0-2.7,2.25-5.07,5.07-5.07s5.07,2.36,5.07,5.07Z`,`M208.61,15.88v17.57c0,2.82-2.25,5.07-5.07,5.07s-5.07-2.25-5.07-5.07V15.88c0-2.36-2.03-4.39-4.51-4.39-1.13,0-2.25.45-3.15,1.24-.79.9-1.24,2.03-1.24,3.15v14.57c0,2.82-2.25,5.07-5.07,5.07s-5.07-2.25-5.07-5.07v-14.57c0-2.36-2.03-4.39-4.5-4.39s-4.39,1.92-4.39,4.39v17.68c0,2.7-2.25,4.96-5.07,4.96s-5.07-2.25-5.07-5.07V15.88c0-8,6.53-14.53,14.53-14.53,3.72,0,6.98,1.35,9.57,3.49,2.59-2.25,5.97-3.49,9.46-3.49,8.11,0,14.64,6.53,14.64,14.53Z`,`M227.74,5.07v28.38c0,2.82-2.25,5.07-5.07,5.07s-5.07-2.25-5.07-5.07V5.07c0-2.7,2.25-5.07,5.07-5.07s5.07,2.36,5.07,5.07Z`]){let n=document.createElementNS(B,`path`);n.setAttribute(`d`,e),n.setAttribute(`fill`,`#fff`),t.append(n)}e.append(t);let n=document.createElement(`div`);n.className=`comimi-splash-heart comimi-splash-heart-1`;let r=document.createElement(`div`);return r.className=`comimi-splash-heart comimi-splash-heart-2`,e.append(n,r),e}function W(e,t,n){let r=document.createElementNS(B,`path`);r.setAttribute(`d`,t),r.setAttribute(`class`,`comimi-splash-stroke ${n??``}`.trim()),e.append(r)}function G({className:e}={}){let t=document.createElement(`div`);return t.className=e?`comimi-root ${e}`:`comimi-root`,t.tabIndex=0,t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Manga viewer`),t}var K=`
|
|
40
|
+
.comimi-arrows {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
z-index: 30;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.comimi-arrow-button {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 50%;
|
|
50
|
+
width: 46px;
|
|
51
|
+
height: 46px;
|
|
52
|
+
padding: 0;
|
|
53
|
+
border: 0;
|
|
54
|
+
background: transparent;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
pointer-events: auto;
|
|
57
|
+
transform: translateY(-50%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.comimi-arrow-next {
|
|
61
|
+
right: 24px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.comimi-arrow-prev {
|
|
65
|
+
left: 24px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.comimi-arrow-inner {
|
|
69
|
+
position: absolute;
|
|
70
|
+
inset: 0;
|
|
71
|
+
transition:
|
|
72
|
+
transform 0.6s var(--comimi-spring),
|
|
73
|
+
opacity 0.3s linear;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.comimi-arrows[data-overlay="false"] .comimi-arrow-next .comimi-arrow-inner {
|
|
77
|
+
transform: translateX(35px);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
transition:
|
|
80
|
+
transform 0.3s var(--comimi-spring),
|
|
81
|
+
opacity 0.15s linear;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.comimi-arrows[data-overlay="false"] .comimi-arrow-prev .comimi-arrow-inner {
|
|
85
|
+
transform: translateX(-35px);
|
|
86
|
+
opacity: 0;
|
|
87
|
+
transition:
|
|
88
|
+
transform 0.3s var(--comimi-spring),
|
|
89
|
+
opacity 0.15s linear;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.comimi-arrows[data-overlay="false"] {
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.comimi-arrow-bg {
|
|
97
|
+
position: absolute;
|
|
98
|
+
inset: 0;
|
|
99
|
+
border-radius: 16px;
|
|
100
|
+
background: var(--comimi-glass);
|
|
101
|
+
box-shadow: var(--comimi-shadow);
|
|
102
|
+
backdrop-filter: blur(5px);
|
|
103
|
+
transition: inset 0.36s var(--comimi-spring), border-radius 0.36s var(--comimi-spring);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.comimi-arrow-icon {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 50%;
|
|
109
|
+
left: 50%;
|
|
110
|
+
width: 20px;
|
|
111
|
+
height: 20px;
|
|
112
|
+
color: #666;
|
|
113
|
+
transform: translate(-50%, -50%);
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.comimi-arrow-prev .comimi-arrow-icon {
|
|
118
|
+
transform: translate(-50%, -50%) scaleX(-1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@keyframes comimi-arrow-bounce {
|
|
122
|
+
from, to {
|
|
123
|
+
transform: translate(-50%, -50%);
|
|
124
|
+
}
|
|
125
|
+
40% {
|
|
126
|
+
transform: translate(calc(-50% + 3px), -50%);
|
|
127
|
+
}
|
|
128
|
+
70% {
|
|
129
|
+
transform: translate(calc(-50% - 1.5px), -50%);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@keyframes comimi-arrow-bounce-prev {
|
|
134
|
+
from, to {
|
|
135
|
+
transform: translate(-50%, -50%) scaleX(-1);
|
|
136
|
+
}
|
|
137
|
+
40% {
|
|
138
|
+
transform: translate(calc(-50% - 3px), -50%) scaleX(-1);
|
|
139
|
+
}
|
|
140
|
+
70% {
|
|
141
|
+
transform: translate(calc(-50% + 1.5px), -50%) scaleX(-1);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@media (hover: hover) {
|
|
146
|
+
.comimi-arrow-button:hover .comimi-arrow-bg {
|
|
147
|
+
inset: -3px;
|
|
148
|
+
border-radius: 20px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.comimi-arrow-next:hover .comimi-arrow-icon {
|
|
152
|
+
animation: comimi-arrow-bounce 0.5s ease-in-out 0.1s both;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.comimi-arrow-prev:hover .comimi-arrow-icon {
|
|
156
|
+
animation: comimi-arrow-bounce-prev 0.5s ease-in-out 0.1s both;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (max-width: 767px) {
|
|
161
|
+
.comimi-arrow-button {
|
|
162
|
+
width: 36px;
|
|
163
|
+
height: 50px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.comimi-arrow-next {
|
|
167
|
+
right: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.comimi-arrow-prev {
|
|
171
|
+
left: 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.comimi-arrow-next .comimi-arrow-bg {
|
|
175
|
+
border-radius: 16px 0 0 16px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.comimi-arrow-prev .comimi-arrow-bg {
|
|
179
|
+
border-radius: 0 16px 16px 0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
`,q=`
|
|
183
|
+
.comimi-center-message {
|
|
184
|
+
position: absolute;
|
|
185
|
+
top: 50%;
|
|
186
|
+
left: 50%;
|
|
187
|
+
transform: translate(-50%, -50%);
|
|
188
|
+
pointer-events: none;
|
|
189
|
+
z-index: 20;
|
|
190
|
+
transition: opacity 0.3s linear;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.comimi-center-message[data-overlay="false"] {
|
|
194
|
+
opacity: 0;
|
|
195
|
+
transition: opacity 0.15s linear;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.comimi-center-message-text {
|
|
199
|
+
box-sizing: border-box;
|
|
200
|
+
padding: 6px 12px;
|
|
201
|
+
border-radius: 8px;
|
|
202
|
+
background: rgba(255, 255, 255, 0.5);
|
|
203
|
+
box-shadow: var(--comimi-shadow);
|
|
204
|
+
backdrop-filter: blur(5px);
|
|
205
|
+
color: #bbb;
|
|
206
|
+
font-size: 12px;
|
|
207
|
+
font-weight: 400;
|
|
208
|
+
line-height: 1.45;
|
|
209
|
+
text-align: center;
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.comimi-center-message-mobile {
|
|
214
|
+
display: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@media (max-width: 767px) {
|
|
218
|
+
.comimi-center-message {
|
|
219
|
+
width: calc(100% - 60px * 2);
|
|
220
|
+
max-width: max-content;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.comimi-center-message-desktop {
|
|
224
|
+
display: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.comimi-center-message-mobile {
|
|
228
|
+
display: block;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`,se=`
|
|
232
|
+
/* --- Controls dock (bottom) ------------------------------------------- */
|
|
233
|
+
|
|
234
|
+
.comimi-controls-dock {
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
position: absolute;
|
|
237
|
+
bottom: 24px;
|
|
238
|
+
left: 24px;
|
|
239
|
+
width: calc(100% - 48px);
|
|
240
|
+
padding: 20px 24px;
|
|
241
|
+
z-index: 40;
|
|
242
|
+
pointer-events: auto;
|
|
243
|
+
transition:
|
|
244
|
+
transform 0.6s var(--comimi-spring),
|
|
245
|
+
opacity 0.3s linear;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.comimi-controls-dock[data-overlay="false"] {
|
|
249
|
+
transform: translateY(35px);
|
|
250
|
+
opacity: 0;
|
|
251
|
+
pointer-events: none;
|
|
252
|
+
transition:
|
|
253
|
+
transform 0.3s var(--comimi-spring),
|
|
254
|
+
opacity 0.15s linear;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.comimi-controls-bg {
|
|
258
|
+
position: absolute;
|
|
259
|
+
inset: 0;
|
|
260
|
+
border-radius: 20px;
|
|
261
|
+
background: var(--comimi-glass);
|
|
262
|
+
box-shadow: var(--comimi-shadow);
|
|
263
|
+
backdrop-filter: blur(5px);
|
|
264
|
+
transition: inset 0.36s var(--comimi-spring), border-radius 0.36s var(--comimi-spring);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@media (hover: hover) {
|
|
268
|
+
.comimi-controls-dock:hover > .comimi-controls-bg {
|
|
269
|
+
inset: -4px -4px 0 -4px;
|
|
270
|
+
border-radius: 20px;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.comimi-controls-row {
|
|
275
|
+
position: relative;
|
|
276
|
+
display: grid;
|
|
277
|
+
grid-template-columns: auto auto;
|
|
278
|
+
justify-content: space-between;
|
|
279
|
+
align-items: center;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.comimi-controls-side {
|
|
283
|
+
display: grid;
|
|
284
|
+
grid-auto-flow: column;
|
|
285
|
+
column-gap: 16px;
|
|
286
|
+
justify-content: end;
|
|
287
|
+
align-items: center;
|
|
288
|
+
transition:
|
|
289
|
+
opacity 0.2s ease-in-out,
|
|
290
|
+
visibility 0.2s ease-in-out;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.comimi-controls-dock[data-autoplay="true"] .comimi-controls-side {
|
|
294
|
+
opacity: 0;
|
|
295
|
+
visibility: hidden;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* --- Seek bar --------------------------------------------------------- */
|
|
299
|
+
|
|
300
|
+
.comimi-seek {
|
|
301
|
+
position: relative;
|
|
302
|
+
display: grid;
|
|
303
|
+
grid-template-columns: auto 1fr;
|
|
304
|
+
column-gap: 10px;
|
|
305
|
+
align-items: center;
|
|
306
|
+
margin-bottom: 10px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.comimi-seek-text {
|
|
310
|
+
display: grid;
|
|
311
|
+
grid-template-columns: repeat(2, auto);
|
|
312
|
+
justify-content: start;
|
|
313
|
+
align-items: end;
|
|
314
|
+
line-height: 14px;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.comimi-seek-current {
|
|
318
|
+
color: #333;
|
|
319
|
+
font-size: 12px;
|
|
320
|
+
font-weight: 700;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.comimi-seek-total {
|
|
324
|
+
color: #999;
|
|
325
|
+
font-size: 12px;
|
|
326
|
+
font-weight: 400;
|
|
327
|
+
margin-left: 0.4em;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.comimi-seek-bar {
|
|
331
|
+
position: relative;
|
|
332
|
+
width: 100%;
|
|
333
|
+
height: 18px;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.comimi-seek-track {
|
|
337
|
+
position: absolute;
|
|
338
|
+
top: 50%;
|
|
339
|
+
left: 0;
|
|
340
|
+
right: 0;
|
|
341
|
+
height: 8px;
|
|
342
|
+
border-radius: 999px;
|
|
343
|
+
background: #e0e0e0;
|
|
344
|
+
overflow: hidden;
|
|
345
|
+
transform: translateY(-50%);
|
|
346
|
+
transition: height 0.36s var(--comimi-spring);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@media (hover: hover) {
|
|
350
|
+
.comimi-seek-bar:hover .comimi-seek-track {
|
|
351
|
+
height: 12px;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.comimi-seek-fill {
|
|
356
|
+
position: absolute;
|
|
357
|
+
top: 0;
|
|
358
|
+
height: 100%;
|
|
359
|
+
border-radius: 999px;
|
|
360
|
+
background: #666;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.comimi-seek-bar[data-direction="rtl"] .comimi-seek-fill {
|
|
364
|
+
right: 0;
|
|
365
|
+
border-top-left-radius: 0;
|
|
366
|
+
border-bottom-left-radius: 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.comimi-seek-bar[data-direction="ltr"] .comimi-seek-fill {
|
|
370
|
+
left: 0;
|
|
371
|
+
border-top-right-radius: 0;
|
|
372
|
+
border-bottom-right-radius: 0;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.comimi-seek-input {
|
|
376
|
+
position: absolute;
|
|
377
|
+
inset: 0;
|
|
378
|
+
z-index: 1;
|
|
379
|
+
width: 100%;
|
|
380
|
+
height: 18px;
|
|
381
|
+
margin: 0;
|
|
382
|
+
padding: 0;
|
|
383
|
+
border: 0;
|
|
384
|
+
background: transparent;
|
|
385
|
+
appearance: none;
|
|
386
|
+
-webkit-appearance: none;
|
|
387
|
+
cursor: pointer;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.comimi-seek-input::-webkit-slider-runnable-track {
|
|
391
|
+
height: 8px;
|
|
392
|
+
background: transparent;
|
|
393
|
+
border: 0;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.comimi-seek-input::-webkit-slider-thumb {
|
|
397
|
+
appearance: none;
|
|
398
|
+
-webkit-appearance: none;
|
|
399
|
+
width: 18px;
|
|
400
|
+
height: 18px;
|
|
401
|
+
margin-top: -5px;
|
|
402
|
+
border: 0;
|
|
403
|
+
border-radius: 50%;
|
|
404
|
+
background: #666;
|
|
405
|
+
box-shadow: none;
|
|
406
|
+
transition:
|
|
407
|
+
transform 0.36s var(--comimi-spring),
|
|
408
|
+
background-color 0.2s ease-in-out;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.comimi-seek-input:hover::-webkit-slider-thumb {
|
|
412
|
+
transform: scale(1.15);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.comimi-seek-input::-moz-range-track {
|
|
416
|
+
height: 8px;
|
|
417
|
+
background: transparent;
|
|
418
|
+
border: 0;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.comimi-seek-input::-moz-range-thumb {
|
|
422
|
+
width: 18px;
|
|
423
|
+
height: 18px;
|
|
424
|
+
border: 0;
|
|
425
|
+
border-radius: 50%;
|
|
426
|
+
background: #666;
|
|
427
|
+
box-shadow: none;
|
|
428
|
+
transition:
|
|
429
|
+
transform 0.36s var(--comimi-spring),
|
|
430
|
+
background-color 0.2s ease-in-out;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.comimi-seek-input:hover::-moz-range-thumb {
|
|
434
|
+
transform: scale(1.15);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.comimi-seek-input:focus-visible {
|
|
438
|
+
outline: none;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.comimi-seek-input:focus-visible::-webkit-slider-thumb {
|
|
442
|
+
box-shadow: none;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.comimi-seek-input:focus-visible::-moz-range-thumb {
|
|
446
|
+
box-shadow: none;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.comimi-seek-input[data-direction="rtl"] {
|
|
450
|
+
direction: rtl;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* --- Auto Play -------------------------------------------------------- */
|
|
454
|
+
|
|
455
|
+
.comimi-autoplay {
|
|
456
|
+
position: relative;
|
|
457
|
+
display: grid;
|
|
458
|
+
grid-template-columns: auto auto;
|
|
459
|
+
column-gap: 12px;
|
|
460
|
+
justify-content: start;
|
|
461
|
+
align-items: center;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.comimi-autoplay-button {
|
|
465
|
+
position: relative;
|
|
466
|
+
width: 24px;
|
|
467
|
+
height: 24px;
|
|
468
|
+
padding: 0;
|
|
469
|
+
border: 0;
|
|
470
|
+
background: transparent;
|
|
471
|
+
color: #666;
|
|
472
|
+
cursor: pointer;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.comimi-autoplay-window {
|
|
476
|
+
position: absolute;
|
|
477
|
+
top: 50%;
|
|
478
|
+
left: 50%;
|
|
479
|
+
width: 20px;
|
|
480
|
+
height: 20px;
|
|
481
|
+
overflow: hidden;
|
|
482
|
+
transform: translate(-50%, -50%);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.comimi-autoplay-slider {
|
|
486
|
+
position: absolute;
|
|
487
|
+
top: 0;
|
|
488
|
+
right: 0;
|
|
489
|
+
width: 200%;
|
|
490
|
+
height: 100%;
|
|
491
|
+
transition: transform 0.36s var(--comimi-spring);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.comimi-autoplay-slider[data-active="true"] {
|
|
495
|
+
transform: translateX(50%);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.comimi-autoplay-icon {
|
|
499
|
+
position: absolute;
|
|
500
|
+
top: 0;
|
|
501
|
+
width: 50%;
|
|
502
|
+
height: 100%;
|
|
503
|
+
display: block;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.comimi-autoplay-icon-play {
|
|
507
|
+
right: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.comimi-autoplay-icon-pause {
|
|
511
|
+
left: 0;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.comimi-autoplay-progress {
|
|
515
|
+
position: relative;
|
|
516
|
+
width: 140px;
|
|
517
|
+
height: 6px;
|
|
518
|
+
border-radius: 999px;
|
|
519
|
+
background: #e0e0e0;
|
|
520
|
+
overflow: hidden;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.comimi-autoplay-progress-bar {
|
|
524
|
+
display: block;
|
|
525
|
+
position: absolute;
|
|
526
|
+
inset: 0;
|
|
527
|
+
border-radius: 999px;
|
|
528
|
+
background: #666;
|
|
529
|
+
animation: comimi-autoplay-progress 3s linear 0s infinite;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* --- Page Mode Toggle (single / spread) ------------------------------ */
|
|
533
|
+
|
|
534
|
+
.comimi-page-mode {
|
|
535
|
+
position: relative;
|
|
536
|
+
width: 80px;
|
|
537
|
+
height: 30px;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.comimi-page-mode-wrapper {
|
|
541
|
+
position: absolute;
|
|
542
|
+
top: 50%;
|
|
543
|
+
left: 50%;
|
|
544
|
+
width: 80px;
|
|
545
|
+
height: 30px;
|
|
546
|
+
display: grid;
|
|
547
|
+
grid-template-columns: 1fr 1fr;
|
|
548
|
+
background: #eeeeee;
|
|
549
|
+
border-radius: 8px;
|
|
550
|
+
transform: translate(-50%, -50%);
|
|
551
|
+
transition: width 0.36s var(--comimi-spring);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
@media (hover: hover) {
|
|
555
|
+
.comimi-page-mode-wrapper:hover {
|
|
556
|
+
width: 95px;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.comimi-page-mode-button {
|
|
561
|
+
position: relative;
|
|
562
|
+
display: grid;
|
|
563
|
+
place-content: center;
|
|
564
|
+
width: 100%;
|
|
565
|
+
height: 100%;
|
|
566
|
+
padding: 0;
|
|
567
|
+
border: 0;
|
|
568
|
+
background: transparent;
|
|
569
|
+
color: #666;
|
|
570
|
+
cursor: pointer;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.comimi-page-mode-icon {
|
|
574
|
+
display: block;
|
|
575
|
+
width: 20px;
|
|
576
|
+
opacity: 0.3;
|
|
577
|
+
transform-origin: center bottom;
|
|
578
|
+
transition: opacity 0.2s ease-in-out;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.comimi-page-mode-button[data-selected="true"] .comimi-page-mode-icon {
|
|
582
|
+
opacity: 1;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.comimi-page-mode-icon.comimi-pop-animate {
|
|
586
|
+
animation: comimi-pop 0.5s ease-in-out 0s both;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/* --- Settings (button + popover panel) ------------------------------- */
|
|
590
|
+
|
|
591
|
+
.comimi-settings {
|
|
592
|
+
position: relative;
|
|
593
|
+
width: 24px;
|
|
594
|
+
height: 24px;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.comimi-settings-button {
|
|
598
|
+
position: absolute;
|
|
599
|
+
inset: 0;
|
|
600
|
+
padding: 0;
|
|
601
|
+
border: 0;
|
|
602
|
+
background: transparent;
|
|
603
|
+
cursor: pointer;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.comimi-settings-icon {
|
|
607
|
+
display: block;
|
|
608
|
+
width: 100%;
|
|
609
|
+
height: 100%;
|
|
610
|
+
color: #666;
|
|
611
|
+
transition: transform 0.36s var(--comimi-spring);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.comimi-settings[data-open="true"] .comimi-settings-icon {
|
|
615
|
+
transform: rotate(30deg);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
@keyframes comimi-pop {
|
|
619
|
+
from, to {
|
|
620
|
+
transform: scale(1, 1);
|
|
621
|
+
}
|
|
622
|
+
50% {
|
|
623
|
+
transform: scale(0.95, 1.15);
|
|
624
|
+
}
|
|
625
|
+
75% {
|
|
626
|
+
transform: scale(1.15, 0.95);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
@keyframes comimi-autoplay-progress {
|
|
631
|
+
from {
|
|
632
|
+
transform: translateX(-100%);
|
|
633
|
+
}
|
|
634
|
+
to {
|
|
635
|
+
transform: translateX(0);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
@media (max-width: 767px) {
|
|
640
|
+
.comimi-controls-dock {
|
|
641
|
+
bottom: 0;
|
|
642
|
+
left: 0;
|
|
643
|
+
width: 100%;
|
|
644
|
+
padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.comimi-controls-bg {
|
|
648
|
+
border-radius: 20px 20px 0 0;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
`,ce=`
|
|
652
|
+
.comimi-error-icon {
|
|
653
|
+
position: absolute;
|
|
654
|
+
top: 50%;
|
|
655
|
+
left: 50%;
|
|
656
|
+
transform: translate(-50%, -50%);
|
|
657
|
+
display: grid;
|
|
658
|
+
gap: 10px;
|
|
659
|
+
justify-items: center;
|
|
660
|
+
width: 80px;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.comimi-error-icon-svg {
|
|
664
|
+
width: 80px;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.comimi-error-svg {
|
|
668
|
+
display: block;
|
|
669
|
+
width: 100%;
|
|
670
|
+
transform-origin: center bottom;
|
|
671
|
+
animation: comimi-error-fall 0.8s ease-in-out 0s both;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.comimi-error-stroke {
|
|
675
|
+
fill: none;
|
|
676
|
+
stroke: #ccc;
|
|
677
|
+
stroke-linecap: round;
|
|
678
|
+
stroke-linejoin: round;
|
|
679
|
+
stroke-width: 10px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.comimi-error-mimi {
|
|
683
|
+
transform-origin: 56px 43px;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.comimi-error-mimi-left {
|
|
687
|
+
animation:
|
|
688
|
+
comimi-error-mimi-left-intro 0.8s ease-in-out 0s both,
|
|
689
|
+
comimi-error-mimi-left-loop 1.5s ease-in-out 0.8s infinite forwards;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.comimi-error-mimi-right {
|
|
693
|
+
animation:
|
|
694
|
+
comimi-error-mimi-right-intro 0.8s ease-in-out 0s both,
|
|
695
|
+
comimi-error-mimi-right-loop 1.5s ease-in-out 0.8s infinite forwards;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.comimi-error-eye {
|
|
699
|
+
fill: #ccc;
|
|
700
|
+
transform-origin: center;
|
|
701
|
+
transform-box: fill-box;
|
|
702
|
+
animation: comimi-error-eye 1.5s ease-in-out 0.8s infinite forwards;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.comimi-error-icon-text {
|
|
706
|
+
color: #aaa;
|
|
707
|
+
font-size: 12px;
|
|
708
|
+
font-weight: 700;
|
|
709
|
+
line-height: 1.45;
|
|
710
|
+
text-align: center;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
@keyframes comimi-error-fall {
|
|
714
|
+
from {
|
|
715
|
+
opacity: 0;
|
|
716
|
+
transform: translateY(-40%) rotate(10deg);
|
|
717
|
+
}
|
|
718
|
+
20% {
|
|
719
|
+
opacity: 1;
|
|
720
|
+
}
|
|
721
|
+
40% {
|
|
722
|
+
transform: translateY(0) rotate(0);
|
|
723
|
+
}
|
|
724
|
+
60% {
|
|
725
|
+
transform: translateY(0) scale(1.1, 0.95);
|
|
726
|
+
}
|
|
727
|
+
80% {
|
|
728
|
+
transform: translateY(0) scale(0.95, 1.1);
|
|
729
|
+
}
|
|
730
|
+
to {
|
|
731
|
+
opacity: 1;
|
|
732
|
+
transform: translateY(0);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
@keyframes comimi-error-mimi-left-intro {
|
|
737
|
+
from {
|
|
738
|
+
transform: rotate(0deg);
|
|
739
|
+
}
|
|
740
|
+
60% {
|
|
741
|
+
transform: rotate(20deg);
|
|
742
|
+
}
|
|
743
|
+
to {
|
|
744
|
+
transform: rotate(10deg);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
@keyframes comimi-error-mimi-left-loop {
|
|
749
|
+
from, to {
|
|
750
|
+
transform: rotate(10deg);
|
|
751
|
+
}
|
|
752
|
+
50% {
|
|
753
|
+
transform: rotate(30deg);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
@keyframes comimi-error-mimi-right-intro {
|
|
758
|
+
from {
|
|
759
|
+
transform: rotate(0deg);
|
|
760
|
+
}
|
|
761
|
+
60% {
|
|
762
|
+
transform: rotate(-20deg);
|
|
763
|
+
}
|
|
764
|
+
to {
|
|
765
|
+
transform: rotate(-10deg);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
@keyframes comimi-error-mimi-right-loop {
|
|
770
|
+
from, to {
|
|
771
|
+
transform: rotate(-10deg);
|
|
772
|
+
}
|
|
773
|
+
50% {
|
|
774
|
+
transform: rotate(-30deg);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
@keyframes comimi-error-eye {
|
|
779
|
+
from, to {
|
|
780
|
+
transform: translateY(0);
|
|
781
|
+
}
|
|
782
|
+
50% {
|
|
783
|
+
transform: translateY(4px);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
`,le=`
|
|
787
|
+
.comimi-icon {
|
|
788
|
+
display: block;
|
|
789
|
+
width: 100%;
|
|
790
|
+
height: 100%;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.comimi-icon-fill {
|
|
794
|
+
fill: currentColor;
|
|
795
|
+
transition: fill .2s linear;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.comimi-icon-stroke {
|
|
799
|
+
fill: none;
|
|
800
|
+
stroke: currentColor;
|
|
801
|
+
stroke-width: 1.6;
|
|
802
|
+
transition: stroke .2s linear;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.comimi-menu-svg,
|
|
806
|
+
.comimi-close-svg {
|
|
807
|
+
display: block;
|
|
808
|
+
position: relative;
|
|
809
|
+
width: 34px;
|
|
810
|
+
height: 34px;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.comimi-menu-svg span,
|
|
814
|
+
.comimi-close-svg span {
|
|
815
|
+
position: absolute;
|
|
816
|
+
left: 50%;
|
|
817
|
+
width: 17px;
|
|
818
|
+
height: 3px;
|
|
819
|
+
border-radius: 999px;
|
|
820
|
+
background: #666;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.comimi-menu-svg span:nth-child(1) {
|
|
824
|
+
top: 9px;
|
|
825
|
+
transform: translateX(-50%);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.comimi-menu-svg span:nth-child(2) {
|
|
829
|
+
top: 50%;
|
|
830
|
+
transform: translate(-50%, -50%);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.comimi-menu-svg span:nth-child(3) {
|
|
834
|
+
bottom: 9px;
|
|
835
|
+
transform: translateX(-50%);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.comimi-close-svg span {
|
|
839
|
+
top: 50%;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.comimi-close-svg span:nth-child(1) {
|
|
843
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.comimi-close-svg span:nth-child(2) {
|
|
847
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
848
|
+
}
|
|
849
|
+
`,ue=`
|
|
850
|
+
.comimi-selectbox {
|
|
851
|
+
position: relative;
|
|
852
|
+
display: inline-block;
|
|
853
|
+
width: 100%;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.comimi-selectbox-bg {
|
|
857
|
+
position: absolute;
|
|
858
|
+
inset: 0;
|
|
859
|
+
border-radius: 8px;
|
|
860
|
+
background: #eeeeee;
|
|
861
|
+
transition: inset 0.36s var(--comimi-spring);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
@media (hover: hover) {
|
|
865
|
+
.comimi-selectbox:hover .comimi-selectbox-bg {
|
|
866
|
+
inset: -3px;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
.comimi-selectbox-select {
|
|
871
|
+
position: absolute;
|
|
872
|
+
inset: 0;
|
|
873
|
+
z-index: 2;
|
|
874
|
+
width: 100%;
|
|
875
|
+
height: 100%;
|
|
876
|
+
box-sizing: border-box;
|
|
877
|
+
margin: 0;
|
|
878
|
+
padding: 0;
|
|
879
|
+
border: 0;
|
|
880
|
+
background: transparent;
|
|
881
|
+
appearance: none;
|
|
882
|
+
-webkit-appearance: none;
|
|
883
|
+
color: transparent;
|
|
884
|
+
font: inherit;
|
|
885
|
+
cursor: pointer;
|
|
886
|
+
opacity: 0;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.comimi-selectbox-select:disabled {
|
|
890
|
+
cursor: not-allowed;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.comimi-selectbox-label {
|
|
894
|
+
position: relative;
|
|
895
|
+
display: block;
|
|
896
|
+
box-sizing: border-box;
|
|
897
|
+
width: 100%;
|
|
898
|
+
padding: 8px 32px 8px 12px;
|
|
899
|
+
color: #333;
|
|
900
|
+
font-size: 12px;
|
|
901
|
+
font-weight: 400;
|
|
902
|
+
line-height: 1.45;
|
|
903
|
+
cursor: pointer;
|
|
904
|
+
pointer-events: none;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.comimi-selectbox-arrow {
|
|
908
|
+
position: absolute;
|
|
909
|
+
top: 50%;
|
|
910
|
+
right: 12px;
|
|
911
|
+
z-index: 1;
|
|
912
|
+
width: 16px;
|
|
913
|
+
height: 16px;
|
|
914
|
+
color: #aaa;
|
|
915
|
+
transform: translateY(-50%) rotate(90deg);
|
|
916
|
+
pointer-events: none;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
@media (hover: hover) {
|
|
920
|
+
.comimi-selectbox:hover .comimi-selectbox-arrow {
|
|
921
|
+
animation: comimi-selectbox-arrow 0.5s ease-in-out 0s both;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
@keyframes comimi-selectbox-arrow {
|
|
926
|
+
from, to {
|
|
927
|
+
transform: translateY(-50%) rotate(90deg);
|
|
928
|
+
}
|
|
929
|
+
40% {
|
|
930
|
+
transform: translateY(calc(-50% + 3px)) rotate(90deg);
|
|
931
|
+
}
|
|
932
|
+
70% {
|
|
933
|
+
transform: translateY(calc(-50% - 1.5px)) rotate(90deg);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.comimi-toggle-switch {
|
|
938
|
+
display: grid;
|
|
939
|
+
grid-template-columns: repeat(2, auto);
|
|
940
|
+
column-gap: 6px;
|
|
941
|
+
justify-content: start;
|
|
942
|
+
align-items: center;
|
|
943
|
+
width: 100%;
|
|
944
|
+
padding: 2px;
|
|
945
|
+
border: 0;
|
|
946
|
+
background: transparent;
|
|
947
|
+
cursor: pointer;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.comimi-toggle-track {
|
|
951
|
+
position: relative;
|
|
952
|
+
width: 32px;
|
|
953
|
+
height: 18px;
|
|
954
|
+
border-radius: 999px;
|
|
955
|
+
background: #eeeeee;
|
|
956
|
+
transition: background-color 0.2s linear;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
.comimi-toggle-switch[data-checked="true"] .comimi-toggle-track {
|
|
960
|
+
background: #666;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.comimi-toggle-knob {
|
|
964
|
+
position: absolute;
|
|
965
|
+
top: 2px;
|
|
966
|
+
left: 2px;
|
|
967
|
+
width: 14px;
|
|
968
|
+
height: 14px;
|
|
969
|
+
border-radius: 50%;
|
|
970
|
+
background: #666;
|
|
971
|
+
transition:
|
|
972
|
+
transform 0.36s var(--comimi-spring),
|
|
973
|
+
background-color 0.2s linear;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.comimi-toggle-switch[data-checked="true"] .comimi-toggle-knob {
|
|
977
|
+
background: #fff;
|
|
978
|
+
transform: translateX(100%);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.comimi-toggle-label-wrap {
|
|
982
|
+
position: relative;
|
|
983
|
+
width: 22px;
|
|
984
|
+
height: 12px;
|
|
985
|
+
overflow: hidden;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.comimi-toggle-label-inner {
|
|
989
|
+
position: absolute;
|
|
990
|
+
inset: 0;
|
|
991
|
+
transition: transform 0.36s var(--comimi-spring);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.comimi-toggle-switch[data-checked="false"] .comimi-toggle-label-inner {
|
|
995
|
+
transform: translateX(-100%);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.comimi-toggle-label {
|
|
999
|
+
position: absolute;
|
|
1000
|
+
top: 0;
|
|
1001
|
+
left: 0;
|
|
1002
|
+
width: 100%;
|
|
1003
|
+
font-size: 11px;
|
|
1004
|
+
font-weight: 400;
|
|
1005
|
+
line-height: 12px;
|
|
1006
|
+
text-align: center;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.comimi-toggle-label-on {
|
|
1010
|
+
color: #333;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.comimi-toggle-label-off {
|
|
1014
|
+
color: #aaa;
|
|
1015
|
+
transform: translateX(100%);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.comimi-range-slider {
|
|
1019
|
+
display: grid;
|
|
1020
|
+
grid-template-columns: 1fr auto;
|
|
1021
|
+
column-gap: 8px;
|
|
1022
|
+
align-items: center;
|
|
1023
|
+
width: 100%;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.comimi-range-slider[data-disabled="true"] {
|
|
1027
|
+
opacity: 0.6;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
.comimi-range-slider-wrap {
|
|
1031
|
+
position: relative;
|
|
1032
|
+
display: grid;
|
|
1033
|
+
align-items: center;
|
|
1034
|
+
min-width: 0;
|
|
1035
|
+
height: 18px;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
.comimi-range-slider-track {
|
|
1039
|
+
position: absolute;
|
|
1040
|
+
top: 50%;
|
|
1041
|
+
left: 0;
|
|
1042
|
+
right: 0;
|
|
1043
|
+
height: 6px;
|
|
1044
|
+
border-radius: 999px;
|
|
1045
|
+
background: #eeeeee;
|
|
1046
|
+
overflow: hidden;
|
|
1047
|
+
transform: translateY(-50%);
|
|
1048
|
+
transition: height 0.36s var(--comimi-spring);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
@media (hover: hover) {
|
|
1052
|
+
.comimi-range-slider-wrap:hover .comimi-range-slider-track {
|
|
1053
|
+
height: 10px;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
.comimi-range-slider-fill {
|
|
1058
|
+
display: block;
|
|
1059
|
+
height: 100%;
|
|
1060
|
+
background: #666;
|
|
1061
|
+
border-radius: inherit;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
.comimi-range-slider-input {
|
|
1065
|
+
position: relative;
|
|
1066
|
+
z-index: 1;
|
|
1067
|
+
width: 100%;
|
|
1068
|
+
height: 18px;
|
|
1069
|
+
margin: 0;
|
|
1070
|
+
padding: 0;
|
|
1071
|
+
border: 0;
|
|
1072
|
+
background: transparent;
|
|
1073
|
+
appearance: none;
|
|
1074
|
+
-webkit-appearance: none;
|
|
1075
|
+
cursor: pointer;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
.comimi-range-slider-input::-webkit-slider-runnable-track {
|
|
1079
|
+
height: 6px;
|
|
1080
|
+
background: transparent;
|
|
1081
|
+
border: 0;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
.comimi-range-slider-input::-webkit-slider-thumb {
|
|
1085
|
+
appearance: none;
|
|
1086
|
+
-webkit-appearance: none;
|
|
1087
|
+
width: 18px;
|
|
1088
|
+
height: 18px;
|
|
1089
|
+
margin-top: -6px;
|
|
1090
|
+
border: 0;
|
|
1091
|
+
border-radius: 50%;
|
|
1092
|
+
background: #666;
|
|
1093
|
+
box-shadow: none;
|
|
1094
|
+
transition:
|
|
1095
|
+
transform 0.36s var(--comimi-spring),
|
|
1096
|
+
background-color 0.2s ease-in-out;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.comimi-range-slider-input:hover:not(:disabled)::-webkit-slider-thumb {
|
|
1100
|
+
transform: scale(1.15);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.comimi-range-slider-input::-moz-range-track {
|
|
1104
|
+
height: 6px;
|
|
1105
|
+
background: transparent;
|
|
1106
|
+
border: 0;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
.comimi-range-slider-input::-moz-range-thumb {
|
|
1110
|
+
width: 18px;
|
|
1111
|
+
height: 18px;
|
|
1112
|
+
border: 0;
|
|
1113
|
+
border-radius: 50%;
|
|
1114
|
+
background: #666;
|
|
1115
|
+
box-shadow: none;
|
|
1116
|
+
transition:
|
|
1117
|
+
transform 0.36s var(--comimi-spring),
|
|
1118
|
+
background-color 0.2s ease-in-out;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
.comimi-range-slider-input:hover:not(:disabled)::-moz-range-thumb {
|
|
1122
|
+
transform: scale(1.15);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
.comimi-range-slider-input:focus-visible {
|
|
1126
|
+
outline: none;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
.comimi-range-slider-input:focus-visible::-webkit-slider-thumb {
|
|
1130
|
+
box-shadow: none;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.comimi-range-slider-input:focus-visible::-moz-range-thumb {
|
|
1134
|
+
box-shadow: none;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
.comimi-range-slider-value {
|
|
1138
|
+
width: 36px;
|
|
1139
|
+
color: #666;
|
|
1140
|
+
font-size: 11px;
|
|
1141
|
+
font-weight: 400;
|
|
1142
|
+
line-height: 1;
|
|
1143
|
+
text-align: right;
|
|
1144
|
+
white-space: nowrap;
|
|
1145
|
+
}
|
|
1146
|
+
`,de=`
|
|
1147
|
+
.comimi-loading-icon {
|
|
1148
|
+
position: absolute;
|
|
1149
|
+
top: 50%;
|
|
1150
|
+
left: 50%;
|
|
1151
|
+
transform: translate(-50%, -50%);
|
|
1152
|
+
display: grid;
|
|
1153
|
+
gap: 10px;
|
|
1154
|
+
justify-items: center;
|
|
1155
|
+
width: 80px;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.comimi-loading-icon-svg {
|
|
1159
|
+
width: 80px;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
.comimi-loading-svg {
|
|
1163
|
+
display: block;
|
|
1164
|
+
width: 100%;
|
|
1165
|
+
transform-origin: center bottom;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
.comimi-loading-stroke {
|
|
1169
|
+
fill: none;
|
|
1170
|
+
stroke: #ccc;
|
|
1171
|
+
stroke-linecap: round;
|
|
1172
|
+
stroke-linejoin: round;
|
|
1173
|
+
stroke-width: 10px;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
.comimi-loading-mimi {
|
|
1177
|
+
transform-origin: 56px 43px;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
.comimi-loading-mimi-left {
|
|
1181
|
+
animation:
|
|
1182
|
+
comimi-loading-mimi-left 0.4s ease-in-out 0.1s 2 forwards,
|
|
1183
|
+
comimi-loading-mimi-left 0.4s ease-in-out 1.7s 2 forwards;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
.comimi-loading-mimi-right {
|
|
1187
|
+
animation:
|
|
1188
|
+
comimi-loading-mimi-right 0.4s ease-in-out 0.1s 2 forwards,
|
|
1189
|
+
comimi-loading-mimi-right 0.4s ease-in-out 1.7s 2 forwards;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
.comimi-loading-eyes {
|
|
1193
|
+
transform: translateX(-7px);
|
|
1194
|
+
animation:
|
|
1195
|
+
comimi-loading-eyes-move 0.4s ease-in-out 1.2s both,
|
|
1196
|
+
comimi-loading-eyes-move 0.4s ease-in-out 2.6s reverse forwards;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
.comimi-loading-eye {
|
|
1200
|
+
fill: #ccc;
|
|
1201
|
+
transform-origin: center;
|
|
1202
|
+
transform-box: fill-box;
|
|
1203
|
+
animation:
|
|
1204
|
+
comimi-loading-eye 0.4s ease-in-out 0s forwards,
|
|
1205
|
+
comimi-loading-eye 0.4s ease-in-out 1.6s forwards;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.comimi-loading-icon-text {
|
|
1209
|
+
color: #aaa;
|
|
1210
|
+
font-size: 12px;
|
|
1211
|
+
font-weight: 700;
|
|
1212
|
+
line-height: 1.45;
|
|
1213
|
+
text-align: center;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
.comimi-loading-icon-text span {
|
|
1217
|
+
display: inline-block;
|
|
1218
|
+
animation: comimi-loading-dot 0.8s ease-in-out 0s infinite both;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.comimi-loading-icon-text span:nth-child(1) {
|
|
1222
|
+
animation-delay: 0s;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.comimi-loading-icon-text span:nth-child(2) {
|
|
1226
|
+
animation-delay: 0.15s;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.comimi-loading-icon-text span:nth-child(3) {
|
|
1230
|
+
animation-delay: 0.3s;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
@keyframes comimi-loading-mimi-left {
|
|
1234
|
+
from, to {
|
|
1235
|
+
transform: rotate(0deg);
|
|
1236
|
+
}
|
|
1237
|
+
50% {
|
|
1238
|
+
transform: rotate(20deg);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
@keyframes comimi-loading-mimi-right {
|
|
1243
|
+
from, to {
|
|
1244
|
+
transform: rotate(0deg);
|
|
1245
|
+
}
|
|
1246
|
+
50% {
|
|
1247
|
+
transform: rotate(-20deg);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
@keyframes comimi-loading-eyes-move {
|
|
1252
|
+
from {
|
|
1253
|
+
transform: translateX(-7px);
|
|
1254
|
+
}
|
|
1255
|
+
to {
|
|
1256
|
+
transform: translateX(7px);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
@keyframes comimi-loading-eye {
|
|
1261
|
+
from, to {
|
|
1262
|
+
transform: scaleY(1);
|
|
1263
|
+
}
|
|
1264
|
+
50% {
|
|
1265
|
+
transform: scaleY(0.2);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
@keyframes comimi-loading-dot {
|
|
1270
|
+
from, 50%, to {
|
|
1271
|
+
opacity: 1;
|
|
1272
|
+
}
|
|
1273
|
+
25% {
|
|
1274
|
+
opacity: 0;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
`,fe=`
|
|
1278
|
+
.comimi-menu-panel {
|
|
1279
|
+
position: absolute;
|
|
1280
|
+
top: 24px;
|
|
1281
|
+
left: 24px;
|
|
1282
|
+
width: 420px;
|
|
1283
|
+
z-index: 45;
|
|
1284
|
+
pointer-events: auto;
|
|
1285
|
+
transition:
|
|
1286
|
+
transform 0.6s var(--comimi-spring),
|
|
1287
|
+
opacity 0.3s linear;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
.comimi-menu-panel[data-overlay="false"] {
|
|
1291
|
+
transform: translateY(-35px);
|
|
1292
|
+
opacity: 0;
|
|
1293
|
+
pointer-events: none;
|
|
1294
|
+
transition:
|
|
1295
|
+
transform 0.3s var(--comimi-spring),
|
|
1296
|
+
opacity 0.15s linear;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
.comimi-menu-bg {
|
|
1300
|
+
position: absolute;
|
|
1301
|
+
inset: 0;
|
|
1302
|
+
border-radius: 16px;
|
|
1303
|
+
background: var(--comimi-glass);
|
|
1304
|
+
box-shadow: var(--comimi-shadow);
|
|
1305
|
+
backdrop-filter: blur(5px);
|
|
1306
|
+
transition: inset 0.36s var(--comimi-spring);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
@media (hover: hover) {
|
|
1310
|
+
.comimi-menu-panel:hover > .comimi-menu-bg {
|
|
1311
|
+
inset: -5px;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.comimi-menu-top {
|
|
1316
|
+
position: relative;
|
|
1317
|
+
display: grid;
|
|
1318
|
+
grid-template-columns: auto 1fr;
|
|
1319
|
+
column-gap: 13px;
|
|
1320
|
+
align-items: center;
|
|
1321
|
+
box-sizing: border-box;
|
|
1322
|
+
width: 100%;
|
|
1323
|
+
height: 62px;
|
|
1324
|
+
padding: 0 13px;
|
|
1325
|
+
border: 0;
|
|
1326
|
+
background: transparent;
|
|
1327
|
+
color: inherit;
|
|
1328
|
+
text-align: left;
|
|
1329
|
+
cursor: pointer;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
.comimi-menu-button {
|
|
1333
|
+
position: relative;
|
|
1334
|
+
width: 34px;
|
|
1335
|
+
height: 34px;
|
|
1336
|
+
overflow: hidden;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
.comimi-menu-button-inner {
|
|
1340
|
+
display: block;
|
|
1341
|
+
position: absolute;
|
|
1342
|
+
inset: 0;
|
|
1343
|
+
transition: transform 0.4s var(--comimi-spring);
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
.comimi-menu-panel[data-open="true"] .comimi-menu-button-inner {
|
|
1347
|
+
transform: translateY(100%);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.comimi-menu-button-inner > * {
|
|
1351
|
+
position: absolute;
|
|
1352
|
+
inset: 0;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
.comimi-menu-button-inner > *:nth-child(2) {
|
|
1356
|
+
transform: translateY(-100%);
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
.comimi-menu-title-wrap {
|
|
1360
|
+
min-width: 0;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
.comimi-menu-title {
|
|
1364
|
+
display: block;
|
|
1365
|
+
width: 100%;
|
|
1366
|
+
color: #333;
|
|
1367
|
+
font-size: 15px;
|
|
1368
|
+
font-weight: 700;
|
|
1369
|
+
overflow: hidden;
|
|
1370
|
+
text-overflow: ellipsis;
|
|
1371
|
+
white-space: nowrap;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
.comimi-menu-author {
|
|
1375
|
+
display: block;
|
|
1376
|
+
width: 100%;
|
|
1377
|
+
color: #666;
|
|
1378
|
+
font-size: 12px;
|
|
1379
|
+
font-weight: 400;
|
|
1380
|
+
overflow: hidden;
|
|
1381
|
+
text-overflow: ellipsis;
|
|
1382
|
+
white-space: nowrap;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.comimi-menu-bottom {
|
|
1386
|
+
position: relative;
|
|
1387
|
+
width: 100%;
|
|
1388
|
+
overflow: hidden;
|
|
1389
|
+
transition: height 0.24s ease-in-out;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
.comimi-menu-border {
|
|
1393
|
+
width: 100%;
|
|
1394
|
+
height: 1px;
|
|
1395
|
+
background: #e0e0e0;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
.comimi-menu-view {
|
|
1399
|
+
position: absolute;
|
|
1400
|
+
top: 1px;
|
|
1401
|
+
left: 0;
|
|
1402
|
+
width: 100%;
|
|
1403
|
+
transition: all 0.28s ease-in-out;
|
|
1404
|
+
opacity: 0;
|
|
1405
|
+
visibility: hidden;
|
|
1406
|
+
transform: scale(0.92);
|
|
1407
|
+
filter: blur(5px);
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
.comimi-menu-view-menu {
|
|
1411
|
+
position: relative;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.comimi-menu-panel[data-view="menu"] .comimi-menu-view-menu,
|
|
1415
|
+
.comimi-menu-panel[data-view="shortcut"] .comimi-menu-view-shortcut,
|
|
1416
|
+
.comimi-menu-panel[data-view="pageList"] .comimi-menu-view-page-list {
|
|
1417
|
+
opacity: 1;
|
|
1418
|
+
visibility: visible;
|
|
1419
|
+
transform: scale(1);
|
|
1420
|
+
filter: blur(0);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
.comimi-menu-list {
|
|
1424
|
+
position: relative;
|
|
1425
|
+
width: 100%;
|
|
1426
|
+
padding: 10px 0;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
.comimi-menu-link {
|
|
1430
|
+
box-sizing: border-box;
|
|
1431
|
+
display: grid;
|
|
1432
|
+
grid-template-columns: 1fr auto;
|
|
1433
|
+
column-gap: 8px;
|
|
1434
|
+
align-items: center;
|
|
1435
|
+
width: 100%;
|
|
1436
|
+
padding: 10px 16px 10px 22px;
|
|
1437
|
+
border: 0;
|
|
1438
|
+
border-radius: 10px;
|
|
1439
|
+
background: transparent;
|
|
1440
|
+
color: #666;
|
|
1441
|
+
cursor: pointer;
|
|
1442
|
+
transition: background-color 0.24s linear;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.comimi-menu-link:hover {
|
|
1446
|
+
background: #f1f1f1;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
.comimi-menu-link-text {
|
|
1450
|
+
color: #666;
|
|
1451
|
+
font-size: 14px;
|
|
1452
|
+
font-weight: 700;
|
|
1453
|
+
line-height: 1.45;
|
|
1454
|
+
text-align: left;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
.comimi-menu-link-arrow {
|
|
1458
|
+
display: block;
|
|
1459
|
+
width: 20px;
|
|
1460
|
+
height: 20px;
|
|
1461
|
+
color: #aaa;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
.comimi-menu-link-arrow > svg {
|
|
1465
|
+
display: block;
|
|
1466
|
+
width: 100%;
|
|
1467
|
+
height: 100%;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.comimi-page-list-inner {
|
|
1471
|
+
display: grid;
|
|
1472
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1473
|
+
gap: 20px;
|
|
1474
|
+
box-sizing: border-box;
|
|
1475
|
+
padding: 22px;
|
|
1476
|
+
max-height: 315px;
|
|
1477
|
+
overflow-y: auto;
|
|
1478
|
+
-webkit-overflow-scrolling: touch;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.comimi-page-list-item {
|
|
1482
|
+
display: grid;
|
|
1483
|
+
row-gap: 4px;
|
|
1484
|
+
padding: 0;
|
|
1485
|
+
border: 0;
|
|
1486
|
+
background: transparent;
|
|
1487
|
+
color: #666;
|
|
1488
|
+
cursor: pointer;
|
|
1489
|
+
text-align: center;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.comimi-page-list-thumb {
|
|
1493
|
+
position: relative;
|
|
1494
|
+
display: block;
|
|
1495
|
+
width: 100%;
|
|
1496
|
+
aspect-ratio: 100 / 141;
|
|
1497
|
+
background: #fff;
|
|
1498
|
+
border-radius: 6px;
|
|
1499
|
+
outline: 3px solid #e0e0e0;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
.comimi-page-list-thumb img {
|
|
1503
|
+
display: block;
|
|
1504
|
+
width: 100%;
|
|
1505
|
+
height: 100%;
|
|
1506
|
+
object-fit: contain;
|
|
1507
|
+
border-radius: 4px;
|
|
1508
|
+
user-select: none;
|
|
1509
|
+
-webkit-user-drag: none;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.comimi-page-list-text {
|
|
1513
|
+
color: #666;
|
|
1514
|
+
font-size: 14px;
|
|
1515
|
+
font-weight: 700;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
.comimi-shortcut-inner {
|
|
1519
|
+
display: grid;
|
|
1520
|
+
row-gap: 22px;
|
|
1521
|
+
box-sizing: border-box;
|
|
1522
|
+
padding: 22px;
|
|
1523
|
+
max-height: 315px;
|
|
1524
|
+
overflow-y: auto;
|
|
1525
|
+
-webkit-overflow-scrolling: touch;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
.comimi-shortcut-section {
|
|
1529
|
+
display: grid;
|
|
1530
|
+
row-gap: 8px;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
.comimi-shortcut-heading {
|
|
1534
|
+
color: #666;
|
|
1535
|
+
font-size: 12px;
|
|
1536
|
+
font-weight: 700;
|
|
1537
|
+
line-height: 1.45;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
.comimi-shortcut-list {
|
|
1541
|
+
display: grid;
|
|
1542
|
+
row-gap: 8px;
|
|
1543
|
+
justify-items: start;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.comimi-shortcut-column {
|
|
1547
|
+
display: flex;
|
|
1548
|
+
flex-wrap: wrap;
|
|
1549
|
+
gap: 8px 16px;
|
|
1550
|
+
align-items: center;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
.comimi-shortcut-item {
|
|
1554
|
+
display: grid;
|
|
1555
|
+
grid-template-columns: repeat(2, auto);
|
|
1556
|
+
column-gap: 8px;
|
|
1557
|
+
align-items: center;
|
|
1558
|
+
width: fit-content;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
.comimi-shortcut-badge {
|
|
1562
|
+
display: grid;
|
|
1563
|
+
grid-auto-flow: column;
|
|
1564
|
+
column-gap: 6px;
|
|
1565
|
+
align-items: center;
|
|
1566
|
+
padding: 4px 8px;
|
|
1567
|
+
border-radius: 7px;
|
|
1568
|
+
background: #eeeeee;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
.comimi-shortcut-key {
|
|
1572
|
+
color: #666;
|
|
1573
|
+
font-size: 13px;
|
|
1574
|
+
font-weight: 700;
|
|
1575
|
+
line-height: 1.45;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.comimi-shortcut-or::before {
|
|
1579
|
+
content: "or";
|
|
1580
|
+
display: block;
|
|
1581
|
+
color: #666;
|
|
1582
|
+
font-size: 11px;
|
|
1583
|
+
font-weight: 400;
|
|
1584
|
+
line-height: 1.45;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
.comimi-shortcut-label {
|
|
1588
|
+
color: #666;
|
|
1589
|
+
font-size: 13px;
|
|
1590
|
+
font-weight: 400;
|
|
1591
|
+
line-height: 1.45;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
.comimi-back-button {
|
|
1595
|
+
position: relative;
|
|
1596
|
+
width: 100%;
|
|
1597
|
+
height: 56px;
|
|
1598
|
+
padding: 0;
|
|
1599
|
+
border: 0;
|
|
1600
|
+
background: transparent;
|
|
1601
|
+
cursor: pointer;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
.comimi-back-inner {
|
|
1605
|
+
position: absolute;
|
|
1606
|
+
inset: 8px;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
.comimi-back-bg {
|
|
1610
|
+
position: absolute;
|
|
1611
|
+
inset: 0;
|
|
1612
|
+
border-radius: 8px;
|
|
1613
|
+
background: #eeeeee;
|
|
1614
|
+
transition: inset 0.36s var(--comimi-spring), border-radius 0.36s var(--comimi-spring);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
.comimi-back-button:hover .comimi-back-bg {
|
|
1618
|
+
inset: -4px;
|
|
1619
|
+
border-radius: 10px;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.comimi-back-text {
|
|
1623
|
+
position: absolute;
|
|
1624
|
+
top: 50%;
|
|
1625
|
+
left: 50%;
|
|
1626
|
+
transform: translate(-50%, -50%);
|
|
1627
|
+
color: #666;
|
|
1628
|
+
font-size: 14px;
|
|
1629
|
+
font-weight: 700;
|
|
1630
|
+
line-height: 1.45;
|
|
1631
|
+
pointer-events: none;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.comimi-back-arrow {
|
|
1635
|
+
position: absolute;
|
|
1636
|
+
top: 50%;
|
|
1637
|
+
left: 8px;
|
|
1638
|
+
width: 22px;
|
|
1639
|
+
height: 22px;
|
|
1640
|
+
color: #aaa;
|
|
1641
|
+
transform: translateY(-50%) scaleX(-1);
|
|
1642
|
+
pointer-events: none;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
.comimi-back-arrow > svg {
|
|
1646
|
+
display: block;
|
|
1647
|
+
width: 100%;
|
|
1648
|
+
height: 100%;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
@media (max-width: 767px) {
|
|
1652
|
+
.comimi-menu-panel {
|
|
1653
|
+
top: 0;
|
|
1654
|
+
left: 0;
|
|
1655
|
+
width: 100%;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
.comimi-menu-bg {
|
|
1659
|
+
border-radius: 0 0 16px 16px;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
.comimi-menu-top {
|
|
1663
|
+
width: 100%;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
.comimi-page-list-inner,
|
|
1667
|
+
.comimi-shortcut-inner {
|
|
1668
|
+
max-height: calc(var(--view-height, 100vh) - 62px - 56px);
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
`,pe=`
|
|
1672
|
+
.comimi-notifications {
|
|
1673
|
+
position: absolute;
|
|
1674
|
+
bottom: 140px;
|
|
1675
|
+
left: 50%;
|
|
1676
|
+
transform: translateX(-50%);
|
|
1677
|
+
display: grid;
|
|
1678
|
+
row-gap: 8px;
|
|
1679
|
+
justify-items: center;
|
|
1680
|
+
pointer-events: none;
|
|
1681
|
+
z-index: 35;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
.comimi-toast {
|
|
1685
|
+
display: grid;
|
|
1686
|
+
grid-template-columns: auto auto;
|
|
1687
|
+
gap: 5px;
|
|
1688
|
+
align-items: center;
|
|
1689
|
+
justify-content: center;
|
|
1690
|
+
width: fit-content;
|
|
1691
|
+
padding: 6px 13px 6px 8px;
|
|
1692
|
+
border-radius: 999px;
|
|
1693
|
+
background-color: #666;
|
|
1694
|
+
animation: comimi-toast-popup 0.37s ease-in-out 0s both;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
.comimi-toast-dot {
|
|
1698
|
+
display: block;
|
|
1699
|
+
width: 10px;
|
|
1700
|
+
height: 10px;
|
|
1701
|
+
border-radius: 50%;
|
|
1702
|
+
background: #888;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
.comimi-toast-text {
|
|
1706
|
+
color: #fff;
|
|
1707
|
+
font-size: 12px;
|
|
1708
|
+
font-weight: 700;
|
|
1709
|
+
line-height: 1.45;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
@keyframes comimi-toast-popup {
|
|
1713
|
+
from {
|
|
1714
|
+
transform: translateY(6px) scale(0.2, 0.8);
|
|
1715
|
+
opacity: 0;
|
|
1716
|
+
}
|
|
1717
|
+
60% {
|
|
1718
|
+
transform: translateY(-1px) scale(1.1, 1.05);
|
|
1719
|
+
opacity: 1;
|
|
1720
|
+
}
|
|
1721
|
+
to {
|
|
1722
|
+
transform: scale(1, 1);
|
|
1723
|
+
opacity: 1;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
@media (max-width: 767px) {
|
|
1728
|
+
.comimi-notifications {
|
|
1729
|
+
bottom: calc(120px + env(safe-area-inset-bottom, 0px));
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
`,me=`
|
|
1733
|
+
.comimi-stage {
|
|
1734
|
+
position: absolute;
|
|
1735
|
+
inset: 0;
|
|
1736
|
+
will-change: transform;
|
|
1737
|
+
transition: transform .18s ease;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
.comimi-stage[data-dragging="true"] {
|
|
1741
|
+
transition: none;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
.comimi-page-group {
|
|
1745
|
+
position: absolute;
|
|
1746
|
+
inset: 0;
|
|
1747
|
+
display: flex;
|
|
1748
|
+
align-items: center;
|
|
1749
|
+
justify-content: center;
|
|
1750
|
+
gap: 0;
|
|
1751
|
+
box-sizing: border-box;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
.comimi-page {
|
|
1755
|
+
position: relative;
|
|
1756
|
+
display: flex;
|
|
1757
|
+
align-items: center;
|
|
1758
|
+
justify-content: center;
|
|
1759
|
+
width: 100%;
|
|
1760
|
+
height: 100%;
|
|
1761
|
+
max-width: 100%;
|
|
1762
|
+
max-height: 100%;
|
|
1763
|
+
min-width: 0;
|
|
1764
|
+
min-height: 0;
|
|
1765
|
+
background: transparent;
|
|
1766
|
+
overflow: hidden;
|
|
1767
|
+
flex: 0 0 auto;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
.comimi-page[data-spread="true"] {
|
|
1771
|
+
width: 50%;
|
|
1772
|
+
height: 100%;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
.comimi-page[data-spread="false"] {
|
|
1776
|
+
width: 100%;
|
|
1777
|
+
height: 100%;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
.comimi-page[data-position="left"] {
|
|
1781
|
+
justify-content: flex-end;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
.comimi-page[data-position="right"] {
|
|
1785
|
+
justify-content: flex-start;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
.comimi-page img,
|
|
1789
|
+
.comimi-html-page {
|
|
1790
|
+
display: block;
|
|
1791
|
+
max-width: 100%;
|
|
1792
|
+
max-height: 100%;
|
|
1793
|
+
width: 100%;
|
|
1794
|
+
height: 100%;
|
|
1795
|
+
object-fit: contain;
|
|
1796
|
+
transform-origin: center center;
|
|
1797
|
+
user-select: none;
|
|
1798
|
+
-webkit-user-select: none;
|
|
1799
|
+
-webkit-user-drag: none;
|
|
1800
|
+
-webkit-touch-callout: none;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
.comimi-page[data-spread="true"] img,
|
|
1804
|
+
.comimi-page[data-spread="true"] .comimi-html-page {
|
|
1805
|
+
width: 100%;
|
|
1806
|
+
height: 100%;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
.comimi-page[data-position="left"] img,
|
|
1810
|
+
.comimi-page[data-position="left"] .comimi-html-page {
|
|
1811
|
+
object-position: right center;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
.comimi-page[data-position="right"] img,
|
|
1815
|
+
.comimi-page[data-position="right"] .comimi-html-page {
|
|
1816
|
+
object-position: left center;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
.comimi-html-page {
|
|
1820
|
+
width: min(100%, 960px);
|
|
1821
|
+
height: min(100%, 680px);
|
|
1822
|
+
background: #fff;
|
|
1823
|
+
color: #111;
|
|
1824
|
+
overflow: auto;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
`,he=`
|
|
1828
|
+
.comimi-rabbit {
|
|
1829
|
+
position: absolute;
|
|
1830
|
+
width: 50px;
|
|
1831
|
+
pointer-events: none;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
.comimi-rabbit-svg {
|
|
1835
|
+
display: block;
|
|
1836
|
+
width: 100%;
|
|
1837
|
+
height: auto;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
.comimi-controls-dock > .comimi-rabbit {
|
|
1841
|
+
bottom: 0;
|
|
1842
|
+
left: 50%;
|
|
1843
|
+
transform: translateX(-50%);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
.comimi-menu-panel > .comimi-rabbit {
|
|
1847
|
+
top: 20px;
|
|
1848
|
+
right: 20px;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
@media (max-width: 767px) {
|
|
1852
|
+
.comimi-controls-dock > .comimi-rabbit {
|
|
1853
|
+
display: none;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
@media (min-width: 768px) {
|
|
1858
|
+
.comimi-menu-panel > .comimi-rabbit {
|
|
1859
|
+
display: none;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
`,ge=`
|
|
1863
|
+
.comimi-settings-panel {
|
|
1864
|
+
position: absolute;
|
|
1865
|
+
top: 0;
|
|
1866
|
+
right: -16px;
|
|
1867
|
+
width: 250px;
|
|
1868
|
+
height: 0;
|
|
1869
|
+
border-radius: 20px;
|
|
1870
|
+
overflow: hidden;
|
|
1871
|
+
background: var(--comimi-glass-strong);
|
|
1872
|
+
box-shadow: var(--comimi-shadow);
|
|
1873
|
+
backdrop-filter: blur(5px);
|
|
1874
|
+
opacity: 0;
|
|
1875
|
+
transform: translateY(calc(-100% - 8px));
|
|
1876
|
+
transition:
|
|
1877
|
+
height 0.38s cubic-bezier(0.12, 1.06, 0.56, 1.02),
|
|
1878
|
+
opacity 0.38s cubic-bezier(0.12, 1.06, 0.56, 1.02);
|
|
1879
|
+
z-index: 10;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
.comimi-settings-panel[data-open="true"] {
|
|
1883
|
+
opacity: 1;
|
|
1884
|
+
height: var(--comimi-settings-height, 460px);
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
.comimi-settings-panel-body {
|
|
1888
|
+
position: relative;
|
|
1889
|
+
width: 100%;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
.comimi-settings-panel-inner {
|
|
1893
|
+
box-sizing: border-box;
|
|
1894
|
+
position: relative;
|
|
1895
|
+
padding: 16px 20px 22px;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
.comimi-settings-panel-title {
|
|
1899
|
+
color: #333;
|
|
1900
|
+
font-size: 14px;
|
|
1901
|
+
font-weight: 700;
|
|
1902
|
+
text-align: center;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
.comimi-settings-section {
|
|
1906
|
+
display: grid;
|
|
1907
|
+
row-gap: 8px;
|
|
1908
|
+
margin-top: 18px;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
.comimi-settings-label {
|
|
1912
|
+
color: #333;
|
|
1913
|
+
font-size: 12px;
|
|
1914
|
+
font-weight: 400;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
@media (max-width: 767px) {
|
|
1918
|
+
.comimi-settings-panel-body {
|
|
1919
|
+
max-height: calc(var(--view-height, 100vh) - 62px - 56px);
|
|
1920
|
+
overflow-y: auto;
|
|
1921
|
+
-webkit-overflow-scrolling: touch;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
`,_e=`
|
|
1925
|
+
.comimi-splash {
|
|
1926
|
+
position: absolute;
|
|
1927
|
+
inset: 0;
|
|
1928
|
+
z-index: 100;
|
|
1929
|
+
background-color: #e0e0e0;
|
|
1930
|
+
overflow: hidden;
|
|
1931
|
+
animation: comimi-splash-clip 1s cubic-bezier(0.82, 0.01, 0.48, 1.02) 1s both;
|
|
1932
|
+
pointer-events: none;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
.comimi-splash-logo-wrap {
|
|
1936
|
+
position: absolute;
|
|
1937
|
+
top: 50%;
|
|
1938
|
+
left: 50%;
|
|
1939
|
+
transform: translate(-50%, -60%);
|
|
1940
|
+
width: 260px;
|
|
1941
|
+
aspect-ratio: 290 / 99;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
.comimi-splash-logo {
|
|
1945
|
+
position: absolute;
|
|
1946
|
+
top: 50%;
|
|
1947
|
+
left: 50%;
|
|
1948
|
+
transform: translate(-50%, -50%) scale(0.72);
|
|
1949
|
+
width: 360px;
|
|
1950
|
+
aspect-ratio: 360 / 99;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
.comimi-splash-symbol {
|
|
1954
|
+
position: absolute;
|
|
1955
|
+
top: 0;
|
|
1956
|
+
left: 0;
|
|
1957
|
+
width: 113px;
|
|
1958
|
+
display: block;
|
|
1959
|
+
transform-origin: center bottom;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.comimi-splash-typo-wrap {
|
|
1963
|
+
position: absolute;
|
|
1964
|
+
right: 7px;
|
|
1965
|
+
bottom: 11px;
|
|
1966
|
+
width: 229.5px;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
.comimi-splash-typo {
|
|
1970
|
+
display: block;
|
|
1971
|
+
width: 100%;
|
|
1972
|
+
overflow: visible;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
.comimi-splash-stroke {
|
|
1976
|
+
fill: none;
|
|
1977
|
+
stroke: #fff;
|
|
1978
|
+
stroke-linecap: round;
|
|
1979
|
+
stroke-linejoin: round;
|
|
1980
|
+
stroke-width: 10px;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
.comimi-splash-mimi {
|
|
1984
|
+
transform-origin: 56px 43px;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
.comimi-splash-mimi-left {
|
|
1988
|
+
animation: comimi-splash-mimi-left 0.4s ease-in-out 0.3s 2 forwards;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
.comimi-splash-mimi-right {
|
|
1992
|
+
animation: comimi-splash-mimi-right 0.4s ease-in-out 0.3s 2 forwards;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
.comimi-splash-eyes {
|
|
1996
|
+
transform: translateX(-7px);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
.comimi-splash-eye {
|
|
2000
|
+
transform-origin: center;
|
|
2001
|
+
transform-box: fill-box;
|
|
2002
|
+
animation: comimi-splash-eye 0.4s ease-in-out 0.2s forwards;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
.comimi-splash-heart {
|
|
2006
|
+
--size: 14px;
|
|
2007
|
+
position: absolute;
|
|
2008
|
+
top: -20px;
|
|
2009
|
+
width: var(--size);
|
|
2010
|
+
height: var(--size);
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
.comimi-splash-heart::before,
|
|
2014
|
+
.comimi-splash-heart::after {
|
|
2015
|
+
content: "";
|
|
2016
|
+
display: block;
|
|
2017
|
+
position: absolute;
|
|
2018
|
+
bottom: 0;
|
|
2019
|
+
left: 0;
|
|
2020
|
+
width: 100%;
|
|
2021
|
+
height: 150%;
|
|
2022
|
+
border-radius: 999px;
|
|
2023
|
+
transform-origin: center bottom;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
.comimi-splash-heart::before {
|
|
2027
|
+
transform: translateX(-32%) rotate(45deg);
|
|
2028
|
+
background-color: #eee;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
.comimi-splash-heart::after {
|
|
2032
|
+
transform: translateX(32%) rotate(-45deg);
|
|
2033
|
+
background-color: #fff;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
.comimi-splash-heart-1 {
|
|
2037
|
+
right: -2px;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
.comimi-splash-heart-2 {
|
|
2041
|
+
right: 76px;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
.comimi-splash-text {
|
|
2045
|
+
position: absolute;
|
|
2046
|
+
bottom: 0;
|
|
2047
|
+
left: 50%;
|
|
2048
|
+
transform: translate(-50%, 120%);
|
|
2049
|
+
color: #fff;
|
|
2050
|
+
font-size: 16px;
|
|
2051
|
+
font-weight: 700;
|
|
2052
|
+
line-height: 1.45;
|
|
2053
|
+
text-align: center;
|
|
2054
|
+
white-space: nowrap;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
.comimi-splash-text span {
|
|
2058
|
+
display: inline-block;
|
|
2059
|
+
animation: comimi-splash-dot 0.8s ease-in-out 0s infinite both;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
.comimi-splash-text span:nth-child(1) {
|
|
2063
|
+
animation-delay: 0s;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
.comimi-splash-text span:nth-child(2) {
|
|
2067
|
+
animation-delay: 0.15s;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
.comimi-splash-text span:nth-child(3) {
|
|
2071
|
+
animation-delay: 0.3s;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
@keyframes comimi-splash-clip {
|
|
2075
|
+
from {
|
|
2076
|
+
clip-path: circle(70%);
|
|
2077
|
+
}
|
|
2078
|
+
to {
|
|
2079
|
+
clip-path: circle(0%);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
@keyframes comimi-splash-mimi-left {
|
|
2084
|
+
from, to {
|
|
2085
|
+
transform: rotate(0deg);
|
|
2086
|
+
}
|
|
2087
|
+
50% {
|
|
2088
|
+
transform: rotate(20deg);
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
@keyframes comimi-splash-mimi-right {
|
|
2093
|
+
from, to {
|
|
2094
|
+
transform: rotate(0deg);
|
|
2095
|
+
}
|
|
2096
|
+
50% {
|
|
2097
|
+
transform: rotate(-20deg);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
@keyframes comimi-splash-eye {
|
|
2102
|
+
from, to {
|
|
2103
|
+
transform: scaleY(1);
|
|
2104
|
+
}
|
|
2105
|
+
50% {
|
|
2106
|
+
transform: scaleY(0.2);
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
@keyframes comimi-splash-dot {
|
|
2111
|
+
from, 50%, to {
|
|
2112
|
+
opacity: 1;
|
|
2113
|
+
}
|
|
2114
|
+
25% {
|
|
2115
|
+
opacity: 0;
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
`,ve=`
|
|
2119
|
+
.comimi-tooltip {
|
|
2120
|
+
position: absolute;
|
|
2121
|
+
bottom: 0;
|
|
2122
|
+
left: 50%;
|
|
2123
|
+
padding: 6px 10px;
|
|
2124
|
+
border-radius: 8px;
|
|
2125
|
+
background: rgba(255, 255, 255, 0.5);
|
|
2126
|
+
box-shadow: var(--comimi-shadow);
|
|
2127
|
+
backdrop-filter: blur(5px);
|
|
2128
|
+
color: #333;
|
|
2129
|
+
font-size: 12px;
|
|
2130
|
+
font-weight: 600;
|
|
2131
|
+
line-height: 1.45;
|
|
2132
|
+
white-space: nowrap;
|
|
2133
|
+
pointer-events: none;
|
|
2134
|
+
user-select: none;
|
|
2135
|
+
opacity: 0;
|
|
2136
|
+
transform: translate(-50%, calc(100% + 6px)) scale(0.88);
|
|
2137
|
+
transform-origin: center top;
|
|
2138
|
+
transition:
|
|
2139
|
+
opacity 0.1s ease-in-out,
|
|
2140
|
+
transform 0.16s ease-in-out;
|
|
2141
|
+
z-index: 5;
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
@media (hover: hover) {
|
|
2145
|
+
.comimi-has-tooltip:hover > .comimi-tooltip {
|
|
2146
|
+
opacity: 1;
|
|
2147
|
+
transform: translate(-50%, calc(100% + 6px)) scale(1);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
`,ye=`
|
|
2151
|
+
.comimi-root {
|
|
2152
|
+
--comimi-bg: #fff;
|
|
2153
|
+
--comimi-surface: #f7f7f7;
|
|
2154
|
+
--comimi-surface-2: #eeeeee;
|
|
2155
|
+
--comimi-fg: #333;
|
|
2156
|
+
--comimi-muted: #666;
|
|
2157
|
+
--comimi-soft: #999;
|
|
2158
|
+
--comimi-line: #e0e0e0;
|
|
2159
|
+
--comimi-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
|
|
2160
|
+
--comimi-glass: rgba(255, 255, 255, 0.8);
|
|
2161
|
+
--comimi-glass-strong: rgba(255, 255, 255, 0.8);
|
|
2162
|
+
--comimi-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
2163
|
+
background: var(--comimi-bg);
|
|
2164
|
+
color: var(--comimi-fg);
|
|
2165
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
2166
|
+
position: relative;
|
|
2167
|
+
width: calc(100% - 24px * 2);
|
|
2168
|
+
max-width: 900px;
|
|
2169
|
+
aspect-ratio: 900 / 636;
|
|
2170
|
+
margin: 0 auto;
|
|
2171
|
+
border-radius: 16px;
|
|
2172
|
+
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.06);
|
|
2173
|
+
overflow: hidden;
|
|
2174
|
+
user-select: none;
|
|
2175
|
+
touch-action: none;
|
|
2176
|
+
transition: box-shadow 0.24s ease-out;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
.comimi-root:focus {
|
|
2180
|
+
outline: none;
|
|
2181
|
+
box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.14);
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
@media (max-width: 767px) {
|
|
2185
|
+
.comimi-root {
|
|
2186
|
+
max-width: 500px;
|
|
2187
|
+
aspect-ratio: 390 / 490;
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
.comimi-root[data-layout="theater"] {
|
|
2192
|
+
width: 100%;
|
|
2193
|
+
max-width: none;
|
|
2194
|
+
aspect-ratio: auto;
|
|
2195
|
+
min-height: 320px;
|
|
2196
|
+
margin: 0;
|
|
2197
|
+
border-radius: 0;
|
|
2198
|
+
box-shadow: none;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
.comimi-root[data-layout="browserFullscreen"],
|
|
2202
|
+
.comimi-root[data-layout="nativeFullscreen"] {
|
|
2203
|
+
position: fixed;
|
|
2204
|
+
inset: 0;
|
|
2205
|
+
z-index: 999;
|
|
2206
|
+
width: 100vw;
|
|
2207
|
+
height: 100dvh;
|
|
2208
|
+
max-width: none;
|
|
2209
|
+
aspect-ratio: auto;
|
|
2210
|
+
margin: 0;
|
|
2211
|
+
border-radius: 0;
|
|
2212
|
+
box-shadow: none;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
.comimi-resize-handle {
|
|
2216
|
+
position: relative;
|
|
2217
|
+
width: 100%;
|
|
2218
|
+
height: 20px;
|
|
2219
|
+
background: #fff;
|
|
2220
|
+
cursor: ns-resize;
|
|
2221
|
+
touch-action: none;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
.comimi-resize-handle::after {
|
|
2225
|
+
content: "";
|
|
2226
|
+
position: absolute;
|
|
2227
|
+
top: 50%;
|
|
2228
|
+
left: 50%;
|
|
2229
|
+
transform: translate(-50%, -50%);
|
|
2230
|
+
width: 40px;
|
|
2231
|
+
height: 3px;
|
|
2232
|
+
border-radius: 999px;
|
|
2233
|
+
background: #bbb;
|
|
2234
|
+
transition:
|
|
2235
|
+
width 0.36s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
2236
|
+
height 0.36s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
2237
|
+
background-color 0.2s linear;
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
@media (hover: hover) {
|
|
2241
|
+
.comimi-resize-handle:hover::after {
|
|
2242
|
+
width: 52px;
|
|
2243
|
+
height: 5px;
|
|
2244
|
+
background: #888;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
`,be=`
|
|
2249
|
+
.comimi-view-switcher {
|
|
2250
|
+
position: absolute;
|
|
2251
|
+
top: 20px;
|
|
2252
|
+
right: 20px;
|
|
2253
|
+
display: grid;
|
|
2254
|
+
grid-template-columns: repeat(3, 60px);
|
|
2255
|
+
width: 180px;
|
|
2256
|
+
border-radius: 16px;
|
|
2257
|
+
background: var(--comimi-glass);
|
|
2258
|
+
box-shadow: var(--comimi-shadow);
|
|
2259
|
+
backdrop-filter: blur(5px);
|
|
2260
|
+
pointer-events: auto;
|
|
2261
|
+
transition:
|
|
2262
|
+
transform 0.6s var(--comimi-spring),
|
|
2263
|
+
opacity 0.3s linear;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
.comimi-view-switcher[data-overlay="false"] {
|
|
2267
|
+
transform: translateY(-35px);
|
|
2268
|
+
opacity: 0;
|
|
2269
|
+
pointer-events: none;
|
|
2270
|
+
transition:
|
|
2271
|
+
transform 0.3s var(--comimi-spring),
|
|
2272
|
+
opacity 0.15s linear;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
@media (hover: hover) {
|
|
2276
|
+
.comimi-view-switcher:hover {
|
|
2277
|
+
transform: scaleX(1.03);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
.comimi-view-switcher-indicator {
|
|
2282
|
+
position: absolute;
|
|
2283
|
+
top: 0;
|
|
2284
|
+
left: 0;
|
|
2285
|
+
width: 60px;
|
|
2286
|
+
height: 100%;
|
|
2287
|
+
border-radius: 16px;
|
|
2288
|
+
background: #666;
|
|
2289
|
+
transition: transform 0.36s var(--comimi-spring);
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
.comimi-view-switcher-button {
|
|
2293
|
+
position: relative;
|
|
2294
|
+
display: grid;
|
|
2295
|
+
row-gap: 5px;
|
|
2296
|
+
justify-items: center;
|
|
2297
|
+
align-content: center;
|
|
2298
|
+
height: 58px;
|
|
2299
|
+
padding: 0;
|
|
2300
|
+
border: 0;
|
|
2301
|
+
background: transparent;
|
|
2302
|
+
color: #666;
|
|
2303
|
+
cursor: pointer;
|
|
2304
|
+
transition: color 0.2s linear;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
.comimi-view-switcher-button[data-selected="true"] {
|
|
2308
|
+
color: #fff;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
.comimi-view-switcher-icon-wrap {
|
|
2312
|
+
width: 20px;
|
|
2313
|
+
height: 20px;
|
|
2314
|
+
transform-origin: center bottom;
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2317
|
+
.comimi-view-switcher-icon {
|
|
2318
|
+
display: block;
|
|
2319
|
+
width: 100%;
|
|
2320
|
+
height: 100%;
|
|
2321
|
+
color: currentColor;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
.comimi-view-switcher-icon-wrap.comimi-pop-animate {
|
|
2325
|
+
animation: comimi-pop 0.5s ease-in-out 0.1s both;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
.comimi-view-switcher-label {
|
|
2329
|
+
color: currentColor;
|
|
2330
|
+
font-size: 10px;
|
|
2331
|
+
font-weight: 500;
|
|
2332
|
+
text-align: center;
|
|
2333
|
+
transition: color 0.2s linear;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
@media (max-width: 767px) {
|
|
2337
|
+
.comimi-view-switcher {
|
|
2338
|
+
top: 70px;
|
|
2339
|
+
right: auto;
|
|
2340
|
+
left: calc(50% - 90px);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
`,J=!1,xe=[ye,le,ve,me,de,ce,K,q,be,se,ue,ge,fe,pe,he,_e].join(`
|
|
2344
|
+
`);function Se(){if(J||typeof document>`u`)return;let e=document.createElement(`style`);e.dataset.comimiViewer=`true`,e.textContent=xe,document.head.append(e),J=!0}var Ce=180,we=2e3,Te=class{container;callbacks;assetLoader;i18n;root;cleanup=[];mouseStart;touchStart;pinchStart;pageStage;pageTurnTimer;splashRemoveTimer;splash;isPageTurnAnimating=!1;suppressNextClick=!1;prevOverlayVisible=!1;overlayApplyRaf;menuPanel;viewModeSwitcher;controlsDock;resizeHandle;viewSizeObserver;constructor(e,t,n,r,i){this.container=e,this.callbacks=t,this.assetLoader=n,this.i18n=r,Se(),this.pageStage=new L({assetLoader:this.assetLoader,i18n:this.i18n,isMobileViewport:()=>this.isMobileViewport()}),this.root=G({className:i}),this.container.replaceChildren(this.root),this.observeViewSize()}observeViewSize(){let e=()=>{this.root.style.setProperty(`--view-width`,`${this.root.offsetWidth}px`),this.root.style.setProperty(`--view-height`,`${this.root.offsetHeight}px`)};e(),typeof ResizeObserver<`u`?(this.viewSizeObserver=new ResizeObserver(e),this.viewSizeObserver.observe(this.root)):(window.addEventListener(`resize`,e),this.cleanup.push(()=>window.removeEventListener(`resize`,e)))}update(e){if(this.isPageTurnAnimating)return;this.cleanup.forEach(e=>e()),this.cleanup=[],this.i18n.setLocale(e.settings.locale),this.root.dataset.layout=e.layout.mode,e.layout.mode===`theater`&&e.layout.theaterHeightPx?this.root.style.height=`${e.layout.theaterHeightPx}px`:this.root.style.height=``;let t=this.prevOverlayVisible!==e.overlayVisible,n=t?{...e,overlayVisible:this.prevOverlayVisible}:e;this.menuPanel||=new ie(this.callbacks,this.i18n),this.viewModeSwitcher||=new ae(this.callbacks,this.i18n),this.controlsDock||=new C(this.callbacks,this.i18n);let r=this.pageStage.getElement(),i=this.menuPanel.getElement(),a=this.viewModeSwitcher.getElement(),o=this.controlsDock.getElement();Array.from(this.root.children).forEach(e=>{e!==r&&e!==i&&e!==a&&e!==o&&e!==this.splash&&e.remove()}),r.parentNode!==this.root&&this.root.prepend(r),this.pageStage.update(e,this.isMobileViewport()),this.pageStage.snapTransform();let s=[ne(n,this.i18n),h({state:n,callbacks:this.callbacks}),z(e)];this.syncResizeHandle(e.layout.mode===`theater`);let c=i.parentNode===this.root?i:null;if(c?s.forEach(e=>this.root.insertBefore(e,c)):(s.forEach(e=>this.root.appendChild(e)),this.root.appendChild(i)),a.parentNode!==this.root&&this.root.appendChild(a),o.parentNode!==this.root&&this.root.appendChild(o),this.menuPanel.update(n),this.viewModeSwitcher.update(n),this.controlsDock.update(n,this.isMobileViewport()),this.splash&&this.splash.parentNode!==this.root&&this.root.append(this.splash),this.bindGestures(e),this.overlayApplyRaf!==void 0&&(cancelAnimationFrame(this.overlayApplyRaf),this.overlayApplyRaf=void 0),t){let t=e.overlayVisible;this.root.offsetWidth,this.overlayApplyRaf=requestAnimationFrame(()=>{this.overlayApplyRaf=void 0,this.applyOverlayVisibility(t)})}this.prevOverlayVisible=e.overlayVisible}applyOverlayVisibility(e){let t=String(e);this.root.querySelectorAll(`.comimi-arrows, .comimi-center-message, .comimi-menu-panel, .comimi-view-switcher, .comimi-controls-dock`).forEach(e=>{e.dataset.overlay=t})}showSplash(){this.splash||(this.splash=V(this.i18n),this.root.append(this.splash),this.splashRemoveTimer=window.setTimeout(()=>{this.splash?.remove(),this.splash=void 0},we))}destroy(){window.clearTimeout(this.pageTurnTimer),window.clearTimeout(this.splashRemoveTimer),this.overlayApplyRaf!==void 0&&(cancelAnimationFrame(this.overlayApplyRaf),this.overlayApplyRaf=void 0),this.cleanup.forEach(e=>e()),this.cleanup=[],this.viewSizeObserver?.disconnect(),this.viewSizeObserver=void 0,this.resizeHandle?.remove(),this.resizeHandle=void 0,this.root.remove()}getElement(){return this.root}isAnimatingPageTurn(){return this.isPageTurnAnimating}animatePageTurn(e,t,n){return window.clearTimeout(this.pageTurnTimer),!e.settings.pageTurnAnimation||this.isPageTurnAnimating||T(e,t,this.isMobileViewport()).length===0?!1:(this.isPageTurnAnimating=!0,this.setStageDragOffset(this.getPageTurnTargetOffset(e,t),!0),this.pageTurnTimer=window.setTimeout(()=>{this.isPageTurnAnimating=!1,n()},Ce),!0)}isMobileViewport(){return window.matchMedia(`(max-width: 767px)`).matches}clampPan(e,t,n,r){if(n<=1)return{x:0,y:0};let i=w(r,this.isMobileViewport()).length>1?this.root.offsetWidth/2:this.root.offsetWidth,a=this.root.offsetHeight,o=i*(n-1)/2,s=a*(n-1)/2;return{x:Math.min(Math.max(e,-o),o),y:Math.min(Math.max(t,-s),s)}}clampedZoom(e,t){return Math.min(Math.max(e,t.settings.zoom.min),t.settings.zoom.max)}syncResizeHandle(e){e?(this.resizeHandle||=this.createResizeHandle(),this.resizeHandle.parentNode!==this.container&&this.container.appendChild(this.resizeHandle)):this.resizeHandle&&this.resizeHandle.remove()}createResizeHandle(){let e=document.createElement(`div`);e.className=`comimi-resize-handle`,e.setAttribute(`role`,`separator`),e.setAttribute(`aria-orientation`,`horizontal`);let t=0,n=0,r,i=e=>{e.pointerId===r&&this.callbacks.setTheaterHeight(n+e.clientY-t)},a=e=>{e.pointerId===r&&(window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a),r=void 0)};return e.addEventListener(`pointerdown`,e=>{e.preventDefault(),r=e.pointerId,t=e.clientY,n=this.root.getBoundingClientRect().height,window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}),e}bindGestures(e){let t=e=>{if(this.suppressNextClick||this.isPageTurnAnimating){this.suppressNextClick=!1,e.preventDefault(),e.stopPropagation();return}this.isInteractiveTarget(e.target)||this.callbacks.toggleOverlay()},n=t=>{if(this.isInteractiveTarget(t.target)||!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let n=t.deltaY>0?-e.settings.zoom.step:e.settings.zoom.step,r=this.clampedZoom(e.zoomScale+n,e),i=this.clampPan(e.panX,e.panY,r,e);this.callbacks.setZoom(r,i.x,i.y)},r=t=>{this.isPageTurnAnimating||this.isInteractiveTarget(t.target)||t.button===0&&(this.mouseStart={x:t.clientX,y:t.clientY,panX:e.panX,panY:e.panY})},i=t=>{if(!this.mouseStart)return;t.preventDefault();let n=t.clientX-this.mouseStart.x,r=t.clientY-this.mouseStart.y;if((Math.abs(n)>6||Math.abs(r)>6)&&(this.suppressNextClick=!0),e.zoomScale<=1){this.setStageDragOffset(this.constrainDragOffset(n,r,e));return}let i=this.mouseStart.panX+t.clientX-this.mouseStart.x,a=this.mouseStart.panY+t.clientY-this.mouseStart.y,o=this.clampPan(i,a,e.zoomScale,e);this.callbacks.setPan(o.x,o.y)},a=t=>{if(!this.mouseStart)return;let n=t.clientX-this.mouseStart.x,r=t.clientY-this.mouseStart.y;this.handleSwipeEnd(n,r,e),this.mouseStart=void 0},o=t=>{if(this.isPageTurnAnimating)return;if(t.touches.length===2){t.preventDefault(),this.touchStart=void 0,this.pinchStart={distance:Y(t),scale:e.zoomScale};return}if(this.isInteractiveTarget(t.target))return;let n=t.touches[0];n&&(this.touchStart={x:n.clientX,y:n.clientY,panX:e.panX,panY:e.panY})},s=t=>{if(this.pinchStart&&t.touches.length===2){t.preventDefault();let n=this.pinchStart.scale*(Y(t)/this.pinchStart.distance),r=this.clampedZoom(n,e),i=this.clampPan(e.panX,e.panY,r,e);this.callbacks.setZoom(r,i.x,i.y);return}if(this.isInteractiveTarget(t.target))return;let n=t.touches[0];if(!n||!this.touchStart)return;t.preventDefault();let r=n.clientX-this.touchStart.x,i=n.clientY-this.touchStart.y;if((Math.abs(r)>6||Math.abs(i)>6)&&(this.suppressNextClick=!0),e.zoomScale<=1){this.setStageDragOffset(this.constrainDragOffset(r,i,e));return}let a=this.touchStart.panX+n.clientX-this.touchStart.x,o=this.touchStart.panY+n.clientY-this.touchStart.y,s=this.clampPan(a,o,e.zoomScale,e);this.callbacks.setPan(s.x,s.y)},c=t=>{t.touches.length<2&&(this.pinchStart=void 0);let n=t.changedTouches[0];if(!n||!this.touchStart){this.touchStart=void 0;return}let r=n.clientX-this.touchStart.x,i=n.clientY-this.touchStart.y;this.handleSwipeEnd(r,i,e),this.touchStart=void 0},l=t=>{this.isInteractiveTarget(t.target)||(e.zoomScale>1?this.callbacks.resetZoom():this.callbacks.setZoom(2))},u=t=>{if(this.suppressNextClick||this.isPageTurnAnimating||e.panel!==`settings`)return;let n=t.target;n instanceof Element&&(n.closest(`.comimi-settings`)||this.callbacks.setPanel(`none`))};this.root.addEventListener(`click`,u,!0),this.root.addEventListener(`click`,t),this.root.addEventListener(`wheel`,n,{passive:!1}),this.root.addEventListener(`mousedown`,r),window.addEventListener(`mousemove`,i),window.addEventListener(`mouseup`,a),this.root.addEventListener(`touchstart`,o,{passive:!1}),this.root.addEventListener(`touchmove`,s,{passive:!1}),this.root.addEventListener(`touchend`,c),this.root.addEventListener(`dblclick`,l),this.cleanup.push(()=>this.root.removeEventListener(`click`,u,!0),()=>this.root.removeEventListener(`click`,t),()=>this.root.removeEventListener(`wheel`,n),()=>this.root.removeEventListener(`mousedown`,r),()=>window.removeEventListener(`mousemove`,i),()=>window.removeEventListener(`mouseup`,a),()=>this.root.removeEventListener(`touchstart`,o),()=>this.root.removeEventListener(`touchmove`,s),()=>this.root.removeEventListener(`touchend`,c),()=>this.root.removeEventListener(`dblclick`,l))}handleSwipeEnd(e,t,n){if(window.clearTimeout(this.pageTurnTimer),!(n.zoomScale<=1&&Math.abs(e)>64&&Math.abs(e)>Math.abs(t))){this.setStageDragOffset(0,!0);return}let r=k(e,n.settings.readingDirection)?`next`:`previous`;if(!(T(n,r,this.isMobileViewport()).length>0)){this.setStageDragOffset(0,!0);return}this.requestPageTurn(n,r)||(r===`next`?this.callbacks.commitNextPage():this.callbacks.commitPreviousPage())}requestPageTurn(e,t){return this.animatePageTurn(e,t,()=>{t===`next`?this.callbacks.commitNextPage():this.callbacks.commitPreviousPage()})}constrainDragOffset(e,t,n){return Math.abs(t)>Math.abs(e)?0:T(n,k(e,n.settings.readingDirection)?`next`:`previous`,this.isMobileViewport()).length>0?e:this.applyEdgeResistance(e)}applyEdgeResistance(e){let t=Math.sign(e),n=Math.abs(e),r=Math.max(this.root.clientWidth,1),i=Math.min(r*.22,140);return t*(i*(1-Math.exp(-n/i)))}setStageDragOffset(e,t=!1){this.pageStage.setDragOffset(e,t)}getPageTurnTargetOffset(e,t){return O(e,t)===`left`?this.root.clientWidth:-this.root.clientWidth}isInteractiveTarget(e){return e instanceof Element?!!e.closest([`.comimi-arrow-button`,`.comimi-view-switcher`,`.comimi-controls-dock`,`.comimi-menu-panel`,`.comimi-settings-panel`,`button`,`input`,`select`,`textarea`,`a`,`iframe`].join(`,`)):!1}};function Y(e){let[t,n]=Array.from(e.touches);return!t||!n?1:Math.hypot(t.clientX-n.clientX,t.clientY-n.clientY)}var Ee=class{enabled;databaseName;dbPromise;constructor(e={}){this.enabled=e.enabled!==!1&&typeof indexedDB<`u`,this.databaseName=e.databaseName??`manga-viewer`}async getSettings(){return(await this.get(`settings`,`global`))?.value}async saveSettings(e){await this.put(`settings`,{id:`global`,value:e,updatedAt:Date.now()})}async getProgress(e){return(await this.get(`readingProgress`,e))?.pageIndex}async saveProgress(e,t){await this.put(`readingProgress`,{mangaId:e,pageIndex:t,updatedAt:Date.now()})}async saveLayout(e){await this.put(`layout`,{id:`global`,value:e,updatedAt:Date.now()})}async getLayout(){return(await this.get(`layout`,`global`))?.value}async get(e,t){if(this.enabled)return Z((await this.store(e,`readonly`)).get(t))}async put(e,t){this.enabled&&await Z((await this.store(e,`readwrite`)).put(t))}async delete(e,t){this.enabled&&await Z((await this.store(e,`readwrite`)).delete(t))}async store(e,t){return(await this.open()).transaction(e,t).objectStore(e)}open(){return this.enabled?(this.dbPromise??=new Promise((e,t)=>{let n=indexedDB.open(this.databaseName,1);n.onupgradeneeded=()=>{let e=n.result;X(e,`settings`,`id`),X(e,`readingProgress`,`mangaId`),X(e,`layout`,`id`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}),this.dbPromise):Promise.reject(Error(`IndexedDB is not available`))}};function X(e,t,n){e.objectStoreNames.contains(t)||e.createObjectStore(t,{keyPath:n})}function Z(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}function Q(e,t){switch(t.type){case`setManga`:{let n=i(t.pageIndex??0,t.manga.pages.length);return $({...e,manga:t.manga,currentPageIndex:n,zoomScale:1,panX:0,panY:0})}case`goToPage`:{let n=i(t.pageIndex,e.manga.pages.length),r=e.zoomScale===1&&e.panX===0&&e.panY===0;return n===e.currentPageIndex&&r?e:$({...e,currentPageIndex:n,zoomScale:1,panX:0,panY:0})}case`nextPage`:{let t=a(e.settings,e.currentPageIndex);return Q(e,{type:`goToPage`,pageIndex:e.currentPageIndex+t})}case`previousPage`:{let t=a(e.settings,e.currentPageIndex);return Q(e,{type:`goToPage`,pageIndex:e.currentPageIndex-t})}case`setOverlayVisible`:return{...e,overlayVisible:t.visible,panel:t.visible?e.panel:`none`};case`toggleAutoPageTurn`:return{...e,autoPageTurnEnabled:!e.autoPageTurnEnabled};case`updateSettings`:{let n=r(e.settings,t.settings);return $({...e,settings:n,layout:{...e.layout,mode:n.layoutMode}})}case`setLayoutMode`:return Q(e,{type:`updateSettings`,settings:{layoutMode:t.layoutMode}});case`setTheaterHeight`:return{...e,layout:{...e.layout,theaterHeightPx:Math.max(240,Math.round(t.heightPx))}};case`setZoom`:return{...e,zoomScale:De(t.scale,e),panX:t.panX??e.panX,panY:t.panY??e.panY};case`setPan`:return{...e,panX:t.panX,panY:t.panY};case`resetZoom`:return{...e,zoomScale:1,panX:0,panY:0};case`setPanel`:return{...e,panel:t.panel,overlayVisible:t.panel===`none`?e.overlayVisible:!0};case`pushNotification`:return{...e,notifications:[t.notification]};case`removeNotification`:return{...e,notifications:e.notifications.filter(e=>e.id!==t.id)}}}function $(e){return{...e,visiblePageIndexes:o(e.currentPageIndex,e.manga.pages.length,e.settings)}}function De(e,t){return Math.min(Math.max(e,t.settings.zoom.min),t.settings.zoom.max)}var Oe=class{state;listeners=new Set;constructor(e){this.state=e}getState(){return this.state}dispatch(e){let t=this.state,n=Q(t,e);if(n!==t){this.state=n;for(let e of this.listeners)e(n,t)}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},ke=class{objectUrls=new Set;async resolveImageSource(e,t){return t.src}revokeAll(){for(let e of this.objectUrls)URL.revokeObjectURL(e);this.objectUrls.clear()}},Ae=class{handlers=new Map;on(e,t){let n=this.handlers.get(e);return n||(n=new Set,this.handlers.set(e,n)),n.add(t),()=>{n.delete(t)}}emit(e,t){let n=this.handlers.get(e);if(n)for(let e of n)try{e(t)}catch(e){console.error(e)}}clear(){this.handlers.clear()}},je=class{container;store;storage;assetLoader;renderer;i18n;events=new Ae;unsubscribers=[];notificationTimers=new Map;autoTimer;mobileMediaQuery;constructor(e,i){this.container=e;let a=r(t,{...i.settings,locale:i.locale??i.settings?.locale??t.locale});this.storage=new Ee(i.storage),this.assetLoader=new ke,this.i18n=new l(a.locale,i.translations),this.store=new Oe(n(i.manga,a,i.initialPageIndex));let o={goToPage:e=>this.goToPage(e),nextPage:()=>this.nextPage(),previousPage:()=>this.previousPage(),commitNextPage:()=>this.commitNextPage(),commitPreviousPage:()=>this.commitPreviousPage(),toggleOverlay:e=>this.toggleOverlay(e),toggleAutoPageTurn:()=>this.toggleAutoPageTurn(),updateSettings:e=>{this.updateSettings(e)},setLayoutMode:e=>void this.setLayoutMode(e),setTheaterHeight:e=>this.setTheaterHeight(e),setPanel:e=>{this.store.dispatch({type:`setPanel`,panel:e})},setZoom:(e,t,n)=>this.store.dispatch({type:`setZoom`,scale:e,panX:t,panY:n}),setPan:(e,t)=>this.store.dispatch({type:`setPan`,panX:e,panY:t}),resetZoom:()=>this.store.dispatch({type:`resetZoom`})};this.renderer=new Te(this.container,o,this.assetLoader,this.i18n,i.className);for(let[e,t]of Object.entries(i.events??{}))this.on(e,t);this.unsubscribers.push(this.store.subscribe((e,t)=>{this.renderer.update(e),this.afterStateChange(e,t)})),this.bindKeyboard(),this.bindViewportChange(),this.bootstrap()}destroy(){window.clearInterval(this.autoTimer);for(let e of this.notificationTimers.values())window.clearTimeout(e);this.notificationTimers.clear(),this.unsubscribers.forEach(e=>e()),this.assetLoader.revokeAll(),this.renderer.destroy(),this.events.emit(`destroy`,void 0),this.events.clear()}async setManga(e){let t=await this.storage.getProgress(e.id)??0;this.store.dispatch({type:`setManga`,manga:e,pageIndex:t})}async setPages(e){await this.setManga({...this.store.getState().manga,pages:e})}getState(){return this.store.getState()}async updateSettings(e){this.store.dispatch({type:`updateSettings`,settings:e});let t=this.store.getState().settings;this.i18n.setLocale(t.locale),await this.storage.saveSettings(t),this.events.emit(`settingsChange`,{settings:t})}goToPage(e){let t=this.store.getState().currentPageIndex;this.store.dispatch({type:`goToPage`,pageIndex:e});let n=this.store.getState().currentPageIndex;if(t!==n){let e=this.store.getState();this.storage.saveProgress(e.manga.id,n),this.events.emit(`pageChange`,{pageIndex:n,page:e.manga.pages[n]})}}nextPage(){if(this.renderer.isAnimatingPageTurn())return;let e=this.store.getState();this.renderer.animatePageTurn(e,`next`,()=>this.commitNextPage())||this.commitNextPage()}previousPage(){if(this.renderer.isAnimatingPageTurn())return;let e=this.store.getState();this.renderer.animatePageTurn(e,`previous`,()=>this.commitPreviousPage())||this.commitPreviousPage()}commitNextPage(){if(this.renderer.isMobileViewport()){this.goToPage(this.store.getState().currentPageIndex+1);return}let e=this.store.getState().currentPageIndex;this.store.dispatch({type:`nextPage`}),this.emitPageChangeIfNeeded(e)}commitPreviousPage(){if(this.renderer.isMobileViewport()){this.goToPage(this.store.getState().currentPageIndex-1);return}let e=this.store.getState().currentPageIndex;this.store.dispatch({type:`previousPage`}),this.emitPageChangeIfNeeded(e)}toggleOverlay(e){let t=this.store.getState().overlayVisible,n=e??!t;this.store.dispatch({type:`setOverlayVisible`,visible:n})}toggleAutoPageTurn(){this.store.dispatch({type:`toggleAutoPageTurn`}),this.syncAutoTimer();let e=this.store.getState().autoPageTurnEnabled;this.notify(this.i18n.t(e?`autoplay.start`:`autoplay.stop`))}async toggleFullscreen(){let e=this.store.getState();if(document.fullscreenElement){await document.exitFullscreen(),await this.setLayoutMode(`inline`);return}await this.setLayoutMode(e.layout.mode===`nativeFullscreen`?`inline`:`nativeFullscreen`)}on(e,t){return this.events.on(e,t)}async bootstrap(){let e=await this.storage.getSettings(),t=await this.storage.getLayout(),n=this.store.getState().manga.id,r=await this.storage.getProgress(n);e&&this.store.dispatch({type:`updateSettings`,settings:e}),t?.mode&&this.store.dispatch({type:`setLayoutMode`,layoutMode:t.mode}),t?.theaterHeightPx&&this.store.dispatch({type:`setTheaterHeight`,heightPx:t.theaterHeightPx}),typeof r==`number`&&this.store.dispatch({type:`goToPage`,pageIndex:r}),this.renderer.update(this.store.getState()),this.renderer.showSplash(),window.setTimeout(()=>{this.toggleOverlay(!0)},1550),this.events.emit(`ready`,{manga:this.store.getState().manga})}bindKeyboard(){this.renderer.getElement();let e=e=>{if(this.shouldHandleKeyboardEvent(e))switch(e.key){case`ArrowLeft`:e.preventDefault(),this.moveFromKey(`left`);break;case`ArrowRight`:e.preventDefault(),this.moveFromKey(`right`);break;case` `:e.preventDefault(),this.moveFromKey(e.shiftKey?`right`:`left`);break;case`a`:case`A`:e.preventDefault(),this.toggleAutoPageTurn();break;case`n`:case`N`:e.preventDefault(),this.setLayoutMode(`inline`);break;case`w`:case`W`:e.preventDefault(),this.setLayoutMode(`theater`);break;case`f`:case`F`:e.preventDefault(),this.setLayoutMode(`browserFullscreen`);break;case`m`:case`M`:{e.preventDefault();let t=this.store.getState().panel,n=t===`menu`||t===`pages`||t===`shortcuts`;this.store.dispatch({type:`setPanel`,panel:n?`none`:`menu`}),n||this.toggleOverlay(!0);break}case`p`:case`P`:e.preventDefault(),this.updateSettings({pageTurnMode:this.store.getState().settings.pageTurnMode===`spread`?`single`:`spread`});break;case`s`:case`S`:{e.preventDefault();let t=this.store.getState().panel===`settings`;this.store.dispatch({type:`setPanel`,panel:t?`none`:`settings`}),t||this.toggleOverlay(!0);break}case`Escape`:e.preventDefault(),this.store.dispatch({type:`setPanel`,panel:`none`}),document.fullscreenElement&&document.exitFullscreen();break}};window.addEventListener(`keydown`,e),this.unsubscribers.push(()=>window.removeEventListener(`keydown`,e))}shouldHandleKeyboardEvent(e){let t=e.target;return t instanceof Element?!t.closest(`input, select, textarea, [contenteditable='true']`):!0}bindViewportChange(){this.mobileMediaQuery=window.matchMedia(`(max-width: 676px)`);let e=()=>{this.renderer.update(this.store.getState())};this.mobileMediaQuery.addEventListener(`change`,e),this.unsubscribers.push(()=>this.mobileMediaQuery?.removeEventListener(`change`,e))}moveFromKey(e){this.store.getState().settings.readingDirection===`rtl`?e===`left`?this.nextPage():this.previousPage():e===`left`?this.previousPage():this.nextPage()}async setLayoutMode(e){if(e===`nativeFullscreen`)try{await this.renderer.getElement().requestFullscreen()}catch{e=`browserFullscreen`}else document.fullscreenElement&&await document.exitFullscreen();if(e===`theater`&&!this.store.getState().layout.theaterHeightPx){let e=this.renderer.getElement().offsetHeight;e>0&&this.store.dispatch({type:`setTheaterHeight`,heightPx:e})}this.store.dispatch({type:`setLayoutMode`,layoutMode:e}),await this.storage.saveSettings(this.store.getState().settings),await this.storage.saveLayout(this.store.getState().layout),this.events.emit(`layoutChange`,{layoutMode:e})}setTheaterHeight(e){this.store.dispatch({type:`setTheaterHeight`,heightPx:e}),this.storage.saveLayout(this.store.getState().layout)}afterStateChange(e,t){e.autoPageTurnEnabled!==t.autoPageTurnEnabled&&this.syncAutoTimer()}syncAutoTimer(){window.clearInterval(this.autoTimer),this.store.getState().autoPageTurnEnabled&&(this.autoTimer=window.setInterval(()=>{let e=this.store.getState(),t=a(e.settings,e.currentPageIndex);if(e.currentPageIndex+t>=e.manga.pages.length){this.toggleAutoPageTurn();return}this.nextPage()},this.store.getState().settings.autoPageTurnIntervalMs))}emitPageChangeIfNeeded(e){let t=this.store.getState();t.currentPageIndex!==e&&(this.storage.saveProgress(t.manga.id,t.currentPageIndex),this.events.emit(`pageChange`,{pageIndex:t.currentPageIndex,page:t.manga.pages[t.currentPageIndex]}))}notify(e,t=`info`){for(let e of this.notificationTimers.values())window.clearTimeout(e);this.notificationTimers.clear();let n=`${Date.now()}-${Math.random().toString(36).slice(2)}`;this.store.dispatch({type:`pushNotification`,notification:{id:n,message:e,tone:t,createdAt:Date.now()}});let r=window.setTimeout(()=>{this.store.dispatch({type:`removeNotification`,id:n}),this.notificationTimers.delete(n)},3e3);this.notificationTimers.set(n,r)}};function Me(e,t){return new je(e,t)}return e.createMangaViewer=Me,e})({});
|