Skip to content

Commit da1b93d

Browse files
committed
Start cleaning up styles, structure of staking modals
1 parent f3774ae commit da1b93d

File tree

7 files changed

+99
-168
lines changed

7 files changed

+99
-168
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template functional>
22
<svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
3-
<path opacity="0.5" d="M10.6966 8.29117C11.0513 8.68617 11.0357 9.28937 10.661 9.66552C10.2863 10.0417 9.683 10.0598 9.28636 9.70688L6.17374 6.59532C6.07552 6.49844 5.91765 6.49844 5.81944 6.59532L2.70781 9.70688C2.31269 10.0879 1.68673 10.0879 1.29161 9.70688C1.10368 9.51921 0.998077 9.26456 0.998077 8.99902C0.998077 8.73348 1.10368 8.47883 1.29161 8.29117L4.40424 5.18061C4.45124 5.13386 4.47767 5.07031 4.47767 5.00402C4.47767 4.93774 4.45124 4.87419 4.40424 4.82744L1.29161 1.71588C0.932602 1.32123 0.946463 0.714413 1.32312 0.336552C1.69978 -0.04131 2.30675 -0.0573141 2.7028 0.300173L5.81443 3.41173C5.86137 3.45877 5.92511 3.48521 5.99158 3.48521C6.05805 3.48521 6.12179 3.45877 6.16873 3.41173L9.28136 0.300173C9.67243 -0.0904874 10.3063 -0.0902634 10.6971 0.300673C11.0879 0.69161 11.0876 1.32522 10.6966 1.71588L7.58393 4.82744C7.48658 4.92505 7.48658 5.083 7.58393 5.18061L10.6966 8.29117Z" fill="#0582CA"/>
3+
<path opacity=".5" d="M10.7 8.3a1 1 0 01-1.41 1.4L6.17 6.6a.25.25 0 00-.35 0L2.7 9.7a1 1 0 11-1.42-1.42L4.4 5.2a.25.25 0 000-.35L1.3 1.72A1 1 0 012.7.3l3.11 3.11a.25.25 0 00.36 0L9.28.3a1 1 0 011.42 1.42l-3.12 3.1c-.1.1-.1.26 0 .36L10.7 8.3z" fill="currentColor"/>
44
</svg>
55
</template>
Lines changed: 38 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<div class="stake-info-page flex-column">
33
<PageHeader>
44
<template #default>
55
<div class="staking-icon">
@@ -8,26 +8,26 @@
88
{{ $t('Stake NIM to earn NIM') }}
99
</template>
1010
<template #more>
11-
<span class="nq-text nq-blue">
11+
<p class="nq-text nq-blue">
1212
{{ $t('Help secure the network by locking up NIM and get a percentage as a reward.') }}
13-
</span>
13+
</p>
1414
</template>
1515
</PageHeader>
1616
<PageBody>
17-
<div class="staking-rounded-background">
17+
<div class="staking-rounded-background flex-column">
1818
<div class="staking-icons-lace">
1919
<img v-for="(icon, index) in orderOfValidators"
2020
:key="index"
2121
:src="`/img/staking/providers/${icon}`"
22-
:style="{top: `${((Math.sin((index + 1) * (Math.PI / 10))) * 25)}px`}"
22+
:style="{top: `${((Math.sin((index + 1) * (Math.PI / 10))) * 20)}px`}"
2323
/>
2424
</div>
2525
<div class="staking-under-icons-text">
2626
{{ $t('So called validators facilitate this process.'
2727
+ ' Choose one to stake on your behalf, set an amount and go.') }}
2828
</div>
2929
<button class="nq-button light-blue stake-button" @click="$emit('next')">
30-
{{ $t('let\'s go') }}
30+
{{ $t('Let\'s go') }}
3131
</button>
3232
</div>
3333
</PageBody>
@@ -76,13 +76,17 @@ export default defineComponent({
7676
</script>
7777

7878
<style lang="scss" scoped>
79+
.stake-info-page {
80+
flex-grow: 1;
81+
}
82+
7983
.page-header {
8084
height: 36.625rem;
8185
padding-top: 3rem;
8286
line-height: 1;
87+
8388
/deep/ .nq-h1 {
84-
font-size: 3rem;
85-
color: var(--nimiq-blue);
89+
font-size: var(--h1-size);
8690
}
8791
.staking-icon {
8892
margin-top: .75rem;
@@ -96,35 +100,23 @@ export default defineComponent({
96100
.page-body {
97101
padding: 0;
98102
margin: 0;
99-
height: 31rem;
103+
flex-grow: 1;
104+
100105
.staking-rounded-background {
101-
display: flex;
102-
flex-direction: column;
103-
justify-content: center;
104106
background-image: url('/img/staking/background-collar.svg');
105107
background-size: cover;
106108
background-position: 0rem -1rem;
107109
background-repeat: no-repeat;
108-
text-align: center;
109-
.staking-under-icons-text {
110-
font-size: 1.75rem;
111-
font-weight: 600;
112-
padding: 7.625rem 2rem;
113-
padding-bottom: 1.25rem;
114-
line-height: 2.45rem;
115-
text-align: center;
116-
color: #231044;
117-
opacity: 0.6;
118-
width: 95%;
119-
margin: auto;
120-
}
110+
padding-bottom: 2rem;
111+
height: 100%;
112+
121113
.staking-icons-lace {
122114
position: relative;
123-
top: 3.0rem;
124-
left: -3.25rem;
115+
left: -2rem;
116+
margin-top: 3rem;
125117
white-space: nowrap;
126-
width: 95%;
127-
margin: auto;
118+
flex-grow: 1;
119+
min-height: 9rem;
128120
129121
img {
130122
position: relative;
@@ -133,34 +125,30 @@ export default defineComponent({
133125
margin-left: .81rem;
134126
}
135127
}
128+
129+
.staking-under-icons-text {
130+
font-size: var(--small-size);
131+
font-weight: 600;
132+
padding: 0 4rem;
133+
padding-bottom: 1.25rem;
134+
line-height: 2.45rem;
135+
text-align: center;
136+
color: var(--text-60);
137+
}
138+
136139
.stake-button {
137-
height: 8rem;
138140
width: 31.5rem;
139-
font-weight: bold;
140-
font-size: 2rem;
141-
line-height: 2.5rem;
142-
letter-spacing: 0.1875rem;
143141
}
144142
}
145143
}
146144
147145
.nq-text {
148-
display: inline-block;
149-
margin-top: 1.25rem;
146+
margin: 1.25rem 0 0;
150147
padding: 0rem 1rem;
151-
font-size: 2rem;
152-
font-weight: 400;
153-
line-height: 140%;
154-
color: #231044;
155-
}
156-
157-
@media (max-width: 960px) and (min-width: 701px) { // Tablet breakpoint
158148
}
159149
160150
@media (max-width: 700px) { // Full mobile breakpoint
161151
.page-header {
162-
height: 36.625rem;
163-
padding-top: 3.5rem;
164152
.staking-icon {
165153
margin-top: 1.375rem;
166154
margin-bottom: 1.25rem;
@@ -169,55 +157,25 @@ export default defineComponent({
169157
height: 16rem;
170158
}
171159
}
172-
/deep/ .nq-h1 {
173-
font-size: 2.75rem;
174-
font-weight: 700;
175-
line-height: 3.3rem;
176-
color: var(--nimiq-blue);
177-
}
178160
}
161+
179162
.page-body {
180-
padding: 0;
181-
margin-top: -1.375rem;
182-
height: 32.375rem;
183163
.staking-rounded-background {
184-
.staking-under-icons-text {
185-
position: relative;
186-
left: .125rem;
187-
padding-top: 7.75rem;
188-
padding-bottom: .25rem;
189-
width: 37rem;
190-
font-weight: 600;
191-
font-size: 1.625rem;
192-
line-height: 140%;
193-
}
194164
.staking-icons-lace {
195-
position: relative;
196-
top: 2.5rem;
165+
margin-top: 2.5rem;
197166
img {
198167
margin-left: .65rem;
199168
width: 4.75rem;
200169
height: 4.75rem;
201170
}
202171
}
203-
.stake-button {
204-
position: relative;
205-
top: -.25rem;
206-
left: .25rem;
207-
height: 7rem;
208-
width: 34rem;
209-
font-size: 1.875rem;
210-
letter-spacing: 0.1875rem;
172+
.staking-under-icons-text {
173+
padding-bottom: .25rem;
211174
}
212175
}
213176
}
214177
.nq-text {
215-
font-size: 1.875rem;
216-
margin-top: 1rem;
217-
margin-left: .25rem;
218-
line-height: 2.5rem;
219-
font-weight: 600;
220-
opacity: 0.8;
178+
margin: 1rem 0 0;
221179
}
222180
}
223181
</style>

src/components/stake/StakeModal.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ export default defineComponent({
125125
}
126126
}
127127
}
128-
/deep/ .page-header-back-button {
129-
margin-top: 3.25rem;
130-
margin-left: 1rem;
131-
}
132128
&.fat-modal {
133129
/deep/ .small-page {
134130
width: 63.5rem;

src/components/stake/StakeValidatorFilter.vue

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="validator-filter">
2+
<div class="stake-validator-filter">
33
<div class="validator-filter-wrapper" v-if="state !== FilterState.SEARCH">
44
<button class="validator-switch" :class="{ selected: state === FilterState.TRUST }"
55
@click="state = FilterState.TRUST">
@@ -49,18 +49,19 @@ export default defineComponent({
4949
const $search = ref<HTMLInputElement>();
5050
5151
watch(state, () => context.emit('changed', state.value));
52+
53+
function enableSearch() {
54+
state.value = FilterState.SEARCH;
55+
context.root.$nextTick(() => $search.value?.focus());
56+
}
57+
5258
return {
5359
state,
5460
FilterState,
5561
$search,
56-
enableSearch: () => {
57-
state.value = FilterState.SEARCH;
58-
setTimeout(() => $search.value?.focus(), 0);
59-
},
62+
enableSearch,
6063
};
6164
},
62-
props: {
63-
},
6465
components: {
6566
FatSearchIcon,
6667
SearchIcon,
@@ -70,20 +71,21 @@ export default defineComponent({
7071
</script>
7172

7273
<style lang="scss" scoped>
73-
.validator-filter {
74+
.stake-validator-filter {
7475
width: 38rem;
7576
height: 3.75rem;
7677
margin: auto;
7778
margin-bottom: 1.5rem;
7879
white-space: nowrap;
7980
8081
.validator-filter-wrapper {
81-
background-color: #f2f2f4;
82+
background-color: var(--text-6);
8283
height: 3.75rem;
8384
border-radius: 2rem;
8485
padding: 0;
85-
padding-top: .125rem;
86+
padding-left: .25rem;
8687
white-space: nowrap;
88+
overflow: hidden;
8789
8890
.validator-switch {
8991
font-family: Muli, Helvetica, serif;
@@ -102,12 +104,20 @@ export default defineComponent({
102104
line-height: 1.75rem;
103105
text-align: center;
104106
105-
color: #9c9eae;
107+
color: var(--text-50);
106108
cursor: pointer;
109+
110+
transition: color 0.3s;
111+
107112
* {
108113
select: none;
109114
}
110115
116+
&:hover,
117+
&:focus {
118+
color: var(--text-80);
119+
}
120+
111121
&.selected {
112122
color: var(--nimiq-blue);
113123
background: white;
@@ -193,6 +203,7 @@ export default defineComponent({
193203
cursor: pointer;
194204
border: 0;
195205
background: transparent;
206+
color: #0582CA;
196207
}
197208
}
198209
}

src/components/stake/StakeValidatorListItem.vue

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<button
33
class="validator-list-item reset flex-row"
44
:class="{ 'wrapper-mini': isMini }"
5-
@click="selectValidator(validatorData)"
65
@focus="$emit('focus', true)"
76
@blur="$emit('focus', false)">
87

@@ -79,37 +78,29 @@ const getPayoutText = (payout: number) => {
7978
};
8079
8180
export default defineComponent({
82-
setup(props) {
83-
return {
84-
payoutText: getPayoutText(props.validatorData.payout),
85-
Helpers: {
86-
capitalise: (string: string) => string.charAt(0).toUpperCase() + string.slice(1),
87-
},
88-
};
89-
},
9081
props: {
9182
validatorData: {
9283
type: Object as () => ValidatorData,
9384
required: true,
9485
},
95-
validatorsList: {
96-
type: Array as () => ValidatorData[],
97-
required: true,
98-
},
9986
stakingData: {
10087
type: Object as () => StakingData,
10188
required: true,
10289
},
103-
selectValidator: {
104-
type: Function as () => unknown,
105-
required: true,
106-
},
10790
isMini: {
10891
type: Boolean,
10992
required: false,
11093
default: false,
11194
},
11295
},
96+
setup(props) {
97+
return {
98+
payoutText: getPayoutText(props.validatorData.payout),
99+
Helpers: {
100+
capitalise: (string: string) => string.charAt(0).toUpperCase() + string.slice(1),
101+
},
102+
};
103+
},
113104
components: {
114105
LabelTooltip,
115106
ScoreTooltip,
@@ -124,7 +115,7 @@ export default defineComponent({
124115
-moz-box-sizing: border-box;
125116
-webkit-box-sizing: border-box;
126117
127-
width: 48.5rem;
118+
width: calc(100% - 4rem);
128119
line-height: 9rem;
129120
margin: auto;
130121
margin-bottom: -.25rem;
@@ -136,9 +127,7 @@ export default defineComponent({
136127
outline: none;
137128
138129
&:focus {
139-
width: 49.5rem;
140-
border: 4px solid #f2f2f4;
141-
margin: -.375rem -.5rem -.875rem .5rem;
130+
outline: 4px solid #f2f2f4;
142131
box-shadow: none;
143132
}
144133

0 commit comments

Comments
 (0)