/
HomeIntro.vue
159 lines (132 loc) · 3.16 KB
/
HomeIntro.vue
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
155
156
157
158
159
<template>
<Section class="home-intro" dots="true" dark="true">
<div class="home-cols grid-cols grid-cols--2 grid-cols--gap-small">
<div class="home-cols__left">
<h1 class="home-title">
Build <br class="show-for-small" />
<VueTyper :text="words" :type-delay="30" initial-action="erasing" caret-animation="smooth" />
<br /> websites & apps
<br /> with Vue.js
</h1>
<p class="home-links">
<g-link to="/docs/" class="button primary button--large">
Get started
</g-link>
</p>
<p class="home-info">
<span>Open-source MIT Licensed. </span>
<a href="//github.com/gridsome/gridsome" target="_blank" rel="noopener noreferrer">
<span>GitHub (v{{ $static.metaData.gridsomeVersion }})</span>
</a>
</p>
</div>
<div class="home-cols__right">
<div class="home-anim">
<div class="home-anim__source-logos"><g-image alt="Logos" blur="1" src="~/assets/images/cms-logos.png" /></div>
<div class="home-anim__lines-in"> <lines-in /> </div>
<div class="home-anim__lines-out"> <lines-out /> </div>
<div class="home-anim__logo"> <Logo /> </div>
</div>
</div>
</div>
</Section>
</template>
<static-query>
query {
metaData {
gridsomeVersion
}
}
</static-query>
<script>
import LinesOut from '~/assets/images/home-lines-out.svg'
import LinesIn from '~/assets/images/home-lines-in.svg'
import Logo from '~/assets/images/home-logo.svg'
const words = ['insanely fast', 'JAMstack', 'static & secure', 'future-ready']
export default {
components: {
LinesOut,
LinesIn,
Logo,
VueTyper: process.isServer
? { inheritAttrs: false, render: h => h('span', null, [words[0]]) }
: () => import('vue-typer').then(({ VueTyper }) => VueTyper)
},
data () {
return { words }
}
}
</script>
<style lang="scss">
.home-intro {
.vue-typer {
display: inline-block;
text-align: left;
white-space: nowrap;
.custom.char {
color: #FFF;
}
.custom.char.typed {
animation: Type .3s;
}
.custom.caret {
background-color: rgba(255,255,255,.5);
margin: 0 2px;
width: 2px;
}
}
}
.home-cols {
align-items: center;
&__left {
padding: 0 5%;
}
&__right {
}
}
.home-links {
margin-top: 2.5rem;
}
.home-lead {
font-weight: 300;
}
.home-title {
line-height: 1.3;
font-size: 2.4rem;
@media (max-width: 600px) {
padding-top: 2rem;
font-size: 1.8rem;
}
}
.home-anim {
position: relative;
transform: translateZ(0);
img {
display: block;
position: relative;
z-index: 1;
}
> div:not(.home-anim__source-logos) {
position: absolute;
top: 0;
width: 100%;
height: auto;
}
svg {
width: 100%;
height: 100%;
}
&__lines-in svg path {
stroke-width: 4px;
stroke-linecap: round;
stroke-dasharray: 0 20;
animation: stroke 800ms linear infinite;
}
&__lines-out path {
stroke-width: 7px;
stroke-linecap: round;
stroke-dasharray: 0 20;
animation: stroke-invert 400ms linear infinite;
}
}
</style>