Tags: Mobile edit Mobile web edit |
|
| (8 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| /* FORCE DESKTOP MODE ON MOBILE */ | | /* Standard Miraheze Font Loader */ |
| if ( window.location.href.indexOf('mobileaction=toggle_view_mobile') === -1 &&
| |
| window.location.href.indexOf('mobileaction=toggle_view_desktop') === -1 &&
| |
| /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
| |
|
| |
| var url = new URL(window.location.href);
| |
| url.searchParams.set('mobileaction', 'toggle_view_desktop');
| |
| window.location.href = url.href;
| |
| }
| |
| | |
| /* FORCE DESKTOP SCALE */
| |
| (function() { | | (function() { |
| var meta = document.createElement('meta'); | | $('head').append('<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Crimson+Pro:wght@400;700&display=swap">'); |
| meta.name = "viewport";
| |
| meta.content = "width=1200, initial-scale=0.3, maximum-scale=1.0";
| |
| document.getElementsByTagName('head')[0].appendChild(meta);
| |
| })(); | | })(); |
|
| |
| /* Adjust Viewport for Mobile but stay in Mobile Mode */
| |
| if (window.innerWidth < 1200) {
| |
| $('meta[name="viewport"]').remove();
| |
| $('head').append('<meta name="viewport" content="width=1200, initial-scale=0.3, user-scalable=yes">');
| |
| }
| |
|
| |
| /* Zoom out on Mobile to fit the Desktop width */
| |
| if (window.innerWidth < 1200) {
| |
| var viewportMeta = document.querySelector('meta[name="viewport"]');
| |
| if (viewportMeta) {
| |
| viewportMeta.setAttribute('content', 'width=1200, initial-scale=0.3');
| |
| }
| |
| }
| |
/* Standard Miraheze Font Loader */
(function() {
$('head').append('<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Crimson+Pro:wght@400;700&display=swap">');
})();