Skip to content

Commit 5a0c238

Browse files
committed
feat: add FeatureCard and ImageViewer components, refactor iExec Explorer documentation
1 parent e49dbb0 commit 5a0c238

File tree

5 files changed

+214
-203
lines changed

5 files changed

+214
-203
lines changed

src/components/FeatureCard.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<template>
2+
<a :href="linkUrl" class="block h-full text-inherit no-underline!">
3+
<div
4+
class="bg-soft-bg border-border flex h-full cursor-pointer flex-col rounded-lg border p-6 transition-all duration-200 ease-in-out hover:-translate-y-0.5 hover:shadow-md"
5+
>
6+
<div class="mb-4 text-3xl">{{ icon }}</div>
7+
<h3 class="text-text1 m-0 mb-2">{{ title }}</h3>
8+
<p class="text-text2 m-0 flex-grow leading-relaxed">{{ description }}</p>
9+
</div>
10+
</a>
11+
</template>
12+
13+
<script setup lang="ts">
14+
interface Props {
15+
icon: string;
16+
title: string;
17+
description: string;
18+
linkUrl: string;
19+
}
20+
21+
defineProps<Props>();
22+
</script>

src/components/FeatureGrid.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="my-8 grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-6">
3+
<slot />
4+
</div>
5+
</template>

src/components/ImageGrid.vue

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<div class="my-12 grid grid-cols-[repeat(auto-fit,minmax(500px,1fr))] gap-12">
3+
<div v-for="(image, index) in images" :key="index" class="text-center">
4+
<a :href="image.linkUrl" target="_blank" rel="noreferrer">
5+
<img
6+
:src="image.imageUrl"
7+
:alt="image.imageAlt"
8+
class="border-border w-full max-w-[700px] rounded-lg border shadow-lg transition-transform duration-200 ease-in-out hover:scale-[1.02]"
9+
/>
10+
</a>
11+
<p class="text-text2 mt-2 font-medium">{{ image.title }}</p>
12+
<p v-if="image.caption" class="mt-2">
13+
<a
14+
:href="image.linkUrl"
15+
target="_blank"
16+
rel="noreferrer"
17+
class="text-primary hover:text-primary2 inline-flex items-center gap-2 text-sm no-underline transition-colors duration-200"
18+
>
19+
<Icon :icon="image.linkIcon || 'mdi:external-link'" height="16" />
20+
{{ image.caption }}
21+
</a>
22+
</p>
23+
</div>
24+
</div>
25+
</template>
26+
27+
<script setup lang="ts">
28+
import { Icon } from '@iconify/vue';
29+
30+
interface ImageGridItem {
31+
imageUrl: string;
32+
imageAlt: string;
33+
linkUrl: string;
34+
title: string;
35+
caption?: string;
36+
linkIcon?: string;
37+
}
38+
39+
interface Props {
40+
images: ImageGridItem[];
41+
}
42+
43+
defineProps<Props>();
44+
</script>

src/components/ImageViewer.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<div :class="['my-8', { 'text-center': centered }]">
3+
<a :href="linkUrl" target="_blank" rel="noreferrer">
4+
<img
5+
:src="imageUrl"
6+
:alt="imageAlt"
7+
:style="{
8+
width: '100%',
9+
maxWidth: maxWidth,
10+
borderRadius: borderRadius,
11+
border: '1px solid var(--vp-c-border)',
12+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
13+
}"
14+
class="transition-transform duration-200 ease-in-out hover:scale-[1.02]"
15+
/>
16+
</a>
17+
<p v-if="caption" class="mt-4 font-medium">
18+
<a
19+
:href="linkUrl"
20+
target="_blank"
21+
rel="noreferrer"
22+
class="text-primary hover:text-primary2 inline-flex items-center gap-2 no-underline transition-colors duration-200"
23+
>
24+
<Icon :icon="linkIcon" height="16" />
25+
{{ caption }}
26+
</a>
27+
</p>
28+
</div>
29+
</template>
30+
31+
<script setup lang="ts">
32+
import { Icon } from '@iconify/vue';
33+
34+
interface Props {
35+
imageUrl: string;
36+
imageAlt: string;
37+
linkUrl: string;
38+
caption?: string;
39+
linkIcon?: string;
40+
centered?: boolean;
41+
maxWidth?: string;
42+
borderRadius?: string;
43+
}
44+
45+
withDefaults(defineProps<Props>(), {
46+
linkIcon: 'mdi:external-link',
47+
centered: true,
48+
maxWidth: '800px',
49+
borderRadius: '8px',
50+
});
51+
</script>

0 commit comments

Comments
 (0)