-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
577 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
<script setup lang="ts"> | ||
import { useDark } from '@vueuse/core'; | ||
import { onMounted, ref, watch } from 'vue'; | ||
import { useDark } from '@vueuse/core' | ||
import { onMounted, ref, watch } from 'vue' | ||
const props = defineProps<{ | ||
src: string; | ||
srcDark?: string; | ||
alt?: string; | ||
}>(); | ||
src: string | ||
srcDark?: string | ||
alt?: string | ||
}>() | ||
const url = ref(''); | ||
const isDark = useDark(); | ||
const url = ref('') | ||
const isDark = useDark() | ||
onMounted(() => { | ||
watch(isDark, (newVal) => { | ||
const src = newVal ? props.srcDark ?? props.src : props.src; | ||
url.value = src; | ||
}, { immediate: true }) | ||
watch( | ||
isDark, | ||
(newVal) => { | ||
const src = newVal ? (props.srcDark ?? props.src) : props.src | ||
url.value = src | ||
}, | ||
{ immediate: true }, | ||
) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<img :src="url" :alt="alt"> | ||
<img :src="url" :alt="alt" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,57 @@ | ||
<script setup lang="ts"> | ||
import type { Project } from '@/data/project'; | ||
import { ArrowRightIcon } from '@heroicons/vue/24/outline'; | ||
import AutoDarkImage from './AutoDarkImage.vue'; | ||
import type { Project } from '@/data/project' | ||
import { ArrowRightIcon } from '@heroicons/vue/24/outline' | ||
import AutoDarkImage from './AutoDarkImage.vue' | ||
defineProps<{ | ||
project: Project; | ||
}>(); | ||
project: Project | ||
}>() | ||
</script> | ||
<template> | ||
<a :href="project.link" target="_blank" rel="noopener noreferrer" decoration-none rounded-xl bg-gray-100 | ||
dark:bg-dark-600 flex="~ col gap-2" w-full h-auto p-4 box-border border="1 gray-200 dark:dark-100 solid" | ||
class="group text-unset!"> | ||
<div h-12 w-12 rounded-md bg-gray-200 dark:bg-dark-700 flex justify-center items-center box-border p-2 | ||
border="1 gray-300 dark:dark-200 solid"> | ||
<AutoDarkImage v-if="project.image" :src="project.image" :src-dark="project.imageDark" :alt="project.title" | ||
object-contain w-8 h-8 /> | ||
<a | ||
:href="project.link" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
decoration-none | ||
rounded-xl | ||
bg-gray-100 | ||
dark:bg-dark-600 | ||
flex="~ col gap-2" | ||
w-full | ||
h-auto | ||
p-4 | ||
box-border | ||
border="1 gray-200 dark:dark-100 solid" | ||
class="group text-unset!" | ||
> | ||
<div | ||
h-12 | ||
w-12 | ||
rounded-md | ||
bg-gray-200 | ||
dark:bg-dark-700 | ||
flex | ||
justify-center | ||
items-center | ||
box-border | ||
p-2 | ||
border="1 gray-300 dark:dark-200 solid" | ||
> | ||
<AutoDarkImage | ||
v-if="project.image" | ||
:src="project.image" | ||
:src-dark="project.imageDark" | ||
:alt="project.title" | ||
object-contain | ||
w-8 | ||
h-8 | ||
/> | ||
<span v-else text-xl>{{ project.title.charAt(0) }}</span> | ||
</div> | ||
<span m-t-1 text-xl font-semibold>{{ project.title }}</span> | ||
<p p-0 m-0 flex-1>{{ project.description }}</p> | ||
<ArrowRightIcon | ||
class="h-5 w-5 text-gray-500 self-end group-hover:translate-x-1 transition-transform duration-200" /> | ||
class="h-5 w-5 text-gray-500 self-end group-hover:translate-x-1 transition-transform duration-200" | ||
/> | ||
</a> | ||
</template> |
Oops, something went wrong.