-
Notifications
You must be signed in to change notification settings - Fork 82
/
CompareHeader.vue
133 lines (128 loc) · 3.2 KB
/
CompareHeader.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
<template>
<div
id="compare-header"
class="header pa-3 elevation-4 d-print-none"
@click="toggleDrawer()"
v-show="currentSchoolCount > 0 || currentFieldOfStudyCount > 0"
>
<div class="compare-header-text ml-8 mr-6 mb-1">
<v-icon class="mt-1" color="black" size="24"> </v-icon>
Ready to Compare:
</div>
<div v-if="currentSchoolCount < 10" class="compare-header-text mb-1 ml-4 mr-2">
<div
class="compare-icon-wrapper d-inline-block mr-2"
style="background: #83c38c;"
>
<v-icon class="mt-1" color="black" size="24">
fas fa-university
</v-icon>
</div>
{{ currentSchoolCount }} {{ schoolText }}
</div>
<div v-else class="compare-header-text mb-1 ml-4 mr-2">
<div class="compare-icon-wrapper d-inline-block mr-2 mt-n1">
<v-icon
class="mt-1"
color="red"
medium
style="font-size:40px;border-radius:50%;"
>
fas fa-exclamation-circle
</v-icon>
</div>
Maximum of 10 Schools reached
</div>
<div
v-if="currentFieldOfStudyCount < 10"
class="compare-header-text mb-1 ml-4"
>
<div
class="compare-icon-wrapper d-inline-block mr-2"
style="background: #fec005;"
>
<v-icon class="mt-1" color="black" size="24">
fas fa-award
</v-icon>
</div>
{{ currentFieldOfStudyCount }} {{ fieldOfStudyText }}
</div>
<div v-else class="compare-header-text mb-1 ml-4">
<div class="compare-icon-wrapper d-inline-block mr-2 mt-n1">
<v-icon
class="mt-1"
color="red"
medium
style="font-size:40px;border-radius:50%;"
>
fas fa-exclamation-circle
</v-icon>
</div>
Maximum of 10 Fields of Study reached
</div>
</div>
</template>
<style lang="scss" scoped>
@import "~/sass/_variables";
.header {
position: fixed;
width: 50%;
left: 25%;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.98);
color: #ffffff;
z-index: 200;
border-radius: 3px 3px 0 0;
cursor: pointer;
@media only screen and (max-width: 600px) {
width: 100%;
left: 0;
}
}
.compare-icon-wrapper {
border-radius: 50%;
width: 40px;
height: 40px;
text-align: center;
}
.compare-header-text {
line-height: 2;
display: inline-flex;
justify-content: center;
align-items: center;
white-space: nowrap;
height: 40px;
@media only screen and (max-width: 600px) {
display:inline;
}
}
</style>
<script>
export default {
methods: {
toggleDrawer() {
this.$store.commit("toggleDrawer", true)
},
},
computed: {
currentSchoolCount() {
return this.$store.state.institutions.length
},
currentFieldOfStudyCount() {
return this.$store.state.fos.length
},
schoolText() {
return this.$store.state.institutions.length > 1 ||
this.$store.state.institutions.length === 0
? "Schools"
: "School"
},
fieldOfStudyText() {
return this.$store.state.fos.length > 1 ||
this.$store.state.fos.length === 0
? "Fields of Study"
: "Field of Study"
},
},
}
</script>