Skip to content

Commit 6801afa

Browse files
authored
feat: fine tune the design of the website (#31)
this fine-tuning includes mostly changes to the tailwind classes applied. I also added a footer giving credit to Santosh for creating this awesome project!
1 parent ab76b37 commit 6801afa

File tree

8 files changed

+45
-38
lines changed

8 files changed

+45
-38
lines changed

src/components/BlogCard.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ url = url + "/";
1717
---
1818

1919
<li
20-
class="flex flex-col gap-2 sm:grid-cols-4 leading-relaxed rounded-2xl border-zinc-700 dark:text-zinc-400"
20+
class="flex flex-col leading-relaxed rounded-2xl border border-zinc-900/10 dark:border-zinc-700/40 hover:dark:bg-zinc-800/20 hover:bg-zinc-200/20 dark:text-zinc-400"
2121
>
2222
<a
23-
class="col-span-3 flex flex-col gap-2 sm:gap-4 p-5 my-2 hover:dark:bg-zinc-800 hover:bg-zinc-200 rounded-lg transition-colors shadow-md"
23+
class="flex flex-col gap-2 sm:gap-4 pt-5 px-5 pb-8"
2424
href={url}
2525
>
2626
<time class="shrink-0 text-base sm:hidden">{shortDate}</time>
2727
<span class="flex items-center justify-between mb-1">
28-
<h2 class="text-xl text-black dark:text-white">{title}</h2>
28+
<h2 class="text-xl font-medium text-black dark:text-white">{title}</h2>
2929
<time class="shrink-0 text-base hidden sm:block">{shortDate}</time>
3030
</span>
3131
<TagsLine tags={tags} />

src/components/Footer.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<footer class="mx-auto text-sm px-8 pt-8 pb-12 text-gray-500 dark:text-gray-400 max-w-7xl text-right">
2+
An open source project created by Santhosh Yadav.
3+
</footer>

src/components/Header.astro

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ const navItems = [
1414
1515
---
1616

17-
<header class="dark:bg-zinc-900 bg-white max-w-7xl m-auto transition-colors">
17+
<header class="dark:bg-zinc-900 bg-white max-w-7xl m-auto">
1818
<a href="/" class="text-lg sm:text-xl text-black dark:text-zinc-300 hover:dark:text-white transition-colors absolute m-8">Angular Snippets</a>
1919
<nav class="p-8 hidden sm:flex justify-end">
20-
<ul class="flex justify-end items-center m-0 space-x-1">
20+
<ul class="flex justify-end items-center m-0 space-x-2">
2121
{
2222
navItems.map((item) => (
2323
<li>
24-
<a href ={item.href} class="hover:bg-zinc-300 dark:hover:bg-zinc-700 dark:text-zinc-300 text-black p-2 transition-colors rounded-lg">
24+
<a href ={item.href} class="hover:bg-zinc-300/60 dark:hover:bg-zinc-700/30 dark:text-zinc-300 text-black px-2 py-1 transition-colors rounded-lg">
2525
{item.name}
2626
</a>
2727
</li>
2828
))
2929
}
3030
</ul>
31-
<a aria-label="github" class="pointer ml-2 mr-4" href="https://github.com/santoshyadavdev/angular-snipptes" target="_blank">
32-
<Icon name="simple-icons:github" class="w-6 dark:text-white text-black" />
31+
<a aria-label="github" class="dark:opacity-80 dark:hover:opacity-100 hover:opacity-90 pointer mx-6" href="https://github.com/santoshyadavdev/angular-snipptes" target="_blank">
32+
<Icon name="simple-icons:github" class="w-5 dark:text-white text-black" />
3333
</a>
34-
<button aria-label="theme toggle" class="pointer theme-toggle">
35-
<Icon name="eva:moon-outline" class="w-6 dark:text-white text-black transition-colors dark:hidden" />
36-
<Icon name="akar-icons:sun" class="w-6 dark:text-white text-black transition-colors hidden dark:block" />
34+
<button aria-label="theme toggle" class="dark:opacity-80 dark:hover:opacity-100 hover:opacity-90 pointer theme-toggle">
35+
<Icon name="eva:moon-outline" class="w-5 dark:text-white text-black transition-colors dark:hidden" />
36+
<Icon name="akar-icons:sun" class="w-5 dark:text-white text-black transition-colors hidden dark:block" />
3737
</button>
3838
</nav>
3939
<nav class="p-2 flex sm:hidden justify-end">
@@ -51,12 +51,12 @@ const navItems = [
5151

5252
</header>
5353

54-
<header class="nav-menu hidden bg-white dark:bg-zinc-900">
54+
<header class="absolute border-b border-gray-900/10 dark:border-gray-700/40 t-0 inset-x-0 nav-menu hidden bg-white dark:bg-zinc-900">
5555
{
5656
(
57-
<nav class="m-8 flex flex-col inline-flex space-y-1 ">
57+
<nav class="w-full p-8 pt-0 flex flex-col inline-flex space-y-1 ">
5858
{navItems.map((navbar) => (
59-
<a href={navbar.href} class="hover:bg-zinc-300 dark:hover:bg-zinc-700 dark:text-zinc-300 text-black p-2 transition-colors rounded-lg">
59+
<a href={navbar.href} class="w-full hover:bg-zinc-300 dark:hover:bg-zinc-700 dark:text-zinc-300 text-black p-2 transition-colors rounded-lg">
6060
{navbar.name}
6161
</a>
6262
))}

src/components/TagsLine.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { tags } = Astro.props;
55
<div class="flex text-sm gap-2">
66
{
77
tags.map((tag) => (
8-
<span class="bg-slate-800 px-2 py-1 rounded text-white dark:bg-slate-400 ">
8+
<span class="bg-zinc-200/10 px-2 py-1 rounded-lg border border-zinc-900/10 dark:border-zinc-700/40 dark:bg-zinc-800">
99
{tag}
1010
</span>
1111
))

src/layouts/BlogLayout.astro

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import "@fontsource/inter/variable.css";
33
import "@fontsource/fira-code";
44
import Header from "@components/Header.astro";
5+
import Footer from "@components/Footer.astro";
56
import TagsLine from "@components/TagsLine.astro";
67
78
let { pubDate } = Astro.props.content;
@@ -77,19 +78,19 @@ const canonicalURL = new URL(Astro.url).href;
7778
<script src="@scripts/main.js"></script>
7879
</head>
7980
<body
80-
class="font-inter dark:bg-zinc-900 text-lg sm:text-xl dark:text-white transition-colors selection:bg-sky-600/60 scrollbar-thin scrollbar-thumb-zinc-400 scrollbar-track-zinc-300 dark:scrollbar-thumb-zinc-600 dark:scrollbar-track-zinc-800"
81+
class="font-inter dark:bg-zinc-900 dark:text-white selection:bg-sky-600/60 scrollbar-thin scrollbar-thumb-zinc-400 scrollbar-track-zinc-300 dark:scrollbar-thumb-zinc-600 dark:scrollbar-track-zinc-800"
8182
>
8283
<Header />
83-
<main class="m-auto p-6 max-w-7xl">
84+
<main class="mx-auto !max-w-screen-lg m-auto p-6 max-w-7xl">
8485
<section
85-
class="prose sm:prose-xl dark:text-slate-200 prose-a:dark:text-blue-400 prose-a:no-underline prose-pre:scrollbar-thin prose-pre:scrollbar-thumb-zinc-400 prose-pre:scrollbar-track-zinc-300 prose-pre:dark:scrollbar-thumb-zinc-500 prose-pre:dark:scrollbar-track-zinc-700 dark:bg-zinc-900 hover:prose-a:underline prose-a:text-blue-700 dark:prose-invert prose-a:underline-offset-2 dark:bg-inherit px-3"
86+
class="dark:text-slate-200 dark:bg-inherit px-3"
8687
>
8788
<header class="mb-5">
88-
<h1 class="m-0 !text-4xl mb-7 dark:text-white">
89+
<h1 class="font-bold text-4xl mb-4 dark:text-white">
8990
{frontmatter.title}
9091
</h1>
9192
<nav
92-
class="flex flex-col sm:flex-row sm:space-x-3 text-base dark:text-zinc-400"
93+
class="flex flex-col sm:flex-row sm:space-x-3 text-base text-zinc-600 dark:text-zinc-400"
9394
>
9495
<time datetime={frontmatter.pubDate} class="mb-3 sm:mb-0">
9596
{thisDate}
@@ -98,18 +99,19 @@ const canonicalURL = new URL(Astro.url).href;
9899
{frontmatter.contributedBy}
99100
</span>
100101
</nav>
101-
<div class="mys-2">
102+
<div class="my-2">
102103
<TagsLine tags={frontmatter.tags} />
103104
</div>
104105
</header>
105-
<article>
106+
<article class="mx-auto !max-w-screen-lg prose prose-zinc sm:prose-lg prose-img:mx-auto prose-a:dark:text-blue-400 prose-a:no-underline prose-pre:scrollbar-thin prose-pre:scrollbar-thumb-zinc-400 prose-pre:scrollbar-track-zinc-300 prose-pre:dark:scrollbar-thumb-zinc-500 prose-pre:dark:scrollbar-track-zinc-700 dark:bg-zinc-900 hover:prose-a:underline prose-a:text-blue-700 dark:prose-invert prose-a:underline-offset-2">
106107
<slot />
107108
</article>
108-
<footer class="flex flex-row justify-between mt-16 text-lg">
109-
<a href="/snippets" class="dark:text-blue-400 text-blue-600"
109+
<section class="flex flex-row justify-between my-16">
110+
<a href="/snippets" class="hover:underline"
110111
>Back to snippets</a
111112
>
112-
</footer>
113+
</section>
114+
<Footer />
113115
</section>
114116
</main>
115117
</body>

src/layouts/Layout.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import "@fontsource/inter/variable.css";
33
import Header from "@components/Header.astro";
4+
import Footer from "@components/Footer.astro";
45
56
export interface Props {
67
title?: string;
@@ -61,11 +62,12 @@ const canonicalURL = new URL(Astro.url).href;
6162

6263
</head>
6364
<body
64-
class="font-inter text-lg sm:text-xl dark:bg-zinc-900 dark:text-white transition-colors selection:bg-sky-600/60 scrollbar-thin scrollbar-thumb-zinc-400 scrollbar-track-zinc-300 dark:scrollbar-thumb-zinc-600 dark:scrollbar-track-zinc-800"
65+
class="font-inter dark:bg-zinc-900 dark:text-white selection:bg-sky-600/60 scrollbar-thin scrollbar-thumb-zinc-400 scrollbar-track-zinc-300 dark:scrollbar-thumb-zinc-600 dark:scrollbar-track-zinc-800"
6566
>
6667
<Header />
6768
<main class="m-auto px-8 max-w-7xl">
6869
<slot />
6970
</main>
71+
<Footer />
7072
</body>
7173
</html>

src/pages/index.astro

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@ blogs = blogs.sort(
1818
---
1919

2020
<Layout {...metadata}>
21-
<section class="flex flex-col sm:flex-row justify-evenly items-center py-14">
22-
<div class="w-32 m-5 md:m-10 my-10">
23-
<Icon class="h-8 md:h-12" name="simple-icons:angular" />
21+
<section class="flex flex-col sm:flex-row justify-between items-center sm:py-14">
22+
<div class="flex items-center justify-center sm:w-1/2 m-5 md:m-10 my-10">
23+
<Icon class="h-12 lg:h-20" name="simple-icons:angular" />
2424
</div>
2525
<header class="max-w-xl sm:order-first">
2626
<h1
2727
class="text-2xl sm:text-3xl font-bold mb-7 md:mb-5 text-center sm:text-left"
2828
>
29-
Welcome to Angular Snippets, add a snippet and help community
29+
Welcome to Angular Snippets, add a snippet and help the community
3030
</h1>
31-
<p class="text-black dark:text-zinc-300 mb-5">
31+
<p class="mb-4 text-base text-zinc-700 dark:text-zinc-300">
3232
There are some code snippets which you may have created and want to
3333
share with the world!
3434
</p>
35-
<p class="text-black dark:text-zinc-300">
35+
<p class="text-zinc-700 dark:text-zinc-300">
3636
This is the place to share your code snippets with the world. You can
3737
add your own snippets and help the community.
3838
</p>
3939
</header>
4040
</section>
4141
<section class="py-14">
42-
<h1 class="text-2xl sm:text-3xl font-bold mb-5">Recent Snippets</h1>
43-
<p class="text-black dark:text-zinc-300 mb-2">
42+
<h1 class="text-xl sm:text-2xl font-bold mb-2">Recent Snippets</h1>
43+
<p class="text-zinc-700 dark:text-zinc-300 mb-4">
4444
Looking for all snippets? Click the "snippets" or the "Show more snippets"
4545
link down below.
4646
</p>
47-
<ul class="flex flex-col justify-center py-5">
47+
<ul class="flex flex-col justify-center gap-4 sm:gap-6 pb-4 sm:pb-6">
4848
{
4949
blogs.length >= 1 &&
5050
blogs
@@ -63,7 +63,7 @@ blogs = blogs.sort(
6363
</ul>
6464
<div class="text-center dark:text-zinc-300 text-zinc-200 mt-5">
6565
<a
66-
class="flex items-center dark:bg-zinc-800 bg-zinc-200 dark:ring-zinc-700 hover:ring-2 ring-zinc-300 transition-all dark:text-white flex-col m-2 p-2 rounded-xl text-black"
66+
class="text-base flex items-center dark:bg-zinc-800 bg-zinc-200/30 dark:ring-zinc-700 hover:ring-2 ring-zinc-300 transition-all dark:text-white flex-col m-2 p-2 rounded-xl text-black"
6767
href="/snippets">Show more snippets</a
6868
>
6969
</div>

src/pages/snippets.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ blogs = blogs.sort(
1414
<Layout title="Snippets" description="hello world">
1515
<section class="flex flex-col mt-8">
1616
<h1 class="text-2xl sm:text-3xl font-bold mb-5">Snippets</h1>
17-
<h2 class="text-black dark:text-zinc-300 mb-5">
17+
<h2 class="text-zinc-700 dark:text-zinc-300 mb-5">
1818
Find and share useful code snippets for Angular. Snippets are small,
1919
reusable code that you can use to solve common problems.
2020
</h2>
2121
</section>
2222
<section>
23-
<ul class="flex flex-col justify-center mb-8">
23+
<ul class="flex flex-col gap-4 sm:gap-6 justify-center mb-12">
2424
{
2525
blogs.map((post) => {
2626
return (

0 commit comments

Comments
 (0)