mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 12:14:42 +01:00
Implement back bookmarks
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable node/prefer-global/process */
|
||||
export default defineNuxtRouteMiddleware((to) => {
|
||||
if (to.path === '/bookmarks' || to.path === '/writing' && process.env.NODE_ENV !== 'development') {
|
||||
if (to.path === '/writing' && process.env.NODE_ENV !== 'development') {
|
||||
return navigateTo('/', {
|
||||
redirectCode: 301,
|
||||
})
|
||||
|
||||
@@ -99,24 +99,23 @@ function getColor() {
|
||||
</template>
|
||||
</UPopover>
|
||||
</div>
|
||||
<div v-if="bookmarks && getCategories" class="mt-8 md:mt-16">
|
||||
<div v-if="bookmarks.length > 0 && !pending" class="grid grid-cols-1 gap-x-12 gap-y-16 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5">
|
||||
<div v-if="bookmarks && getCategories" class="mt-8">
|
||||
<div v-if="bookmarks.length > 0 && !pending" class="grid grid-cols-1 gap-x-12 gap-y-16 sm:grid-cols-2 md:grid-cols-3">
|
||||
<div
|
||||
v-for="bookmark in bookmarks"
|
||||
:key="bookmark.name.toLowerCase().trim()"
|
||||
class="group relative flex flex-col justify-between"
|
||||
class="group relative flex justify-between items-center"
|
||||
>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col gap-y-1">
|
||||
<div class="flex gap-6 items-center">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-zinc-800 dark:text-zinc-100">
|
||||
<div class="absolute -inset-y-6 -inset-x-4 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" />
|
||||
<div class="absolute -inset-y-2 md:-inset-y-4 -inset-x-4 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" />
|
||||
<NuxtLink
|
||||
:href="bookmark.website"
|
||||
external
|
||||
target="_blank"
|
||||
>
|
||||
<span class="absolute -inset-y-6 -inset-x-4 z-20 sm:-inset-x-6 sm:rounded-2xl" />
|
||||
<span class="absolute -inset-y-2 md:-inset-y-4 -inset-x-4 z-20 sm:-inset-x-6 sm:rounded-2xl" />
|
||||
<div class="flex gap-2 items-center">
|
||||
<h1 class="relative z-10">
|
||||
{{ bookmark.name }}
|
||||
@@ -128,8 +127,6 @@ function getColor() {
|
||||
</NuxtLink>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-2 z-10">
|
||||
<UBadge
|
||||
v-for="category in bookmark.categories"
|
||||
@@ -141,7 +138,8 @@ function getColor() {
|
||||
{{ category.category.name }}
|
||||
</UBadge>
|
||||
</div>
|
||||
<p class="relative z-10 mt-4 flex text-sm font-medium items-center" :class="getColor()">
|
||||
</div>
|
||||
<p class="relative z-10 flex text-sm font-medium items-center" :class="getColor()">
|
||||
<UIcon name="i-ph-link-bold" />
|
||||
<span class="ml-2">{{ bookmark.website.replace('https://', '') }}</span>
|
||||
</p>
|
||||
|
||||
@@ -190,7 +190,7 @@ async function suggest() {
|
||||
</UPopover>
|
||||
</div>
|
||||
<UDivider class="my-2" />
|
||||
<div v-if="talents && getCategories" class="mt-8 md:mt-16">
|
||||
<div v-if="talents && getCategories" class="mt-8">
|
||||
<div v-if="talents.length > 0 && !pending" class="grid grid-cols-1 gap-y-4 md:gap-x-12 md:gap-y-16 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<div
|
||||
v-for="talent in talents"
|
||||
|
||||
Reference in New Issue
Block a user