modified PostCarousel to use grid, among other things

This commit is contained in:
Wyatt J. Miller 2024-12-10 14:08:03 -05:00
parent 637f0b47dd
commit addb2e55d9
5 changed files with 41 additions and 28 deletions

View File

@ -9,11 +9,13 @@ export default function AuthorCard({
}) { }) {
return ( return (
<div <div
class={isIdentified class={
? "p-6 bg-[#45475a] rounded-lg shadow-md" isIdentified
: "p-6 bg-[#45475a] rounded-lg shadow-md transition-all duration-300 ease-in-out hover:shadow-xl hover:scale-105"} ? "p-6 bg-[#313244] shadow-md"
: "p-6 bg-[#313244] shadow-md transition-all duration-300 ease-in-out hover:shadow-xl hover:scale-105"
}
> >
<div class="min-w-screen flex flex-col items-center justify-between bg-[#313244] sm:min-h-screen"> <div class="min-w-screen flex flex-col items-center justify-between bg-[#45475a] rounded-lg shadow-md">
<div class="sm:mt-14 sm:mb-14 mt-12 mb-4 flex flex-col items-center gap-y-5 gap-x-10 md:flex-row"> <div class="sm:mt-14 sm:mb-14 mt-12 mb-4 flex flex-col items-center gap-y-5 gap-x-10 md:flex-row">
<PhotoCircle <PhotoCircle
src={author.image ?? "/logo.svg"} src={author.image ?? "/logo.svg"}

View File

@ -1,3 +1,5 @@
import * as hi from "jsr:@preact-icons/hi2";
export default function Footer() { export default function Footer() {
return ( return (
<footer class="bg-[#313244] text-[#cdd6f4] py-8"> <footer class="bg-[#313244] text-[#cdd6f4] py-8">
@ -7,51 +9,59 @@ export default function Footer() {
<div class="space-y-2"> <div class="space-y-2">
<a <a
class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]" class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]"
href="/posts.rss" href={`${Deno.env.get("BASE_URI_API")}/posts/rss`}
> >
<div class="flex items-center gap-2">
<hi.HiOutlineRss />
RSS RSS
</div>
</a> </a>
<br />
<a <a
class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]" class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]"
href="/sitemap.xml" href="/sitemap.xml"
> >
<div class="flex items-center gap-2">
<hi.HiOutlineMap />
Sitemap Sitemap
</div>
</a> </a>
</div> </div>
<div> <div>
<a class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]"> <a class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]">
<div class="flex items-center gap-2">
<hi.HiOutlineBriefcase />
Resume Resume
</div>
</a> </a>
<br />
<a <a
class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]" class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]"
href="mailto:wjmiller2016@gmail.com" href="mailto:wjmiller2016@gmail.com"
> >
<div class="flex items-center gap-2">
<hi.HiOutlineEnvelope />
Email me Email me
</div>
</a> </a>
<br />
<a <a
class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]" class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]"
href="https://x.com/wymillerlinux" href="https://x.com/wymillerlinux"
> >
X <div class="flex items-center gap-2">X (Twitter)</div>
</a> </a>
<br />
<a <a
class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]" class="mb-8 text-[#cdd6f4] transition-all duration-300 ease-in-out hover:text-[#cba6f7] hover:drop-shadow-[0_0_20px_rgba(96,165,250,0.7)] hover:scale-110 cursor-pointer visited:text-[#bac2de]"
href="https://github.com/wymillerlinux" href="https://github.com/wymillerlinux"
> >
GitHub <div class="flex items-center gap-2">GitHub</div>
</a> </a>
</div> </div>
</div> </div>
<div class="border-t border-gray-700 mt-8 pt-4 text-center"> <div class="border-t border-gray-700 mt-8 pt-4 text-center">
<p class="text-sm text-gray-400"> <p class="text-sm text-gray-400">
© {new Date().getFullYear()}{" "} © {new Date().getFullYear()} Miller Web Solutions. All Rights
Miller Web Solutions. All Rights Reserved. Hosted by Akamai. Reserved. Hosted by Akamai.
</p> </p>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@ import { truncateString } from "../lib/truncate.ts";
export const PostCard = function PostCard({ post }: { post: Post }) { export const PostCard = function PostCard({ post }: { post: Post }) {
return ( return (
<div class="p-6 bg-[#45475a] rounded-lg shadow-md transition-all duration-300 ease-in-out hover:shadow-xl hover:scale-105"> <div class="p-6 bg-[#45475a] rounded-lg shadow-md transition-all duration-300 ease-in-out hover:shadow-xl hover:scale-105">
<a href={`${Deno.env.get("BASE_URI_WEB")}/posts/${post.post_id}`}> <a href={`${Deno.env.get("BASE_URI_WEB")}/posts/${post.slug}`}>
<h2 class="text-white text-lg font-bold mb-2">{post.title}</h2> <h2 class="text-white text-lg font-bold mb-2">{post.title}</h2>
<p class="text-white"> <p class="text-white">
Written by{" "} Written by{" "}
@ -30,4 +30,5 @@ export type Post = {
title: string; title: string;
body: string; body: string;
created_at: string; created_at: string;
slug: string;
}; };

View File

@ -6,12 +6,12 @@ interface PostOpts {
export const PostCarousel = function PostCarousel({ posts }: PostOpts) { export const PostCarousel = function PostCarousel({ posts }: PostOpts) {
return ( return (
<div class="post-carousel flex flex-col items-center justify-between bg-[#313244]"> <div className="flex w-full bg-[#313244] p-8">
<div class="flex items-center justify-center"> <div className="items-center justify-center">
<div class="flex space-x-4"> <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 max-w-7xl w-full">
{posts.map((post: Post) => { {posts.map((post: Post) => (
return <PostCard post={post} />; <PostCard key={post.post_id} post={post} />
})} ))}
</div> </div>
</div> </div>
</div> </div>

View File

@ -12,7 +12,7 @@ interface PageData {
} }
export const handler: Handlers<PageData> = { export const handler: Handlers<PageData> = {
async GET(_: any, ctx: any) { async GET(_, ctx) {
const [featuredResult, recentResult, hotResult, popularResult] = const [featuredResult, recentResult, hotResult, popularResult] =
await Promise.all([ await Promise.all([
fetch(`${Deno.env.get("BASE_URI_API")}/posts/featured`), fetch(`${Deno.env.get("BASE_URI_API")}/posts/featured`),
@ -22,8 +22,8 @@ export const handler: Handlers<PageData> = {
]); ]);
// parse all JSON responses concurrently // parse all JSON responses concurrently
const [featuredPosts, recentPosts, hotPosts, popularPosts] = await Promise const [featuredPosts, recentPosts, hotPosts, popularPosts] =
.all([ await Promise.all([
featuredResult.json(), featuredResult.json(),
recentResult.json(), recentResult.json(),
hotResult.json(), hotResult.json(),
@ -52,7 +52,7 @@ export default function PostPage({ data }: PageProps<PageData>) {
Featured Posts Featured Posts
</h2> </h2>
</div> </div>
<div className="text-lg font-thin italic text-white text-center flex"> <div className="text-lg font-thin italic text-white mb-4 text-center flex">
Ignite the impossible Ignite the impossible
</div> </div>
<PostCarousel posts={featuredPosts} /> <PostCarousel posts={featuredPosts} />