Skip to content

Commit

Permalink
feat: improved news with a layout and a darker readable color
Browse files Browse the repository at this point in the history
  • Loading branch information
Eveeifyeve committed Apr 12, 2024
1 parent 3437330 commit ec390d0
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 33 deletions.
103 changes: 103 additions & 0 deletions src/layouts/newspost.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
import { twMerge } from "tailwind-merge";
import Footer from "@component/footer.astro";
import Head from "@component/head.astro";
import Header from "@component/header.astro";
import DiscordSVG from "@assets/svgs/Discord.svg";
import GithubSVG from "@assets/svgs/Github-white.svg";
import { Image } from 'astro:assets';
// Styles
import "../styles/style.css";
export interface Props {
postprops: PostProps;
className?: string;
}
export interface PostProps {
author: AuthorProps;
title: string;
desc?: string;
banner: string;
bannerSize: number;
pubDate: string;
}
export interface AuthorProps {
name: string;
role: string;
img?: string;
socials?: AuthorSocialsProps;
}
export interface AuthorSocialsProps {
discordServer?: string;
github?: string;
}
const Sociallogosizes = 36;
const { postprops, className } = Astro.props;
const pubDate = new Date(postprops.pubDate);
const formattedPubDate = `${pubDate.toLocaleDateString()}`;
---

<Head
title={String(postprops.title) ?? "TeaClent Website"}
customDescription={postprops.desc}
,
bannerPath={postprops.banner}
/>
<Header />
<div
class={twMerge(
`h-screen text-[var(--text)] my-[5%] mx-[5%] bg-[var(--nav-color)] rounded-lg ${className}`
)}
>
<div class="flex justify-between w-full bg-neutral-900 text-neutral-400 rounded-t-lg mr-5 left-0 space-x-2 p-4">
<a href="/news">&lt;- Back to News Articles</a>
Published on: {formattedPubDate}
</div>

<div class="flex flex-col items-center justify-center pb-3">
<div class="mx-5 my-5">
<Image
src={postprops.banner}
alt={`${postprops.title} Banner`}
height={postprops.bannerSize}
width={postprops.bannerSize}
loading="eager"
class="border border-purple-600 rounded-xl w-[100%]"
/>
</div>

<h1 class="text-2xl">{postprops.title}</h1>
<slot />
</div>

<div class="flex justify-between bg-neutral-900 rounded-b-lg mt-3">
<div class="flex flex-col ml-10 mb-5">
<div class="flex text-white flex-row gap-x-2 mt-5">
<img
class="flex w-8 h-8 rounded-full"
src={postprops.author.img}
alt={`${postprops.author.name}`}
/>
{postprops.author.name}
</div>
<div class="text-neutral-400 mt-1">{postprops.author.role}</div>
</div>
{postprops.author.socials && (
<div class="flex gap-x-2 mr-4 mt-10">
{postprops.author.socials.github && (
<a href={postprops.author.socials.github} class="text-gray-500 hover:text-gray-700"><Image src={GithubSVG} alt="Github Logo" width={Sociallogosizes} height={Sociallogosizes}/></a>
)}
{postprops.author.socials.discordServer && (
<a href={postprops.author.socials.discordServer} class="text-blue-500 hover:text-blue-700"><Image src={DiscordSVG} alt="Github Logo" width={Sociallogosizes} height={Sociallogosizes}/></a>
)}
</div>
)}
</div>
</div>
<Footer />
55 changes: 22 additions & 33 deletions src/pages/news/updates/new-staffaplications-19-3-24.mdx
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
---
title: New Staff Applications!
banner: /news/new-screenshot-1-19-3-24.png
bannerSize: 100
link: 'https://teaclient.net/news'
pubDate: 2024-03-19
author:
name: eveeifyeve
role: CEO/Owner of TeaClient
img: https://github.com/eveeifyeve.png
socials:
github: https://github.com/eveeifyeve
discordServer: https://teaclient.net/discord
---
import Layout from "@layout/layout.astro";

<Layout className="items-center h-full w-full text-center justify-center" title="New Staff Applications! | TeaClient Website">
<div className="mx-5 my-5">
<img src="/news/new-screenshot-1-19-3-24.png" class="border justify-center border-purple-600 rounded-xl w-[50%] h-[60%]"/>
<div class="w-full h-full">


# {frontmatter.title}

<div class="flex flex-col items-center space-x-2 p-4">
Posted at {frontmatter.pubDate}
<div class="flex items-center">
<img
class="w-8 h-8 rounded-full"
src={`https://github.com/eveeifyeve.png`}
alt={`eveeifyeve's GitHub Profile Picture`}
/>
eveeifyeve
</div>
</div>
import Layout from "@layout/newspost.astro";


<Layout postprops={frontmatter} className="h-full bg-[var(--nav-color2)]">



<br/>

Expand All @@ -39,10 +33,11 @@ We have a very few plaforms for staff Applications for now but more to come.


The full list is:
<div class="bg-gradient-to-br from-purple-300 to-lime-300 bg-clip-text text-transparent">
- Our Discord
- Revolt(Discord Alternat)

<div class="bg-gradient-to-br bg-clip-text text-transparent">
<ul class="list-disc list-inside">
<li class="text-indigo-500">Our Discord</li>
<li class="text-red-600">Revolt (Discord Alternative)</li>
</ul>
</div>

<br/>
Expand All @@ -54,14 +49,8 @@ You will be showing all the values of teaclient helping out members, moderate, a

<br/>

<div class="bg-gradient-to-br from-purple-300 to-lime-300 bg-clip-text text-transparent">
So What are you waiting for <a href="/apply" class="bg-gradient-to-br from-blue-300 to-purple-300 bg-clip-text text-transparent">JOIN TODAY!</a>
<div class="bg-gradient-to-br from-violet-200 to-green-200 bg-clip-text text-transparent">
So What are you waiting for <a href="/apply" class="bg-gradient-to-br from-blue-600 to-purple-600 bg-clip-text text-transparent">JOIN TODAY!</a>
</div>





</div>
</div>
</Layout>
5 changes: 5 additions & 0 deletions src/styles/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
:root {
/* Define the variables for both themes here */
--nav-color-dark: rgb(0 0 0 / 50%);
--nav-color-dark2: rgba(0, 0, 0, 0.79);
--nav-color-light: rgb(255 255 255 / 25%);
--nav-color-light2: rgb(255 255 255 / 0.5);
--navBar-Items-dark: white;
--navBar-Items-light: black;
--hover-color: #6e2bec;
Expand All @@ -12,13 +14,16 @@
/* Apply the variables based on the theme */
[data-theme="dark"] {
--nav-color: var(--nav-color-dark);
--nav-color2: var(--nav-color-dark2);

--navBar-Items: var(--navBar-Items-dark);
--text: var(--text-dark);
--nav-buttons: var(--nav-color-dark);
}

[data-theme="light"] {
--nav-color: var(--nav-color-light);
--nav-color2: var(--nav-color-light2);
--navBar-Items: var(--navBar-Items-light);
--text: var(--text-light);
--nav-buttons: #0000005c ;
Expand Down

0 comments on commit ec390d0

Please sign in to comment.