Skip to content

Commit 1ed0684

Browse files
committed
add mobile version of website
1 parent ac35100 commit 1ed0684

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

index.html

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
html {
1818
font-size: 10px;
19+
height: 100vh;
1920
overflow: hidden;
21+
width: 100vw;
2022
}
2123

2224
body {
@@ -25,10 +27,7 @@
2527
font-size: 1.1em;
2628
height: 100%;
2729
justify-content: center;
28-
left: 0;
2930
margin: 0;
30-
position: absolute;
31-
top: 0;
3231
width: 100%;
3332
}
3433

@@ -44,9 +43,8 @@
4443
margin: 0 auto;
4544
}
4645

47-
#blob {
48-
display: inline-block;
49-
vertical-align: middle;
46+
#mobile-blob {
47+
display: none;
5048
}
5149

5250
.options-container {
@@ -75,9 +73,18 @@
7573
text-align: center;
7674
}
7775

78-
@media (max-width: 320px) {
79-
#blob {
76+
@media (max-width: 1000px) {
77+
body {
78+
align-items: center;
79+
}
80+
81+
#mobile-blob {
8082
display: block;
83+
padding-top: 20vh;
84+
}
85+
86+
#blob, .options-container, #error {
87+
display: none;
8188
}
8289
}
8390

@@ -90,6 +97,7 @@
9097
</header>
9198

9299
<main>
100+
<div id="mobile-blob" onclick="refreshMobile()"></div>
93101
<div id="blob"></div>
94102
<div class="options-container">
95103
<div class="edit-me">
@@ -100,6 +108,23 @@
100108
</main>
101109
<div id="error">&nbsp;</div>
102110

111+
<!-- Generate random blob for mobile users. -->
112+
<script>
113+
var mobileElem = document.getElementById("mobile-blob");
114+
115+
function refreshMobile() {
116+
if (!mobileElem) return;
117+
118+
mobileElem.innerHTML = blobs({
119+
color: "#ec576b",
120+
complexity: 0.3,
121+
contrast: 0.6,
122+
size: 300,
123+
});
124+
}
125+
126+
refreshMobile();
127+
</script>
103128

104129
<!-- Regenerate the blob from current options. -->
105130
<script>

0 commit comments

Comments
 (0)