-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathApp.vue
176 lines (169 loc) · 4.96 KB
/
App.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
<div id="app">
<Header :title="$t('app.title')" />
<div
id="site-container"
class="container"
>
<div class="page-head">
<div class="select-license-column">
<h2 class="vocab h2a ha">
{{ $t('select-license.heading') }}
</h2>
<p class="stepper-instructions vocab-body body-bigger">
{{ $t('select-license.instructions') }}
</p>
</div>
<LocaleChooser />
</div>
<div class="columns">
<Stepper v-model="currentStepId" />
<div class="column">
<div class="fixed-right-column">
<LicenseDetailsCard
v-if="showLicense"
/>
<LicenseUseCard
v-if="showLicenseUse"
/>
<HelpSection />
</div>
</div>
</div>
</div>
<Footer />
</div>
</template>
<script>
// TODO Reduce custom styling in favour of Vocabulary styles
import HelpSection from './components/HelpSection'
import Stepper from './components/Stepper'
import LicenseUseCard from './components/LicenseUseCard'
import Header from './components/Header.vue'
import Footer from './components/Footer'
import LocaleChooser from './components/LocaleChooser'
import LicenseDetailsCard from './components/LicenseDetailsCard'
export default {
name: 'App',
components: {
HelpSection,
Stepper,
LicenseDetailsCard,
LicenseUseCard,
Header,
Footer,
LocaleChooser
},
data() {
return {
currentStepId: 0,
showLicense: false
}
},
computed: {
showLicenseUse() {
return this.currentStepId === 7
}
},
created: function() {
// send home to google analytics
if (process.env.NODE_ENV === 'production') {
this.$ga.page('/')
}
this.$store.subscribe((mutation, state) => {
if (mutation.type === 'updateAttributesFromShort' || mutation.type === 'setSelected') {
this.showLicense = true
}
})
}
}
</script>
<style lang="scss">
// Import Bulma's core
@import "~bulma/sass/utilities/_all";
$primary: hsl(138, 95%, 33%);
// Links
$link: $primary;
$link-focus-border: $primary;
// Fonts
$family-primary: Source Sans Pro,Noto Sans,Arial,Helvetica Neue,Helvetica,sans-serif;
$family-sans-serif: Source Sans Pro,Noto Sans,Arial,Helvetica Neue,Helvetica,sans-serif!important;
// Import Bulma and Buefy styles
@import "~bulma";
@import '~buefy/src/scss/utils/_variables.scss';
@import '~buefy/src/scss/components/_modal.scss';
@import '~buefy/src/scss/components/_radio.scss';
@import '~buefy/src/scss/components/_tabs.scss';
@import '~buefy/src/scss/components/_select.scss';
@import '~buefy/src/scss/components/_form.scss';
@import '~buefy/src/scss/components/_icon.scss';
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro%3A%20400%2C600%2C700%7CRoboto+Condensed&ver=4.9.8");
#app {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
counter-reset: step-counter;
}
#site-container {
padding-top: 2rem;
padding-bottom: 2%;
}
.page-head {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1.5rem;
.select-license-column {
grid-column: 1;
}
.locale-chooser {
grid-column: 2;
}
}
.stepper-instructions {
margin-bottom: 14px;
}
.fixed-right-column {
position: sticky;
top: 10px;
}
.selected-license-card {
// Margin is added to make the left column long enough for the right column to stay sticky when scrolling
margin-bottom: 32px;
}
@media only screen and (max-width: 1025px) {
#site-container {
margin-left: 2%;
margin-right: 2%;
}
.mobile-hide {
display: none;
}
.mobile-show {
display: block;
}
}
@media only screen and (max-width: 768px) {
#site-container {
padding-top: 0;
}
.page-head {
grid-template-columns: 100%;
grid-gap: 1rem;
}
.select-license-column {
order: 2;
}
.locale-chooser {
padding-top: 1rem;
height: auto;
grid-column: auto;
order: 1;
}
}
@media only screen and (max-width: 670px) {
#site-container {
margin-left: 3%;
margin-right: 3%;
}
}
</style>