Skip to content

Commit 07394f6

Browse files
Merge pull request #47 from KristiforMilchev/development
Responsive design changes.
2 parents 8f4ae92 + f65db20 commit 07394f6

File tree

5 files changed

+191
-34
lines changed

5 files changed

+191
-34
lines changed

Data/ContractService.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,26 @@ public static async Task<decimal> ConvertTokenToUsd(decimal tokens, string[] add
145145

146146
public static async Task<decimal> CheckUserBalanceForContract(string ownerAddress, string contract, string endpoint, int decimals)
147147
{
148-
149-
var balanceOfFunctionMessage = new BalanceOf()
148+
try
150149
{
151-
Owner = ownerAddress,
152-
};
153-
var web3 = new Nethereum.Web3.Web3(endpoint);
150+
var balanceOfFunctionMessage = new BalanceOf()
151+
{
152+
Owner = ownerAddress,
153+
};
154+
var web3 = new Nethereum.Web3.Web3(endpoint);
154155

155-
var balanceHandler = web3.Eth.GetContractQueryHandler<BalanceOf>();
156-
var balance = await balanceHandler.QueryAsync<BigInteger>(contract, balanceOfFunctionMessage);
157-
var convert = ConvertToDex(balance, decimals);
158-
return convert;
156+
var balanceHandler = web3.Eth.GetContractQueryHandler<BalanceOf>();
157+
var balance = await balanceHandler.QueryAsync<BigInteger>(contract, balanceOfFunctionMessage);
158+
var convert = ConvertToDex(balance, decimals);
159+
return convert;
160+
}
161+
catch (Exception e)
162+
{
163+
var dt = DateTime.UtcNow;
164+
Debug.WriteLine($"{dt.ToShortDateString()} {dt.ToShortTimeString()} -> Error checking account balance for Owner: {ownerAddress} Contract: {contract} Network: {endpoint} ");
165+
return 0;
166+
}
167+
159168
}
160169

161170

Pages/Create.razor

Lines changed: 124 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,131 @@
1111
@inject IJSRuntime JS
1212

1313

14+
<style>
15+
.logoPos{
16+
width: 250px;
17+
height: 200px;
18+
}
19+
20+
21+
22+
23+
/* (1280x720) Galaxy Note 2, WXGA */
24+
@@media only screen and (max-width: 1280px) {
25+
.container {
26+
display: flex;
27+
flex-direction: column;
28+
justify-content: center;
29+
align-content: center;
30+
height: 100%;
31+
width: 100%;
32+
max-width: 100%;
33+
}
34+
.logoPos{
35+
width: 500px;
36+
height: 500px;
37+
position: absolute;
38+
left: 78%;
39+
top: 50%;
40+
}
41+
}
42+
43+
/* (1280x1024) SXGA Display */
44+
@@media screen and (max-width: 1280px) {
45+
.container {
46+
display: flex;
47+
flex-direction: column;
48+
justify-content: center;
49+
align-content: center;
50+
height: 100%;
51+
width: 100%;
52+
max-width: 100%;
53+
}
54+
.logoPos{
55+
width: 500px;
56+
height: 500px;
57+
position: absolute;
58+
left: 78%;
59+
top: 50%;
60+
}
61+
62+
}
63+
64+
/* (1366x768) WXGA Display */
65+
@@media screen and (max-width: 1366px) {
66+
.container {
67+
display: flex;
68+
flex-direction: column;
69+
justify-content: center;
70+
align-content: center;
71+
height: 100%;
72+
width: 100%;
73+
max-width: 100%;
74+
}
75+
.logoPos{
76+
width: 500px;
77+
height: 500px;
78+
position: absolute;
79+
left: 78%;
80+
top: 50%;
81+
}
82+
83+
}
84+
85+
/* (1440x900) WXGA+ Display */
86+
@@media screen and (max-width: 1440px) {
87+
/* insert styles here */
88+
.container {
89+
display: flex;
90+
flex-direction: column;
91+
justify-content: center;
92+
align-content: center;
93+
height: 100%;
94+
width: 100%;
95+
max-width: 100%;
96+
}
97+
98+
99+
}
100+
101+
/* (1600x900) HD+ Display */
102+
@@media screen and (max-width: 1600px) {
103+
/* insert styles here */
104+
.container {
105+
display: flex;
106+
flex-direction: column;
107+
justify-content: center;
108+
align-content: center;
109+
height: 100%;
110+
width: 60%;
111+
max-width: 100%;
112+
}
113+
114+
}
115+
116+
/* (1920x1080) Full HD Display */
117+
@@media screen and (max-width: 1920px) {
118+
/* insert styles here */
119+
.container {
120+
display: flex;
121+
flex-direction: column;
122+
justify-content: center;
123+
align-content: center;
124+
height: 100%;
125+
width: 100%;
126+
max-width: 100%;
127+
}
128+
129+
}
130+
131+
</style>
132+
14133
<div class="container FixCenter" style=" height: 100vh;
15134
display: flex;
16135
flex-direction: column;
17136
justify-content: center;">
18137
<div class="row" style="display: flex;flex-direction: row;align-items: center;justify-content: center;">
19-
<img src="/logo.png" style="width: 250px;height: 200px;" alt="homepage" class="light-logo" />
20-
138+
<img src="/logo.png" alt="homepage" class="light-logo logoPos" />
21139
</div>
22140
<div class="row" id="Options" style="width: 100%;display: flex;justify-content: center;align-items: center; padding:0; margin:0;">
23141
<div class="col-md-5 " style="margin:10px;">
@@ -97,10 +215,8 @@
97215
<div class="row" id="confirm" style="width: 100%;display: flex;justify-content: center;align-items: center; padding:0; margin:0;display:none; margin-top:50px;">
98216
<div class="card" style="padding: 0;overflow: hidden;">
99217
<div class="card-body">
100-
<div>
101-
<button onclick="ReturnToSeedSave()" style="width: 200px; " type="button" class="btn waves-effect waves-light btn-rounded btn-info">
102-
Retrun
103-
</button>
218+
<div class="row" style=" margin-top: 25px;">
219+
<a class="nav-link sidebartoggler waves-effect waves-light" onclick="ReturnToSeedSave()" style="font-size: 25px;"><i class="icon-arrow-left-circle"></i> Return</a>
104220
</div>
105221
<div class="row" style="flex-wrap: wrap;
106222
flex-direction: row;
@@ -135,10 +251,8 @@
135251
<div class="row" id="ImportConfirm" style="width: 100%;display: flex;justify-content: center;align-items: center; padding:0; margin:0;display:none; margin-top:50px;">
136252
<div class="card" style="padding: 0;overflow: hidden;">
137253
<div class="card-body">
138-
<div>
139-
<button onclick="ReturnToSeedSave()" style="width: 200px; " type="button" class="btn waves-effect waves-light btn-rounded btn-info">
140-
Retrun
141-
</button>
254+
<div class="row" style=" margin-top: 25px;">
255+
<a class="nav-link sidebartoggler waves-effect waves-light" onclick="ReturnToSeedSave()" style="font-size: 25px;"><i class="icon-arrow-left-circle"></i> Return</a>
142256
</div>
143257
<div class="row" style="flex-wrap: wrap;
144258
flex-direction: row;

