|
| 1 | +<script setup lang="ts"> |
| 2 | +import { blogPosts } from '../../functions/sample' |
| 3 | +
|
| 4 | +defineOptions({ |
| 5 | + name: 'BlogPage', |
| 6 | +}) |
| 7 | +
|
| 8 | +useHead({ |
| 9 | + title: 'Blog - The Chamber of Secrets', |
| 10 | + meta: [ |
| 11 | + { name: 'description', content: 'Latest articles and insights about the judicial system.' }, |
| 12 | + ], |
| 13 | +}) |
| 14 | +</script> |
| 15 | + |
| 16 | +<template> |
| 17 | + <div class="min-h-screen"> |
| 18 | + <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-8 pb-32"> |
| 19 | + <!-- Header Section --> |
| 20 | + <div class="text-center mb-16"> |
| 21 | + <h1 class="text-4xl font-bold tracking-tight text-gray-900 sm:text-5xl">Blog</h1> |
| 22 | + <p class="mt-4 text-lg text-gray-600">Latest articles and insights about the judicial system</p> |
| 23 | + </div> |
| 24 | + |
| 25 | + <!-- Blog Posts List --> |
| 26 | + <div class="space-y-12"> |
| 27 | + <router-link |
| 28 | + v-for="post in blogPosts" |
| 29 | + :key="post.id" |
| 30 | + :to="`/blog/${post.id}`" |
| 31 | + class="block group" |
| 32 | + > |
| 33 | + <article class="relative isolate flex flex-col gap-8 lg:flex-row rounded-2xl p-6 hover:bg-gray-50 transition-all duration-200"> |
| 34 | + <div class="relative aspect-[16/9] sm:aspect-[2/1] lg:aspect-square lg:w-64 lg:shrink-0"> |
| 35 | + <img :src="post.author.imageUrl" :alt="post.author.name" class="absolute inset-0 h-full w-full rounded-2xl bg-gray-50 object-cover"> |
| 36 | + <div class="absolute inset-0 rounded-2xl ring-1 ring-inset ring-gray-900/10"></div> |
| 37 | + </div> |
| 38 | + <div class="flex-1"> |
| 39 | + <div class="flex items-center gap-x-4 text-xs"> |
| 40 | + <time :datetime="post.dateTime" class="text-gray-500">{{ post.date }}</time> |
| 41 | + </div> |
| 42 | + <div class="group relative max-w-xl"> |
| 43 | + <h3 class="mt-3 text-lg font-semibold leading-6 text-gray-900 group-hover:text-softBrown transition-colors duration-200"> |
| 44 | + {{ post.title }} |
| 45 | + </h3> |
| 46 | + <div class="mt-5 flex items-center gap-x-4"> |
| 47 | + <div class="text-sm leading-6"> |
| 48 | + <p class="font-semibold text-gray-900"> |
| 49 | + {{ post.author.name }} |
| 50 | + </p> |
| 51 | + </div> |
| 52 | + </div> |
| 53 | + <p class="mt-5 text-sm leading-6 text-gray-600 line-clamp-3">{{ post.content }}</p> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </article> |
| 57 | + </router-link> |
| 58 | + </div> |
| 59 | + |
| 60 | + <!-- Pagination --> |
| 61 | + <div class="mt-16"> |
| 62 | + <nav class="flex items-center justify-between border-t border-gray-200 px-4 sm:px-0"> |
| 63 | + <div class="-mt-px flex w-0 flex-1"> |
| 64 | + <a href="#" class="inline-flex items-center border-t-2 border-transparent pt-4 pr-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700"> |
| 65 | + <svg class="mr-3 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor"> |
| 66 | + <path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.06l-4.5-4.25a.75.75 0 010-1.06l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" /> |
| 67 | + </svg> |
| 68 | + Previous |
| 69 | + </a> |
| 70 | + </div> |
| 71 | + <div class="hidden md:-mt-px md:flex"> |
| 72 | + <a href="#" class="inline-flex items-center border-t-2 border-soft-brown px-4 pt-4 text-sm font-medium text-soft-brown">1</a> |
| 73 | + <a href="#" class="inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">2</a> |
| 74 | + <a href="#" class="inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">3</a> |
| 75 | + </div> |
| 76 | + <div class="-mt-px flex w-0 flex-1 justify-end"> |
| 77 | + <a href="#" class="inline-flex items-center border-t-2 border-transparent pt-4 pl-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700"> |
| 78 | + Next |
| 79 | + <svg class="ml-3 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor"> |
| 80 | + <path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" /> |
| 81 | + </svg> |
| 82 | + </a> |
| 83 | + </div> |
| 84 | + </nav> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | +</template> |
0 commit comments