merge SM codes

This commit is contained in:
Abhishek Sinha 2020-09-07 14:25:36 +05:30
commit 6e92e331e1
5 changed files with 14241 additions and 206 deletions

View File

@ -1,9 +1,8 @@
@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap");
* {
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: "Barlow", sans-serif;
font-family: "Roboto", sans-serif;
}
:root {
@ -33,8 +32,35 @@ a {
color: #111;
}
h1 {
font-size: 3.5rem;
}
h2 {
font-size: 2rem;
}
h3 {
font-size: 1.5rem;
}
h4 {
font-size: 1rem;
}
h5 {
font-size: 0.8rem;
}
h1, h2, h3, h4, h5 {
font-weight: 600;
font-family: "Manrope", sans-serif;
font-weight: 700;
}
p {
line-height: 1.5;
max-width: 60ch;
color: rgba(var(--text-color), 0.9);
}
button {
@ -42,24 +68,24 @@ button {
display: inline-flex;
align-items: center;
justify-content: center;
text-transform: uppercase;
letter-spacing: 0.08em;
padding: 0.4rem 0.7rem;
font-weight: 600;
text-transform: capitalize;
padding: 0.6rem 1.2rem;
font-weight: 700;
cursor: pointer;
border-radius: 0.2em;
border-radius: 0.3rem;
color: var(--accent-color);
transition: transform 0.3s;
border: none;
background: rgba(var(--text-color), 0.1);
-webkit-tap-highlight-color: transparent;
font-family: "Manrope", sans-serif;
}
button:focus {
outline: thin solid rgba(var(--text-color-light), 0.4);
}
button:disabled {
cursor: default;
background: rgba(var(--text-color-light), 1);
background: rgba(var(--text-color), 0.5);
}
button:disabled ~ .loader {
opacity: 0;
@ -187,12 +213,6 @@ input:invalid {
stroke-dashoffset: -210;
}
}
p {
line-height: 1.5;
font-family: "Roboto", sans-serif;
color: rgba(var(--text-color), 0.8);
}
.action {
position: relative;
display: inline-flex;
@ -205,9 +225,8 @@ p {
background: none;
}
.action h4 {
font-weight: 500;
padding: 0.5rem 0.8rem;
font-size: 1rem;
font-size: 0.9rem;
clip-path: circle(100%);
transition: clip-path 0.3s;
border-radius: 0.2rem;
@ -265,21 +284,19 @@ p {
display: inline-grid;
align-items: center;
grid-template-columns: auto 1fr;
gap: 0.6rem 0.2rem;
gap: 0.6rem 0.4rem;
margin-right: 1rem;
}
#logo h4 {
letter-spacing: 0.06rem;
word-spacing: 0.12rem;
margin-top: 0.2rem;
}
#logo h5 {
font-family: "Roboto", sans-serif;
font-weight: 400;
}
#logo #main_logo {
height: 1.4rem;
width: 1.4rem;
height: 1.6rem;
width: 1.6rem;
fill: rgba(var(--text-color), 1);
stroke: none;
}
@ -315,7 +332,7 @@ textarea {
border: 0.1em solid var(--accent-color);
}
.input .placeholder {
opacity: 0.7;
opacity: 0.6;
font-weight: 500;
font-size: 1em;
position: absolute;
@ -367,7 +384,6 @@ textarea {
}
.container-header h2 {
flex: 1;
font-weight: 600;
}
.container-header button {
align-self: center;
@ -437,24 +453,23 @@ form {
margin-left: auto;
}
.popup-container .popup .container-header {
display: grid;
grid-template-columns: auto 1fr auto;
display: flex;
align-items: center;
padding: 0;
gap: 1rem;
margin-bottom: 1.5rem;
margin-bottom: 1rem;
}
.popup-container .popup .container-header h4 {
flex: 1;
}
.popup-container .popup .container-header button {
width: auto;
}
.popup-container .popup .container-header .icon {
cursor: pointer;
padding-right: 0.4rem;
margin-right: 0.3rem;
stroke-width: 8;
}
.popup-container .popup .container-header .btn {
padding: 0.6em 1.2em;
}
.popup-container .popup .container-header h3 {
text-transform: capitalize;
}
.popup-container .popup p {
margin-bottom: 1.5rem !important;
}
@ -464,9 +479,6 @@ form {
}
#confirmation p, #prompt p {
margin: 1rem;
font-size: 1rem;
font-weight: 500;
color: rgba(var(--rgb-bw), 1) !important;
}
#confirmation h4, #prompt h4 {
font-weight: 500;
@ -504,7 +516,6 @@ form {
}
#sign_in_popup p {
margin-top: 1rem;
font-size: 0.9rem;
margin-bottom: 0 !important;
}
#sign_in_popup .input {
@ -513,7 +524,6 @@ form {
.primary-btn {
background: var(--accent-color);
padding: 0.8em 1.6em;
justify-content: center;
color: rgba(var(--foreground-color), 1);
}
@ -598,10 +608,8 @@ form {
}
#home_page h1 {
margin-top: 4vw;
margin-bottom: 1rem;
font-weight: 700;
font-size: 3rem;
margin-bottom: 0;
font-weight: 800;
}
#home_page p {
margin-bottom: 3rem;
@ -623,9 +631,10 @@ form {
padding: 1.5rem;
margin-right: 1rem;
margin-bottom: 1rem;
width: 9rem;
border: solid 1px rgba(var(--text-color), 0.2);
width: 10rem;
box-shadow: 0 1px 0.1rem #00000030, 0 0 0.4rem #00000016;
text-transform: capitalize;
transition: transform 0.3s;
cursor: pointer;
}
.options-tab .option .icon {
@ -636,8 +645,8 @@ form {
margin-bottom: 1rem;
stroke: rgba(var(--text-color), 0.4);
}
.options-tab .option h4 {
font-weight: 400;
.options-tab .option:active {
transform: scale(0.95);
}
.options-tab .option:nth-of-type(1) .icon {
background: #ffe5ea;
@ -681,8 +690,11 @@ form {
background: linear-gradient(rgba(var(--foreground-color), 1) 90%, transparent);
}
.secondary-btn {
background: none;
sm-tab-header {
position: sticky;
top: 0;
background: rgba(var(--foreground-color), 1);
z-index: 1;
}
.request {
@ -693,14 +705,11 @@ form {
border: solid 1px rgba(var(--text-color), 0.2);
}
.request h5 {
color: rgba(var(--text-color-light), 1);
margin-bottom: 0.4rem;
margin-bottom: 0.2rem;
text-transform: capitalize;
}
.request h3, .request h4 {
margin-bottom: 1.5rem;
font-family: "Roboto", sans-serif;
font-weight: 500;
}
.request h4:last-of-type {
margin-bottom: 0;
@ -753,6 +762,7 @@ form {
.container {
display: grid;
gap: 1em;
width: 100%;
grid-template-columns: 1fr;
}
@ -765,15 +775,11 @@ form {
grid-template-columns: 1fr auto;
grid-template-areas: ". ." "search search";
gap: 1rem;
position: sticky;
top: 0;
background: rgba(var(--foreground-color), 1);
will-change: auto;
z-index: 2;
}
.page .container-header h2 {
font-weight: 600;
}
.page .container-header .search {
grid-area: search;
}
@ -814,16 +820,12 @@ form {
}
.time {
font-family: "Roboto", sans-serif;
margin-bottom: 1.5rem !important;
font-weight: 400;
font-weight: 500;
}
#report_popup h4 {
font-weight: 400;
}
#report_popup textarea {
margin-top: 1rem;
#report_popup {
width: 32rem;
}
#profile_page {
@ -861,6 +863,7 @@ form {
.complaints-container {
padding-top: 1.5rem;
display: grid;
align-items: flex-start;
gap: 1.5rem;
}
@ -909,7 +912,7 @@ form {
transform: translateY(0) scale(0.96);
width: 24rem;
align-self: center;
border-radius: 0.2rem;
border-radius: 0.4rem;
height: auto;
}
@ -1003,8 +1006,6 @@ form {
}
#activity_page sm-tab-header {
position: sticky;
top: 0;
margin-bottom: 1rem;
}
@ -1037,10 +1038,6 @@ form {
body {
padding: 1rem 12vw;
}
.container {
grid-template-columns: repeat(3, 1fr);
}
}
@media only screen and (min-width: 1920px) {
body {
@ -1057,10 +1054,6 @@ form {
font-size: 24px;
padding: 2rem 30vw;
}
.container {
grid-template-columns: repeat(4, 1fr);
}
}
@media only screen and (max-width: 320px) {
body {

1
css/main.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,8 @@
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap');
*{
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: 'Barlow', sans-serif;
font-family: 'Roboto', sans-serif;
}
:root{
scroll-behavior: smooth;
@ -28,31 +27,52 @@ a{
.dark-text{
color: #111;
}
h1{
font-size: 3.5rem;
}
h2{
font-size: 2rem;
}
h3{
font-size: 1.5rem;
}
h4{
font-size: 1rem;
}
h5{
font-size: 0.8rem;
}
h1,h2,h3,h4,h5{
font-weight: 600;
font-family: 'Manrope', sans-serif;
font-weight: 700;
}
p{
line-height: 1.5;
max-width: 60ch;
color: rgba(var(--text-color), 0.9);
}
button{
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
text-transform: uppercase;
letter-spacing: 0.08em;
padding: 0.4rem 0.7rem;
font-weight: 600;
text-transform: capitalize;
padding: 0.6rem 1.2rem;
font-weight: 700;
cursor: pointer;
border-radius: 0.2em;
border-radius: 0.3rem;
color: var(--accent-color);
transition: transform 0.3s;
border: none;
background: rgba(var(--text-color), 0.1);
-webkit-tap-highlight-color: transparent;
font-family: 'Manrope', sans-serif;
&:focus{
outline: thin solid rgba(var(--text-color-light), .4);
}
&:disabled{
cursor: default;
background: rgba(var(--text-color-light), 1);
background: rgba(var(--text-color), 0.5);
}
&:disabled ~ .loader{
opacity: 0;
@ -148,11 +168,6 @@ input:invalid{
stroke-dashoffset: -210;
}
}
p{
line-height: 1.5;
font-family: 'Roboto', sans-serif;
color: rgba(var(--text-color), 0.8);
}
.action{
position: relative;
display: inline-flex;
@ -166,9 +181,8 @@ p{
}
}
h4{
font-weight: 500;
padding: 0.5rem 0.8rem;
font-size: 1rem;
font-size: 0.9rem;
clip-path: circle(100%);
transition: clip-path 0.3s;
border-radius: 0.2rem;
@ -221,20 +235,18 @@ p{
display: inline-grid;
align-items: center;
grid-template-columns: auto 1fr;
gap: 0.6rem 0.2rem;
gap: 0.6rem 0.4rem;
margin-right: 1rem;
h4{
letter-spacing: 0.06rem;
word-spacing: 0.12rem;
margin-top: 0.2rem;
}
h5{
font-family: 'Roboto', sans-serif;
font-weight: 400;
}
#main_logo{
height: 1.4rem;
width: 1.4rem;
height: 1.6rem;
width: 1.6rem;
fill: rgba(var(--text-color), 1);
stroke: none;
}
@ -268,7 +280,7 @@ textarea{
border: 0.1em solid var(--accent-color);
}
.placeholder{
opacity: .7;
opacity: .6;
font-weight: 500;
font-size: 1em;
position: absolute;
@ -318,7 +330,6 @@ textarea{
padding: 1rem 0;
h2{
flex: 1;
font-weight: 600;
}
button{
align-self: center;
@ -381,23 +392,22 @@ form{
margin-left: auto;
}
.container-header{
display: grid;
grid-template-columns: auto 1fr auto;
display: flex;
align-items: center;
padding: 0;
gap: 1rem;
margin-bottom: 1.5rem;
margin-bottom: 1rem;
h4{
flex: 1;
}
button{
width: auto;
}
.icon{
cursor: pointer;
padding-right: 0.4rem;
margin-right: 0.3rem;
stroke-width: 8;
}
.btn{
padding: 0.6em 1.2em;
}
h3{
text-transform: capitalize;
}
}
p{
margin-bottom: 1.5rem !important;
@ -408,9 +418,6 @@ form{
flex-direction: column;
p{
margin: 1rem;
font-size: 1rem;
font-weight: 500;
color: rgba(var(--rgb-bw),1) !important;
}
h4{
font-weight: 500;
@ -448,7 +455,6 @@ form{
}
p{
margin-top: 1rem;
font-size: 0.9rem;
margin-bottom: 0 !important;
}
.input{
@ -457,7 +463,6 @@ form{
}
.primary-btn{
background: var(--accent-color);
padding: 0.8em 1.6em;
justify-content: center;
color: rgba(var(--foreground-color), 1);
}
@ -539,10 +544,8 @@ form{
}
#home_page{
h1{
margin-top: 4vw;
margin-bottom: 1rem;
font-weight: 700;
font-size: 3rem;
margin-bottom: 0;
font-weight: 800;
}
p{
margin-bottom: 3rem;
@ -563,9 +566,10 @@ form{
padding: 1.5rem;
margin-right: 1rem;
margin-bottom: 1rem;
width: 9rem;
border: solid 1px rgba(var(--text-color), 0.2);
width: 10rem;
box-shadow: 0 1px 0.1rem #00000030, 0 0 0.4rem #00000016;
text-transform: capitalize;
transition: transform 0.3s;
cursor: pointer;
.icon{
height: 2.8rem;
@ -575,8 +579,8 @@ form{
margin-bottom: 1rem;
stroke: rgba(var(--text-color), 0.4);
}
h4{
font-weight: 400;
&:active{
transform: scale(0.95);
}
&:nth-of-type(1){
.icon{
@ -630,8 +634,11 @@ form{
background: linear-gradient(rgba(var(--foreground-color), 1) 90%, transparent);
}
}
.secondary-btn{
background: none;
sm-tab-header{
position: sticky;
top: 0;
background: rgba(var(--foreground-color), 1);
z-index: 1;
}
.request{
display: inline-flex;
@ -640,14 +647,11 @@ form{
border-radius: 0.4em;
border: solid 1px rgba(var(--text-color), 0.2);
h5{
color: rgba(var(--text-color-light), 1);
margin-bottom: 0.4rem;
margin-bottom: 0.2rem;
text-transform: capitalize;
}
h3,h4{
margin-bottom: 1.5rem;
font-family: 'Roboto', sans-serif;
font-weight: 500;
}
h4:last-of-type{
margin-bottom: 0;
@ -697,6 +701,7 @@ form{
.container{
display: grid;
gap: 1em;
width: 100%;
grid-template-columns: 1fr;
}
.page{
@ -708,14 +713,10 @@ form{
grid-template-areas: '. .'
'search search';
gap: 1rem;
position: sticky;
top: 0;
background: rgba(var(--foreground-color), 1);
will-change: auto;
z-index: 2;
h2{
font-weight: 600;
}
.search{
grid-area: search;
input{
@ -756,17 +757,11 @@ form{
}
}
.time{
font-family: 'Roboto', sans-serif;
margin-bottom: 1.5rem !important;
font-weight: 400;
font-weight: 500;
}
#report_popup{
h4{
font-weight: 400;
}
textarea{
margin-top: 1rem;
}
width: 32rem;
}
#profile_page{
display: flex;
@ -803,6 +798,7 @@ form{
.complaints-container{
padding-top: 1.5rem;
display: grid;
align-items: flex-start;
gap: 1.5rem;
}
#helpline_page{
@ -850,7 +846,7 @@ form{
transform: translateY(0) scale(0.96);
width: 24rem;
align-self: center;
border-radius: 0.2rem;
border-radius: 0.4rem;
height: auto;
}
}
@ -945,8 +941,6 @@ form{
}
#activity_page{
sm-tab-header{
position: sticky;
top: 0;
margin-bottom: 1rem;
}
}
@ -978,9 +972,6 @@ form{
body{
padding: 1rem 12vw;
}
.container{
grid-template-columns: repeat(3, 1fr);
}
}
@media only screen and (min-width: 1920px){
body{
@ -996,9 +987,6 @@ form{
font-size: 24px;
padding: 2rem 30vw;
}
.container{
grid-template-columns: repeat(4, 1fr);
}
}
@media only screen and (max-width: 320px){
body{

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blockchain UPI</title>
<link
href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap"
href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="css/main.css">
</head>
@ -21,7 +21,7 @@
<p id="confirm_message"></p>
<div class="btns">
<button class="hover cancel-btn">Cancel</button>
<button class="hover submit-btn">Ok</button>
<button class="hover submit-btn">OK</button>
</div>
</div>
</div>
@ -45,7 +45,7 @@
<title>Loader</title>
<path d="M72.5,36.5c0,19.88-16.12,36-36,36s-36-16.12-36-36s16.12-36,36-36S72.5,16.62,72.5,36.5" />
</svg>
<h3 id="tip_container">Loading BLOCKCHAIN UPi</h3>
<h4 id="tip_container">Loading BLOCKCHAIN UPI </h4>
<button onclick="signOut()">Reset</button>
</div>
</div>
@ -76,7 +76,7 @@
<line x1="64" y1="0" x2="0" y2="64" />
<line x1="64" y1="64" x2="0" y2="0" />
</svg>
<h3>Transfer Rupee</h3>
<h4>Transfer Rupee</h4>
<button id="send_tokens_btn" class="action expand" type="submit" disabled>
<h4 class="expand primary-btn">
transfer
@ -111,10 +111,10 @@
<line x1="64" y1="0" x2="0" y2="64" />
<line x1="64" y1="64" x2="0" y2="0" />
</svg>
<h3>Deposit rupee</h3>
<h4>Deposit rupee</h4>
<button id="request_tokens_btn" class="action expand" type="submit" disabled>
<h4 class="primary-btn expand">
deposit
Continue
</h4>
<svg viewBox="0 0 73 73" class="loader">
<path
@ -122,15 +122,22 @@
</svg>
</button>
</div>
<form id="deposit_amount_section" autocomplete="off" onsubmit="return false">
<p>
Deposit rupee through UPI to use as Digital currency powered by blockchain.
</p>
<form autocomplete="off" onsubmit="return false">
<label class="input">
<label class="input">
<input id="token_amount_to_buy" inputmode="numeric" type="number" min="1" required>
<div class="placeholder">Amount</div>
</label>
</form>
<form id="upi_txId_section" class="hide-completely top-padding" autocomplete="off" onsubmit="return false">
<p id="send_cash_to_deposit"></p>
<label class="input">
<input id="deposited_rupee_txId" required disabled>
<div class="placeholder">UPI TxID</div>
</label>
</form>
</div>
</div>
<div class="popup-container hide">
@ -141,7 +148,7 @@
<line x1="64" y1="0" x2="0" y2="64" />
<line x1="64" y1="64" x2="0" y2="0" />
</svg>
<h3>Withdraw rupee</h3>
<h4>Withdraw rupee</h4>
<button id="withdraw_cash_btn" class="action expand" type="submit" disabled>
<h4 class="primary-btn expand">
withdraw
@ -175,7 +182,7 @@
<line x1="64" y1="0" x2="0" y2="64" />
<line x1="64" y1="64" x2="0" y2="0" />
</svg>
<h3>Request rupee</h3>
<h4>Request rupee</h3>
<button id="request_rupee_btn" class="action expand" type="submit" disabled>
<h4 class="primary-btn expand">
request
@ -191,7 +198,7 @@
</p>
<form autocomplete="off" onsubmit="return false">
<label class="input">
<input id="requested_address" minlength="20" type="text" required>
<input floId id="requested_address" minlength="20" type="text" required>
<div class="placeholder">Request from</div>
</label>
<label class="input">
@ -209,7 +216,7 @@
<line x1="64" y1="0" x2="0" y2="64" />
<line x1="64" y1="64" x2="0" y2="0" />
</svg>
<h3>Pay through cashier</h3>
<h4>Pay through cashier</h4>
<button id="cnf_cash_payment" class="action expand" type="submit" disabled>
<h4 class="primary-btn expand">
pay
@ -224,10 +231,10 @@
Don't have enough token balance? Pay to our cashier through UPI and your cash will be
transfered as Rupee tokens.
</p>
<p><strong id="pay_cashier_info"></strong></p>
<p id="pay_cashier_info"></p>
<form autocomplete="off" onsubmit="return false">
<label class="input">
<input id="recvr_id" type="text" required>
<input floId id="recvr_id" type="text" required>
<div class="placeholder">Reciever's FLO ID</div>
</label>
<label class="input">
@ -250,11 +257,11 @@
<line x1="64" y1="0" x2="0" y2="64" />
<line x1="64" y1="64" x2="0" y2="0" />
</svg>
<h3>Report</h3>
<button id="report_btn" class="btn">report</button>
<h4>Report</h4>
<button id="report_btn" class="primary-btn">report</button>
</div>
<h4>Please add any message you want to send us regarding this issue</h4>
<textarea name="complaint" id="complaint_field" rows="6"></textarea>
<textarea name="complaint" placeholder="Please describe issue in detail." id="complaint_field"
rows="10"></textarea>
</div>
</div>
@ -280,7 +287,7 @@
</div>
<div id="display_balance">
<h5>Rupee Balance</h5>
<h3 id="token_balance">0</h3>
<h4 id="token_balance">0</h4>
<svg class="icon" onclick="refresh_balance(this)" viewBox="0 0 64 64">
<title>refresh balance</title>
<path d="M60.94,43.13A30.87,30.87,0,1,1,59,17.93" />
@ -386,13 +393,13 @@
</nav>
<main class="hide-completely">
<section class="page hide-completely" id="home_page">
<h1>What DO WE OFFER?</h1>
<h1>What is Blockchain UPI?</h1>
<p>
Your Rupee balance is digital footprint of actual cash.<br> Deposit, Withdraw or Pay Rupee digitally
using a FLO Blockchain address.
</p>
<h3>Go ahead and try something</h3>
<h4>Go ahead and try something</h4>
<div class="options-tab">
<div class="option" onclick="showPopup('cash_transfer')">
@ -651,18 +658,14 @@
</div>
</section>
<section id="request_page" class="page hide-completely">
<div class="container-header">
<h2>Payment Requests</h2>
</div>
<p class="bottom-margin">These are payment requests you received.</p>
<p class="bottom-margin">Your payment requests will appear here.</p>
<div id="payment_request_container" class="container">
<h4>You don't have any requests.</h4>
</div>
</section>
<section id="activity_page" class="page">
<div class="container-header">
<h2>Activity</h2>
</div>
<p class="bottom-margin">*If your request isn't completed in 12hrs, use <strong>REPORT</strong> to get
assistance from our helpline.</p>
<sm-tab-header target="user_activities">
@ -1746,6 +1749,12 @@ stroke-width: 6;
}
}
clearAll = () => {
Array.from(this.notificationPanel.children).forEach(child => {
this.removeNotification(child)
})
}
connectedCallback() {
this.notificationPanel = this.shadowRoot.querySelector(
".notification-panel"
@ -1783,7 +1792,7 @@ stroke-width: 6;
if (!mutation.addedNodes[0].classList.contains("pinned"))
setTimeout(() => {
this.removeNotification(mutation.addedNodes[0]);
}, 4000);
}, 5000);
if (window.innerWidth > 640)
this.notificationPanel.style.padding =
"1.5rem 0 3rem 1.5rem";
@ -2569,11 +2578,12 @@ background-color: transparent;
//Checks for internet connection status
if (!navigator.onLine)
notify('There seems to be a problem connecting to the internet.', 'error', true, true)
notify('There seems to be a problem connecting to the internet.', 'error', '', true)
window.addEventListener('offline', () => {
notify('There seems to be a problem connecting to the internet.', 'error', true, true)
})
window.addEventListener('online', () => {
notifications.clearAll()
notify('We are back online.', '', '', true)
})
// function required for popups or modals to appear
@ -2597,6 +2607,7 @@ background-color: transparent;
zIndex = 10;
function showPopup(popup, permission) {
document.body.setAttribute('style', `overflow: hidden; top: -${window.scrollY}px`)
let thisPopup = document.getElementById(popup);
thisPopup.parentNode.classList.remove('hide');
thisPopup.classList.add('no-transformations');
@ -2621,6 +2632,11 @@ background-color: transparent;
// hides the popup or modal
function hidePopup() {
const scrollY = document.body.style.top;
window.scrollTo(0, parseInt(scrollY || '0') * -1);
setTimeout(() => {
document.body.setAttribute('style', `overflow: auto; top: initial`)
}, 300);
if (popupStack.peek() === undefined)
return;
let { popup, permission } = popupStack.pop();
@ -2648,6 +2664,15 @@ background-color: transparent;
}
if (popup === 'cash_transfer') {
payingRequested = false;
tokenReceiver.disabled = false
tokenAmount.disabled = false
}
if (popup === 'deposit_rupee') {
depositRequested = 0;
document.getElementById('upi_txId_section').classList.add('hide-completely')
document.getElementById('deposit_amount_section').classList.remove('hide-completely')
depositedRupeeTxId.disabled = true
document.getElementById('request_tokens_btn').children[0].textContent = 'Continue'
}
}
@ -2693,13 +2718,13 @@ background-color: transparent;
let notifications = document.getElementById('show_message');
//Function for displaying toast notifications. pass in error for mode param if you want to show an error.
function notify(message, mode, behavior, sound) {
function notify(message, mode, pinned, sound) {
if (mode === 'error')
console.error(message)
else
console.log(message)
notifications.push(message, mode, behavior)
notifications.push(message, mode, pinned)
if (navigator.onLine && sound) {
notificationSound.currentTime = 0;
notificationSound.play();
@ -2756,10 +2781,11 @@ background-color: transparent;
month = timeFrag[1],
date = timeFrag[2],
year = timeFrag[3],
hours = timeFrag[4].slice(0, timeFrag[4].lastIndexOf(':')),
finalTime = '';
parseInt(hours.split(':')[0]) > 12 ? finalTime = 'PM' : finalTime = 'AM'
return `${hours} ${finalTime} ${day} ${date} ${month} ${year}`;
minutes = new Date(parseInt(time)).getMinutes(),
hours = new Date(parseInt(time)).getHours()
minutes = minutes.length === 1 ? `0${minutes}` : minutes
let finalHours = hours - 12 > 0 ? `${hours - 12}:${minutes} pm` : `${hours}:${minutes} am`
return `${finalHours} ${month} ${date} ${year}`;
} catch (e) {
console.error(e);
return time;
@ -2784,7 +2810,7 @@ background-color: transparent;
}
function areInputsEmpty(parent) {
let allInputs = parent.querySelectorAll(".input input");
let allInputs = parent.querySelectorAll(".input input:not(:disabled)");
return [...allInputs].every(input => input.checkValidity())
}
@ -2817,6 +2843,8 @@ background-color: transparent;
let allForms = document.querySelectorAll('form'),
payingRequested = false,
currentPaymentRequest;
const tokenReceiver = document.getElementById('token_receiver'),
tokenAmount = document.getElementById('token_amount')
window.addEventListener('load', () => {
allForms.forEach((form) => {
form.addEventListener('input', (e) => {
@ -2899,9 +2927,10 @@ background-color: transparent;
document.getElementById('request_rupee_btn').addEventListener('click', (e) => {
let requestedAddress = document.getElementById('requested_address').value,
requestedAmount = document.getElementById('requested_amount').value
btnLoading('request_rupee_btn', 'start')
request_payment(requestedAddress, requestedAmount)
})
// Function for accepting payment request
document.getElementById('payment_request_container').addEventListener('click', async (e) => {
if (e.target.closest('.send-rupee')) {
@ -2915,20 +2944,24 @@ background-color: transparent;
paymentRequest: parent,
requestId: paymentRequestId
}
popup.querySelector('#token_receiver').value = senderAddress;
popup.querySelector('#token_amount').value = amount;
tokenReceiver.value = senderAddress;
tokenAmount.value = amount;
tokenReceiver.disabled = true
tokenAmount.disabled = true
}
if (e.target.closest('.decline-request')) {
let parent = e.target.closest('.request'),
paymentRequestId = parent.dataset.paymentRequestId;
if (await confirmation(`Do want to decline this request? This will remove the request.`)) {
if (await confirmation(
`Do want to decline this request? This will remove the request.`)) {
payment_request_status(paymentRequestId, 'DECLINED')
e.target.closest('.request').remove()
}
}
})
document.getElementById('select_cashier').addEventListener('change', async function (e) {
await Promise.all([load_deposit_complaints(this.value), load_withdraw_complaints(this.value), load_pay_thru_cashier_complaints(this.value)])
await Promise.all([load_deposit_complaints(this.value), load_withdraw_complaints(
this.value), load_pay_thru_cashier_complaints(this.value)])
})
document.getElementById('helpline_page').addEventListener('click', async e => {
@ -2986,7 +3019,8 @@ background-color: transparent;
compactIDB.deleteDB().then((message) => {
delete token_app.master_configurations;
onLoadStartUp()
notify('You have logged out successfully.')
notifications.clearAll()
notify('Logged out')
}).catch((error) => {
console.log(error)
})
@ -3667,7 +3701,9 @@ background-color: transparent;
window.crypto.getRandomValues(ua);
for (t = 0; t < sr.poolSize; ++t)
sr.pool[sr.pptr++] = ua[t];
} catch (e) { alert(e); }
} catch (e) {
alert(e);
}
}
while (sr.pptr < sr.poolSize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
@ -12975,6 +13011,7 @@ background-color: transparent;
}
}
if (refreshButton) {
notifications.clearAll()
notify('Balance Updated')
refreshButton.classList.remove('animate-loader')
}
@ -13056,7 +13093,7 @@ background-color: transparent;
if (typeof my_token_balance !== "object" ||
typeof my_token_balance.balance !== "number" ||
my_token_balance.balance < amount_to_pay) {
err_msg = `INFO: You have insufficient rupee balance.`;
err_msg = `You have insufficient rupee balance.`;
notify(err_msg, 'error', true, true);
return false;
}
@ -13098,22 +13135,31 @@ background-color: transparent;
<!-- User functions -->
<script>
let depositRequested = 0,
depositedRupeeTxId = document.getElementById('deposited_rupee_txId');
function request_rupee_token() {
try {
const request_tokens_btn = document.getElementById('request_tokens_btn');
const cashier = randomNoRepeats(Object.keys(token_app.master_configurations.cashiers))();
const token_amount_to_buy = document.getElementById('token_amount_to_buy');
request_tokens_btn.onclick = async function () {
btnLoading('request_tokens_btn', 'start')
if (depositRequested === 0) {
if (typeof myFloID !== "string" || myFloID.length < 1) return;
const token_amount_to_buy = Number(document.getElementById('token_amount_to_buy').value);
const cashier_upi = token_app.master_configurations.cashiers[cashier].upi_id;
notify(`Please pay ₹ ${token_amount_to_buy} to UPI id ${cashier_upi}.`, '', true, true);
let upi_txid = await askPrompt(
`Please enter UPI TXID for deposited cash to ${cashier_upi}`);
document.getElementById('send_cash_to_deposit').innerHTML = `Please pay <b>₹${token_amount_to_buy.value}</b> to UPI Id <b>${cashier_upi}</b>.<br> After sending money, enter UPI transaction ID below.`;
document.getElementById('upi_txId_section').classList.remove('hide-completely')
document.getElementById('deposit_amount_section').classList.add('hide-completely')
depositedRupeeTxId.disabled = false
request_tokens_btn.disabled = true
request_tokens_btn.children[0].textContent = 'Deposit'
}
if (depositRequested === 1) {
btnLoading('request_tokens_btn', 'start')
let upi_txid = depositedRupeeTxId.value
let request_object = {
user_flo_id: myFloID,
upi_txid: upi_txid,
deposit_amount: token_amount_to_buy,
deposit_amount: token_amount_to_buy.value
}
if (typeof upi_txid === "string" && upi_txid.length > 1) {
floCloudAPI.sendGeneralData(request_object, token_app.master_configurations
@ -13121,18 +13167,17 @@ background-color: transparent;
receiverID: cashier
}).then(result => {
console.log(result);
notify('Request sent.', 'success');
notify('Deposit request sent.', 'success');
hidePopup()
})
return true;
} else if (upi_txid.trim() === '') {
notify('Please enter UPI TxID if you wish continue your transaction.');
} else if (upi_txid === null) {
notify('Request cancelled.', 'error');
}
hidePopup()
}
return false;
}
depositRequested = depositRequested === 1 ? 0 : 1
}
} catch (error) {
throw new Error(error)
}
@ -13170,7 +13215,7 @@ background-color: transparent;
}
const current_balance = Number(user_token_balance_object.balance);
if (current_balance < withdraw_cash_amount) {
notify(`You have unsufficient balance to withdraw. You can withdraw only Rs ${user_token_balance_object.balance}`,
notify(`You have unsufficient balance to withdraw. You can withdraw only ${user_token_balance_object.balance}`,
'error', true, true);
hidePopup()
return;
@ -13214,10 +13259,10 @@ background-color: transparent;
const cashier = randomNoRepeats(Object.keys(token_app.master_configurations.cashiers))();
const cashier_upi = token_app.master_configurations.cashiers[cashier].upi_id;
const txt = `Please send cash to UPI address ${cashier_upi}.
Then specify the amount sent and UPI Transaction id below.`;
const txt = `Please send cash to UPI address <strong>${cashier_upi}</strong>.
Then specify the <strong>amount sent</strong> and <strong>UPI Transaction ID</strong> below.`;
document.getElementById('pay_cashier_info').innerText = txt;
document.getElementById('pay_cashier_info').innerHTML = txt;
const cnf_cash_payment_btn = document.getElementById('cnf_cash_payment')
cnf_cash_payment_btn.onclick = function () {

14008
index.html.orig Normal file

File diff suppressed because it is too large Load Diff