Pages/Landing.razor

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@
2929
padding: 10px;
3030
}
3131
32-
.dropdown-menu.show {
32+
.dropdown-menu.show {
3333
display: block;
3434
position: absolute !important;
3535
left: 68% !important;
3636
top: 4% !important;
3737
background: #282931;
3838
}
39-
40-
41-
.contentCard{
39+
40+
.contentCard {
4241
height: 650px;
4342
overflow: hidden;
4443
overflow-y: auto;
@@ -50,8 +49,9 @@
5049
flex-direction: column;
5150
justify-content: center;
5251
}
52+
5353
/* (1280x720) Galaxy Note 2, WXGA */
54-
@@media only screen and (width: 1280px) {
54+
@@media only screen and (max-width: 1280px) {
5555
.container{
5656
display: flex;
5757
flex-direction: column;
@@ -62,10 +62,16 @@
6262
max-width:100%;
6363
6464
}
65+
66+
.contentCard {
67+
height: 450px;
68+
overflow: hidden;
69+
overflow-y: auto;
70+
}
6571
}
6672
67-
/* (1366x768) WXGA Display */
68-
@@media screen and (width: 1366px) {
73+
/* (1280x1024) SXGA Display */
74+
@@media screen and (max-width: 1280px) {
6975
.container{
7076
display: flex;
7177
flex-direction: column;
@@ -76,10 +82,16 @@
7682
max-width:100%;
7783
7884
}
85+
86+
.contentCard {
87+
height: 450px;
88+
overflow: hidden;
89+
overflow-y: auto;
90+
}
7991
}
8092
81-
/* (1280x1024) SXGA Display */
82-
@@media screen and (width: 1280px) {
93+
/* (1366x768) WXGA Display */
94+
@@media screen and (max-width: 1366px) {
8395
.container{
8496
display: flex;
8597
flex-direction: column;
@@ -90,10 +102,16 @@
90102
max-width:100%;
91103
92104
}
105+
106+
.contentCard {
107+
height: 450px;
108+
overflow: hidden;
109+
overflow-y: auto;
110+
}
93111
}
94112
95113
/* (1440x900) WXGA+ Display */
96-
@@media screen and (width: 1440px) {
114+
@@media screen and (max-width: 1440px) {
97115
/* insert styles here */
98116
.container{
99117
display: flex;
@@ -104,10 +122,15 @@
104122
width:100%;
105123
max-width:100%;
106124
107-
}
108-
}
109-
125+
}
126+
127+
.contentCard{
128+
height: 450px;
129+
overflow: hidden;
130+
overflow-y: auto;
131+
}
110132
133+
}
111134
112135
/* (1600x900) HD+ Display */
113136
@@media screen and (max-width: 1600px) {
@@ -121,6 +144,8 @@
121144
width:60%;
122145
max-width:100%;
123146
}
147+
148+
124149
}
125150
126151
/* (1920x1080) Full HD Display */
@@ -137,6 +162,8 @@
137162
138163
}
139164
}
165+
166+
140167
</style>
141168

142169

@@ -667,6 +694,10 @@
667694
private void SetMaxAmount()
668695
{
669696

697+
InvokeAsync(() =>
698+
{
699+
TokensToSend = SelectedContract.UserBalance;
700+
});
670701
}
671702

672703
private void CancelSend()

wwwroot/css/site.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
}
397397

398398
.timeline::-webkit-scrollbar-thumb {
399-
background: #009efb;
399+
background: #565758;
400400
border-radius: 0;
401401
}
402402

@@ -409,7 +409,7 @@
409409
}
410410

411411
::-webkit-scrollbar-thumb {
412-
background: #009efb;
412+
background: #565758;
413413
border-radius: 0;
414414
}
415415

wwwroot/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@
154154
.bg-success {
155155
background-color: #706e6e !important;
156156
}
157+
158+
159+
157160

158161
</style>
159162

0 commit comments

Comments
 (0)