[READ-ONLY] Mirror of https://github.com/flo-bit/flo-bit.github.io. my personal website, w/ astro, svelte, tailwind, typescript, threlte flo-bit.dev/
portfolio portfolio-website svelte sveltekit tailwind threejs threlte typescript
0

Configure Feed

Select the types of activity you want to include in your feed.

add articles section

+106 -6
+4
src/app.css
··· 19 19 scrollbar-width: none; /* Firefox */ 20 20 } 21 21 } 22 + 23 + /* * { 24 + outline: red solid 1px; 25 + } */
+83
src/lib/components/Posts.svelte
··· 1 + <script lang="ts"> 2 + interface Article { 3 + title: string; 4 + description: string; 5 + date: string; 6 + href: string; 7 + } 8 + 9 + const articles: Article[] = [ 10 + { 11 + title: 'How I use AI for Software Development', 12 + description: 13 + 'I admit it, I have asked ChatGPT at least 17 times how to center a div!', 14 + date: '2024-01-08', 15 + href: 'https://flobit.substack.com/p/how-i-use-ai-for-software-development-474551a7aa7f' 16 + } 17 + ]; 18 + 19 + function formatDate(date: string) { 20 + return new Date(date).toLocaleDateString('en-US', { 21 + year: 'numeric', 22 + month: 'long', 23 + day: 'numeric' 24 + }); 25 + } 26 + </script> 27 + 28 + <div class="relative isolate overflow-hidden bg-black"> 29 + <div class="mx-auto max-w-5xl px-6 lg:px-8"> 30 + <div id="articles" class="py-16 md:py-32 section"> 31 + <div class="max-w-2xl"> 32 + <h1 class="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl"> 33 + My ramblings 34 + </h1> 35 + <p class="mt-6 text-base text-zinc-600 dark:text-zinc-400"> 36 + Here are some of my thoughts on things I'm learning or working on. 37 + </p> 38 + </div> 39 + <div class="mt-16"> 40 + <div class="grid grid-cols-1 md:grid-cols-2 gap-16"> 41 + {#each articles as article} 42 + <article class=""> 43 + <div class="group relative flex flex-col items-start"> 44 + <div 45 + class="text-base z-10 font-semibold tracking-tight text-zinc-800 dark:text-zinc-100" 46 + > 47 + {article.title} 48 + </div> 49 + <div 50 + class="relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500 pl-3.5 mt-1" 51 + > 52 + <span class="absolute inset-y-0 left-0 flex items-center" aria-hidden="true"> 53 + <span class="h-4 w-0.5 rounded-full bg-zinc-200 dark:bg-zinc-500" /> 54 + </span> 55 + {formatDate(article.date)} 56 + </div> 57 + 58 + <p class="relative z-10 mt-2 text-sm text-zinc-600 dark:text-zinc-400"> 59 + {article.description} 60 + </p> 61 + 62 + <a href={article.href} target="_blank"> 63 + <div 64 + class="absolute -inset-x-4 -inset-y-6 z-0 scale-95 bg-zinc-50 opacity-0 transition group-hover:scale-100 group-hover:opacity-100 dark:bg-zinc-800/50 sm:-inset-x-6 sm:rounded-2xl" 65 + /> 66 + <span class="absolute -inset-x-4 -inset-y-6 z-20 sm:-inset-x-6 sm:rounded-2xl" /> 67 + <span class="relative z-10 mt-4 flex items-center text-sm font-medium text-zinc-400 transition-colors duration-200 group-hover:text-cyan-400"> 68 + Read Article 69 + <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3 ml-1 mt-0.5"> 70 + <path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" /> 71 + </svg> 72 + 73 + </span> 74 + 75 + </a> 76 + </div> 77 + </article> 78 + {/each} 79 + </div> 80 + </div> 81 + </div> 82 + </div> 83 + </div>
+1 -1
src/lib/components/Projects.svelte
··· 136 136 </div> 137 137 {#if project.link} 138 138 <p 139 - class="relative z-10 mt-6 flex text-sm font-medium text-zinc-400 transition group-hover:text-cyan-500 dark:text-zinc-200" 139 + class="relative z-10 mt-6 flex text-sm font-medium text-zinc-400 transition group-hover:text-cyan-400 dark:text-zinc-200" 140 140 > 141 141 <svg viewBox="0 0 24 24" aria-hidden="true" class="h-6 w-6 flex-none"> 142 142 <path
+3 -2
src/lib/components/nav/DektopNavigation.svelte
··· 5 5 6 6 export { classes as class }; 7 7 8 - export let active: 'home' | 'about' | 'projects' | 'learning' | 'contact' = 'home'; 8 + export let active: 'home' | 'about' | 'projects' | 'learning' | 'contact' | 'articles' = 'home'; 9 9 </script> 10 10 11 11 <nav class={classes}> 12 12 <ul 13 13 class="flex rounded-full bg-white/90 px-3 text-sm font-medium text-zinc-800 shadow-lg shadow-zinc-800/5 ring-1 ring-zinc-900/5 backdrop-blur dark:bg-white/5 dark:text-zinc-200 dark:ring-white/10" 14 14 > 15 - <NavigationItem href="#home" isActive={active == 'home'}>Home</NavigationItem> 15 + <!-- <NavigationItem href="#home" isActive={active == 'home'}>Home</NavigationItem> --> 16 16 <NavigationItem href="#about" isActive={active == 'about'}>About</NavigationItem> 17 17 <NavigationItem href="#projects" isActive={active == 'projects'}>Projects</NavigationItem> 18 + <NavigationItem href="#articles" isActive={active == 'articles'}>Articles</NavigationItem> 18 19 <NavigationItem href="#learning" isActive={active == 'learning'}>Learning</NavigationItem> 19 20 <NavigationItem href="#contact" isActive={active == 'contact'}>Contact</NavigationItem> 20 21 </ul>
+12 -3
src/lib/components/nav/MobileNavigation.svelte
··· 17 17 open.set(false); 18 18 } 19 19 20 - export let active: 'home' | 'about' | 'projects' | 'learning' | 'contact' = 'home'; 20 + export let active: 'home' | 'about' | 'projects' | 'learning' | 'contact' | 'articles' = 'home'; 21 21 </script> 22 22 23 23 <button ··· 64 64 <ul 65 65 class="-my-2 divide-y divide-white/10 text-base text-zinc-800 dark:divide-zinc-100/5 dark:text-zinc-100" 66 66 > 67 - <li> 67 + <!-- <li> 68 68 <a 69 69 href="#home" 70 70 class="block py-2 {active == 'home' ? 'dark:text-cyan-400' : ''}" ··· 72 72 > 73 73 Home 74 74 </a> 75 - </li> 75 + </li> --> 76 76 <li> 77 77 <a 78 78 href="#about" ··· 89 89 on:click={hide} 90 90 > 91 91 Projects 92 + </a> 93 + </li> 94 + <li> 95 + <a 96 + href="#articles" 97 + class="block py-2 {active == 'articles' ? 'dark:text-cyan-400' : ''}" 98 + on:click={hide} 99 + > 100 + Articles 92 101 </a> 93 102 </li> 94 103 <li>
+3
src/routes/+page.svelte
··· 13 13 import Footer from '$lib/components/Footer.svelte'; 14 14 import About from '$lib/components/About.svelte'; 15 15 import Learning from '$lib/components/Learning.svelte'; 16 + import Posts from '$lib/components/Posts.svelte'; 16 17 17 18 let active: 'home' | 'about' | 'projects' | 'learning' | 'contact' = 'home'; 18 19 ··· 60 61 <About /> 61 62 62 63 <Projects /> 64 + 65 + <Posts /> 63 66 64 67 <Learning /> 65 68