mobile: hide initial menu animation in landscape #210

This commit is contained in:
Sören Weber 2022-03-13 12:36:48 +01:00
parent 30bf0250e4
commit bc018cbb0d
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
4 changed files with 8 additions and 5 deletions

View file

@ -22,8 +22,8 @@
</style> </style>
{{- partial "custom-header.html" . }} {{- partial "custom-header.html" . }}
</head> </head>
<body data-url="/"> <body class="mobile-support" data-url="/">
<div id="body default-animation" style="margin-left:0px;"> <div id="body" class="default-animation" style="margin-left:0px;">
<div id="sidebar-overlay"></div> <div id="sidebar-overlay"></div>
<main id="body-inner" class="chapter"> <main id="body-inner" class="chapter">
<div class="flex-block-wrapper"> <div class="flex-block-wrapper">

View file

@ -24,7 +24,7 @@
{{- partial "stylesheet.html" . }} {{- partial "stylesheet.html" . }}
{{- partial "custom-header.html" . }} {{- partial "custom-header.html" . }}
</head> </head>
<body data-url="{{ .RelPermalink }}"> <body class="mobile-support" data-url="{{ .RelPermalink }}">
<div id="body" class="default-animation"> <div id="body" class="default-animation">
<div id="sidebar-overlay"></div> <div id="sidebar-overlay"></div>
<div id="toc-overlay"></div> <div id="toc-overlay"></div>

View file

@ -99,7 +99,7 @@ th {
} }
.default-animation{ .default-animation{
transition: all 0.5s ease; transition: all 0.35s ease;
} }
#sidebar { #sidebar {

View file

@ -1,6 +1,9 @@
var isIE = /*@cc_on!@*/false || !!document.documentMode; var isIE = /*@cc_on!@*/false || !!document.documentMode;
if( !isIE ){ if( isIE ){
// we don't support sidebar flyout in IE // we don't support sidebar flyout in IE
document.querySelector( 'body' ).classList.remove( 'mobile-support' );
}
else{
document.querySelector( 'body' ).classList.add( 'mobile-support' ); document.querySelector( 'body' ).classList.add( 'mobile-support' );
} }
var touchsupport = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0) var touchsupport = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)