Skip to content

Commit b7965a1

Browse files
authored
Third attempt to fix sizes on mobile device
1 parent ddf632b commit b7965a1

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/_templates/default.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<html>
33
<head>
4-
<meta name="viewport" content="width=980">
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
55
<meta charset="UTF-8">
66
<base href="&baseurl&"/>
77
<title>&title& - E-Maxx Algorithms</title>
@@ -23,14 +23,29 @@
2323
<meta name="google-site-verification" content="qSnbeMPNVgZ3kIpGVsPIAPIvEdwYSg583kPdwgJtFO8" />
2424
<meta name="yandex-verification" content="dac3ebdbebe78eec" />
2525
<style>
26-
body { font-size: 28px; }
26+
body { font-size: 34px; }
2727
@media only screen and (min-device-width: 400px) {
28-
body { font-size: 20px; }
28+
body { font-size: 24px; }
2929
}
3030
@media only screen and (min-device-width: 600px) {
3131
body { font-size: 14px; }
3232
}
3333
</style>
34+
<script>
35+
window.onresize = function(){
36+
var w0 = 980;
37+
var w1 = $(window).width();
38+
if (w1 < w0) {
39+
var zoom = Math.floor(w1 * 100 / w0);
40+
document.body.style.zoom = "" + zoom + "%";
41+
} else {
42+
document.body.style.zoom = "";
43+
}
44+
};
45+
$(function() {
46+
setTimeout(window.onresize, 350);
47+
});
48+
</script>
3449
</head>
3550
<body>
3651
<div id="container">

0 commit comments

Comments
 (0)