-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): update preview and add localization
- Loading branch information
Showing
12 changed files
with
186 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,24 +1,46 @@ | ||
<script setup lang="ts"> | ||
import ContainerScroll from '@/components/ui/ContainerScroll/ContainerScroll.vue' | ||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' | ||
import { PREVIEW_TABS_DATA } from '@/data/PreviewTabs.data' | ||
</script> | ||
|
||
<template> | ||
<section> | ||
<div class="mb-16 flex flex-col"> | ||
<ContainerScroll> | ||
<template #title> | ||
<h1 class="text-6xl font-bold">Какой-то текст</h1> | ||
</template> | ||
<template #card> | ||
<img | ||
src="/images/linear.webp" | ||
class="mx-auto h-full rounded-2xl object-cover object-left-top" | ||
alt="hero" | ||
height="3104" | ||
width="5480" | ||
/> | ||
</template> | ||
</ContainerScroll> | ||
</div> | ||
<Tabs default-value="home"> | ||
<div class="mb-16 flex flex-col"> | ||
<ContainerScroll> | ||
<template #title> | ||
<TabsList | ||
class="flex w-full flex-row gap-1 border border-white/10 bg-black/5 backdrop-blur-sm" | ||
> | ||
<TabsTrigger | ||
v-memo="tab" | ||
v-for="tab in PREVIEW_TABS_DATA" | ||
:key="tab.value" | ||
:value="tab.value" | ||
> | ||
{{ $t(`previews.${tab.value}`) }} | ||
</TabsTrigger> | ||
</TabsList> | ||
</template> | ||
<template #card> | ||
<TabsContent | ||
v-memo="tab" | ||
v-for="tab in PREVIEW_TABS_DATA" | ||
:key="tab.value" | ||
:value="tab.value" | ||
> | ||
<img | ||
:src="tab.content" | ||
class="mx-auto h-full rounded-2xl object-cover object-left-top" | ||
alt="hero" | ||
height="3104" | ||
width="5480" | ||
/> | ||
</TabsContent> | ||
</template> | ||
</ContainerScroll> | ||
</div> | ||
</Tabs> | ||
</section> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
import type { TabsRootEmits, TabsRootProps } from 'radix-vue' | ||
import { TabsRoot, useForwardPropsEmits } from 'radix-vue' | ||
const props = defineProps<TabsRootProps>() | ||
const emits = defineEmits<TabsRootEmits>() | ||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<TabsRoot v-bind="forwarded"> | ||
<slot /> | ||
</TabsRoot> | ||
</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,22 @@ | ||
<script setup lang="ts"> | ||
import type { TabsContentProps } from 'radix-vue' | ||
import { TabsContent } from 'radix-vue' | ||
import type { HTMLAttributes } from 'vue' | ||
import { computed } from 'vue' | ||
import { cn } from '@/utils' | ||
const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<TabsContent :class="cn(props.class)" v-bind="delegatedProps"> | ||
<slot /> | ||
</TabsContent> | ||
</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,30 @@ | ||
<script setup lang="ts"> | ||
import type { TabsListProps } from 'radix-vue' | ||
import { TabsList } from 'radix-vue' | ||
import type { HTMLAttributes } from 'vue' | ||
import { computed } from 'vue' | ||
import { cn } from '@/utils' | ||
const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<TabsList | ||
v-bind="delegatedProps" | ||
:class=" | ||
cn( | ||
'inline-flex items-center justify-center rounded-md bg-muted p-0.5 text-muted-foreground', | ||
props.class, | ||
) | ||
" | ||
> | ||
<slot /> | ||
</TabsList> | ||
</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,34 @@ | ||
<script setup lang="ts"> | ||
import type { TabsTriggerProps } from 'radix-vue' | ||
import { TabsTrigger, useForwardProps } from 'radix-vue' | ||
import type { HTMLAttributes } from 'vue' | ||
import { computed } from 'vue' | ||
import { cn } from '@/utils' | ||
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwardedProps = useForwardProps(delegatedProps) | ||
</script> | ||
|
||
<template> | ||
<TabsTrigger | ||
v-bind="forwardedProps" | ||
:class=" | ||
cn( | ||
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-base font-medium text-[#aaaaaa] ring-offset-background transition-all hover:bg-white/10 hover:text-[#f2f2f2] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white/20 data-[state=active]:text-[#f2f2f2] data-[state=active]:shadow-sm', | ||
props.class, | ||
) | ||
" | ||
> | ||
<span class="truncate"> | ||
<slot /> | ||
</span> | ||
</TabsTrigger> | ||
</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,4 @@ | ||
export { default as Tabs } from './Tabs.vue' | ||
export { default as TabsContent } from './TabsContent.vue' | ||
export { default as TabsList } from './TabsList.vue' | ||
export { default as TabsTrigger } from './TabsTrigger.vue' |
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,27 @@ | ||
export interface PreviewTabsData { | ||
value: string | ||
content: string | ||
} | ||
|
||
export const PREVIEW_TABS_DATA: PreviewTabsData[] = [ | ||
{ | ||
value: 'home', | ||
content: '/images/screen.webp', | ||
}, | ||
{ | ||
value: 'valorant', | ||
content: '/images/screen.webp', | ||
}, | ||
{ | ||
value: 'faceit', | ||
content: '/images/screen.webp', | ||
}, | ||
{ | ||
value: 'music', | ||
content: '/images/screen.webp', | ||
}, | ||
{ | ||
value: 'bot', | ||
content: '/images/screen.webp', | ||
}, | ||
] |
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