forked from labex-labs/python-cheatsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage.vue
More file actions
155 lines (146 loc) · 4.45 KB
/
HomePage.vue
File metadata and controls
155 lines (146 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<script setup lang="ts">
import { breakpointsTailwind } from '@vueuse/core'
import ReferenceIcon from '~/components/icons/ReferenceIcon.vue'
import PluginIcon from '~/components/icons/PluginIcon.vue'
import ArrowIcon from '~/components/icons/ArrowIcon.vue'
import GridIcon from '~/components/icons/GridIcon.vue'
import LightBulbIcon from '~/components/icons/LightBulbIcon.vue'
import BookIcon from '~/components/icons/BookIcon.vue'
import { computed } from 'vue'
const { t, localePath } = useI18n()
const cardLinks = computed(() => [
{
path: 'https://labex.io/learn/python',
name: t('home.cardLinks.pythonCourse'),
description: t('home.cardLinks.pythonCourseDesc'),
icon: BookIcon,
external: true,
},
{
path: 'https://labex.io/labs/python-use-vs-code-for-python-development-585783?course=python-cheatsheet',
name: t('home.cardLinks.pythonPlayground'),
description: t('home.cardLinks.pythonPlaygroundDesc'),
icon: LightBulbIcon,
external: true,
},
{
path: 'https://github.com/labex-labs/python-cheatsheet',
name: t('home.cardLinks.viewOnGithub'),
description: t('home.cardLinks.viewOnGithubDesc'),
icon: ArrowIcon,
external: true,
},
{
path: localePath('/blog'),
name: t('home.cardLinks.blog'),
description: t('home.cardLinks.blogDesc'),
icon: ReferenceIcon,
},
{
path: localePath('/contributing'),
name: t('home.cardLinks.contribute'),
description: t('home.cardLinks.contributeDesc'),
icon: PluginIcon,
},
{
path: localePath('/changelog'),
name: t('home.cardLinks.changelog'),
description: t('home.cardLinks.changelogDesc'),
icon: GridIcon,
external: false,
},
])
const isDark = useDark()
const { description } = useMeta()
const breakpoints = useBreakpoints(breakpointsTailwind)
const smAndLarger = breakpoints.greater('sm')
</script>
<template>
<article>
<prose>
<div class="flex justify-center sm:hidden">
<img
class="h-20 w-auto"
:src="
isDark
? 'https://cdn.jsdelivr.net/gh/labex-labs/files@master/images/labex-logo-light.svg'
: 'https://cdn.jsdelivr.net/gh/labex-labs/files@master/images/labex-logo-dark.svg'
"
alt="python-cheatsheet"
/>
</div>
<base-title
v-if="smAndLarger"
id="python-cheatsheet"
:title="t('home.title')"
:description="description"
>
{{ t('home.title') }}
</base-title>
<h1
v-else
class="mb-2 bg-gradient-to-r from-secondary-400 to-green-400 bg-clip-text text-center font-display text-4xl font-medium tracking-tight text-transparent dark:from-primary-400 dark:via-teal-300 dark:to-orange-300"
>
{{ t('home.title') }}
</h1>
</prose>
<prose>
<base-disclaimer>
<base-disclaimer-title>
{{ t('home.disclaimer.title') }}
</base-disclaimer-title>
<base-disclaimer-content>
<p>{{ t('home.disclaimer.content') }}</p>
</base-disclaimer-content>
</base-disclaimer>
</prose>
<prose>
<p>
{{ t('home.anyoneCanForget') }}
<router-link
:to="
localePath(
'/cheatsheet/regular-expressions#making-your-own-character-classes',
)
"
>
{{ t('home.makeCharacterClasses') }}
</router-link>
{{ t('home.forRegex') }}
<router-link
:to="
localePath(
'/cheatsheet/lists-and-tuples#getting-sublists-with-slices',
)
"
>
{{ t('home.sliceAList') }}
</router-link>
{{ t('home.orDoA') }}
<router-link :to="localePath('/cheatsheet/control-flow#for-loop')">
{{ t('home.forLoop') }}
</router-link>
. {{ t('home.description') }}
<a
href="https://github.com/labex-labs/python-cheatsheet/blob/master/contributors/contributors.json"
target="_blank"
rel="noopener noreferrer"
>
{{ t('home.contributors') }}
</a>
{{ t('home.onGithub') }}
</p>
</prose>
<div className="not-prose my-8 grid grid-cols-1 gap-6 sm:grid-cols-2">
<base-link-card
v-for="link in cardLinks"
:key="link.path"
:title="link.name"
:description="link.description"
:path="link.path"
:icon="link.icon"
:is-external="link.external"
/>
</div>
</article>
</template>