mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-26 03:16:40 +07:00

Author: Fedor Katurov <gotham48@gmail.com> Date: Thu Nov 10 14:33:09 2022 +0600 fixed appearance on mobile devices
1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
import $ from"./LayoutMainMenuToggle.0229fd1d.js";import T from"./LayoutMainMenu.73d179c8.js";import{k,a as M,q as B,J as P,aa as L,y as V,ab as A,o as j,e as C,i as y,h as r,f as u,w as E,r as H,ac as I}from"./entry.b61ebbed.js";import"./LayoutMainMenuToggle.vue_used_vue_type_style_index_0_lang.module.ab60ac3f.js";import"./navigation.3574a1bb.js";function D(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}else return Array.from(t)}var p=!1;if(typeof window<"u"){var h={get passive(){p=!0}};window.addEventListener("testPassive",null,h),window.removeEventListener("testPassive",null,h)}var c=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),l=[],f=!1,g=-1,d=void 0,s=void 0,a=void 0,w=function(e){return l.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},v=function(e){var o=e||window.event;return w(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},O=function(e){if(a===void 0){var o=!!e&&e.reserveScrollBarGap===!0,i=window.innerWidth-document.documentElement.clientWidth;if(o&&i>0){var n=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);a=document.body.style.paddingRight,document.body.style.paddingRight=n+i+"px"}}d===void 0&&(d=document.body.style.overflow,document.body.style.overflow="hidden")},F=function(){a!==void 0&&(document.body.style.paddingRight=a,a=void 0),d!==void 0&&(document.body.style.overflow=d,d=void 0)},R=function(){return window.requestAnimationFrame(function(){if(s===void 0){s={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var e=window,o=e.scrollY,i=e.scrollX,n=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-o,document.body.style.left=-i,setTimeout(function(){return window.requestAnimationFrame(function(){var m=n-window.innerHeight;m&&o>=n&&(document.body.style.top=-(o+m))})},300)}})},Y=function(){if(s!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=s.position,document.body.style.top=s.top,document.body.style.left=s.left,window.scrollTo(o,e),s=void 0}},q=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},N=function(e,o){var i=e.targetTouches[0].clientY-g;return w(e.target)?!1:o&&o.scrollTop===0&&i>0||q(o)&&i<0?v(e):(e.stopPropagation(),!0)},W=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!l.some(function(n){return n.targetElement===e})){var i={targetElement:e,options:o||{}};l=[].concat(D(l),[i]),c?R():O(o),c&&(e.ontouchstart=function(n){n.targetTouches.length===1&&(g=n.targetTouches[0].clientY)},e.ontouchmove=function(n){n.targetTouches.length===1&&N(n,e)},f||(document.addEventListener("touchmove",v,p?{passive:!1}:void 0),f=!0))}},z=function(){c&&(l.forEach(function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null}),f&&(document.removeEventListener("touchmove",v,p?{passive:!1}:void 0),f=!1),g=-1),c?Y():F(),l=[]};const J="_grid_4vjki_1",U="_main_4vjki_17",X="_sidebar_4vjki_39",G="_active_4vjki_52",K="_menu_4vjki_58",Q="_menu_toggle_4vjki_78",Z="_shifted_4vjki_95",x="_footer_4vjki_102",ee="_content_4vjki_106",te={grid:J,main:U,sidebar:X,active:G,menu:K,menu_toggle:Q,shifted:Z,footer:x,content:ee},oe=M({setup(){const t=B(0),e=()=>{t.value=window.scrollY};return P(()=>addEventListener("scroll",e)),L(()=>removeEventListener("scroll",e)),{menuShifted:V(()=>t.value>60),scrollTop:t}},data(){return{menuVisible:!1}},methods:{toggleMenu(){this.$data.menuVisible=!this.$data.menuVisible}},watch:{$route(){!this.menuVisible||A(()=>this.toggleMenu())},menuVisible(t){t&&W(this.$refs.sidebar),z()}}});function ne(t,e,o,i,n,m){const _=$,b=T,S=I;return j(),C("div",{class:r(t.$style.grid)},[y(_,{active:t.menuVisible,class:r([t.$style.menu_toggle,{[t.$style.shifted]:t.menuShifted,[t.$style.active]:t.menuVisible}]),onClick:t.toggleMenu},null,8,["active","class","onClick"]),u("div",{class:r([t.$style.sidebar,{[t.$style.active]:t.menuVisible}]),ref:"sidebar"},[u("div",{class:r(t.$style.menu)},[y(b)],2)],2),u("div",{class:r(t.$style.main)},[u("div",{class:r(t.$style.content)},[y(S,{name:"content"},{default:E(()=>[H(t.$slots,"default")]),_:3})],2)],2)],2)}const ie={$style:te},ue=k(oe,[["render",ne],["__cssModules",ie]]);export{ue as default};
|