Skip to content

feat: make app looks good on mobile #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/CodeBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,10 @@ div[class~='language-bash']::before {
div[class~='language-yaml']::before {
content: 'yaml';
}
/* media queries */
@media (max-width: 768px) {
.code-block-wrapper {
height: 100%;
}
}
</style>
8 changes: 8 additions & 0 deletions src/components/IconDiscord.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<svg width="20" height="20" viewBox="0 0 448 512">
<path
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"
fill="currentColor"
></path>
</svg>
</template>
26 changes: 26 additions & 0 deletions src/components/IconDownload.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
class="iconify download iconify--system-uicons"
width="20"
height="20"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 21 21"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6.5 10.5l4 4.232l4-4.191"></path>
<path d="M10.5 3.5v11"></path>
<path d="M4.5 17.5h12"></path>
</g>
</svg>
</template>
8 changes: 8 additions & 0 deletions src/components/IconGitHub.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<svg width="20" height="20" viewBox="0 0 496 512">
<path
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"
fill="currentColor"
></path>
</svg>
</template>
8 changes: 8 additions & 0 deletions src/components/IconTwitter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<svg width="20" height="20" viewBox="0 0 512 512">
<path
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"
fill="currentColor"
></path>
</svg>
</template>
132 changes: 18 additions & 114 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
width="50"
height="50"
/>
<span>Code Generator</span>
<span class="pname">Code Generator</span>
<small class="version">v{{ version }}</small>
</a>
</h1>
Expand All @@ -19,132 +19,31 @@
title="Download the generated code as a zip file"
>
Download
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
class="iconify download iconify--system-uicons"
width="20"
height="20"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 21 21"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6.5 10.5l4 4.232l4-4.191"></path>
<path d="M10.5 3.5v11"></path>
<path d="M4.5 17.5h12"></path>
</g>
</svg>
<IconDownload />
</button>
<a
class="external-links"
href="https://github.com/pytorch-ignite/code-generator"
target="_blank"
rel="noopener noreferrer"
>
GitHub
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
class="iconify iconify--system-uicons"
width="15"
height="15"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 21 21"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18.5 8.5v-5h-5"></path>
<path d="M18.5 3.5l-7 7"></path>
<path
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"
></path>
</g>
</svg>
<IconGitHub />
</a>
<a
class="external-links"
href="https://twitter.com/pytorch_ignite"
target="_blank"
rel="noopener noreferrer"
>
Twitter
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
class="iconify iconify--system-uicons"
width="15"
height="15"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 21 21"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18.5 8.5v-5h-5"></path>
<path d="M18.5 3.5l-7 7"></path>
<path
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"
></path>
</g>
</svg>
<IconTwitter />
</a>
<a
class="external-links"
href="https://discord.gg/djZtm3EmKj"
target="_blank"
rel="noopener noreferrer"
>
Discord
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
class="iconify iconify--system-uicons"
width="15"
height="15"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 21 21"
>
<g
fill="none"
fill-rule="evenodd"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18.5 8.5v-5h-5"></path>
<path d="M18.5 3.5l-7 7"></path>
<path
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"
></path>
</g>
</svg>
<IconDiscord />
</a>
</div>
</nav>
Expand All @@ -155,8 +54,13 @@ import { version } from '../../package.json'
import { store } from '../store'
import { saveAs } from 'file-saver'
import JSZip from 'jszip'
import IconDiscord from './IconDiscord.vue'
import IconDownload from './IconDownload.vue'
import IconGitHub from './IconGitHub.vue'
import IconTwitter from './IconTwitter.vue'

export default {
components: { IconDiscord, IconDownload, IconGitHub, IconTwitter },
setup() {
let zip = new JSZip()

Expand Down Expand Up @@ -189,12 +93,8 @@ h1 img {
top: -5px;
}
.external-links {
margin: 0.25rem;
margin: 0 0.5rem;
font-size: var(--font-size);
border-bottom: 2px solid transparent;
}
.external-links:hover {
border-bottom: 2px solid var(--c-brand-red);
}
.nav-bar {
display: flex;
Expand Down Expand Up @@ -227,9 +127,13 @@ h1 img {
.iconify {
vertical-align: middle;
position: relative;
top: -2px;
}
.iconify.download {
top: -3px;
}
/* media queries */
@media (max-width: 768px) {
.pname,
.version {
display: none;
}
}
</style>
14 changes: 13 additions & 1 deletion src/components/PaneLeft.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ export default {

<style scoped>
.left-pane-tabs {
display: flex;
flex-direction: row;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
border-bottom: 1px solid var(--c-white-dark);
}
.left-pane-tabs,
.left-pane-contexts {
padding-left: 1.5rem;
}
.left-pane-tab {
display: inline-block;
background-color: var(--c-white);
cursor: pointer;
color: var(--c-text);
Expand All @@ -68,4 +72,12 @@ export default {
height: 100vh;
overflow: auto;
}
/* media queries */
@media (max-width: 768px) {
.left-pane-contexts {
height: 100%;
padding: 0;
margin-bottom: 1rem;
}
}
</style>
13 changes: 12 additions & 1 deletion src/components/PaneRight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ export default {

<style scoped>
.right-pane-tabs {
display: flex;
flex-direction: row;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
border-bottom: 1px solid var(--c-white-dark);
}
.right-pane-tabs,
.right-pane-contexts {
padding-right: 1.5rem;
}
.right-pane-tab {
display: inline-block;
background-color: var(--c-white);
cursor: pointer;
color: var(--c-text);
Expand All @@ -63,4 +67,11 @@ export default {
color: var(--c-brand-red);
border-bottom-color: var(--c-brand-red);
}
/* media queries */
@media (max-width: 768px) {
.right-pane-contexts {
height: 100%;
padding: 0;
}
}
</style>
13 changes: 13 additions & 0 deletions src/components/PaneSplit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,17 @@ export default {
width: 10px;
cursor: ew-resize;
}
/* media queries */
@media (max-width: 768px) {
.split-pane {
flex-wrap: wrap;
}
.left,
.right {
width: 100% !important;
}
.split-line {
display: none;
}
}
</style>