Skip to content

Commit 5ab628e

Browse files
authored
Migrate Homepage (#71)
Migrated the homepage over to docs-next. As the default VuePress theme is not flexible enough to support the current homepage's layout (most notably the jumbotron/hero area), I've created a (minimal) custom theme instead. This theme also supports HTML in the tagline, feature blocks, and footer, allowing us to have e.g. newlines and links in these elements. I've also gone ahead and moved some custom components like SocialIcon down (up?) to the theme level. The result will not be a 1:1 copycat of current vuejs.org UI, with the most significant difference being the fonts. We'll need to come back and revise this once a new theme for Vue 3 docs is available. Also, a mocked Patreon sponsor list is being used after a discussion with Evan. Other functionalities should be in place.
1 parent 6991a8f commit 5ab628e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1401
-46
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ dist/
100100

101101
# Temporary folders
102102
tmp/
103-
temp/
103+
temp/
+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<template>
2+
<div class="overlay" v-show="isOpen">
3+
<div ref="modal" class="modal" :class="{ open: isOpen }">
4+
<div class="video-space" style="padding: 56.25% 0 0 0; position: relative;">
5+
<iframe
6+
src="https://player.vimeo.com/video/247494684?dnt=1"
7+
style="height: 100%; left: 0; position: absolute; top: 0; width: 100%; margin: 0"
8+
frameborder="0"
9+
webkitallowfullscreen
10+
mozallowfullscreen
11+
allowfullscreen
12+
ref="videoIframe"
13+
></iframe>
14+
</div>
15+
16+
<p class="modal-text">
17+
Video by
18+
<a
19+
href="https://www.vuemastery.com"
20+
target="_blank"
21+
rel="sponsored noopener"
22+
title="Vue.js Courses on Vue Mastery"
23+
>Vue Mastery</a>.
24+
Watch Vue Mastery’s free
25+
<a
26+
href="https://www.vuemastery.com/courses/intro-to-vue-js/vue-instance/"
27+
target="_blank"
28+
rel="sponsored noopener"
29+
title="Vue.js Courses on Vue Mastery"
30+
>Intro to Vue course</a>.
31+
</p>
32+
</div>
33+
</div>
34+
</template>
35+
36+
<script>
37+
export default {
38+
props: {
39+
triggerSelector: {
40+
type: String,
41+
default: '.vuemastery-trigger'
42+
}
43+
},
44+
45+
data: () => ({
46+
isOpen: false
47+
}),
48+
49+
methods: {
50+
initVideoModal () {
51+
const modalButton = document.querySelector(this.triggerSelector)
52+
const player = new Vimeo.Player(this.$refs.videoIframe)
53+
54+
modalButton.addEventListener('click', event => {
55+
event.stopPropagation()
56+
this.isOpen = true
57+
document.body.classList.toggle('stop-scroll')
58+
player.play()
59+
})
60+
61+
document.body.addEventListener('click', event => {
62+
if (this.isOpen && event.target !== modalButton && !this.$refs.modal.contains(event.target)) {
63+
this.isOpen = false
64+
document.body.classList.remove('stop-scroll')
65+
player.pause()
66+
}
67+
})
68+
}
69+
},
70+
71+
mounted () {
72+
if (typeof window !== 'undefined') {
73+
this.initVideoModal()
74+
}
75+
}
76+
}
77+
</script>
78+
79+
<style lang="scss">
80+
@import "@theme/styles/_settings.scss";
81+
82+
.modal {
83+
box-sizing: border-box;
84+
position: fixed;
85+
width: 75%;
86+
height: auto;
87+
padding: 0.5em;
88+
background-color: #f9f9f9;
89+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
90+
top: 50%;
91+
left: 50%;
92+
transform: translate(-50%, -50%);
93+
z-index: 99;
94+
}
95+
96+
.modal-text {
97+
margin-bottom: 0.5em;
98+
text-align: center;
99+
100+
> a {
101+
color: $green;
102+
font-weight: 600;
103+
}
104+
}
105+
106+
.overlay {
107+
position: fixed;
108+
top: 0;
109+
bottom: 0;
110+
left: 0;
111+
right: 0;
112+
background: rgba(0, 0, 0, 0.2);
113+
z-index: 98;
114+
}
115+
116+
.stop-scroll {
117+
overflow: hidden;
118+
height: 100%;
119+
}
120+
121+
@media screen and (max-width: $MQMobileNarrow) {
122+
.modal {
123+
width: 98%;
124+
}
125+
}
126+
</style>

Diff for: src/.vuepress/components/community/partners/partner-item.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
</dd>
4949

5050
<dd class="social">
51-
<SocialIcon v-if="partner.email" type="Email" :url="mailHref"/>
52-
<SocialIcon v-for="link in partner.socialLinks" :key="link.name" :type="link.name" :url="link.url"/>
51+
<SocialIcon v-if="partner.email" type="Email" :link="mailHref"/>
52+
<SocialIcon v-for="link in partner.socialLinks" :key="link.name" :type="link.name" :link="link.url"/>
5353
</dd>
5454
</dl>
5555
</div>
@@ -63,7 +63,7 @@ export default {
6363
},
6464
6565
components: {
66-
SocialIcon: () => import('../../common/social-icon')
66+
SocialIcon: () => import('@theme/components/ui/SocialIcon.vue')
6767
},
6868
6969
computed: {

Diff for: src/.vuepress/components/community/team/vuer-profile.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@
9898
</dd>
9999
</template>
100100
<footer v-if="hasSocialLinks" class="social">
101-
<SocialIcon type="GitHub" v-if="profile.github" :url="generateGithubUrl(profile.github)"/>
102-
<SocialIcon type="Twitter" v-if="profile.twitter" :url="`https://twitter.com/${profile.twitter}`"/>
103-
<SocialIcon type="CodePen" v-if="profile.codepen" :url="`https://codepen.io/${profile.codepen}`"/>
104-
<SocialIcon type="LinkedIn" v-if="profile.linkedin" :url="`https://www.linkedin.com/in/${profile.linkedin}`"/>
101+
<SocialIcon type="GitHub" v-if="profile.github" :link="generateGithubUrl(profile.github)"/>
102+
<SocialIcon type="Twitter" v-if="profile.twitter" :link="`https://twitter.com/${profile.twitter}`"/>
103+
<SocialIcon type="CodePen" v-if="profile.codepen" :link="`https://codepen.io/${profile.codepen}`"/>
104+
<SocialIcon type="LinkedIn" v-if="profile.linkedin" :link="`https://www.linkedin.com/in/${profile.linkedin}`"/>
105105
</footer>
106106
</dl>
107107
</div>
@@ -114,7 +114,7 @@ import { minimizeLink, generateGithubUrl, kmToMi, roundDistance } from './utils'
114114
export default {
115115
components: {
116116
VuerLanguage: () => import('./vuer-language'),
117-
SocialIcon: () => import('../../common/social-icon')
117+
SocialIcon: () => import('@theme/components/ui/SocialIcon.vue')
118118
},
119119
120120
props: {

Diff for: src/.vuepress/components/community/themes/theme-item.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default {
2525
</script>
2626

2727
<style lang="scss" scoped>
28-
@import "../../../styles/_settings";
28+
@import "@theme/styles/_settings.scss";
2929
3030
.item-preview {
3131
width: 290px;

Diff for: src/.vuepress/components/community/themes/theme-provider.vue

+6-21
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
</div>
1010

1111
<div class="see-more-container">
12-
<a :href="provider.seeMoreUrl" class="see-more-button">
12+
<RoundedButton :url="provider.seeMoreUrl">
1313
See More Themes from {{ provider.name }}
14-
</a>
14+
</RoundedButton>
1515
</div>
1616
</section>
1717
</template>
@@ -28,19 +28,20 @@ export default {
2828
},
2929
3030
components: {
31-
ThemeItem: () => import('./theme-item')
31+
ThemeItem: () => import('./theme-item.vue'),
32+
RoundedButton: () => import('@theme/components/ui/RoundedButton.vue')
3233
},
3334
3435
computed: {
35-
description: function () {
36+
description () {
3637
return (new showdown.Converter()).makeHtml(this.provider.description)
3738
}
3839
}
3940
}
4041
</script>
4142

4243
<style lang="scss" scoped>
43-
@import "../../../styles/_settings";
44+
@import "@theme/styles/_settings.scss";
4445
4546
.themes-grid {
4647
display: flex;
@@ -61,21 +62,5 @@ export default {
6162
text-align: center;
6263
width: 100%;
6364
}
64-
65-
&-button {
66-
color: $green;
67-
display: inline-block;
68-
width: auto;
69-
border-radius: 2em;
70-
transition: all 0.15s ease;
71-
border: 1px solid $green;
72-
padding: 12px 24px;
73-
text-decoration: none !important;
74-
75-
&:hover {
76-
background: $green;
77-
color: #fff;
78-
}
79-
}
8065
}
8166
</style>

Diff for: src/.vuepress/config.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,23 @@ module.exports = {
5454
[
5555
'link',
5656
{
57-
href:
58-
'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',
57+
href: 'https://use.fontawesome.com/releases/v5.13.0/css/all.css',
5958
rel: 'stylesheet',
6059
},
6160
],
61+
[
62+
'script',
63+
{
64+
src: 'https://player.vimeo.com/api/player.js',
65+
},
66+
],
67+
[
68+
'script',
69+
{
70+
src: 'https://extend.vimeocdn.com/ga/72160148.js',
71+
defer: 'defer',
72+
},
73+
]
6274
],
6375
themeConfig: {
6476
nav: [

Diff for: src/.vuepress/public/images/sponsors/.gitkeep

Whitespace-only changes.

Diff for: src/.vuepress/public/images/sponsors/Monterail.png

16.7 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/autocode.svg

+115
Loading
117 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/bestvpn_co.png

23.5 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/bit.png

27.7 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/chaitin.png

4.21 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/cloudstudio.png

10 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/devexpress.png

3.71 KB
Loading

Diff for: src/.vuepress/public/images/sponsors/devsquad.png

29.6 KB
Loading
3.87 KB
Loading

0 commit comments

Comments
 (0)