mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 12:14:42 +01:00
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
useHead({
|
||||
title: 'About me • Arthur Danjou'
|
||||
title: 'About me • Arthur Danjou',
|
||||
})
|
||||
|
||||
const { data: skills } = await getSkills()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { useBookmarksStore } from '~/store/bookmarks'
|
||||
import {useBookmarksStore} from '~/store/bookmarks'
|
||||
|
||||
useHead({
|
||||
title: 'Discover my library • Arthur Danjou'
|
||||
title: 'Discover my library • Arthur Danjou',
|
||||
})
|
||||
|
||||
const categories = ref<Array<{ label: string, slug: string }>>([{ label: 'All', slug: 'all' }])
|
||||
@@ -12,13 +12,13 @@ const { data: bookmarks, pending } = await useFetch('/api/bookmarks', {
|
||||
method: 'get',
|
||||
query: {
|
||||
favorite: isFavorite,
|
||||
category: getCategory
|
||||
category: getCategory,
|
||||
},
|
||||
watch: [isFavorite, getCategory]
|
||||
watch: [isFavorite, getCategory],
|
||||
})
|
||||
|
||||
const { data: getCategories } = await useFetch('/api/categories', { method: 'GET', query: { type: 'bookmark' } })
|
||||
getCategories.value!.forEach(category => categories.value.push({label: category.name, slug: category.slug}))
|
||||
getCategories.value!.forEach(category => categories.value.push({ label: category.name, slug: category.slug }))
|
||||
|
||||
function isCategory(slug: string) {
|
||||
return getCategory.value === slug
|
||||
@@ -30,7 +30,7 @@ const getMarkerStyle = computed(() => {
|
||||
top: `${selected?.offsetTop}px`,
|
||||
left: `${selected?.offsetLeft === 12 ? 4 : selected?.offsetLeft}px`,
|
||||
height: `${selected?.offsetHeight}px`,
|
||||
width: `${selected?.offsetWidth}px`
|
||||
width: `${selected?.offsetWidth}px`,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { providers } from '~~/types'
|
||||
import {providers} from '~~/types'
|
||||
|
||||
useHead({
|
||||
title: 'Sign my guestbook • Arthur Danjou'
|
||||
title: 'Sign my guestbook • Arthur Danjou',
|
||||
})
|
||||
|
||||
const { loggedIn, clear, user } = useUserSession()
|
||||
@@ -20,20 +20,20 @@ async function sign() {
|
||||
await $fetch('/api/message', {
|
||||
method: 'post',
|
||||
body: {
|
||||
message: messageContent.value
|
||||
}
|
||||
message: messageContent.value,
|
||||
},
|
||||
}).then(async () => {
|
||||
toast.add({
|
||||
title: `Thanks for leaving a message!`,
|
||||
description: 'Your can see it at the top of the messages.',
|
||||
icon: 'i-material-symbols-check-circle-outline-rounded',
|
||||
timeout: 4000
|
||||
timeout: 4000,
|
||||
})
|
||||
await refresh()
|
||||
}).catch(() => {
|
||||
toast.add({
|
||||
title: 'An error occurred when signing the book!',
|
||||
color: 'red'
|
||||
color: 'red',
|
||||
})
|
||||
})
|
||||
messageContent.value = ''
|
||||
@@ -45,20 +45,20 @@ async function deleteMessage(id: number) {
|
||||
await $fetch('/api/message', {
|
||||
method: 'delete',
|
||||
body: {
|
||||
id
|
||||
}
|
||||
id,
|
||||
},
|
||||
}).then(async () => {
|
||||
toast.add({
|
||||
title: `Message successfully deleted`,
|
||||
icon: 'i-material-symbols-check-circle-outline-rounded',
|
||||
color: 'green',
|
||||
timeout: 4000
|
||||
timeout: 4000,
|
||||
})
|
||||
await refresh()
|
||||
}).catch(() => {
|
||||
toast.add({
|
||||
title: 'An error occured when deleting a message!',
|
||||
color: 'red'
|
||||
color: 'red',
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
useHead({
|
||||
title: 'Arthur Danjou • Software Engineer and Maths Lover'
|
||||
title: 'Arthur Danjou • Software Engineer and Maths Lover',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
definePageMeta({
|
||||
layout: 'maintenance'
|
||||
layout: 'maintenance',
|
||||
})
|
||||
|
||||
useHead({
|
||||
title: 'Site under maintenance • Arthur Danjou'
|
||||
title: 'Site under maintenance • Arthur Danjou',
|
||||
})
|
||||
|
||||
const { data: maintenance } = await useFetch('/api/maintenance')
|
||||
@@ -17,23 +17,23 @@ const socials = [
|
||||
{
|
||||
name: 'mail',
|
||||
icon: 'i-material-symbols-alternate-email',
|
||||
link: 'mailto:arthurdanjou@outlook.fr'
|
||||
link: 'mailto:arthurdanjou@outlook.fr',
|
||||
},
|
||||
{
|
||||
name: 'twitter',
|
||||
icon: 'i-ph-twitter-logo-bold',
|
||||
link: 'https://twitter.com/ArthurDanj'
|
||||
link: 'https://twitter.com/ArthurDanj',
|
||||
},
|
||||
{
|
||||
name: 'github',
|
||||
icon: 'i-ph-github-logo-bold',
|
||||
link: 'https://github.com/ArthurDanjou'
|
||||
link: 'https://github.com/ArthurDanjou',
|
||||
},
|
||||
{
|
||||
name: 'linkedin',
|
||||
icon: 'i-ph-linkedin-logo-bold',
|
||||
link: 'https://www.linkedin.com/in/arthurdanjou/'
|
||||
}
|
||||
link: 'https://www.linkedin.com/in/arthurdanjou/',
|
||||
},
|
||||
]
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { useTalentsStore } from '~/store/talents'
|
||||
import { providers } from '~~/types'
|
||||
import {useTalentsStore} from '~/store/talents'
|
||||
import {providers} from '~~/types'
|
||||
|
||||
useHead({
|
||||
title: 'Discover new talents • Arthur Danjou'
|
||||
title: 'Discover new talents • Arthur Danjou',
|
||||
})
|
||||
|
||||
const categories = ref<Array<{ label: string, slug: string, id: number }>>([{ label: 'All', slug: 'all', id: 0 }])
|
||||
@@ -14,16 +14,16 @@ const { data: talents, pending } = await useFetch('/api/talents', {
|
||||
method: 'get',
|
||||
query: {
|
||||
favorite: isFavorite,
|
||||
category: getCategory
|
||||
category: getCategory,
|
||||
},
|
||||
watch: [isFavorite, getCategory]
|
||||
watch: [isFavorite, getCategory],
|
||||
})
|
||||
|
||||
const { data: getCategories } = await useFetch('/api/categories', { method: 'GET', query: { type: 'talent' } })
|
||||
getCategories.value!.forEach(category => categories.value.push({
|
||||
label: category.name,
|
||||
slug: category.slug,
|
||||
id: category.id
|
||||
id: category.id,
|
||||
}))
|
||||
|
||||
function isCategory(slug: string) {
|
||||
@@ -36,7 +36,7 @@ const getMarkerStyle = computed(() => {
|
||||
top: `${selected?.offsetTop}px`,
|
||||
left: `${selected?.offsetLeft === 12 ? 4 : selected?.offsetLeft}px`,
|
||||
height: `${selected?.offsetHeight}px`,
|
||||
width: `${selected?.offsetWidth}px`
|
||||
width: `${selected?.offsetWidth}px`,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -56,19 +56,19 @@ async function suggest() {
|
||||
await $fetch('/api/suggestion', {
|
||||
method: 'post',
|
||||
body: {
|
||||
content: suggestContent.value
|
||||
}
|
||||
content: suggestContent.value,
|
||||
},
|
||||
}).then((response) => {
|
||||
toast.add({
|
||||
title: `Your suggestion for '${response[0].content}' has been successfully added`,
|
||||
color: 'green',
|
||||
icon: 'i-material-symbols-check-circle-outline-rounded',
|
||||
timeout: 4000
|
||||
timeout: 4000,
|
||||
})
|
||||
}).catch(() => {
|
||||
toast.add({
|
||||
title: 'An error occurred when suggesting someone',
|
||||
color: 'red'
|
||||
color: 'red',
|
||||
})
|
||||
})
|
||||
suggestContent.value = ''
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
useHead({
|
||||
title: 'My work • Arthur Danjou'
|
||||
title: 'My work • Arthur Danjou',
|
||||
})
|
||||
const { data: projects } = await getProjects()
|
||||
</script>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Post as PrismaPost } from '@prisma/client'
|
||||
import type { Post } from '~~/types'
|
||||
import type {Post as PrismaPost} from '@prisma/client'
|
||||
import type {Post} from '~~/types'
|
||||
|
||||
const appConfig = useAppConfig()
|
||||
|
||||
const route = useRoute()
|
||||
const { data: postContent } = await useAsyncData<Post>(`writing:${route.params.slug}`, () => queryContent<Post>(`/writing/${route.params.slug}`).findOne())
|
||||
const {
|
||||
data: post
|
||||
data: post,
|
||||
} = await useFetch<PrismaPost>('/api/article', {
|
||||
method: 'post',
|
||||
body: {
|
||||
slug: route.params.slug.toString()
|
||||
}
|
||||
slug: route.params.slug.toString(),
|
||||
},
|
||||
})
|
||||
|
||||
const likes = ref(post.value?.likes)
|
||||
@@ -20,8 +20,8 @@ async function like() {
|
||||
const data = await $fetch<PrismaPost>('/api/like', {
|
||||
method: 'PUT',
|
||||
body: {
|
||||
slug: post.value?.slug
|
||||
}
|
||||
slug: post.value?.slug,
|
||||
},
|
||||
})
|
||||
likes.value = data.likes
|
||||
}
|
||||
@@ -29,30 +29,30 @@ async function like() {
|
||||
if (!postContent.value) {
|
||||
throw showError({
|
||||
statusMessage: 'The post you are looking for was not found.',
|
||||
statusCode: 404
|
||||
statusCode: 404,
|
||||
})
|
||||
}
|
||||
|
||||
const format = (date: string) => useDateFormat(date, 'D MMMM YYYY').value.replaceAll('"', '')
|
||||
useHead({
|
||||
title: `${postContent.value?.title} • Arthur Danjou's shelf`
|
||||
title: `${postContent.value?.title} • Arthur Danjou's shelf`,
|
||||
})
|
||||
|
||||
function top() {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
behavior: 'smooth',
|
||||
})
|
||||
}
|
||||
|
||||
const { copy, copied } = useClipboard({
|
||||
source: `https://arthurdanjou.fr/writing/${route.params.slug}`,
|
||||
copiedDuring: 4000
|
||||
copiedDuring: 4000,
|
||||
})
|
||||
|
||||
const likeCookie = useCookie<boolean>(`post:like:${postContent.value.slug}`, {
|
||||
maxAge: 604_800
|
||||
maxAge: 604_800,
|
||||
})
|
||||
|
||||
async function handleLike() {
|
||||
|
||||
@@ -3,7 +3,7 @@ const appConfig = useAppConfig()
|
||||
const getColor = computed(() => `text-${appConfig.ui.primary}-500`)
|
||||
|
||||
useHead({
|
||||
title: 'My Shelf • Arthur Danjou'
|
||||
title: 'My Shelf • Arthur Danjou',
|
||||
})
|
||||
|
||||
const { data: posts } = await getPosts()
|
||||
|
||||
Reference in New Issue
Block a user