-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
c845ba5
commit 0bc3e20
Showing
7 changed files
with
144 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
<script setup lang="ts"> | ||
const useActiveSection = useState("activeSection"); | ||
import { projectsData } from "~/assets/data"; | ||
const projectsRef = ref(); | ||
useSectionInView(projectsRef, "我的项目"); | ||
</script> | ||
|
||
<template> | ||
<div ref="projectsRef" class="scroll-mt-28 mb-28" id="projects"> | ||
<div | ||
ref="projectsRef" | ||
class="scroll-mt-28 mb-28" | ||
id="projects" | ||
> | ||
<h2 class="text-3xl font-medium capitalize mb-8 text-center">我的项目</h2> | ||
<AppProjectItem | ||
v-for="(project, index) in projectsData" | ||
:key="index" | ||
:project="project" | ||
/> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<script setup lang="ts"> | ||
interface Project { | ||
title: string; | ||
description: string; | ||
tags: string[]; | ||
imageUrl: string; | ||
projectUrl: string; | ||
demoUrl: string; | ||
detailRoute: string; | ||
} | ||
const props = defineProps<{ | ||
project: Project; | ||
}>(); | ||
const { title, description, tags, imageUrl, projectUrl, demoUrl, detailRoute } = | ||
props.project; | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="group mb-3 sm:mb-8 last:mb-0" | ||
data-aos="new-animation" | ||
data-aos-mirror="true" | ||
> | ||
<section | ||
class="bg-gray-100 max-w-[45rem] border border-black/5 rounded-lg overflow-hidden sm:pr-8 relative sm:h-[28rem] transition sm:group-even:pl-8 dark:text-white dark:bg-white/10" | ||
> | ||
<div | ||
class="group pt-4 pb-7 px-5 sm:pl-10 sm:pr-2 sm:pt-10 sm:max-w-[50%] flex flex-col items-start gap-3 h-full sm:group-even:ml-[18rem]" | ||
> | ||
<div class="flex flex-col gap-3 items-start"> | ||
<h3 | ||
class="text-2xl font-semibold group-hover:text-pink dark:group-hover:text-yellow hover:underline" | ||
> | ||
{{ title }} | ||
</h3> | ||
|
||
<div class="flex gap-3 text-sm text-gray-500 dark:text-gray-300"> | ||
<NuxtLink | ||
v-if="projectUrl" | ||
:to="projectUrl" | ||
target="_blank" | ||
class="w-full flex items-center gap-1 hover:underline underline-offset-2" | ||
> | ||
<span class="break-keep">Code</span> | ||
|
||
<Icon name="mdi:github-box" size="17" /> | ||
</NuxtLink> | ||
<NuxtLink | ||
v-if="demoUrl" | ||
:to="demoUrl" | ||
target="_blank" | ||
class="w-full flex items-center gap-1 hover:underline underline-offset-2" | ||
> | ||
<span class="break-keep min-w-[4.5rem]">Live demo</span> | ||
<Icon name="mdi:launch" size="17" /> | ||
</NuxtLink> | ||
</div> | ||
</div> | ||
|
||
<p class="mt-2 leading-relaxed text-gray-700 dark:text-white/70"> | ||
{{ description }} | ||
</p> | ||
<ul class="flex flex-wrap mt-auto gap-2"> | ||
<li | ||
v-for="(tag, index) in tags" | ||
class="bg-black/[0.7] px-3 py-1 text-[0.7rem] uppercase tracking-wider text-white rounded-full dark:text-white/70" | ||
:key="index" | ||
> | ||
{{ tag }} | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<NuxtImg | ||
:src="imageUrl" | ||
alt="Project I worked on" | ||
quality="95" | ||
class="absolute hidden sm:block top-8 -right-40 w-[28.25rem] rounded-t-lg shadow-2xl transition group-hover:scale-[1.04] group-hover:-translate-x-3 group-hover:translate-y-3 group-hover:-rotate-2 group-even:group-hover:translate-x-3 group-even:group-hover:translate-y-3 group-even:group-hover:rotate-2 group-even:right-[initial] group-even:-left-40" | ||
/> | ||
</section> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
[data-aos="new-animation"] { | ||
scale: 0.8; | ||
opacity: 0.6; | ||
transition-property: transform, scale, opacity; | ||
&.aos-animate { | ||
scale: 1; | ||
opacity: 1; | ||
} | ||
} | ||
</style> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.