Skip to content

Commit

Permalink
website / Add images to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-de-pachtere committed Nov 10, 2024
1 parent 89f83a7 commit 5ead3b5
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 8 deletions.
71 changes: 71 additions & 0 deletions libs/ui-components/glow-border/LychenGlowBorder.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<div
:style="parentStyles"
:class="cn('relative glow-border', $props.class)"
>
<div
:style="childStyles"
:class="
cn(
`glow-border before:absolute before:inset-0 before:aspect-square before:size-full before:rounded-[--border-radius] before:bg-[length:300%_300%] before:p-[--border-width] before:opacity-50 before:will-change-[background-position] before:content-['']`,
'before:![-webkit-mask-composite:xor] before:![mask-composite:exclude] before:[mask:--mask-linear-gradient]',
)
"
></div>
<slot />
</div>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { cn } from '../lib/utils';
interface Props {
borderRadius?: number;
color?: string | Array<string>;
borderWidth?: number;
duration?: number;
class?: string;
}
const props = withDefaults(defineProps<Props>(), {
borderRadius: 10,
color: '#FFF',
borderWidth: 2,
duration: 10,
class: undefined,
});
const parentStyles = computed(() => {
return { '--border-radius': `${props.borderRadius}px` };
});
const childStyles = computed(() => ({
'--border-width': `${props.borderWidth}px`,
'--border-radius': `${props.borderRadius}px`,
'--glow-pulse-duration': `${props.duration}s`,
'--mask-linear-gradient': `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
'--background-radial-gradient': `radial-gradient(circle, transparent, ${
props.color instanceof Array ? props.color.join(',') : props.color
}, transparent)`,
}));
</script>

<style scoped>
.glow-border::before {
animation: glow-pulse var(--glow-pulse-duration) infinite linear;
background-image: var(--background-radial-gradient);
}
@keyframes glow-pulse {
0% {
background-position: 0% 0%;
}
50% {
background-position: 100% 100%;
}
100% {
background-position: 0% 0%;
}
}
</style>
Binary file not shown.
Binary file added projects/website/src/views/assets/hero-1.webp
Binary file not shown.
Binary file not shown.
21 changes: 20 additions & 1 deletion projects/website/src/views/home/ViewHomeDefinition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,32 @@
>
<LychenTitle
variant="h1"
class="z-10 text-surface-on"
class="text-surface-on z-10"
>{{ t('definition.phonetic') }}
</LychenTitle>
<LychenTextGenerateEffect
:words="t('definition.definition')"
class="text-xl font-bold opacity-90 lg:w-1/3"
/>
</LychenPatternBackground>
<div class="container">
<LychenGlowBorder
:color="[
'rgb(var(--color-primary))',
'rgb(var(--color-secondary))',
'rgb(var(--color-tertiary))',
]"
>
<img
:src="imageUrl"
class="h-60 w-full rounded-xl object-cover"
/>
</LychenGlowBorder>
</div>
</template>

<script setup lang="ts">
import imageUrl from '../assets/definition.webp';
import {
PATTERN_BACKGROUND_DIRECTION,
PATTERN_BACKGROUND_MASK,
Expand All @@ -36,6 +51,10 @@ const LychenPatternBackground = defineAsyncComponent(
() => import('@lychen/ui-components/pattern-background/LychenPatternBackground.vue'),
);
const LychenGlowBorder = defineAsyncComponent(
() => import('@lychen/ui-components/glow-border/LychenGlowBorder.vue'),
);
const LychenTitle = defineAsyncComponent(
() => import('@lychen/ui-components/title/LychenTitle.vue'),
);
Expand Down
5 changes: 3 additions & 2 deletions projects/website/src/views/home/ViewHomeHero.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<LychenHero
class="flex flex-col-reverse items-center gap-4 text-surface-on lg:flex-row"
background-image="https://img.passeportsante.net/1200x675/2021-05-03/i103871-lichens-hm.webp"
class="text-surface-on flex flex-col-reverse items-center gap-4 lg:flex-row"
:background-image="heroUrl"
overlay
overlay-class="bg-surface opacity-50"
>
Expand All @@ -24,6 +24,7 @@
</template>

<script setup lang="ts">
import heroUrl from '../assets/hero-1.webp';
import { defineAsyncComponent } from 'vue';
import { useTranslations } from './i18n';
Expand Down
8 changes: 4 additions & 4 deletions projects/website/src/views/home/ViewHomeOSS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@
>
<div class="grid grid-cols-2 grid-rows-2 gap-4">
<LychenCard
class="flex flex-col items-center justify-center gap-4 rounded-lg bg-surface-container-low p-10"
class="bg-surface-container-low flex flex-col items-center justify-center gap-4 rounded-lg p-10"
>
<LychenIcon
icon="lock-open"
class="fa-2xl opacity-70"
/>{{ t('oss.key_point.no_vendor_lockin') }}
</LychenCard>
<LychenCard
class="flex flex-col items-center justify-center gap-4 rounded-lg bg-surface-container-low p-10"
class="bg-surface-container-low flex flex-col items-center justify-center gap-4 rounded-lg p-10"
>
<LychenIcon
icon="arrow-up-right-and-arrow-down-left-from-center"
class="fa-2xl opacity-70"
/>{{ t('oss.key_point.scalable') }}
</LychenCard>
<LychenCard
class="flex flex-col items-center justify-center gap-4 rounded-lg bg-surface-container-low p-10"
class="bg-surface-container-low flex flex-col items-center justify-center gap-4 rounded-lg p-10"
>
<LychenIcon
icon="plug-circle-plus"
class="fa-2xl opacity-70"
/>{{ t('oss.key_point.extensible') }}
</LychenCard>
<LychenCard
class="flex flex-col items-center justify-center gap-4 rounded-lg bg-surface-container-low p-10"
class="bg-surface-container-low flex flex-col items-center justify-center gap-4 rounded-lg p-10"
>
<LychenIcon
icon="cloud-arrow-up"
Expand Down
3 changes: 2 additions & 1 deletion projects/website/src/views/home/ViewHomePresentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
</div>
<div class="basis-1/2">
<img
src="https://images.pexels.com/photos/1072824/pexels-photo-1072824.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
:src="imageUrl"
class="rounded-lg"
/>
</div>
</LychenContainer>
</template>

<script setup lang="ts">
import imageUrl from '../assets/presentation.webp';
import { defineAsyncComponent } from 'vue';
import { useTranslations } from './i18n';
Expand Down

0 comments on commit 5ead3b5

Please sign in to comment.