Skip to content

Commit ae18739

Browse files
committed
feat: add TutorialCard component for improved tutorial presentation in documentation
1 parent a9fd2eb commit ae18739

File tree

2 files changed

+103
-55
lines changed

2 files changed

+103
-55
lines changed

src/components/TutorialCard.vue

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<template>
2+
<a
3+
:href="href"
4+
:class="[
5+
'rounded-xl bg-[var(--vp-c-bg-soft)] p-6 no-underline! text-[var(--vp-c-text-1)]! relative before:duration-300 before:absolute before:inset-x-0 before:top-0 before:h-10 hover:before:-translate-y-0.5 before:bg-primary before:-z-10 before:rounded-xl',
6+
variant === 'bonus' ? 'border-2 border-primary' : ''
7+
]"
8+
>
9+
<h3 class="mt-0! mb-3!">{{ title }}</h3>
10+
<Badge
11+
v-if="variant !== 'bonus'"
12+
:label="readTime"
13+
:variant="badgeVariant"
14+
/>
15+
<p class="text-[var(--vp-c-text-2)] my-4">
16+
{{ description }}
17+
</p>
18+
<div
19+
v-if="variant === 'bonus'"
20+
class="inline-flex items-center gap-2 bg-primary text-white px-4 py-2 rounded-full font-medium hover:bg-primary/90 transition-colors"
21+
>
22+
{{ actionText }}
23+
<Icon icon="lucide:arrow-right" :height="20" />
24+
</div>
25+
<div
26+
v-else
27+
class="inline-flex gap-2 items-center"
28+
>
29+
{{ actionText }}
30+
<Icon icon="lucide:arrow-right" :height="20" />
31+
</div>
32+
</a>
33+
</template>
34+
35+
<script setup lang="ts">
36+
import { Icon } from '@iconify/vue';
37+
import Badge from './Badge.vue';
38+
39+
interface Props {
40+
href: string;
41+
title: string;
42+
readTime: string;
43+
description: string;
44+
actionText?: string;
45+
badgeVariant?: 'primary' | 'default' | 'success' | 'warning' | 'danger' | 'important';
46+
variant?: 'default' | 'bonus';
47+
}
48+
49+
withDefaults(defineProps<Props>(), {
50+
actionText: 'Read',
51+
badgeVariant: 'primary',
52+
variant: 'default',
53+
});
54+
</script>

src/get-started/helloWorld.md

Lines changed: 49 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ description:
66
---
77

88
<script setup>
9+
import { Icon } from '@iconify/vue';
910
import InfoIcon from '@/components/InfoIcon.vue'
1011
import ChainSelector from '@/components/ChainSelector.vue'
1112
import Banner from '../components/Banner.vue'
1213
import Container from '../components/Container.vue'
1314
import CardWithBorder from '../components/CardWithBorder.vue'
15+
import CardGrid from '../components/CardGrid.vue'
16+
import Badge from '../components/Badge.vue'
17+
import TutorialCard from '../components/TutorialCard.vue'
1418
</script>
1519

1620
# 👋 Welcome to iExec
@@ -39,62 +43,52 @@ iExec in this interactive guide.
3943

4044
## What you'll Learn and Build
4145

