Skip to content

Commit 6fe04bc

Browse files
committed
feat: make app looks good on mobile (#105)
* feat: make app looks good on mobile * chore: format
1 parent 7fa2e5b commit 6fe04bc

9 files changed

+112
-116
lines changed

src/components/CodeBlock.vue

+6
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,10 @@ div[class~='language-bash']::before {
140140
div[class~='language-yaml']::before {
141141
content: 'yaml';
142142
}
143+
/* media queries */
144+
@media (max-width: 768px) {
145+
.code-block-wrapper {
146+
height: 100%;
147+
}
148+
}
143149
</style>

src/components/IconDiscord.vue

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<svg width="20" height="20" viewBox="0 0 448 512">
3+
<path
4+
d="M297.216 243.2c0 15.616-11.52 28.416-26.112 28.416c-14.336 0-26.112-12.8-26.112-28.416s11.52-28.416 26.112-28.416c14.592 0 26.112 12.8 26.112 28.416zm-119.552-28.416c-14.592 0-26.112 12.8-26.112 28.416s11.776 28.416 26.112 28.416c14.592 0 26.112-12.8 26.112-28.416c.256-15.616-11.52-28.416-26.112-28.416zM448 52.736V512c-64.494-56.994-43.868-38.128-118.784-107.776l13.568 47.36H52.48C23.552 451.584 0 428.032 0 398.848V52.736C0 23.552 23.552 0 52.48 0h343.04C424.448 0 448 23.552 448 52.736zm-72.96 242.688c0-82.432-36.864-149.248-36.864-149.248c-36.864-27.648-71.936-26.88-71.936-26.88l-3.584 4.096c43.52 13.312 63.744 32.512 63.744 32.512c-60.811-33.329-132.244-33.335-191.232-7.424c-9.472 4.352-15.104 7.424-15.104 7.424s21.248-20.224 67.328-33.536l-2.56-3.072s-35.072-.768-71.936 26.88c0 0-36.864 66.816-36.864 149.248c0 0 21.504 37.12 78.08 38.912c0 0 9.472-11.52 17.152-21.248c-32.512-9.728-44.8-30.208-44.8-30.208c3.766 2.636 9.976 6.053 10.496 6.4c43.21 24.198 104.588 32.126 159.744 8.96c8.96-3.328 18.944-8.192 29.44-15.104c0 0-12.8 20.992-46.336 30.464c7.68 9.728 16.896 20.736 16.896 20.736c56.576-1.792 78.336-38.912 78.336-38.912z"
5+
fill="currentColor"
6+
></path>
7+
</svg>
8+
</template>

src/components/IconDownload.vue

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
xmlns:xlink="http://www.w3.org/1999/xlink"
5+
aria-hidden="true"
6+
role="img"
7+
class="iconify download iconify--system-uicons"
8+
width="20"
9+
height="20"
10+
preserveAspectRatio="xMidYMid meet"
11+
viewBox="0 0 21 21"
12+
>
13+
<g
14+
fill="none"
15+
fill-rule="evenodd"
16+
stroke="currentColor"
17+
stroke-width="1.5"
18+
stroke-linecap="round"
19+
stroke-linejoin="round"
20+
>
21+
<path d="M6.5 10.5l4 4.232l4-4.191"></path>
22+
<path d="M10.5 3.5v11"></path>
23+
<path d="M4.5 17.5h12"></path>
24+
</g>
25+
</svg>
26+
</template>

src/components/IconGitHub.vue

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<svg width="20" height="20" viewBox="0 0 496 512">
3+
<path
4+
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9c1.6 2.3 4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2z"
5+
fill="currentColor"
6+
></path>
7+
</svg>
8+
</template>

src/components/IconTwitter.vue

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<svg width="20" height="20" viewBox="0 0 512 512">
3+
<path
4+
d="M459.37 151.716c.325 4.548.325 9.097.325 13.645c0 138.72-105.583 298.558-298.558 298.558c-59.452 0-114.68-17.219-161.137-47.106c8.447.974 16.568 1.299 25.34 1.299c49.055 0 94.213-16.568 130.274-44.832c-46.132-.975-84.792-31.188-98.112-72.772c6.498.974 12.995 1.624 19.818 1.624c9.421 0 18.843-1.3 27.614-3.573c-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319c-28.264-18.843-46.781-51.005-46.781-87.391c0-19.492 5.197-37.36 14.294-52.954c51.655 63.675 129.3 105.258 216.365 109.807c-1.624-7.797-2.599-15.918-2.599-24.04c0-57.828 46.782-104.934 104.934-104.934c30.213 0 57.502 12.67 76.67 33.137c23.715-4.548 46.456-13.32 66.599-25.34c-7.798 24.366-24.366 44.833-46.132 57.827c21.117-2.273 41.584-8.122 60.426-16.243c-14.292 20.791-32.161 39.308-52.628 54.253z"
5+
fill="currentColor"
6+
></path>
7+
</svg>
8+
</template>

src/components/NavBar.vue

+18-114
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
width="50"
99
height="50"
1010
/>
11-
<span>Code Generator</span>
11+
<span class="pname">Code Generator</span>
1212
<small class="version">v{{ version }}</small>
1313
</a>
1414
</h1>
@@ -19,132 +19,31 @@
1919
title="Download the generated code as a zip file"
2020
>
2121
Download
22-
<svg
23-
xmlns="http://www.w3.org/2000/svg"
24-
xmlns:xlink="http://www.w3.org/1999/xlink"
25-
aria-hidden="true"
26-
role="img"
27-
class="iconify download iconify--system-uicons"
28-
width="20"
29-
height="20"
30-
preserveAspectRatio="xMidYMid meet"
31-
viewBox="0 0 21 21"
32-
>
33-
<g
34-
fill="none"
35-
fill-rule="evenodd"
36-
stroke="currentColor"
37-
stroke-width="1.5"
38-
stroke-linecap="round"
39-
stroke-linejoin="round"
40-
>
41-
<path d="M6.5 10.5l4 4.232l4-4.191"></path>
42-
<path d="M10.5 3.5v11"></path>
43-
<path d="M4.5 17.5h12"></path>
44-
</g>
45-
</svg>
22+
<IconDownload />
4623
</button>
4724
<a
4825
class="external-links"
4926
href="https://github.com/pytorch-ignite/code-generator"
5027
target="_blank"
5128
rel="noopener noreferrer"
5229
>
53-
GitHub
54-
<svg
55-
xmlns="http://www.w3.org/2000/svg"
56-
xmlns:xlink="http://www.w3.org/1999/xlink"
57-
aria-hidden="true"
58-
role="img"
59-
class="iconify iconify--system-uicons"
60-
width="15"
61-
height="15"
62-
preserveAspectRatio="xMidYMid meet"
63-
viewBox="0 0 21 21"
64-
>
65-
<g
66-
fill="none"
67-
fill-rule="evenodd"
68-
stroke="currentColor"
69-
stroke-width="2"
70-
stroke-linecap="round"
71-
stroke-linejoin="round"
72-
>
73-
<path d="M18.5 8.5v-5h-5"></path>
74-
<path d="M18.5 3.5l-7 7"></path>
75-
<path
76-
d="M10.5 3.5h-5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-4"
77-
></path>
78-
</g>
79-
</svg>
30+
<IconGitHub />
8031
</a>
8132
<a
8233
class="external-links"
8334
href="https://twitter.com/pytorch_ignite"
8435
target="_blank"
8536
rel="noopener noreferrer"
8637
>
87-
Twitter
88-
<svg
89-
xmlns="http://www.w3.org/2000/svg"
90-
xmlns:xlink="http://www.w3.org/1999/xlink"
91-
aria-hidden="true"
92-
role="img"
93-
class="iconify iconify--system-uicons"
94-
width="15"
95-
height="15"
96-
preserveAspectRatio="xMidYMid meet"
97-
viewBox="0 0 21 21"
98-
>
99-
<g
100-
fill="none"
101-
fill-rule="evenodd"
102-
stroke="currentColor"
103-
stroke-width="2"
104-
stroke-linecap="round"
105-
stroke-linejoin="round"
106-
>
107-
<path d="M18.5 8.5v-5h-5"></path>
108-
<path d="M18.5 3.5l-7 7"></path>
109-
<path
110-
d="M10.5 3.5h-5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-4"
111-
></path>
112-
</g>
113-
</svg>
38+
<IconTwitter />
11439
</a>
11540
<a
11641
class="external-links"
11742
href="https://discord.gg/djZtm3EmKj"
11843
target="_blank"
11944
rel="noopener noreferrer"
12045
>
121-
Discord
122-
<svg
123-
xmlns="http://www.w3.org/2000/svg"
124-
xmlns:xlink="http://www.w3.org/1999/xlink"
125-
aria-hidden="true"
126-
role="img"
127-
class="iconify iconify--system-uicons"
128-
width="15"
129-
height="15"
130-
preserveAspectRatio="xMidYMid meet"
131-
viewBox="0 0 21 21"
132-
>
133-
<g
134-
fill="none"
135-
fill-rule="evenodd"
136-
stroke="currentColor"
137-
stroke-width="2"
138-
stroke-linecap="round"
139-
stroke-linejoin="round"
140-
>
141-
<path d="M18.5 8.5v-5h-5"></path>
142-
<path d="M18.5 3.5l-7 7"></path>
143-
<path
144-
d="M10.5 3.5h-5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-4"
145-
></path>
146-
</g>
147-
</svg>
46+
<IconDiscord />
14847
</a>
14948
</div>
15049
</nav>
@@ -155,8 +54,13 @@ import { version } from '../../package.json'
15554
import { store } from '../store'
15655
import { saveAs } from 'file-saver'
15756
import JSZip from 'jszip'
57+
import IconDiscord from './IconDiscord.vue'
58+
import IconDownload from './IconDownload.vue'
59+
import IconGitHub from './IconGitHub.vue'
60+
import IconTwitter from './IconTwitter.vue'
15861
15962
export default {
63+
components: { IconDiscord, IconDownload, IconGitHub, IconTwitter },
16064
setup() {
16165
let zip = new JSZip()
16266
@@ -189,12 +93,8 @@ h1 img {
18993
top: -5px;
19094
}
19195
.external-links {
192-
margin: 0.25rem;
96+
margin: 0 0.5rem;
19397
font-size: var(--font-size);
194-
border-bottom: 2px solid transparent;
195-
}
196-
.external-links:hover {
197-
border-bottom: 2px solid var(--c-brand-red);
19898
}
19999
.nav-bar {
200100
display: flex;
@@ -227,9 +127,13 @@ h1 img {
227127
.iconify {
228128
vertical-align: middle;
229129
position: relative;
230-
top: -2px;
231-
}
232-
.iconify.download {
233130
top: -3px;
234131
}
132+
/* media queries */
133+
@media (max-width: 768px) {
134+
.pname,
135+
.version {
136+
display: none;
137+
}
138+
}
235139
</style>

src/components/PaneLeft.vue

+13-1
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ export default {
4242

4343
<style scoped>
4444
.left-pane-tabs {
45+
display: flex;
46+
flex-direction: row;
47+
overflow-x: auto;
48+
overflow-y: hidden;
49+
scrollbar-width: none;
4550
border-bottom: 1px solid var(--c-white-dark);
4651
}
4752
.left-pane-tabs,
4853
.left-pane-contexts {
4954
padding-left: 1.5rem;
5055
}
5156
.left-pane-tab {
52-
display: inline-block;
5357
background-color: var(--c-white);
5458
cursor: pointer;
5559
color: var(--c-text);
@@ -68,4 +72,12 @@ export default {
6872
height: 100vh;
6973
overflow: auto;
7074
}
75+
/* media queries */
76+
@media (max-width: 768px) {
77+
.left-pane-contexts {
78+
height: 100%;
79+
padding: 0;
80+
margin-bottom: 1rem;
81+
}
82+
}
7183
</style>

src/components/PaneRight.vue

+12-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ export default {
4141

4242
<style scoped>
4343
.right-pane-tabs {
44+
display: flex;
45+
flex-direction: row;
46+
overflow-x: auto;
47+
overflow-y: hidden;
48+
scrollbar-width: none;
4449
border-bottom: 1px solid var(--c-white-dark);
4550
}
4651
.right-pane-tabs,
4752
.right-pane-contexts {
4853
padding-right: 1.5rem;
4954
}
5055
.right-pane-tab {
51-
display: inline-block;
5256
background-color: var(--c-white);
5357
cursor: pointer;
5458
color: var(--c-text);
@@ -63,4 +67,11 @@ export default {
6367
color: var(--c-brand-red);
6468
border-bottom-color: var(--c-brand-red);
6569
}
70+
/* media queries */
71+
@media (max-width: 768px) {
72+
.right-pane-contexts {
73+
height: 100%;
74+
padding: 0;
75+
}
76+
}
6677
</style>

src/components/PaneSplit.vue

+13
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,17 @@ export default {
8484
width: 10px;
8585
cursor: ew-resize;
8686
}
87+
/* media queries */
88+
@media (max-width: 768px) {
89+
.split-pane {
90+
flex-wrap: wrap;
91+
}
92+
.left,
93+
.right {
94+
width: 100% !important;
95+
}
96+
.split-line {
97+
display: none;
98+
}
99+
}
87100
</style>

0 commit comments

Comments
 (0)