mirror of
https://github.com/ArthurDanjou/website-old.git
synced 2026-01-21 07:21:47 +01:00
Working
This commit is contained in:
@@ -26,7 +26,7 @@ export default {
|
||||
const {$axios, $sentry, app} = useContext()
|
||||
|
||||
const announce = useAsync(async () => {
|
||||
const response = await $axios.get('/api/announces', {
|
||||
const response = await $axios.get('/api/announce', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
}
|
||||
|
||||
@@ -31,7 +31,9 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
if (response.status === 200) {
|
||||
return response.data.experiences
|
||||
return response.data.experiences.sort((a, b) => {
|
||||
return a.end_date === 'Today' ? -1 : a.end_date.split('-')[1] > b.end_date.split('-')[1] ? -1 : a.end_date.split('-')[0] > b.end_date.split('-')[0] ? 0 : 1
|
||||
})
|
||||
} else {
|
||||
app.error({statusCode: 500})
|
||||
$sentry.captureEvent(response.data)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<a target="_blank" href="https://www.twitch.tv/arthurdanjou" rel="noopener noreferrer">
|
||||
<TwitchIcon />
|
||||
</a>
|
||||
<a target="_blank" href="https://discord.gg/RQhjE5UkxD" rel="noopener noreferrer">
|
||||
<a target="_blank" href="https://discord.gg/ENG6cFQhPS" rel="noopener noreferrer">
|
||||
<DiscordIcon />
|
||||
</a>
|
||||
<a target="_blank" href="mailto:contact@arthurdanjou.fr" rel="noopener noreferrer">
|
||||
|
||||
@@ -31,7 +31,9 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
if (response.status === 200) {
|
||||
return response.data.formations
|
||||
return response.data.formations.sort((a, b) => {
|
||||
return a.end_date === 'Today' ? -1 : a.end_date.split('-')[1] > b.end_date.split('-')[1] ? -1 : a.end_date.split('-')[0] > b.end_date.split('-')[0] ? 0 : 1
|
||||
})
|
||||
} else {
|
||||
app.error({statusCode: 500})
|
||||
$sentry.captureEvent(response.data)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ul class="flex items-center">
|
||||
<li @click="changeLanguage()"
|
||||
class="mx-1 h-9 w-9 cursor-pointer flex items-center justify-center p-1.5 rounded-xl hover:bg-gray-300 duration-200 dark:hover:bg-dark-400">
|
||||
<TranslateIcon/>
|
||||
<TranslateIcon :french="isFrench"/>
|
||||
</li>
|
||||
<li @click="changeColorMode()"
|
||||
class="mx-1 h-9 w-9 cursor-pointer flex items-center p-1.5 rounded-xl hover:bg-gray-300 dark:hover:bg-dark-400 duration-200">
|
||||
@@ -83,6 +83,7 @@ export default defineComponent({
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
const isFrench = computed(() => i18n.locale === 'fr')
|
||||
|
||||
const store = useStore<State>()
|
||||
const route = computed(() => store.state.route)
|
||||
@@ -97,7 +98,8 @@ export default defineComponent({
|
||||
changeColorMode,
|
||||
updateScroll,
|
||||
changeLanguage,
|
||||
isWindow
|
||||
isWindow,
|
||||
isFrench
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<section class="w-full mb-10">
|
||||
<h3 class="font-bold text-2xl md:text-4xl">
|
||||
{{ $t('about.title.languages') }}
|
||||
<TranslateIcon />
|
||||
<LanguageIcon />
|
||||
</h3>
|
||||
<div>
|
||||
<table class="text-base text-xl text-gray-700 dark:text-gray-400">
|
||||
@@ -21,6 +21,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "LanguagesAbout"
|
||||
name: "LanguagesAbout",
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,22 +51,22 @@ export default defineComponent({
|
||||
const toggleMenu = () => {
|
||||
store.commit('TOGGLE_OPENED', !store.state.opened)
|
||||
if (store.state.opened) {
|
||||
document.getElementById('slider')!.style.maxHeight = window.screen.height + 'px'
|
||||
setTimeout(() => document.getElementById('nav')!.classList.add('z-50'), 300)
|
||||
} else {
|
||||
document.getElementById('nav')!.classList.remove('z-50')
|
||||
setTimeout(() => {
|
||||
document.getElementById('slider')!.style.maxHeight = 'none'
|
||||
}, 100)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
const $router = useRouter()
|
||||
$router.afterEach(() => {
|
||||
store.commit('TOGGLE_OPENED', false)
|
||||
document.getElementById('nav')!.classList.remove('z-50')
|
||||
setTimeout(() => {
|
||||
document.getElementById('slider')!.style.maxHeight = 'none'
|
||||
}, 100)
|
||||
}, 600)
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<nuxt-link :to="`/blog/${slug}`">
|
||||
<div class="rounded-lg dark:shadow-white shadow-xl h-116 w-full lg:w-100 text-left bg-gray-100 dark:bg-gray-800 transform hover:scale-103 duration-300 mb-8 lg:mb-0">
|
||||
<div class="h-2/5 post rounded-t-lg"
|
||||
:style="{ backgroundImage: `url(${getCover})` }">
|
||||
:style="{ backgroundImage: `url(https://athena.arthurdanjou.fr/files/${cover})` }">
|
||||
</div>
|
||||
<div class="h-3/5 p-4 flex flex-col justify-between">
|
||||
<div>
|
||||
@@ -11,8 +11,8 @@
|
||||
<Tag :content="tag" :pill="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold">{{ title }}</h1>
|
||||
<p class="text-base mt-3 text-gray-700 dark:text-gray-400 text-justify">{{ description }}</p>
|
||||
<h1 class="text-2xl font-bold">{{ $t(title) }}</h1>
|
||||
<p class="text-base mt-3 text-gray-700 dark:text-gray-400 text-justify">{{ $t(description) }}</p>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<h5 class="text-base text-gray-700 dark:text-gray-400">{{ formatDate }}</h5>
|
||||
@@ -69,8 +69,6 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
setup(props: PostProps) {
|
||||
const getCover = computed(() => require(`~/assets/images/posts/${props.cover}`))
|
||||
|
||||
const { i18n } = useContext()
|
||||
const formatDate = computed(() => {
|
||||
const [first, second, third]: any = props.date.split('-')
|
||||
@@ -78,7 +76,6 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
return {
|
||||
getCover,
|
||||
formatDate
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<div class="my-8 lg:flex w-full lg:space-x-6">
|
||||
<div v-for="post in posts">
|
||||
<Post
|
||||
:title="post.title"
|
||||
:cover="post.cover"
|
||||
:description="post.description"
|
||||
:title="post.title.code"
|
||||
:cover="post.cover.file_name"
|
||||
:description="post.description.code"
|
||||
:date="post.date"
|
||||
:slug="post.slug"
|
||||
:tags="post.tags"
|
||||
@@ -36,17 +36,21 @@ import {Post} from "~/types/types";
|
||||
export default defineComponent({
|
||||
name: "PostsHome",
|
||||
setup() {
|
||||
const { $content, i18n, $sentry } = useContext()
|
||||
const { $axios, app, $sentry } = useContext()
|
||||
|
||||
const posts = useAsync(() => {
|
||||
return $content(`articles/${i18n.locale}`)
|
||||
.sortBy('date', 'asc')
|
||||
.limit(3)
|
||||
.fetch<Post>()
|
||||
.catch((error) => {
|
||||
$sentry.captureEvent(error)
|
||||
})
|
||||
}, 'posts')
|
||||
const posts = useAsync(async () => {
|
||||
const response = await $axios.get('/api/posts', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
}
|
||||
})
|
||||
if (response.status === 200) {
|
||||
return response.data.posts
|
||||
} else {
|
||||
app.error({statusCode: 500})
|
||||
$sentry.captureEvent(response.data)
|
||||
}
|
||||
}, 'posts_home')
|
||||
|
||||
return {
|
||||
posts
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<img class="rounded-full my-5" src="~/assets/images/memojies/Hey.png" alt="A picture of myself" />
|
||||
</div>
|
||||
<div class="text-lg leading-6 text-justify dark:text-gray-400 text-gray-700">
|
||||
<p>{{ $t('about.banner.hello') }} <span class="text-indigo-600 font-bold">Arthur DANJOU</span> 👋.</p> <br/>
|
||||
<div>{{ $t('about.banner.hello') }} <span class="text-indigo-600 font-bold">Arthur DANJOU</span> 👋.</div> <br/>
|
||||
<p>{{ $t('about.banner.1')}}</p> <br/>
|
||||
<p>{{ $t('about.banner.2') }}</p> <br/>
|
||||
<p>{{ $t('about.banner.3') }}</p> <br />
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<a :href="url" target="_blank">
|
||||
<div class="rounded-lg dark:shadow-white shadow-xl h-92 w-full lg:w-84 text-left bg-gray-100 dark:bg-gray-800 transform hover:scale-103 duration-300 mb-8 lg:mb-0">
|
||||
<div class="h-1/2 w-full h-2/5 project rounded-t-lg"
|
||||
:style="{ backgroundImage: `url(${getCover})` }">
|
||||
<div class="rounded-lg dark:shadow-white shadow-xl lg:h-92 w-full lg:w-84 text-left bg-gray-100 dark:bg-gray-800 transform hover:scale-103 duration-300 mb-8 lg:mb-0">
|
||||
<div class="h-64 lg:h-1/2 w-full project rounded-t-lg"
|
||||
:style="{ backgroundImage: `url(https://athena.arthurdanjou.fr/files/${cover})` }">
|
||||
</div>
|
||||
<div class="h-1/2 p-4 flex flex-col justify-between">
|
||||
<div class="lg:h-1/2 py-8 px-4 lg:p-4 flex flex-col justify-between">
|
||||
<div>
|
||||
<div class="flex space-x-2 mb-2">
|
||||
<div v-for="tag in tags">
|
||||
<Tag :content="tag" :pill="false"/>
|
||||
<Tag :content="tag.label.code" :pill="false"/>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold">{{ title }}</h1>
|
||||
@@ -20,15 +20,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {computed, defineComponent} from "@nuxtjs/composition-api";
|
||||
|
||||
interface ProjectProp {
|
||||
title: string,
|
||||
cover: string,
|
||||
tags: Array<String>,
|
||||
description: string,
|
||||
url: string,
|
||||
}
|
||||
import {defineComponent} from "@nuxtjs/composition-api";
|
||||
|
||||
export default defineComponent({
|
||||
name: "Project",
|
||||
@@ -53,13 +45,6 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: 'https://arthurdanjou.fr'
|
||||
}
|
||||
},
|
||||
setup(props: ProjectProp) {
|
||||
const getCover = computed(() => require(`@/assets/images/projects/${props.cover}`))
|
||||
|
||||
return {
|
||||
getCover
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
{{ $t('projects.description') }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="my-8 lg:flex w-full lg:space-x-8 flex flex-wrap justify-center">
|
||||
<div class="my-8 w-full lg:space-x-8 lg:flex justify-center">
|
||||
<div v-for="project in projects" class="mb-4">
|
||||
<Project
|
||||
:title="project.title"
|
||||
:cover="project.cover"
|
||||
:description="project.description"
|
||||
:title="project.name"
|
||||
:cover="project.cover.file_name"
|
||||
:description="project.description.code"
|
||||
:tags="project.tags"
|
||||
:url="project.url"
|
||||
/>
|
||||
@@ -34,16 +34,21 @@ import {Project} from "~/types/types";
|
||||
export default defineComponent({
|
||||
name: "ProjectsHome",
|
||||
setup() {
|
||||
const { $content, $sentry } = useContext()
|
||||
const { $axios, app, $sentry } = useContext()
|
||||
|
||||
const projects = useAsync(() => {
|
||||
return $content(`projects`)
|
||||
.limit(3)
|
||||
.fetch<Project>()
|
||||
.catch((error) => {
|
||||
$sentry.captureEvent(error)
|
||||
})
|
||||
}, 'projects')
|
||||
const projects = useAsync(async () => {
|
||||
const response = await $axios.get('/api/projects', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
}
|
||||
})
|
||||
if (response.status === 200) {
|
||||
return response.data.projects.slice(0, 3)
|
||||
} else {
|
||||
$sentry.captureEvent(response.data)
|
||||
app.error({statusCode: 500})
|
||||
}
|
||||
}, 'projects_home')
|
||||
|
||||
return {
|
||||
projects
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<ul class="flex items-center">
|
||||
<li @click="changeLanguage()"
|
||||
class="mx-1 h-9 w-9 cursor-pointer flex items-center justify-center p-1.5 rounded-xl hover:bg-gray-300 duration-200 dark:hover:bg-dark-400">
|
||||
<TranslateIcon/>
|
||||
<TranslateIcon :french="isFrench" />
|
||||
</li>
|
||||
<li @click="changeColorMode()"
|
||||
class="mx-1 h-9 w-9 cursor-pointer flex items-center p-1.5 rounded-xl hover:bg-gray-300 dark:hover:bg-dark-400 duration-200">
|
||||
@@ -90,7 +90,7 @@
|
||||
<a target="_blank" href="https://www.twitch.tv/arthurdanjou" rel="noopener noreferrer">
|
||||
<TwitchIcon />
|
||||
</a>
|
||||
<a target="_blank" href="https://discord.gg/RQhjE5UkxD" rel="noopener noreferrer">
|
||||
<a target="_blank" href="https://discord.gg/ENG6cFQhPS" rel="noopener noreferrer">
|
||||
<DiscordIcon />
|
||||
</a>
|
||||
<a target="_blank" href="mailto:contact@arthurdanjou.fr" rel="noopener noreferrer">
|
||||
@@ -130,13 +130,15 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
const isFrench = computed(() => i18n.locale === 'fr')
|
||||
|
||||
const store = useStore<State>()
|
||||
const closeMenu = () => {
|
||||
store.commit('TOGGLE_OPENED', false)
|
||||
document.getElementById('nav')!.classList.remove('z-50')
|
||||
setTimeout(() => {
|
||||
document.getElementById('slider')!.style.maxHeight = 'none'
|
||||
}, 100)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
const route = computed(() => store.state.route)
|
||||
@@ -150,7 +152,8 @@ export default defineComponent({
|
||||
changeLanguage,
|
||||
closeMenu,
|
||||
opened: computed(() => store.state.opened),
|
||||
isWindow
|
||||
isWindow,
|
||||
isFrench
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
14
src/components/icons/LanguageIcon.vue
Normal file
14
src/components/icons/LanguageIcon.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<svg class="inline" width="1em" height="1em" viewBox="0 0 24 24" focusable="false">
|
||||
<path
|
||||
d="M12.87 15.07l-2.54-2.51l.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35C8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5l3.11 3.11l.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "LanguageIcon"
|
||||
}
|
||||
</script>
|
||||
@@ -1,14 +1,40 @@
|
||||
<template>
|
||||
<svg class="inline" width="1.5em" height="1.5em" viewBox="0 0 24 24" focusable="false">
|
||||
<svg v-if="french" class="inline" width="1.5em" height="1.5em" viewBox="0 0 36 36" focusable="false">
|
||||
<path
|
||||
d="M12.87 15.07l-2.54-2.51l.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35C8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5l3.11 3.11l.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
fill="#00247D"
|
||||
d="M0 9.059V13h5.628zM4.664 31H13v-5.837zM23 25.164V31h8.335zM0 23v3.941L5.63 23zM31.337 5H23v5.837zM36 26.942V23h-5.631zM36 13V9.059L30.371 13zM13 5H4.664L13 10.837z" />
|
||||
<path
|
||||
fill="#CF1B2B"
|
||||
d="M25.14 23l9.712 6.801a3.977 3.977 0 0 0 .99-1.749L28.627 23H25.14zM13 23h-2.141l-9.711 6.8c.521.53 1.189.909 1.938 1.085L13 23.943V23zm10-10h2.141l9.711-6.8a3.988 3.988 0 0 0-1.937-1.085L23 12.057V13zm-12.141 0L1.148 6.2a3.994 3.994 0 0 0-.991 1.749L7.372 13h3.487z" />
|
||||
<path
|
||||
fill="#EEE"
|
||||
d="M36 21H21v10h2v-5.836L31.335 31H32a3.99 3.99 0 0 0 2.852-1.199L25.14 23h3.487l7.215 5.052c.093-.337.158-.686.158-1.052v-.058L30.369 23H36v-2zM0 21v2h5.63L0 26.941V27c0 1.091.439 2.078 1.148 2.8l9.711-6.8H13v.943l-9.914 6.941c.294.07.598.116.914.116h.664L13 25.163V31h2V21H0zM36 9a3.983 3.983 0 0 0-1.148-2.8L25.141 13H23v-.943l9.915-6.942A4.001 4.001 0 0 0 32 5h-.663L23 10.837V5h-2v10h15v-2h-5.629L36 9.059V9zM13 5v5.837L4.664 5H4a3.985 3.985 0 0 0-2.852 1.2l9.711 6.8H7.372L.157 7.949A3.968 3.968 0 0 0 0 9v.059L5.628 13H0v2h15V5h-2z" />
|
||||
<path
|
||||
fill="#CF1B2B"
|
||||
d="M21 15V5h-6v10H0v6h15v10h6V21h15v-6z" />
|
||||
</svg>
|
||||
<svg v-else class="inline" width="1.5em" height="1.5em" viewBox="0 0 36 36" focusable="false">
|
||||
<path
|
||||
fill="#ED2939"
|
||||
d="M36 27a4 4 0 0 1-4 4h-8V5h8a4 4 0 0 1 4 4v18z" />
|
||||
<path
|
||||
fill="#002495"
|
||||
d="M4 5a4 4 0 0 0-4 4v18a4 4 0 0 0 4 4h8V5H4z" />
|
||||
<path
|
||||
fill="#EEE"
|
||||
d="M12 5h12v26H12z" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TranslateIcon"
|
||||
name: "TranslateIcon",
|
||||
props: {
|
||||
french: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user