42-
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 my-8">
43-
<a href="helloWorld/1-overview" class="bg-[var(--vp-c-bg-soft)] rounded-[6px] p-6 shadow-md hover:shadow-lg transition-all! duration-300 hover:-translate-y-1 flex gap-4 no-underline! relative overflow-hidden before:absolute before:top-0 before:left-0 before:w-full before:h-1 before:bg-[#fcd15a] before:transform before:scale-x-0 before:origin-left before:transition-transform before:duration-300 hover:before:scale-x-100">
44-
<div class="text-3xl">📚</div>
45-
<div class="flex flex-col h-full min-h-[120px]">
46-
<h3 class="m-0! text-lg leading-tight text-[var(--vp-c-text-1)]">1 - iExec Overview</h3>
47-
<p class="my-4 text-sm text-[var(--vp-c-text-2)]">Discover how iExec technologies work and the problems they solve</p>
48-
<div class="mt-auto pt-3">
49-
<span class="inline-block text-sm bg-[var(--vp-c-bg-soft)] rounded text-[var(--vp-c-text-4)]">8 min read</span>
50-
</div>
51-
</div>
52-
</a>
53-
54-
<a href="helloWorld/2-protectData" class="bg-[var(--vp-c-bg-soft)] rounded-[6px] p-6 shadow-md transition-all! hover:shadow-lg duration-300 hover:-translate-y-1 flex gap-4 no-underline! relative overflow-hidden before:absolute before:top-0 before:left-0 before:w-full before:h-1 before:bg-[#fcd15a] before:transform before:scale-x-0 before:origin-left before:transition-transform before:duration-300 hover:before:scale-x-100">
55-
<div class="text-3xl">🔒</div>
56-
<div class="flex flex-col h-full min-h-[120px]">
57-
<h3 class="m-0! text-lg leading-tight text-[var(--vp-c-text-1)]">2. Protect Your Data</h3>
58-
<p class="my-4 text-sm text-[var(--vp-c-text-2)]">Learn to secure your sensitive data using our developer tools</p>
59-
<div class="mt-auto pt-3">
60-
<span class="inline-block text-sm bg-[var(--vp-c-bg-soft)] rounded text-[var(--vp-c-text-4)]">6 min read</span>
61-
</div>
62-
</div>
63-
</a>
64-
65-
<a href="helloWorld/3-buildIApp" class="bg-[var(--vp-c-bg-soft)] rounded-[6px] p-6 shadow-md hover:shadow-lg transition-all! duration-300 hover:-translate-y-1 flex gap-4 no-underline! relative overflow-hidden before:absolute before:top-0 before:left-0 before:w-full before:h-1 before:bg-[#fcd15a] before:transform before:scale-x-0 before:origin-left before:transition-transform before:duration-300 hover:before:scale-x-100">
66-
<div class="text-3xl">💻</div>
67-
<div class="flex flex-col h-full min-h-[120px]">
68-
<h3 class="m-0! text-lg leading-tight text-[var(--vp-c-text-1)]">3. Build your iApp</h3>
69-
<p class="my-4 text-sm text-[var(--vp-c-text-2)]">Build and run your first iExec App to work with protected data in a safe environment</p>
70-
<div class="mt-auto pt-3">
71-
<span class="inline-block text-sm bg-[var(--vp-c-bg-soft)] rounded text-[var(--vp-c-text-4)]">10 min read</span>
72-
</div>
73-
</div>
74-
</a>
75-
76-
<a href="helloWorld/4-manageDataAccess" class="bg-[var(--vp-c-bg-soft)] rounded-[6px] p-6 shadow-md hover:shadow-lg transition-all! duration-300 hover:-translate-y-1 flex gap-4 no-underline! relative overflow-hidden before:absolute before:top-0 before:left-0 before:w-full before:h-1 before:bg-[#fcd15a] before:transform before:scale-x-0 before:origin-left before:transition-transform before:duration-300 hover:before:scale-x-100">
77-
<div class="text-3xl">🔑</div>
78-
<div class="flex flex-col h-full min-h-[120px]">
79-
<h3 class="m-0! text-lg leading-tight text-[var(--vp-c-text-1)]">4. Manage Data Access</h3>
80-
<p class="my-4 text-sm text-[var(--vp-c-text-2)]">Learn advanced data access management, permissions and monetization</p>
81-
<div class="mt-auto pt-3">
82-
<span class="inline-block text-sm bg-[var(--vp-c-bg-soft)] rounded text-[var(--vp-c-text-4)]">6 min read</span>
83-
</div>
84-
</div>
85-
</a>
46+
<CardGrid>
47+
48+
<TutorialCard
49+
href="helloWorld/1-overview"
50+
title="1 - iExec Overview"
51+
readTime="8 min read"
52+
description="Discover how iExec technologies work and the problems they solve"
53+
actionText="Read"
54+
badgeVariant="primary"
55+
/>
56+
57+
<TutorialCard
58+
href="helloWorld/2-protectData"
59+
title="2. Protect Your Data"
60+
readTime="6 min read"
61+
description="Learn to secure your sensitive data using our developer tools"
62+
actionText="Read"
63+
badgeVariant="primary"
64+
/>
65+
66+
<TutorialCard
67+
href="helloWorld/3-buildIApp"
68+
title="3. Build your iApp"
69+
readTime="10 min read"
70+
description="Build and run your first iExec App to work with protected data in a safe environment"
71+
actionText="Read"
72+
badgeVariant="primary"
73+
/>
74+
75+
<TutorialCard
76+
href="helloWorld/4-manageDataAccess"
77+
title="4. Manage Data Access"
78+
readTime="6 min read"
79+
description="Learn advanced data access management, permissions and monetization"
80+
actionText="Read"
81+
badgeVariant="primary"
82+
/>
8683

87-
<a href="helloWorld/5-bonusChapter" class="bg-gradient-to-r from-[#ce2c68] to-[#3f0d3f] text-white rounded-[6px] p-6 shadow-md hover:shadow-lg transition-all! duration-300 hover:-translate-y-1 flex gap-4 no-underline! relative overflow-hidden before:absolute before:top-0 before:left-0 before:w-full before:h-1 before:bg-gradient-to-r before:from-[#ce2c68] before:to-[#3f0d3f] before:transform before:scale-x-0 before:origin-left before:transition-transform before:duration-300 hover:before:scale-x-100">
88-
<div class="text-3xl">✨</div>
89-
<div class="flex flex-col h-full min-h-[120px]">
90-
<h3 class="m-0 text-lg leading-tight text-white">Bonus Chapter</h3>
91-
<p class="my-4 text-sm text-white">Finish the journey with a surprise bonus chapter!</p>
92-
<div class="mt-auto pt-3">
93-
<span class="text-white">Special Content</span>
94-
</div>
95-
</div>
96-
</a>
97-
</div>
84+
<TutorialCard
85+
href="helloWorld/5-bonusChapter"
86+
title="Bonus Chapter"
87+
description="Finish the journey with a surprise bonus chapter!"
88+
actionText="Special content"
89+
variant="bonus"
90+
/>
91+
</CardGrid>
9892

9993
## Getting Started
10094

0 commit comments

Comments
 (0)