Skip to content

Commit 777c7f8

Browse files
committed
Redesign poll component
1 parent 8d8bbd1 commit 777c7f8

File tree

4 files changed

+303
-342
lines changed

4 files changed

+303
-342
lines changed

app/components/Poll/Poll.css

Lines changed: 115 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,167 @@
1-
@import '~app/styles/variables.css';
2-
3-
.optionWrapper {
4-
justify-content: center;
5-
min-height: 120px;
6-
cursor: pointer;
7-
position: relative;
8-
}
9-
10-
.pollTable {
1+
.poll {
2+
margin: 0 auto;
3+
background-color: var(--lego-card-color);
114
width: 100%;
12-
font-size: 14px;
13-
}
14-
15-
.pollTable td {
16-
border: 0;
17-
padding: 5px;
5+
min-width: 250px;
6+
max-width: 500px;
7+
overflow-y: hidden;
8+
border-radius: 15px;
9+
transition: 2s height;
1810
}
1911

20-
.pollTable .textColumn {
21-
border-right: 1px solid #c5c5c5;
22-
text-align: right;
23-
padding-right: 13px;
24-
line-height: 16px;
25-
}
26-
27-
.pollTable .graphColumn {
28-
width: auto;
29-
min-width: 200px;
30-
padding-left: 13px;
12+
.topBar {
13+
background-color: var(--lego-red);
14+
position: relative;
15+
width: 100%;
16+
height: 70px;
17+
box-shadow: 0 4px 4px rgba(0, 0, 0, 25%);
3118
}
3219

33-
.poll {
34-
composes: withShadow from '~app/styles/utilities.css';
35-
background: var(--lego-card-color);
36-
padding: 15px 20px 8px;
20+
.stats {
21+
color: var(--lego-card-color);
22+
margin-top: 17px;
23+
transform: scale(150%);
3724
}
3825

39-
.pollLight {
40-
background: var(--lego-card-color);
26+
.notAnswered {
27+
color: var(--color-white);
28+
font-size: 30px;
29+
font-weight: 900;
30+
line-height: 45px;
4131
}
4232

43-
.noVotes {
44-
font-style: italic;
33+
.headerBar {
34+
color: var(--lego-font-color);
35+
background-color: var(--lego-card-color);
36+
font-weight: 900;
37+
text-align: center;
38+
position: absolute;
39+
bottom: 0;
40+
left: 50%;
41+
width: 80%;
42+
height: 50px;
43+
border-radius: 10px;
44+
box-shadow: 0 4px 4px rgba(0, 0, 0, 25%);
45+
transform: translate(-50%, 50%);
4546
}
4647

47-
.pollGraph {
48-
animation: graph 1.2s cubic-bezier(41%, 80%, 40%, 94%);
49-
background-color: var(--lego-red-color);
50-
padding-left: 8px;
51-
border-radius: 0 2px 2px 0;
52-
font-style: italic;
53-
font-weight: 300;
54-
color: var(--color-white);
55-
height: 30px;
48+
.contentWrapper {
49+
overflow-y: hidden;
50+
width: 100%;
51+
transition: 0.5s height;
5652
}
5753

58-
.fullGraph {
59-
background-color: #e7e7e7;
60-
width: 100%;
54+
.voteOptionsWrapper {
6155
display: flex;
56+
flex-direction: column;
57+
align-items: center;
58+
width: 100%;
59+
height: fit-content;
6260
}
6361

64-
html[data-theme='dark'] .fullGraph {
62+
.voteButton {
6563
color: var(--color-white);
66-
background-color: var(--color-mono-gray-5);
67-
}
68-
69-
html[data-theme='dark'] .pollGraph {
70-
color: var(--color-black);
71-
}
72-
73-
.pollGraph span {
74-
vertical-align: middle;
75-
}
76-
77-
@keyframes graph {
78-
from {
79-
width: 1px;
80-
}
64+
background: var(--lego-red);
65+
font-weight: 500;
66+
width: 90%;
67+
height: 37px;
68+
padding: 5px;
69+
margin: 2px;
8170

82-
to {
83-
width: 100%;
71+
/* Override default components/Button property */
72+
+ .voteButton {
73+
margin-left: 2px;
8474
}
8575
}
8676

87-
.pollHeader {
88-
border-radius: 8px;
89-
margin-bottom: 20px;
90-
margin-left: 20px;
91-
font-size: 16px;
92-
color: var(--lego-font-color);
93-
}
94-
95-
.voteButton {
96-
background: var(--lego-red-color);
97-
color: var(--lego-color-gray-light);
98-
border: 1px solid var(--border-gray);
77+
.voteOptions {
9978
width: 100%;
100-
margin: 0 !important;
101-
font-size: 15px;
102-
max-width: 400px;
103-
}
104-
105-
.voteButton:hover {
106-
opacity: 0.8;
79+
padding-top: 35px;
10780
}
10881

109-
html[data-theme='dark'] .voteButton {
110-
color: var(--color-dark-gray-3);
82+
.bottomInfoWrapper {
83+
display: flex;
84+
flex-direction: column;
85+
align-items: center;
11186
}
11287

113-
.moreOptionsLink {
114-
justify-content: space-between;
88+
.totalVotesInfo {
89+
display: flex;
11590
}
11691

117-
.arrow {
118-
margin-top: 9px;
119-
cursor: pointer;
120-
121-
&:hover {
122-
transform: scale(1.5);
123-
color: var(--color-red-3);
124-
transition: transform 0.2s;
125-
}
92+
.resultsHiddenInfo {
93+
font-style: italic;
12694
}
12795

128-
.blurContainer {
129-
display: none;
130-
position: absolute;
131-
justify-content: center;
96+
.pollTable {
13297
width: 100%;
133-
height: 100%;
98+
font-size: 14px;
13499
}
135100

136-
.blurOverlay {
137-
position: absolute;
138-
z-index: 2;
139-
color: var(--color-black);
140-
margin-top: 25px;
101+
.pollTable tr {
102+
width: 100%;
141103
}
142104

143-
.optionWrapper:hover .blurContainer {
144-
display: flex;
105+
.pollTable td {
106+
border: 0;
107+
padding: 5px;
145108
}
146109

147-
.optionWrapper:hover .blurEffect {
148-
filter: blur(3px);
149-
pointer-events: none;
110+
.pollTable .textColumn {
111+
text-align: right;
112+
line-height: 16px;
113+
word-wrap: break-word;
114+
width: fit-content;
115+
max-width: 200px;
116+
padding-right: 13px;
117+
border-right: 3px solid #c5c5c5;
150118
}
151119

152-
.blurArrow {
153-
margin-top: 40px;
120+
.pollTable .graphColumn {
121+
width: auto;
122+
min-width: 150px;
123+
padding-left: 13px;
124+
padding-right: 15px;
154125
}
155126

156-
.alignItems {
127+
.fullGraph {
157128
display: flex;
158-
justify-content: center;
129+
background-color: var(--color-mono-gray-5);
130+
color: #000;
131+
word-wrap: break-word;
132+
width: 100%;
159133
}
160134

161-
.answered {
162-
margin: 15px 0;
163-
text-align: center;
164-
font-weight: bold;
135+
.pollGraph {
136+
background-color: var(--lego-red);
137+
font-style: italic;
138+
font-weight: 300;
139+
color: var(--color-white);
140+
height: 30px;
141+
padding-left: 8px;
142+
animation: graph 1.2s cubic-bezier(0.41, 0.8, 0.4, 0.94);
143+
border-radius: 0 2px 2px 0;
144+
box-shadow: 0 4px 4px rgba(0, 0, 0, 25%);
165145
}
166146

167-
.bottomInfo {
168-
display: flex;
169-
justify-content: space-between;
147+
.bottomBar {
148+
width: 100%;
149+
height: 70px;
150+
background-color: var(--lego-red);
170151
}
171152

172-
.resultsHidden {
173-
font-style: italic;
153+
.arrowUp,
154+
.arrowDown {
155+
text-shadow: 0 2px 2px rgba(0, 0, 0, 25%);
156+
transform: scale(250%);
157+
color: var(--lego-card-color);
158+
transition: 0.8s margin-bottom;
174159
}
175160

176-
@media (--mobile-device) {
177-
.blurContainer {
178-
display: flex;
179-
}
161+
.arrowUp {
162+
margin-bottom: 25px;
163+
}
180164

181-
.blurEffect {
182-
filter: blur(3px);
183-
pointer-events: none;
184-
}
165+
.arrowDown {
166+
margin-bottom: 10px;
185167
}

0 commit comments

Comments
 (0)