Skip to content

Commit 85e5486

Browse files
committed
wasm/notebook, responsive layout on mobile
1 parent 22fa80e commit 85e5486

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

wasm/notebook/src/index.ejs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313

1414
<div class="d-flex">
15-
<div class="header item-center">RustPython 🐍 😱 🤘</div>
15+
<div class="header md-flex-grow text-center">RustPython 🐍 😱 🤘</div>
1616
<div>
1717
<a target="_blank" class="d-md-none mr-px-5 text-black" href="https://github.com/RustPython/RustPython/tree/master/wasm/notebook">how this works</a>
1818
<a target="_blank" class="text-black" href="https://github.com/RustPython/"> github</a>
@@ -21,26 +21,28 @@
2121

2222
<!-- navigation bar -->
2323
<div class="nav-bar mt-px-5">
24-
<div class="nav-bar-links d-flex d-flex-space-between">
25-
<div class="d-flex">
26-
<a href="#" id="run-btn" class="bg-orange text-white mr-px-5">run &#9658; </a>
27-
<ul class="list-inline" id="buffers-list"></ul>
28-
<a href="#" id="new-tab" class="bg-light mr-px-5 text-black">new tab</a>
29-
<a href="#popup" id="import-code" class="bg-light mr-px-5 text-black">import code</a>
24+
<div class="nav-bar-links d-flex d-flex-space-between d-sm-flex-direction-column">
25+
<div class="d-flex d-sm-flex-direction-column ">
26+
<a href="#" id="run-btn" class="bg-orange mr-px-5 text-white">run &#9658; </a>
27+
<ul class="list-inline sm-mt-5px" id="buffers-list"></ul>
28+
<ul class="list-inline sm-mt-5px">
29+
<li class="bg-light mr-px-5"> <a href="#" class="text-black" id="new-tab">new tab</a></li>
30+
<li class="bg-light mr-px-5"><a href="#popup" class="text-black" id="import-code">import code</a></li>
31+
</ul>
3032
</div>
31-
32-
<div class="nav-bar-links d-flex">
33-
<a href="#" id="split-view" class="d-md-none bg-light mr-px-5 text-black">split view</a>
34-
<a href="#" id="default-view" class="bg-light mr-px-5 text-black">default view</a>
35-
<a href="#" id="reader-view" class="bg-light text-black">reader view</a>
33+
<div class="nav-bar-links d-flex sm-mt-5px">
34+
<ul class="list-inline ">
35+
<li class="d-md-none bg-light"><a href="#" id="split-view" class="mr-px-5 text-black">split view</a></li>
36+
<li class="d-md-none bg-light"><a href="#" id="default-view" class="mr-px-5 text-black">default view</a></li>
37+
<li class="d-md-none bg-light"><a href="#" id="reader-view" class="text-black">reader view</a></li>
38+
</ul>
3639
</div>
37-
3840
</div>
3941
</div>
4042

4143
<!-- code editor and output display -->
4244
<!-- split view -->
43-
<div class="split-view full-height">
45+
<div class="split-view full-height d-sm-flex-direction-column ">
4446
<div id="primary-editor"></div>
4547
<div id="secondary-editor" class="d-none">
4648
<select class="item-right" id="buffers-selection"></select>

wasm/notebook/src/style.css

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ h6 {
5959
color: #fff;
6060
}
6161

62-
.item-center {
62+
.flex-grow {
6363
flex-grow: 1;
64-
text-align: center;
6564
}
6665

6766
.item-right {
@@ -74,6 +73,10 @@ h6 {
7473
text-align: right;
7574
}
7675

76+
.text-center {
77+
text-align: center;
78+
}
79+
7780
.text-black {
7881
color: #1f2430;
7982
}
@@ -241,6 +244,13 @@ input[type='url'] {
241244
overflow: auto;
242245
}
243246

247+
@media screen and (min-width: 768px) {
248+
.md-flex-grow {
249+
flex-grow: 1;
250+
}
251+
252+
}
253+
244254
@media screen and (max-width: 768px) {
245255
.box {
246256
width: 70%;
@@ -254,4 +264,15 @@ input[type='url'] {
254264
display: none;
255265
}
256266

267+
.d-sm-flex-direction-column {
268+
flex-direction: column;
269+
}
270+
271+
.sm-mt-5px {
272+
margin-top: 5px !important;
273+
}
274+
275+
#run-btn {
276+
width: 45px;
277+
}
257278
}

0 commit comments

Comments
 (0)