Skip to content

Commit a26f1ec

Browse files
authored
Update v1.1.0 (#17)
Features - Add `404` page Changes - Refactor main buttons - Update background effect - Update website metadata - Remove preview from README Fixes - Fix wrong swagger url - Fix wrong scrollbar color
1 parent abaa983 commit a26f1ec

File tree

8 files changed

+70
-65
lines changed

8 files changed

+70
-65
lines changed

README.md

-20
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ This repository contains the source code required to build the [HawAPI](https://
88
- [Dependencies](#dependencies)
99
- [Setup](#usage)
1010
- [Scripts](#scripts)
11-
- [Preview](#preview)
1211
- [Contributing](#contributing)
1312
- [License](#license)
1413

@@ -76,25 +75,6 @@ All scripts are run from the root of the project, from a terminal:
7675
| `yarn build-all` | Build all production site to `./build/` |
7776
| `yarn clean` | Remove `./build/` |
7877

79-
> **Note** \
80-
> See [docs](https://github.com/HawAPI/docs) to check all docs scripts.
81-
82-
## Preview
83-
84-
<details>
85-
<summary>Home</summary>
86-
87-
![Home](./assets/preview-home-min.png)
88-
89-
</details>
90-
91-
<details>
92-
<summary>Try it</summary>
93-
94-
![Try it](./assets/preview-try-it-min.png)
95-
96-
</details>
97-
9878
## Contributing
9979

10080
You could help continuing its development by:

assets/preview-home-min.png

-72.2 KB
Binary file not shown.

assets/preview-try-it-min.png

-80.6 KB
Binary file not shown.

src/components/core/BackgroundEffect.astro

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
border-right: 32rem solid transparent;
1212
border-top: 70rem solid red;
1313
filter: blur(120px);
14+
top: 0;
1415
opacity: 0.15;
15-
position: fixed;
16+
position: absolute;
1617
pointer-events: none;
1718
}
1819
</style>

src/components/layouts/Layout.astro

+34-9
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const {
1818
description = 'A Free and Open Source API for Stranger Things.',
1919
tags = 'stranger things, stranger, things, stranger-things, st1, st2, st3, st4, api, github, git, hawapi, haw api, haw-api, HawAPI/HawAPI, theproject id, theproject.id, hawapi.theproject.id, netflix, watch, rest, free, open source',
2020
author = 'LucJosin',
21-
banner = '/images/banner.png',
22-
icon = '/favicon.ico',
21+
banner = Astro.url + 'images/banner.png',
22+
icon = Astro.url + 'favicon.ico',
2323
} = Astro.props as Props;
2424
---
2525

@@ -40,9 +40,8 @@ const {
4040
<meta name="robots" content="index,follow" />
4141

4242
<!-- Twitter -->
43-
<meta name="twitter:card" content="summary" />
44-
<meta name="twitter:creator" content={author} />
45-
<meta name="twitter:site" content={Astro.url} />
43+
<meta name="twitter:card" content="summary_large_image" />
44+
<meta name="twitter:site" content={'@' + author} />
4645
<meta name="twitter:domain" content={Astro.url} />
4746
<meta name="twitter:title" content={title + ' | ' + project} />
4847
<meta
@@ -59,7 +58,7 @@ const {
5958

6059
<!-- Open Graph -->
6160
<meta property="og:url" content={Astro.url} />
62-
<meta property="og:title" content={title} />
61+
<meta property="og:title" content={title + ' | ' + project} />
6362
<meta property="og:site_name" content={project} />
6463
<meta property="og:description" content={description} />
6564
<meta property="og:type" content="website" />
@@ -171,7 +170,6 @@ const {
171170

172171
:global(body) {
173172
margin: 0;
174-
overflow: hidden;
175173
}
176174

177175
:global(main) {
@@ -181,7 +179,6 @@ const {
181179
flex-direction: column;
182180
align-items: center;
183181
justify-content: center;
184-
overflow: hidden;
185182
}
186183

187184
:global(a) {
@@ -214,7 +211,35 @@ const {
214211
}
215212

216213
:global(::-webkit-scrollbar-thumb) {
217-
background-color: #fff;
214+
background-color: var(--secondary-color);
215+
}
216+
217+
:global(.btn) {
218+
display: flex;
219+
height: 2.5rem;
220+
width: 8rem;
221+
border: none;
222+
border-radius: 5px;
223+
align-items: center;
224+
justify-content: center;
225+
transition: all 0.5s;
226+
border: 1px solid transparent;
227+
}
228+
229+
:global(.btn-full) {
230+
background-color: rgb(179, 2, 2);
231+
color: white;
232+
}
233+
234+
:global(.btn-full:hover) {
235+
background-color: rgb(100, 2, 2);
236+
color: white;
237+
}
238+
239+
:global(.btn-border) {
240+
border: 1px solid rgb(179, 2, 2);
241+
background-color: transparent;
242+
color: white;
218243
}
219244

220245
@media (max-width: 1340px) {

src/pages/404.astro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
import BackgroundEffect from '@components/core/BackgroundEffect.astro';
3+
import Layout from '@components/layouts/Layout.astro';
4+
---
5+
6+
<Layout title="404">
7+
<main>
8+
<BackgroundEffect />
9+
<h1 class="sw-effect-title">404</h1>
10+
<p class="error-sub-title">This page could not be found.</p>
11+
<a href="/" class="btn btn-full">Go Back</a>
12+
</main>
13+
</Layout>
14+
15+
<style>
16+
body {
17+
overflow: hidden;
18+
}
19+
20+
.error-sub-title {
21+
font-size: 1.1em;
22+
margin: 0 0 1.2em 0;
23+
text-align: center;
24+
}
25+
</style>

src/pages/index.astro

+7-32
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import Layout from '@components/layouts/Layout.astro';
55

66
<script
77
is:inline
8-
src="https://cdn.statically.io/libs/typed.js/2.0.11/typed.min.js"
9-
></script>
8+
src="https://cdn.statically.io/libs/typed.js/2.0.11/typed.min.js"></script>
109

1110
<Layout title="Home">
1211
<main>
@@ -27,13 +26,17 @@ import Layout from '@components/layouts/Layout.astro';
2726
</p>
2827

2928
<div class="home-btns">
30-
<a href="/docs/" class="hm-btn hm-btn-1">Docs</a>
31-
<a href="/try-it/" class="hm-btn hm-btn-2">Try it</a>
29+
<a href="/docs/" class="btn btn-full">Docs</a>
30+
<a href="/try-it/" class="btn btn-border">Try it</a>
3231
</div>
3332
</main>
3433
</Layout>
3534

3635
<style>
36+
body {
37+
overflow: hidden;
38+
}
39+
3740
.home-sub-title {
3841
font-size: 1.1em;
3942
margin: 0 0 1.2em 0;
@@ -50,34 +53,6 @@ import Layout from '@components/layouts/Layout.astro';
5053
font-family: Benguiat !important;
5154
white-space: normal;
5255
}
53-
54-
.hm-btn {
55-
display: flex;
56-
height: 2.5rem;
57-
width: 8rem;
58-
border: none;
59-
border-radius: 5px;
60-
align-items: center;
61-
justify-content: center;
62-
transition: all 0.5s;
63-
border: 1px solid transparent;
64-
}
65-
66-
.hm-btn {
67-
background-color: rgb(179, 2, 2);
68-
color: white;
69-
}
70-
71-
.hm-btn-1:hover {
72-
background-color: rgb(100, 2, 2);
73-
color: white;
74-
}
75-
76-
.hm-btn-2 {
77-
border: 1px solid rgb(179, 2, 2);
78-
background-color: transparent;
79-
color: white;
80-
}
8156
</style>
8257

8358
<script is:inline>

src/pages/try-it/index.astro

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ import Layout from '@components/layouts/Layout.astro';
3232

3333
<script
3434
is:inline
35-
src="https://unpkg.com/swagger-ui-dist@4.19.0/swagger-ui-bundle.js"
36-
></script>
35+
src="https://unpkg.com/swagger-ui-dist@4.19.0/swagger-ui-bundle.js"></script>
3736
<script
3837
is:inline
3938
src="https://unpkg.com/swagger-ui-dist@4.19.0/swagger-ui-standalone-preset.js"
@@ -42,7 +41,7 @@ import Layout from '@components/layouts/Layout.astro';
4241
window.onload = function () {
4342
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4443
const ui = SwaggerUIBundle({
45-
url: 'http://localhost:8080/v3/api-docs',
44+
url: 'https://hawapi.theproject.id/v3/api-docs',
4645
dom_id: '#swagger-ui',
4746
deepLinking: true,
4847
tagsSorter: 'alpha',

0 commit comments

Comments
 (0)