Skip to content

Commit c9b39e8

Browse files
committed
mobile view for otp, xss check
1 parent 2aa0a39 commit c9b39e8

File tree

4 files changed

+74
-19
lines changed

4 files changed

+74
-19
lines changed

web-assets/css/otp.css

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ body {
4848
flex-direction: column;
4949
align-items: center;
5050
padding: 0;
51-
gap: 8px;
5251
margin-bottom: 51px;
5352
}
5453

54+
.topcoder-logo {
55+
margin-bottom: 8px;
56+
}
57+
5558
.header-text {
5659
font-family: 'Barlow Condensed';
5760
font-weight: 500;
@@ -78,7 +81,6 @@ body {
7881
width: 100%;
7982
display: flex;
8083
flex-direction: column;
81-
gap: 12px;
8284
}
8385

8486
.message-wrapper {
@@ -126,20 +128,23 @@ body {
126128
.digit-group {
127129
display: flex;
128130
flex-direction: row;
129-
gap: 12px;
130131
margin-bottom: 51px;
131132
}
132133

134+
.digit-group :not(:last-child) {
135+
margin-right: 12px;
136+
}
137+
133138
.digit-group input {
134-
width: 44px;
135-
height: 40px;
139+
width: 38px;
140+
height: 36px;
136141
background-color: #FFFFFF;
137142
border: 1px solid #AAAAAA;
138143
line-height: 22px;
139144
text-align: center;
140145
font-size: 14px;
141146
font-weight: 400;
142-
color: #767676;
147+
color: #2A2A2A;
143148
border-radius: 4px;
144149
}
145150

@@ -184,14 +189,57 @@ body {
184189
background-clip: text;
185190
}
186191

192+
@media (min-width: 1157px) {
193+
.info-mobile {
194+
display: none;
195+
}
196+
}
197+
187198
@media (max-width: 1156px) {
199+
body {
200+
background-color: #ffffff;
201+
}
202+
203+
.page-wrapper {
204+
margin-top: 0;
205+
}
206+
188207
.row {
189208
background: white;
190-
width: 500px;
209+
width: 375px;
191210
min-height: auto;
192211
}
193212

213+
.left-column {
214+
width: 375px;
215+
}
216+
194217
.logo-column {
195218
display: none;
196219
}
220+
221+
.signin-column {
222+
padding: 0px 32px 48px 32px;
223+
}
224+
225+
.signin-header {
226+
padding-top: 110px;
227+
margin-bottom: 88px;
228+
}
229+
230+
.info {
231+
padding: 112px 0 0 0;
232+
margin-bottom: 34px;
233+
font-size: 14px;
234+
line-height: 20px;
235+
}
236+
237+
.digit-group {
238+
margin-bottom: 34px;
239+
}
240+
241+
.digit-group input {
242+
width: 35px;
243+
height: 36px;
244+
}
197245
}

web-assets/js/check_email.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
var qs = (function (a) {
1+
const qs = (function (a) {
22
if (a == "") return {};
3-
var b = {};
4-
for (var i = 0; i < a.length; ++i) {
5-
var p = a[i].split("=", 2);
3+
let b = {};
4+
for (let i = 0; i < a.length; ++i) {
5+
let p = a[i].split("=", 2);
66
if (p.length == 1) b[p[0]] = "";
77
else b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
88
}

web-assets/js/otp.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
var qs = (function (a) {
1+
const qs = (function (a) {
22
if (a == "") return {};
3-
var b = {};
4-
for (var i = 0; i < a.length; ++i) {
5-
var p = a[i].split("=", 2);
3+
let b = {};
4+
for (let i = 0; i < a.length; ++i) {
5+
let p = a[i].split("=", 2);
66
if (p.length == 1) b[p[0]] = "";
77
else b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
88
}
99
return b;
1010
})(window.location.search.substr(1).split("&"));
1111

12+
const encode = function (str) {
13+
str = str.replace(/[\x26\x0A\<>'"]/g, function (str) { return "&#" + str.charCodeAt(0) + ";" })
14+
return String(str).replace(/[^\w. ]/gi, function (c) {
15+
return '&#' + c.charCodeAt(0) + ';';
16+
});
17+
}
18+
1219
$(document).ready(function () {
1320
window.history.forward();
1421
let formAction = qs["formAction"] || "#";
@@ -57,7 +64,7 @@ $(document).ready(function () {
5764
}
5865
const errorMessage = qs["message"];
5966
if (errorMessage) {
60-
$("#error").html(errorMessage);
67+
$("#error").html(encode(errorMessage));
6168
$("#error").closest(".message-wrapper").fadeIn();
6269
}
6370

web-assets/static-pages/otp.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
<img class="topcoder-logo" src="./images/topcoderlogo-black.png">
3737
<div class="header-text">Topcoder login</div>
3838
</div>
39-
<div class="info">Please check the email you used to register your
40-
Topcoder account for an email with a <span class="black">6 digit code</span>.
41-
Enter the code below to login</div>
39+
<div class="info">Please check the email you used to register your<br>
40+
Topcoder account for an email <br class="info-mobile">with a <span class="black">6 digit code</span>.<br>
41+
<br class="info-mobile">Enter the code below to login</div>
4242
<div class="messages">
4343
<div class="message-wrapper">
4444
<div role="alert" class="message error">

0 commit comments

Comments
 (0)