Skip to content

Commit f72540b

Browse files
committed
add background gradients (from mshr.app) and fix some small issues
1 parent 9eb3368 commit f72540b

8 files changed

Lines changed: 114 additions & 23 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ pnpm-debug.log*
2828
/dataSources/
2929
/dataSources.local.xml
3030
*.iml
31+
32+
.wrangler/

bun.lockb

0 Bytes
Binary file not shown.

src/components/Header.astro

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ import HeaderLink from "./HeaderLink.astro";
1414
<style>
1515
header {
1616
border-radius: 99999px;
17-
margin: 1rem;
18-
padding: 0 1.5em;
19-
background: white;
20-
border: 2px solid rgba(var(--black), 15%);
21-
box-shadow: 0 2px 8px rgba(var(--black), 5%);
17+
padding: 0.5em 2.5em;
2218
}
2319
h2 {
2420
margin: 0;

src/layouts/Blog.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
---
2+
import type { CollectionEntry } from "astro:content";
23
import BaseHead from "../components/BaseHead.astro";
34
import Header from "../components/Header.astro";
45
import Footer from "../components/Footer.astro";
56
import FormattedDate from "../components/FormattedDate.astro";
67
import Giscus from "../components/Giscus.astro";
78
9+
type Props = CollectionEntry<"blog">["data"];
10+
811
const { title, description, pubDate } = Astro.props;
912
---
1013

1114
<html lang="en">
12-
<!--suppress HtmlRequiredTitleElement -->
1315
<head>
1416
<BaseHead title={title} description={description} />
1517
</head>

src/layouts/Main.astro

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@ import BaseHead from "../components/BaseHead.astro";
33
import Header from "../components/Header.astro";
44
import Footer from "../components/Footer.astro";
55
6+
type Props = {
7+
title: string;
8+
description?: string;
9+
header?: boolean;
10+
};
11+
612
const { title } = Astro.props;
713
const description =
814
Astro.props.description ||
915
"My website where I write about things that interest me.";
16+
const header = Astro.props.header ?? true;
1017
---
1118

12-
<html lang="en">
13-
<!--suppress HtmlRequiredTitleElement -->
19+
<html lang="en" style="">
1420
<head>
1521
<BaseHead title={title} description={description} />
1622
</head>
1723
<body>
18-
<div>
19-
<Header />
24+
<div class={title === "Home" ? "gradient-1" : "gradient-2"}>
25+
{header && <Header />}
2026
<main>
2127
<slot />
2228
</main>

src/pages/blog/[...slug].astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { getCollection } from "astro:content";
2+
import { type CollectionEntry, getCollection } from "astro:content";
33
import Blog from "../../layouts/Blog.astro";
44
55
export const prerender = true;
@@ -12,6 +12,8 @@ export async function getStaticPaths() {
1212
}));
1313
}
1414
15+
type Props = CollectionEntry<"blog">;
16+
1517
const post = Astro.props;
1618
const { Content } = await post.render();
1719
---

src/pages/index.astro

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import Main from "../layouts/Main.astro";
33
---
44

55
<Main title="Home">
6-
<h1>Hello! 👋</h1>
7-
<p>I'm Devarsh!</p>
8-
<p>
9-
I enjoy programming and computers. That is why I have made this website,
10-
built with <a href="https://astro.build">Astro</a>, to share stuff that you
11-
may find interesting!
12-
</p>
13-
<p>
14-
Feel free to take a look around my website! In the footer are ways to talk
15-
to me.
16-
</p>
17-
<p>As I just revamped my website, more things will be added in the future!</p>
6+
<section>
7+
<h1>Hello! 👋</h1>
8+
<p>I'm Devarsh!</p>
9+
<p>
10+
I enjoy programming and computers. That is why I have made this website,
11+
built with <a href="https://astro.build">Astro</a>, to share stuff that
12+
you may find interesting!
13+
</p>
14+
<p>
15+
Feel free to take a look around my website! In the footer are ways to talk
16+
to me.
17+
</p>
18+
</section>
1819
</Main>

src/styles/global.css

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ main {
6666
max-width: calc(100% - 2em);
6767
margin: auto;
6868
padding: 3em 1em;
69+
min-height: 35vh;
6970
}
7071

7172
h1,
@@ -193,3 +194,84 @@ hr {
193194
/* added line to stop words getting smushed together (as they go onto separate lines and some screen readers do not understand line feeds as a space */
194195
white-space: nowrap;
195196
}
197+
198+
/* Following gradients generated by https://mshr.app */
199+
200+
.gradient-1 {
201+
background-color: hsla(238, 0%, 100%, 1);
202+
background-image:
203+
url("data:image/svg+xml,%3Csvg viewBox='0 0 1052 1052' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"),
204+
radial-gradient(
205+
circle at 4% 10%,
206+
hsla(198, 80%, 58%, 0.35) 4.380688239697029%,
207+
transparent 33.03580475382234%
208+
),
209+
radial-gradient(
210+
circle at 29% 10%,
211+
hsla(270, 77%, 74%, 0.35) 3.1210986267166043%,
212+
transparent 33.35643321544201%
213+
),
214+
radial-gradient(
215+
circle at 42% 5%,
216+
hsla(220, 77%, 74%, 0.35) 5.506816480693434%,
217+
transparent 40%
218+
),
219+
radial-gradient(
220+
circle at 59% 5%,
221+
hsla(161, 77%, 74%, 0.35) 5.3936243936243935%,
222+
transparent 40%
223+
),
224+
radial-gradient(
225+
circle at 80% 0%,
226+
hsla(96, 77%, 74%, 0.35) 3.1210986267166043%,
227+
transparent 21.611228303122836%
228+
),
229+
radial-gradient(
230+
circle at 91% 21%,
231+
hsla(96, 91%, 33%, 0.35) 3.1210986267166043%,
232+
transparent 21.611228303122836%
233+
),
234+
radial-gradient(
235+
circle at 67% 14%,
236+
hsla(261.1111111111111, 73%, 65%, 0.35) 3.1210986267166043%,
237+
transparent 21.611228303122836%
238+
);
239+
background-blend-mode:
240+
overlay, normal, normal, normal, normal, normal, normal, normal;
241+
}
242+
243+
.gradient-2 {
244+
background-color: hsla(204, 0%, 100%, 1);
245+
background-image:
246+
radial-gradient(
247+
circle at 0% 0%,
248+
hsla(231.61764705882354, 100%, 67%, 0.35) 15.931854861359255%,
249+
transparent 34.89027460829219%
250+
),
251+
radial-gradient(
252+
circle at 44% 4%,
253+
hsla(301.76470588235304, 92%, 62%, 0.35) 7.688609714732761%,
254+
transparent 40%
255+
),
256+
radial-gradient(
257+
circle at 40% 0%,
258+
hsla(149.5588235294118, 100%, 80%, 0.35) 3.1210986267166043%,
259+
transparent 40%
260+
),
261+
radial-gradient(
262+
circle at 60% 0%,
263+
hsla(127.0588235294118, 76%, 49%, 0.35) 3.1210986267166043%,
264+
transparent 40%
265+
),
266+
radial-gradient(
267+
circle at 80% 0%,
268+
hsla(221.02941176470588, 100%, 69%, 0.35) 3.1210986267166043%,
269+
transparent 40%
270+
),
271+
radial-gradient(
272+
circle at 100% 0%,
273+
hsla(123.08823529411762, 77%, 74%, 0.35) 3%,
274+
transparent 40%
275+
);
276+
background-blend-mode: normal, normal, normal, normal, normal, normal;
277+
}

0 commit comments

Comments
 (0)