Skip to content

Commit 677346c

Browse files
committed
feat: show download successful message
1 parent c7642df commit 677346c

File tree

6 files changed

+89
-30
lines changed

6 files changed

+89
-30
lines changed

src/components/IconDiscord.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<svg width="20" height="20" viewBox="0 0 448 512">
2+
<svg width="1.4em" height="1.4em" viewBox="0 0 448 512" class="icons">
33
<path
44
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"
55
fill="currentColor"

src/components/IconDownload.vue

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
<template>
22
<svg
33
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"
4+
width="1.4em"
5+
height="1.4em"
6+
viewBox="0 0 24 24"
7+
fill="none"
8+
stroke="currentColor"
9+
stroke-width="2"
10+
stroke-linecap="round"
11+
stroke-linejoin="round"
12+
class="icons feather feather-download"
1213
>
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>
14+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
15+
<polyline points="7 10 12 15 17 10"></polyline>
16+
<line x1="12" y1="15" x2="12" y2="3"></line>
2517
</svg>
2618
</template>

src/components/IconGitHub.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<svg width="20" height="20" viewBox="0 0 496 512">
2+
<svg width="1.4em" height="1.4em" viewBox="0 0 496 512" class="icons">
33
<path
44
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"
55
fill="currentColor"

src/components/IconTwitter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<svg width="20" height="20" viewBox="0 0 512 512">
2+
<svg width="1.4em" height="1.4em" viewBox="0 0 512 512" class="icons">
33
<path
44
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"
55
fill="currentColor"

src/components/NavBar.vue

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
class="download-button"
1919
title="Download the generated code as a zip file"
2020
>
21-
Download
2221
<IconDownload />
22+
<span class="icon-text">Download</span>
2323
</button>
2424
<a
2525
class="external-links"
@@ -28,6 +28,7 @@
2828
rel="noopener noreferrer"
2929
>
3030
<IconGitHub />
31+
<span class="icon-text">GitHub</span>
3132
</a>
3233
<a
3334
class="external-links"
@@ -36,6 +37,7 @@
3637
rel="noopener noreferrer"
3738
>
3839
<IconTwitter />
40+
<span class="icon-text">Twitter</span>
3941
</a>
4042
<a
4143
class="external-links"
@@ -44,8 +46,31 @@
4446
rel="noopener noreferrer"
4547
>
4648
<IconDiscord />
49+
<span class="icon-text">Discord</span>
4750
</a>
4851
</div>
52+
<div
53+
class="download-success"
54+
v-show="showDownloadMsg"
55+
@click="showDownloadMsg = false"
56+
>
57+
<div class="msg-wrapper">
58+
<div class="msg">
59+
<h2>🎉 Your Training Script Generated! 🎉</h2>
60+
<p>
61+
Thanks for using Code-Generator! Feel free to reach out to us on
62+
<a
63+
class="external-links msg-gh"
64+
href="https://github.com/pytorch-ignite/code-generator"
65+
target="_blank"
66+
rel="noopener noreferrer"
67+
>
68+
GitHub </a
69+
>with any feedback, bug report, and feature request.
70+
</p>
71+
</div>
72+
</div>
73+
</div>
4974
</nav>
5075
</template>
5176

@@ -58,11 +83,13 @@ import IconDiscord from './IconDiscord.vue'
5883
import IconDownload from './IconDownload.vue'
5984
import IconGitHub from './IconGitHub.vue'
6085
import IconTwitter from './IconTwitter.vue'
86+
import { ref } from 'vue'
6187
6288
export default {
6389
components: { IconDiscord, IconDownload, IconGitHub, IconTwitter },
6490
setup() {
6591
let zip = new JSZip()
92+
const showDownloadMsg = ref(false)
6693
6794
const downloadProject = () => {
6895
for (const filename in store.code) {
@@ -71,9 +98,10 @@ export default {
7198
zip.generateAsync({ type: 'blob' }).then((content) => {
7299
saveAs(content, 'ignite-project.zip')
73100
})
101+
showDownloadMsg.value = true
74102
}
75103
76-
return { version, downloadProject }
104+
return { version, downloadProject, showDownloadMsg }
77105
}
78106
}
79107
</script>
@@ -95,6 +123,10 @@ h1 img {
95123
.external-links {
96124
margin: 0 0.5rem;
97125
font-size: var(--font-size);
126+
border-bottom: 2px solid transparent;
127+
}
128+
.external-links:hover {
129+
border-bottom: 2px solid var(--c-brand-red);
98130
}
99131
.nav-bar {
100132
display: flex;
@@ -123,11 +155,43 @@ h1 img {
123155
cursor: pointer;
124156
font-family: var(--font-family-base);
125157
font-size: var(--font-size);
158+
padding-top: 0;
159+
padding-bottom: 0;
126160
}
127-
.iconify {
161+
.icons {
128162
vertical-align: middle;
129163
position: relative;
130-
top: -3px;
164+
top: -1px;
165+
}
166+
.download-success {
167+
position: fixed;
168+
top: 0;
169+
left: 0;
170+
background-color: rgba(101, 110, 133, 0.8);
171+
z-index: 10;
172+
width: 100vw;
173+
height: 100vh;
174+
}
175+
.msg-wrapper {
176+
display: block;
177+
max-width: 38rem;
178+
margin: 20vh auto 0;
179+
text-align: center;
180+
padding: 0 1rem;
181+
}
182+
.msg {
183+
padding: 2rem 1rem;
184+
background-color: var(--c-white-light);
185+
color: var(--c-text);
186+
border-radius: 8px;
187+
box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.33);
188+
}
189+
.msg-gh {
190+
margin: 0;
191+
color: var(--c-brand-red);
192+
}
193+
.icon-text {
194+
margin-left: 0.5rem;
131195
}
132196
/* media queries */
133197
@media (max-width: 768px) {
@@ -137,9 +201,12 @@ h1 img {
137201
}
138202
.nav-bar {
139203
position: fixed;
140-
z-index: 11;
204+
z-index: 6;
141205
width: 100%;
142206
background-color: var(--c-white);
143207
}
208+
.icon-text {
209+
display: none;
210+
}
144211
}
145212
</style>

src/components/PaneSplit.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ export default {
148148
border-radius: 2px;
149149
width: 2rem;
150150
height: 2rem;
151-
z-index: 99999;
151+
z-index: 6;
152152
}
153153
.left {
154154
position: fixed;
155155
transform: translateX(-100%);
156156
transition: transform 0.25s ease-in;
157-
z-index: 10;
157+
z-index: 5;
158158
background-color: var(--c-white);
159159
top: 0;
160160
bottom: 0;

0 commit comments

Comments
 (0)