diff --git a/css/main.css b/css/main.css
index 7332c66..2b1287a 100644
--- a/css/main.css
+++ b/css/main.css
@@ -671,11 +671,6 @@ ul {
z-index: 1;
}
-.clip {
- -webkit-clip-path: circle(0);
- clip-path: circle(0);
-}
-
#home {
padding: 0;
position: relative;
@@ -931,46 +926,24 @@ ul {
fill: rgba(var(--background-color), 1);
}
-#transaction_result {
- display: grid;
- gap: 0.5rem;
- height: max(40vh, 24rem);
- align-items: center;
- justify-content: center;
- text-align: center;
- align-content: center;
-}
-#transaction_result.success .icon--failed {
- display: none;
-}
-#transaction_result.failed .icon--success {
- display: none;
-}
-#transaction_result h3 {
- text-align: center;
- width: 100%;
-}
-#transaction_result .icon {
+.user-action-result__icon {
justify-self: center;
height: 4rem;
width: 4rem;
border-radius: 5rem;
- margin-bottom: 1rem;
+ margin-bottom: 2rem;
-webkit-animation: popup 1s;
animation: popup 1s;
}
-#transaction_result .icon--success {
+.user-action-result__icon.success {
fill: rgba(var(--background-color), 1);
padding: 1rem;
background-color: #0bbe56;
}
-#transaction_result .icon--failed {
+.user-action-result__icon.failed {
background-color: rgba(var(--text-color), 0.03);
fill: var(--danger-color);
}
-#transaction_result sm-copy {
- font-size: 0.8rem;
-}
@-webkit-keyframes popup {
0% {
diff --git a/css/main.min.css b/css/main.min.css
index 92f09ab..78e8bb8 100644
--- a/css/main.min.css
+++ b/css/main.min.css
@@ -1 +1 @@
-*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #256eff;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);scrollbar-width:thin;scrollbar-gutter:stable;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);transition:background-color .3s;position:relative;display:flex;flex-direction:column}body[data-theme=dark]{--accent-color: #90b8f8;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5)}body[data-theme=dark] sm-popup::part(popup){background-color:rgba(var(--foreground-color), 1)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}p:not(:last-of-type),strong:not(:last-of-type){margin-bottom:1.5rem}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a.button{padding:.4rem .6rem;border-radius:.3rem;font-size:.9rem;font-weight:500;color:inherit}button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:transparent;overflow:hidden;color:inherit;-webkit-tap-highlight-color:transparent;align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.06)}.button--primary,.button--danger{color:rgba(var(--background-color), 1)}.button--primary .icon,.button--danger .icon{fill:rgba(var(--background-color), 1)}.button--primary{background-color:var(--accent-color)}.button--danger{background-color:var(--danger-color)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:1rem}.icon-only{padding:.5rem;border-radius:.3rem}button:disabled{opacity:.5}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}details{padding:1rem 0}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between;color:var(--accent-color)}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}sm-input,sm-textarea{font-size:.9rem;--border-radius: 0.3rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-button{--padding: 0.8rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color), 1)}sm-button[disabled] .icon{fill:rgba(var(--text-color), 0.6)}sm-button.danger{--background: var(--danger-color);color:rgba(var(--background-color), 1)}sm-spinner{--size: 1rem;--stroke-width: 0.1rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem}strip-select{--gap: 0;background-color:rgba(var(--text-color), 0.06);border-radius:.3rem;padding:.3rem}strip-option{font-size:.8rem;--border-radius: 0.2rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ul{list-style:none}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.button--primary .ripple,.button--danger .ripple{background:radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%)}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}.empty-state{display:grid;width:100%;padding:1.5rem 0}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)+.empty-state{display:none}.bullet-point{display:flex;align-items:center;justify-content:center;margin:0 .8ch}.bullet-point::after{content:"";height:.4ch;width:.4ch;border-radius:.5em;background-color:var(--accent-color)}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.page{height:100%}.page__header{display:flex;justify-content:space-between;margin-bottom:1.5rem}.page__header .grid{margin-top:auto}.page__header h1{margin-top:auto;font-size:2rem}.page__header .illustration{height:8rem;width:auto}.page-layout{display:grid;gap:1.5rem 0;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem;align-content:flex-start}.page-layout>*{grid-column:2/3}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-weight:500;margin-bottom:.5rem}#confirmation_popup sm-button,#prompt_popup sm-button{margin:0}#confirmation_popup .flex,#prompt_popup .flex{padding:0;margin-top:1rem}#confirmation_popup .flex sm-button:first-of-type,#prompt_popup .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}#prompt_message{margin-bottom:1.5rem}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center}.popup__header__close{padding:.5rem;margin-left:-0.5rem;cursor:pointer}#secondary_pages{display:flex;flex-direction:column;width:100%}#secondary_pages header{padding:1.5rem}#secondary_pages .inner-page{height:100%}#landing>section{justify-content:center;justify-items:center;align-items:center;text-align:center;padding:8vw 0}#landing h1{font-size:clamp(2rem,5vw,5rem)}#sign_in,#sign_up{justify-items:center;align-content:center}#sign_in section,#sign_up section{margin-top:-8rem;width:min(24rem,100%)}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_up .h2{margin-bottom:.5rem}#sign_up .card{margin:1.5rem 0}#sign_up h5{font-weight:500;color:rgba(var(--text-color), 0.8)}#sign_up .warning{margin-top:2rem}#main_header{padding:1.5rem}#main_card{display:flex;flex-direction:column;height:100%;width:100%;transition:background-color .3s}#main_navbar{display:flex;background:rgba(var(--text-color), 0.03)}#main_navbar.hide-away{position:absolute}#main_navbar ul{display:flex;height:100%;width:100%}#main_navbar ul li{width:100%}.nav-item{position:relative;display:flex;flex:1;width:100%;flex-direction:column;align-items:center;justify-content:center;padding:.5rem .3rem;color:var(--text-color);font-size:.8rem;border-radius:.3rem}.nav-item .icon{transition:transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item__title{margin-top:.3rem;transition:opacity .2s,transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item--active{color:var(--accent-color)}.nav-item--active .icon{fill:var(--accent-color);transform:translateY(50%)}.nav-item--active .nav-item__title{transform:translateY(100%);opacity:0}.nav-item__indicator{position:absolute;bottom:0;width:2rem;height:.3rem;background:var(--accent-color);border-radius:1rem 1rem 0 0;z-index:1}.inner-page{padding:0 1.5rem;flex:1;overflow-y:auto;align-content:start}.password-field label{display:flex}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}.multi-state-button{display:grid;text-align:center;align-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1}.clip{-webkit-clip-path:circle(0);clip-path:circle(0)}#home{padding:0;position:relative}#user,#cashier{position:relative;gap:2rem;height:100%;padding:0 1.5rem;overflow-y:auto;padding-bottom:5rem;align-content:flex-start}#quick_actions_container{display:grid;gap:.5rem;grid-template-columns:repeat(auto-fill, minmax(4rem, 1fr))}.primary-action{display:flex;flex-direction:column;align-items:center;padding:.8rem;gap:.5rem;white-space:normal;font-size:.8rem;border-radius:.5rem;font-weight:400;background-color:rgba(var(--text-color), 0.03);text-align:center}.primary-action .icon{fill:var(--accent-color)}#rupee_balance span:first-of-type{font-size:2rem}#rupee_balance span:last-of-type{font-size:1rem}.wallet-action{background-color:rgba(var(--text-color), 0.03);flex:1}.wallet-action:nth-of-type(2){margin-left:.5rem}.wallet-action .icon{margin-right:.5rem;fill:var(--accent-color)}#saved_ids_list{display:grid;grid-template-columns:minmax(0, 1fr);margin-top:1rem}.saved-id{grid-template-columns:auto 1fr;gap:0 .8rem;border-radius:.3rem;padding:.8rem 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.saved-id.highlight{box-shadow:0 0 .1rem .1rem var(--accent-color) inset}.saved-id .edit-saved{grid-area:1/1/3/2;padding:.3rem;position:relative}.saved-id .edit-saved .icon{position:absolute;height:1.2rem;width:1.2rem;right:0;bottom:0;border-radius:.5rem;padding:.2rem;background-color:rgba(var(--background-color), 1)}.saved-id__initials{display:flex;align-items:center;justify-content:center;height:2.4rem;width:2.4rem;font-size:1.2rem;text-transform:uppercase;color:rgba(var(--background-color), 1);font-weight:700;line-height:1;background-color:var(--accent-color);justify-self:flex-start;border-radius:2rem}.saved-id__title{align-self:flex-end;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.saved-id__flo-id{font-size:.8rem}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:1rem}#contact{display:flex;flex-direction:column;padding:0;height:100%}#contact>*{padding:1rem 1.5rem}#contact>:first-child{padding-top:0}#contact__transactions{display:grid;gap:.5rem;overflow-y:auto;flex:1;padding:0 max(1rem,8vw);align-content:flex-start}.transaction-message{background-color:rgba(var(--text-color), 0.06);padding:1rem;border-radius:.5rem;justify-self:flex-start;border-radius:0 1rem 1rem 1rem;gap:.5rem}.transaction-message.received{background-color:var(--accent-color);color:rgba(var(--background-color), 1)}.transaction-message.received+.transaction-message.received{border-radius:1rem}.transaction-message.sent{margin-left:auto;justify-self:flex-end;border-radius:1rem 1rem 0 1rem;text-align:right}.transaction-message__amount{font-size:1.2rem}.transaction-message__time{opacity:.8;font-size:.8rem}#wallet_history_wrapper{margin-top:1.5rem;padding-bottom:3rem}#payments_history{display:grid;gap:2rem;padding-bottom:4rem}.transaction{grid-template-columns:auto 1fr auto;gap:.5rem 1rem;align-items:center}.transaction.sent .icon{fill:rgba(var(--text-color), 0.8)}.transaction.sent .transaction__amount{color:rgba(var(--text-color), 0.8)}.transaction.sent .transaction__amount::before{content:"- "}.transaction.received .icon{fill:var(--green)}.transaction.received .transaction__amount{color:var(--green)}.transaction.received .transaction__amount::before{content:"+ "}.transaction__icon{display:flex;align-items:center;justify-content:center;grid-area:1/1/3/2;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.transaction__receiver{font-weight:500}.transaction__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.transaction__amount{font-size:1rem;font-weight:700;grid-area:1/3/3/4}.fab{position:absolute;right:0;bottom:0;margin:1.5rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.2);z-index:2}#scroll_to_top{border-radius:3rem;background-color:rgba(var(--foreground-color), 1)}#add_address_button{border-radius:.5rem;color:rgba(var(--background-color), 1);background-color:var(--accent-color)}#add_address_button .icon{fill:rgba(var(--background-color), 1)}#transaction_result{display:grid;gap:.5rem;height:max(40vh,24rem);align-items:center;justify-content:center;text-align:center;align-content:center}#transaction_result.success .icon--failed{display:none}#transaction_result.failed .icon--success{display:none}#transaction_result h3{text-align:center;width:100%}#transaction_result .icon{justify-self:center;height:4rem;width:4rem;border-radius:5rem;margin-bottom:1rem;-webkit-animation:popup 1s;animation:popup 1s}#transaction_result .icon--success{fill:rgba(var(--background-color), 1);padding:1rem;background-color:#0bbe56}#transaction_result .icon--failed{background-color:rgba(var(--text-color), 0.03);fill:var(--danger-color)}#transaction_result sm-copy{font-size:.8rem}@-webkit-keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}@keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}.cashier-request,.payment-request{display:flex;gap:1rem;align-items:center;padding:.8rem;border-radius:.3rem;background-color:rgba(var(--foreground-color), 1)}.cashier-request:not(:last-of-type),.payment-request:not(:last-of-type){margin-bottom:.5rem}.cashier-request__time,.payment-request__time{font-size:.8rem}#payment_request_history{padding-bottom:3rem}.payment-request{display:grid;gap:.5rem 1rem;grid-template-columns:1fr auto;color:rgba(var(--text-color), 1)}.payment-request__requestor{font-weight:500}.payment-request__amount{font-weight:700;text-align:right}.payment-request__status{display:flex;align-items:center;font-size:.8rem;text-transform:capitalize}.payment-request__status .icon{height:1rem;width:1rem;margin-left:.3rem}.payment-request .icon.paid{fill:var(--green)}.payment-request .icon.declined{fill:var(--danger-color)}.payment-request .button{background-color:transparent;padding:.6rem .8rem;color:var(--accent-color);background-color:rgba(var(--foreground-color), 1)}.wallet-request{display:grid;gap:.5rem 1rem;padding:.5rem 0;border-radius:.5rem;grid-template-columns:auto 1fr}.wallet-request:not(.rejected,.pending).withdrawn .wallet-request__amount::before{content:"- "}.wallet-request:not(.rejected,.pending).added .wallet-request__amount{color:var(--green)}.wallet-request:not(.rejected,.pending).added .wallet-request__amount::before{content:"+ "}.wallet-request .icon.pending{fill:var(--yellow)}.wallet-request .icon.failed{fill:var(--danger-color)}.wallet-request__icon{display:flex;align-items:center;justify-content:center;grid-area:1/1/3/2;width:2.5rem;height:2.5rem;border-radius:2rem;background-color:rgba(var(--text-color), 0.06)}.wallet-request__icon .icon{fill:var(--accent-color)}.wallet-request__details{font-weight:500}.wallet-request__details,.wallet-request__amount{color:rgba(var(--text-color), 1)}.wallet-request__amount{font-weight:700}.wallet-request__time,.wallet-request__status{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.wallet-request__status{text-transform:capitalize;text-align:right}.wallet-request__status .icon{margin-left:.3rem}#transaction__remark,#transaction__note{line-height:1.6;justify-self:flex-start;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:.8rem}#transaction__note .icon{fill:var(--danger-color);margin-right:.5rem}#saved_upi_ids_list{display:grid;gap:.5rem;width:min(24rem,100%)}.saved-upi{display:flex;justify-content:space-between;align-items:center;padding:.4rem .4rem .4rem 1rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}@media screen and (max-width: 40rem){#main_navbar.hide-away{bottom:0;left:0;right:0}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.page-layout{grid-template-columns:1fr 90vw 1fr}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 1.5rem}body{align-items:center;justify-content:center}#main_card{height:calc(100vh - 3rem);width:calc(100vw - 3rem);position:relative;border-radius:.5rem;overflow:hidden;background-color:rgba(var(--background-color), 1);box-shadow:0 .1rem .2rem rgba(0,0,0,.05),0 1rem 3rem rgba(0,0,0,.2)}#main_card:not(.nav-hidden){display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"nav header" "nav ."}#main_header{grid-area:header}#main_navbar{grid-area:nav;border-top:none;flex-direction:column;height:100%}#main_navbar ul{flex-direction:column;gap:.5rem;padding:.3rem}#main_navbar ul li:last-of-type{margin-top:auto}.nav-item{aspect-ratio:1/1}.nav-item__indicator{width:.25rem;height:50%;left:0;border-radius:0 1rem 1rem 0;bottom:auto}.card{padding:1.5rem}#saved_ids_list{gap:1rem;grid-template-columns:repeat(auto-fill, minmax(14rem, 1fr))}}@media screen and (min-width: 56rem){#main_card{width:56rem;height:min(90vh,48rem)}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.interact:not([disabled]){transition:background-color .3s}.interact:not([disabled]):hover{background-color:rgba(var(--text-color), 0.06)}button:not([disabled]),.button:not([disabled]){transition:background-color .3s,filter .3s}button:not([disabled]):hover,.button:not([disabled]):hover{filter:contrast(2)}}@supports(overflow: overlay){body{overflow:overlay}}.hide{display:none !important}
\ No newline at end of file
+*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #256eff;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);scrollbar-width:thin;scrollbar-gutter:stable;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);transition:background-color .3s;position:relative;display:flex;flex-direction:column}body[data-theme=dark]{--accent-color: #90b8f8;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5)}body[data-theme=dark] sm-popup::part(popup){background-color:rgba(var(--foreground-color), 1)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}p:not(:last-of-type),strong:not(:last-of-type){margin-bottom:1.5rem}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a.button{padding:.4rem .6rem;border-radius:.3rem;font-size:.9rem;font-weight:500;color:inherit}button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:transparent;overflow:hidden;color:inherit;-webkit-tap-highlight-color:transparent;align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.06)}.button--primary,.button--danger{color:rgba(var(--background-color), 1)}.button--primary .icon,.button--danger .icon{fill:rgba(var(--background-color), 1)}.button--primary{background-color:var(--accent-color)}.button--danger{background-color:var(--danger-color)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:1rem}.icon-only{padding:.5rem;border-radius:.3rem}button:disabled{opacity:.5}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}details{padding:1rem 0}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between;color:var(--accent-color)}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}sm-input,sm-textarea{font-size:.9rem;--border-radius: 0.3rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-button{--padding: 0.8rem}sm-button[variant=primary] .icon{fill:rgba(var(--background-color), 1)}sm-button[disabled] .icon{fill:rgba(var(--text-color), 0.6)}sm-button.danger{--background: var(--danger-color);color:rgba(var(--background-color), 1)}sm-spinner{--size: 1rem;--stroke-width: 0.1rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem}strip-select{--gap: 0;background-color:rgba(var(--text-color), 0.06);border-radius:.3rem;padding:.3rem}strip-option{font-size:.8rem;--border-radius: 0.2rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ul{list-style:none}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.button--primary .ripple,.button--danger .ripple{background:radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%)}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}.empty-state{display:grid;width:100%;padding:1.5rem 0}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)+.empty-state{display:none}.bullet-point{display:flex;align-items:center;justify-content:center;margin:0 .8ch}.bullet-point::after{content:"";height:.4ch;width:.4ch;border-radius:.5em;background-color:var(--accent-color)}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.page{height:100%}.page__header{display:flex;justify-content:space-between;margin-bottom:1.5rem}.page__header .grid{margin-top:auto}.page__header h1{margin-top:auto;font-size:2rem}.page__header .illustration{height:8rem;width:auto}.page-layout{display:grid;gap:1.5rem 0;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem;align-content:flex-start}.page-layout>*{grid-column:2/3}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-weight:500;margin-bottom:.5rem}#confirmation_popup sm-button,#prompt_popup sm-button{margin:0}#confirmation_popup .flex,#prompt_popup .flex{padding:0;margin-top:1rem}#confirmation_popup .flex sm-button:first-of-type,#prompt_popup .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}#prompt_message{margin-bottom:1.5rem}.popup__header{display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center}.popup__header__close{padding:.5rem;margin-left:-0.5rem;cursor:pointer}#secondary_pages{display:flex;flex-direction:column;width:100%}#secondary_pages header{padding:1.5rem}#secondary_pages .inner-page{height:100%}#landing>section{justify-content:center;justify-items:center;align-items:center;text-align:center;padding:8vw 0}#landing h1{font-size:clamp(2rem,5vw,5rem)}#sign_in,#sign_up{justify-items:center;align-content:center}#sign_in section,#sign_up section{margin-top:-8rem;width:min(24rem,100%)}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_up .h2{margin-bottom:.5rem}#sign_up .card{margin:1.5rem 0}#sign_up h5{font-weight:500;color:rgba(var(--text-color), 0.8)}#sign_up .warning{margin-top:2rem}#main_header{padding:1.5rem}#main_card{display:flex;flex-direction:column;height:100%;width:100%;transition:background-color .3s}#main_navbar{display:flex;background:rgba(var(--text-color), 0.03)}#main_navbar.hide-away{position:absolute}#main_navbar ul{display:flex;height:100%;width:100%}#main_navbar ul li{width:100%}.nav-item{position:relative;display:flex;flex:1;width:100%;flex-direction:column;align-items:center;justify-content:center;padding:.5rem .3rem;color:var(--text-color);font-size:.8rem;border-radius:.3rem}.nav-item .icon{transition:transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item__title{margin-top:.3rem;transition:opacity .2s,transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item--active{color:var(--accent-color)}.nav-item--active .icon{fill:var(--accent-color);transform:translateY(50%)}.nav-item--active .nav-item__title{transform:translateY(100%);opacity:0}.nav-item__indicator{position:absolute;bottom:0;width:2rem;height:.3rem;background:var(--accent-color);border-radius:1rem 1rem 0 0;z-index:1}.inner-page{padding:0 1.5rem;flex:1;overflow-y:auto;align-content:start}.password-field label{display:flex}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}.multi-state-button{display:grid;text-align:center;align-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1}#home{padding:0;position:relative}#user,#cashier{position:relative;gap:2rem;height:100%;padding:0 1.5rem;overflow-y:auto;padding-bottom:5rem;align-content:flex-start}#quick_actions_container{display:grid;gap:.5rem;grid-template-columns:repeat(auto-fill, minmax(4rem, 1fr))}.primary-action{display:flex;flex-direction:column;align-items:center;padding:.8rem;gap:.5rem;white-space:normal;font-size:.8rem;border-radius:.5rem;font-weight:400;background-color:rgba(var(--text-color), 0.03);text-align:center}.primary-action .icon{fill:var(--accent-color)}#rupee_balance span:first-of-type{font-size:2rem}#rupee_balance span:last-of-type{font-size:1rem}.wallet-action{background-color:rgba(var(--text-color), 0.03);flex:1}.wallet-action:nth-of-type(2){margin-left:.5rem}.wallet-action .icon{margin-right:.5rem;fill:var(--accent-color)}#saved_ids_list{display:grid;grid-template-columns:minmax(0, 1fr);margin-top:1rem}.saved-id{grid-template-columns:auto 1fr;gap:0 .8rem;border-radius:.3rem;padding:.8rem 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.saved-id.highlight{box-shadow:0 0 .1rem .1rem var(--accent-color) inset}.saved-id .edit-saved{grid-area:1/1/3/2;padding:.3rem;position:relative}.saved-id .edit-saved .icon{position:absolute;height:1.2rem;width:1.2rem;right:0;bottom:0;border-radius:.5rem;padding:.2rem;background-color:rgba(var(--background-color), 1)}.saved-id__initials{display:flex;align-items:center;justify-content:center;height:2.4rem;width:2.4rem;font-size:1.2rem;text-transform:uppercase;color:rgba(var(--background-color), 1);font-weight:700;line-height:1;background-color:var(--accent-color);justify-self:flex-start;border-radius:2rem}.saved-id__title{align-self:flex-end;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.saved-id__flo-id{font-size:.8rem}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:1rem}#contact{display:flex;flex-direction:column;padding:0;height:100%}#contact>*{padding:1rem 1.5rem}#contact>:first-child{padding-top:0}#contact__transactions{display:grid;gap:.5rem;overflow-y:auto;flex:1;padding:0 max(1rem,8vw);align-content:flex-start}.transaction-message{background-color:rgba(var(--text-color), 0.06);padding:1rem;border-radius:.5rem;justify-self:flex-start;border-radius:0 1rem 1rem 1rem;gap:.5rem}.transaction-message.received{background-color:var(--accent-color);color:rgba(var(--background-color), 1)}.transaction-message.received+.transaction-message.received{border-radius:1rem}.transaction-message.sent{margin-left:auto;justify-self:flex-end;border-radius:1rem 1rem 0 1rem;text-align:right}.transaction-message__amount{font-size:1.2rem}.transaction-message__time{opacity:.8;font-size:.8rem}#wallet_history_wrapper{margin-top:1.5rem;padding-bottom:3rem}#payments_history{display:grid;gap:2rem;padding-bottom:4rem}.transaction{grid-template-columns:auto 1fr auto;gap:.5rem 1rem;align-items:center}.transaction.sent .icon{fill:rgba(var(--text-color), 0.8)}.transaction.sent .transaction__amount{color:rgba(var(--text-color), 0.8)}.transaction.sent .transaction__amount::before{content:"- "}.transaction.received .icon{fill:var(--green)}.transaction.received .transaction__amount{color:var(--green)}.transaction.received .transaction__amount::before{content:"+ "}.transaction__icon{display:flex;align-items:center;justify-content:center;grid-area:1/1/3/2;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.transaction__receiver{font-weight:500}.transaction__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.transaction__amount{font-size:1rem;font-weight:700;grid-area:1/3/3/4}.fab{position:absolute;right:0;bottom:0;margin:1.5rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.2);z-index:2}#scroll_to_top{border-radius:3rem;background-color:rgba(var(--foreground-color), 1)}#add_address_button{border-radius:.5rem;color:rgba(var(--background-color), 1);background-color:var(--accent-color)}#add_address_button .icon{fill:rgba(var(--background-color), 1)}.user-action-result__icon{justify-self:center;height:4rem;width:4rem;border-radius:5rem;margin-bottom:2rem;-webkit-animation:popup 1s;animation:popup 1s}.user-action-result__icon.success{fill:rgba(var(--background-color), 1);padding:1rem;background-color:#0bbe56}.user-action-result__icon.failed{background-color:rgba(var(--text-color), 0.03);fill:var(--danger-color)}@-webkit-keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}@keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}.cashier-request,.payment-request{display:flex;gap:1rem;align-items:center;padding:.8rem;border-radius:.3rem;background-color:rgba(var(--foreground-color), 1)}.cashier-request:not(:last-of-type),.payment-request:not(:last-of-type){margin-bottom:.5rem}.cashier-request__time,.payment-request__time{font-size:.8rem}#payment_request_history{padding-bottom:3rem}.payment-request{display:grid;gap:.5rem 1rem;grid-template-columns:1fr auto;color:rgba(var(--text-color), 1)}.payment-request__requestor{font-weight:500}.payment-request__amount{font-weight:700;text-align:right}.payment-request__status{display:flex;align-items:center;font-size:.8rem;text-transform:capitalize}.payment-request__status .icon{height:1rem;width:1rem;margin-left:.3rem}.payment-request .icon.paid{fill:var(--green)}.payment-request .icon.declined{fill:var(--danger-color)}.payment-request .button{background-color:transparent;padding:.6rem .8rem;color:var(--accent-color);background-color:rgba(var(--foreground-color), 1)}.wallet-request{display:grid;gap:.5rem 1rem;padding:.5rem 0;border-radius:.5rem;grid-template-columns:auto 1fr}.wallet-request:not(.rejected,.pending).withdrawn .wallet-request__amount::before{content:"- "}.wallet-request:not(.rejected,.pending).added .wallet-request__amount{color:var(--green)}.wallet-request:not(.rejected,.pending).added .wallet-request__amount::before{content:"+ "}.wallet-request .icon.pending{fill:var(--yellow)}.wallet-request .icon.failed{fill:var(--danger-color)}.wallet-request__icon{display:flex;align-items:center;justify-content:center;grid-area:1/1/3/2;width:2.5rem;height:2.5rem;border-radius:2rem;background-color:rgba(var(--text-color), 0.06)}.wallet-request__icon .icon{fill:var(--accent-color)}.wallet-request__details{font-weight:500}.wallet-request__details,.wallet-request__amount{color:rgba(var(--text-color), 1)}.wallet-request__amount{font-weight:700}.wallet-request__time,.wallet-request__status{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.wallet-request__status{text-transform:capitalize;text-align:right}.wallet-request__status .icon{margin-left:.3rem}#transaction__remark,#transaction__note{line-height:1.6;justify-self:flex-start;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:.8rem}#transaction__note .icon{fill:var(--danger-color);margin-right:.5rem}#saved_upi_ids_list{display:grid;gap:.5rem;width:min(24rem,100%)}.saved-upi{display:flex;justify-content:space-between;align-items:center;padding:.4rem .4rem .4rem 1rem;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}@media screen and (max-width: 40rem){#main_navbar.hide-away{bottom:0;left:0;right:0}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.page-layout{grid-template-columns:1fr 90vw 1fr}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 1.5rem}body{align-items:center;justify-content:center}#main_card{height:calc(100vh - 3rem);width:calc(100vw - 3rem);position:relative;border-radius:.5rem;overflow:hidden;background-color:rgba(var(--background-color), 1);box-shadow:0 .1rem .2rem rgba(0,0,0,.05),0 1rem 3rem rgba(0,0,0,.2)}#main_card:not(.nav-hidden){display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"nav header" "nav ."}#main_header{grid-area:header}#main_navbar{grid-area:nav;border-top:none;flex-direction:column;height:100%}#main_navbar ul{flex-direction:column;gap:.5rem;padding:.3rem}#main_navbar ul li:last-of-type{margin-top:auto}.nav-item{aspect-ratio:1/1}.nav-item__indicator{width:.25rem;height:50%;left:0;border-radius:0 1rem 1rem 0;bottom:auto}.card{padding:1.5rem}#saved_ids_list{gap:1rem;grid-template-columns:repeat(auto-fill, minmax(14rem, 1fr))}}@media screen and (min-width: 56rem){#main_card{width:56rem;height:min(90vh,48rem)}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.interact:not([disabled]){transition:background-color .3s}.interact:not([disabled]):hover{background-color:rgba(var(--text-color), 0.06)}button:not([disabled]),.button:not([disabled]){transition:background-color .3s,filter .3s}button:not([disabled]):hover,.button:not([disabled]):hover{filter:contrast(2)}}@supports(overflow: overlay){body{overflow:overlay}}.hide{display:none !important}
\ No newline at end of file
diff --git a/css/main.scss b/css/main.scss
index e3d7637..64596aa 100644
--- a/css/main.scss
+++ b/css/main.scss
@@ -627,9 +627,6 @@ ul {
z-index: 1;
}
}
-.clip {
- clip-path: circle(0);
-}
#home {
padding: 0;
position: relative;
@@ -874,48 +871,21 @@ ul {
fill: rgba(var(--background-color), 1);
}
}
-
-#transaction_result {
- display: grid;
- gap: 0.5rem;
- height: max(40vh, 24rem);
- align-items: center;
- justify-content: center;
- text-align: center;
- align-content: center;
+.user-action-result__icon {
+ justify-self: center;
+ height: 4rem;
+ width: 4rem;
+ border-radius: 5rem;
+ margin-bottom: 2rem;
+ animation: popup 1s;
&.success {
- .icon--failed {
- display: none;
- }
+ fill: rgba(var(--background-color), 1);
+ padding: 1rem;
+ background-color: #0bbe56;
}
&.failed {
- .icon--success {
- display: none;
- }
- }
- h3 {
- text-align: center;
- width: 100%;
- }
- .icon {
- justify-self: center;
- height: 4rem;
- width: 4rem;
- border-radius: 5rem;
- margin-bottom: 1rem;
- animation: popup 1s;
- &--success {
- fill: rgba(var(--background-color), 1);
- padding: 1rem;
- background-color: #0bbe56;
- }
- &--failed {
- background-color: rgba(var(--text-color), 0.03);
- fill: var(--danger-color);
- }
- }
- sm-copy {
- font-size: 0.8rem;
+ background-color: rgba(var(--text-color), 0.03);
+ fill: var(--danger-color);
}
}
@keyframes popup {
diff --git a/index.html b/index.html
index 8ba7fcf..a026fd7 100644
--- a/index.html
+++ b/index.html
@@ -1032,9 +1032,30 @@
Money will be sent to your bank account linked to selected UPI ID
-${message}
`; + if (action) { + composition += ` + + ` + } if (pinned) { notification.classList.add('pinned'); composition += ` @@ -929,6 +948,8 @@ customElements.define('sm-notifications', class extends HTMLElement { e.target.commitStyles() e.target.cancel() } + if (notification.querySelector('.action')) + notification.querySelector('.action').addEventListener('click', options.action.callback) return notification.id; } diff --git a/scripts/fn_pay.js b/scripts/fn_pay.js index 0f15756..17e27a8 100644 --- a/scripts/fn_pay.js +++ b/scripts/fn_pay.js @@ -39,6 +39,7 @@ User.init = function () { })); */ promises.push(User.getCashierUPI()); + promises.push(organizeSyncedData('savedUserData')); Promise.all(promises) .then(result => resolve(result)) .catch(error => reject(error)) diff --git a/scripts/fn_ui.js b/scripts/fn_ui.js index 22b6a49..899cb73 100644 --- a/scripts/fn_ui.js +++ b/scripts/fn_ui.js @@ -25,12 +25,14 @@ async function organizeSyncedData(obsName) { compactIDB.addData(obsName, decryptedData[key], key); } compactIDB.addData(obsName, fetchedData[0].time, 'lastSyncTime'); + return true; } else { const idbData = await compactIDB.readAllData(obsName); for (const key in idbData) { if (key !== 'lastSyncTime') floGlobals[obsName][key] = idbData[key]; } + return true; } } @@ -53,10 +55,15 @@ function depositMoneyToWallet() { let upiTxID = getRef('topup_wallet__txid').value.trim(); if (upiTxID === '') return notify("Please enter UPI transaction ID", 'error'); + buttonLoader('topup_wallet_button', true); User.cashToToken(cashier, amount, upiTxID).then(result => { console.log(result); - notify("Requested cashier. please wait!"); - }).catch(error => console.error(error)) + showProcessStage('topup_wallet_process', 2); + }).catch(error => { + console.error(error) + getRef('topup_failed_reason').textContent = error; + showProcessStage('topup_wallet_process', 3); + }) } function withdrawMoneyFromWallet() { @@ -64,25 +71,36 @@ function withdrawMoneyFromWallet() { if (!cashier) return notify("No cashier online. Please try again in a while.", 'error'); let amount = parseFloat(getRef('send_cashier_amount').value.trim()); - // let upiId = prompt(`${amount} ${floGlobals.currency}# will be sent to ${cashier}. Enter UPI ID`); const upiId = getRef('select_upi_id').value; if (!upiId) return notify("Please add an UPI ID to continue", 'error'); + buttonLoader('withdraw_rupee_button', true); User.sendToken(cashier, amount, 'for token-to-cash').then(txid => { console.warn(`Withdraw ${amount} from cashier ${cashier}`, txid); User.tokenToCash(cashier, amount, txid, upiId).then(result => { + showProcessStage('withdraw_wallet_process', 1); console.log(result); - notify("Requested cashier. please wait!"); - }).catch(error => console.error(error)) - }).catch(error => console.error(error)) + }).catch(error => { + getRef('withdrawal_failed_reason').textContent = error; + showProcessStage('withdraw_wallet_process', 2); + console.error(error) + }).finally(() => { + buttonLoader('withdraw_rupee_button', false); + }); + }).catch(error => { + getRef('withdrawal_failed_reason').textContent = error; + showProcessStage('withdraw_wallet_process', 2); + buttonLoader('withdraw_rupee_button', false); + console.error(error) + }) } async function renderSavedUpiIds() { const frag = document.createDocumentFragment(); - await organizeSyncedData('savedUserData'); for (const upiId in floGlobals.savedUserData.upiIds) { frag.append(render.savedUpiId(upiId)); } + getRef('saved_upi_ids_list').innerHTML = ''; getRef('saved_upi_ids_list').append(frag); } function saveUpiId() { @@ -115,7 +133,7 @@ function saveUpiId() { delegate(getRef('saved_upi_ids_list'), 'click', '.saved-upi', e => { if (e.target.closest('.delete-upi')) { const upiId = e.delegateTarget.dataset.upiId; - getConfirmation('Do you want delete this FLO ID?', { + getConfirmation('Do you want delete this UPI ID?', { confirmText: 'Delete', }).then(res => { if (res) { @@ -165,20 +183,25 @@ userUI.renderCashierRequests = function (requests, error = null) { return; if (pagesData.lastPage === 'wallet') { for (let transactionID in requests) { - let oldCard = getRef('pending_wallet_transactions').querySelector(`[data-vc-${transactionID}]`); - if (oldCard) { - oldCard.remove() - getRef('wallet_history').prepend(render.walletRequestCard(requests[transactionID])) - } + const { note, tag } = requests[transactionID]; + let status = tag ? 'done' : (note ? 'failed' : "pending"); + getRef('wallet_history_wrapper').querySelectorAll(`[data-vc="${transactionID}"]`).forEach(card => card.remove()); + getRef(status !== 'pending' ? 'wallet_history' : 'pending_wallet_transactions').prepend(render.walletRequestCard(requests[transactionID])) } } }; -delegate(getRef('wallet_history_wrapper'), 'click', '.wallet-request', e => { - let transactionID = e.delegateTarget.dataset.vc; - let request = User.cashierRequests[transactionID]; - console.log(request) -}) +const pendingTransactionsObserver = new MutationObserver((mutations) => { + mutations.forEach(mutation => { + if (mutation.type === 'childList') { + if (mutation.target.children.length) + mutation.target.parentNode.classList.remove('hide') + else + mutation.target.parentNode.classList.add('hide') + + } + }) +}); userUI.renderMoneyRequests = function (requests, error = null) { if (error) @@ -187,9 +210,26 @@ userUI.renderMoneyRequests = function (requests, error = null) { return; if (pagesData.lastPage === 'requests') { for (let r in requests) { - let oldCard = getRef('payment_request_history').querySelector(`[data-vc-${r}]`); - if (oldCard) - oldCard.replaceWith(render.paymentRequestCard(requests[r])); + getRef('requests_history_wrapper').querySelectorAll(`[data-vc="${r}"]`).forEach(card => card.remove()); + if (requests[r].note) { + getRef('payment_request_history').prepend(render.paymentRequestCard(requests[r])); + } else { + getRef('pending_payment_requests').prepend(render.paymentRequestCard(requests[r])); + } + } + } + if (floGlobals.loaded) { + for (let r in requests) { + if (!requests[r].note) { + notify(`You have received payment request from ${getFloIdTitle(requests[r].senderID)}`, '', { + action: { + label: 'View', + callback: () => { + window.location.hash = `#/requests` + } + } + }); + } } } }; @@ -425,6 +465,33 @@ const render = { } }; +function buttonLoader(id, show) { + getRef(id).disabled = show; + const animOptions = { + duration: 200, + fill: 'forwards', + easing: 'ease' + } + if (show) { + getRef(id).animate([ + { + clipPath: 'circle(100%)', + }, + { + clipPath: 'circle(0)', + }, + ], animOptions).onfinish = e => { + e.target.commitStyles() + e.target.cancel() + } + getRef(id).parentNode.append(createElement('sm-spinner')) + } else { + getRef(id).style = '' + const potentialTarget = getRef(id).parentNode.querySelector('sm-spinner') + if (potentialTarget) potentialTarget.remove(); + } +} + let currentUserAction; function showTokenTransfer(type) { getRef('tt_button').textContent = type; diff --git a/scripts/std_op.js b/scripts/std_op.js index 837cd19..d7bd747 100644 --- a/scripts/std_op.js +++ b/scripts/std_op.js @@ -5,7 +5,7 @@ */ 'use strict'; //Crypto.js -(function(GLOBAL) { +(function (GLOBAL) { // Global Crypto object var Crypto = GLOBAL.Crypto = {}; /*! @@ -14,7 +14,7 @@ * Copyright (c) 2009-2013, Jeff Mott. All rights reserved. * http://code.google.com/p/crypto-js/wiki/License */ - (function() { + (function () { var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -22,17 +22,17 @@ var util = Crypto.util = { // Bit-wise rotate left - rotl: function(n, b) { + rotl: function (n, b) { return (n << b) | (n >>> (32 - b)); }, // Bit-wise rotate right - rotr: function(n, b) { + rotr: function (n, b) { return (n << (32 - b)) | (n >>> b); }, // Swap big-endian to little-endian and vice versa - endian: function(n) { + endian: function (n) { // If number given, swap endian if (n.constructor == Number) { @@ -48,28 +48,28 @@ }, // Generate an array of any length of random bytes - randomBytes: function(n) { + randomBytes: function (n) { for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256)); return bytes; }, // Convert a byte array to big-endian 32-bit words - bytesToWords: function(bytes) { + bytesToWords: function (bytes) { for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= (bytes[i] & 0xFF) << (24 - b % 32); return words; }, // Convert big-endian 32-bit words to a byte array - wordsToBytes: function(words) { + wordsToBytes: function (words) { for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); return bytes; }, // Convert a byte array to a hex string - bytesToHex: function(bytes) { + bytesToHex: function (bytes) { for (var hex = [], i = 0; i < bytes.length; i++) { hex.push((bytes[i] >>> 4).toString(16)); hex.push((bytes[i] & 0xF).toString(16)); @@ -78,14 +78,14 @@ }, // Convert a hex string to a byte array - hexToBytes: function(hex) { + hexToBytes: function (hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; }, // Convert a byte array to a base-64 string - bytesToBase64: function(bytes) { + bytesToBase64: function (bytes) { for (var base64 = [], i = 0; i < bytes.length; i += 3) { var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; for (var j = 0; j < 4; j++) { @@ -99,7 +99,7 @@ }, // Convert a base-64 string to a byte array - base64ToBytes: function(base64) { + base64ToBytes: function (base64) { // Remove non-base-64 characters base64 = base64.replace(/[^A-Z0-9+\/]/ig, ""); @@ -121,12 +121,12 @@ var UTF8 = charenc.UTF8 = { // Convert a string to a byte array - stringToBytes: function(str) { + stringToBytes: function (str) { return Binary.stringToBytes(unescape(encodeURIComponent(str))); }, // Convert a byte array to a string - bytesToString: function(bytes) { + bytesToString: function (bytes) { return decodeURIComponent(escape(Binary.bytesToString(bytes))); } @@ -136,14 +136,14 @@ var Binary = charenc.Binary = { // Convert a string to a byte array - stringToBytes: function(str) { + stringToBytes: function (str) { for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF); return bytes; }, // Convert a byte array to a string - bytesToString: function(bytes) { + bytesToString: function (bytes) { for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i])); return str.join(""); @@ -159,7 +159,7 @@ * (c) 2009-2012 by Jeff Mott. All rights reserved. * http://code.google.com/p/crypto-js/wiki/License */ - (function() { + (function () { // Shortcuts var C = Crypto, @@ -169,15 +169,15 @@ Binary = charenc.Binary; // Public API - var SHA1 = C.SHA1 = function(message, options) { + var SHA1 = C.SHA1 = function (message, options) { var digestbytes = util.wordsToBytes(SHA1._sha1(message)); return options && options.asBytes ? digestbytes : options && options.asString ? Binary.bytesToString(digestbytes) : - util.bytesToHex(digestbytes); + util.bytesToHex(digestbytes); }; // The core - SHA1._sha1 = function(message) { + SHA1._sha1 = function (message) { // Convert to byte array if (message.constructor == String) message = UTF8.stringToBytes(message); @@ -214,9 +214,9 @@ var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + ( j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 : - j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 : - j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 : - (H1 ^ H2 ^ H3) - 899497514); + j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 : + j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 : + (H1 ^ H2 ^ H3) - 899497514); H4 = H3; H3 = H2; @@ -252,7 +252,7 @@ * (c) 2009-2012 by Jeff Mott. All rights reserved. * http://code.google.com/p/crypto-js/wiki/License */ - (function() { + (function () { // Shortcuts var C = Crypto, @@ -261,7 +261,7 @@ UTF8 = charenc.UTF8, Binary = charenc.Binary; - C.HMAC = function(hasher, message, key, options) { + C.HMAC = function (hasher, message, key, options) { // Convert to byte arrays if (message.constructor == String) message = UTF8.stringToBytes(message); @@ -290,7 +290,7 @@ return options && options.asBytes ? hmacbytes : options && options.asString ? Binary.bytesToString(hmacbytes) : - util.bytesToHex(hmacbytes); + util.bytesToHex(hmacbytes); }; @@ -304,7 +304,7 @@ * (c) 2009-2012 by Jeff Mott. All rights reserved. * http://code.google.com/p/crypto-js/wiki/License */ - (function() { + (function () { var d = Crypto, k = d.util, g = d.charenc, @@ -320,11 +320,11 @@ 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298 ], - e = d.SHA256 = function(b, c) { + e = d.SHA256 = function (b, c) { var f = k.wordsToBytes(e._sha256(b)); return c && c.asBytes ? f : c && c.asString ? a.bytesToString(f) : k.bytesToHex(f) }; - e._sha256 = function(a) { + e._sha256 = function (a) { a.constructor == String && (a = b.stringToBytes(a)); var e = k.bytesToWords(a), f = a.length * 8, @@ -347,7 +347,7 @@ for (h = 0; h < 64; h++) { h < 16 ? d[h] = e[h + t] : (l = d[h - 15], j = d[h - 2], d[h] = ((l << 25 | l >>> 7) ^ (l << 14 | l >>> 18) ^ l >>> 3) + (d[h - 7] >>> 0) + ((j << 15 | j >>> 17) ^ - (j << 13 | j >>> 19) ^ j >>> 10) + (d[h - 16] >>> 0)); + (j << 13 | j >>> 19) ^ j >>> 10) + (d[h - 16] >>> 0)); j = f & g ^ f & m ^ g & m; var u = (f << 30 | f >>> 2) ^ (f << 19 | f >>> 13) ^ (f << 10 | f >>> 22); l = (s >>> 0) + ((i << 26 | i >>> 6) ^ (i << 21 | i >>> 11) ^ (i << 7 | i >>> 25)) + @@ -376,13 +376,13 @@ e._blocksize = 16; e._digestsize = 32 })(); - (function() { + (function () { var d = Crypto, k = d.util, g = d.charenc, b = g.UTF8, a = g.Binary; - d.HMAC = function(c, e, d, g) { + d.HMAC = function (c, e, d, g) { e.constructor == String && (e = b.stringToBytes(e)); d.constructor == String && (d = b.stringToBytes(d)); d.length > c._blocksize * 4 && (d = c(d, { @@ -401,9 +401,9 @@ })(typeof global !== "undefined" ? global : window); //SecureRandom.js -(function(GLOBAL) { +(function (GLOBAL) { - const getRandomValues = function(buf) { + const getRandomValues = function (buf) { if (typeof require === 'function') { var bytes = require('crypto').randomBytes(buf.length); buf.set(bytes) @@ -426,7 +426,7 @@ */ // Constructor function of Global SecureRandom object - var sr = GLOBAL.SecureRandom = function() {}; + var sr = GLOBAL.SecureRandom = function () { }; // Properties sr.state; @@ -442,7 +442,7 @@ // public method // ba: byte array - sr.prototype.nextBytes = function(ba) { + sr.prototype.nextBytes = function (ba) { var i; if (getRandomValues && GLOBAL.Uint8Array) { try { @@ -463,11 +463,11 @@ // Mix in the current time (w/milliseconds) into the pool // NOTE: this method should be called from body click/keypress event handlers to increase entropy - sr.seedTime = function() { + sr.seedTime = function () { sr.seedInt(new Date().getTime()); } - sr.getByte = function() { + sr.getByte = function () { if (sr.state == null) { sr.seedTime(); sr.state = sr.ArcFour(); // Plug in your RNG constructor here @@ -482,7 +482,7 @@ } // Mix in a 32-bit integer into the pool - sr.seedInt = function(x) { + sr.seedInt = function (x) { sr.seedInt8(x); sr.seedInt8((x >> 8)); sr.seedInt8((x >> 16)); @@ -490,19 +490,19 @@ } // Mix in a 16-bit integer into the pool - sr.seedInt16 = function(x) { + sr.seedInt16 = function (x) { sr.seedInt8(x); sr.seedInt8((x >> 8)); } // Mix in a 8-bit integer into the pool - sr.seedInt8 = function(x) { + sr.seedInt8 = function (x) { sr.pool[sr.pptr++] ^= x & 255; if (sr.pptr >= sr.poolSize) sr.pptr -= sr.poolSize; } // Arcfour is a PRNG - sr.ArcFour = function() { + sr.ArcFour = function () { function Arcfour() { this.i = 0; this.j = 0; @@ -587,7 +587,7 @@ } entropyStr += pluginsStr + mimeTypesStr; // cookies and storage: 1 bit - entropyStr += navigator.cookieEnabled + typeof(sessionStorage) + typeof(localStorage); + entropyStr += navigator.cookieEnabled + typeof (sessionStorage) + typeof (localStorage); // language: ~7 bit entropyStr += navigator.language; // history: ~2 bit @@ -605,7 +605,7 @@ })(typeof global !== "undefined" ? global : window); //ripemd160.js -(function(GLOBAL) { +(function (GLOBAL) { /* CryptoJS v3.1.2 @@ -654,7 +654,7 @@ var hl = [0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]; var hr = [0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]; - var bytesToWords = function(bytes) { + var bytesToWords = function (bytes) { var words = []; for (var i = 0, b = 0; i < bytes.length; i++, b += 8) { words[b >>> 5] |= bytes[i] << (24 - b % 32); @@ -662,7 +662,7 @@ return words; }; - var wordsToBytes = function(words) { + var wordsToBytes = function (words) { var bytes = []; for (var b = 0; b < words.length * 32; b += 8) { bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); @@ -670,7 +670,7 @@ return bytes; }; - var processBlock = function(H, M, offset) { + var processBlock = function (H, M, offset) { // Swap endian for (var i = 0; i < 16; i++) { @@ -806,7 +806,7 @@ })(typeof global !== "undefined" ? global : window); //BigInteger.js -(function(GLOBAL) { +(function (GLOBAL) { // Upstream 'BigInteger' here: // Original Author: http://www-cs-students.stanford.edu/~tjw/jsbn/ // Follows 'jsbn' on Github: https://github.com/jasondavies/jsbn @@ -831,7 +831,7 @@ if (a != null) if ("number" == typeof a) this.fromNumber(a, b, c); else if (b == null && "string" != typeof a) this.fromString(a, 256); - else this.fromString(a, b); + else this.fromString(a, b); }; // Bits per digit @@ -977,7 +977,7 @@ // (protected) copy this to r - BigInteger.prototype.copyTo = function(r) { + BigInteger.prototype.copyTo = function (r) { for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]; r.t = this.t; r.s = this.s; @@ -985,7 +985,7 @@ // (protected) set from integer value x, -DV <= x < DV - BigInteger.prototype.fromInt = function(x) { + BigInteger.prototype.fromInt = function (x) { this.t = 1; this.s = (x < 0) ? -1 : 0; if (x > 0) this[0] = x; @@ -994,7 +994,7 @@ }; // (protected) set from string and radix - BigInteger.prototype.fromString = function(s, b) { + BigInteger.prototype.fromString = function (s, b) { var k; if (b == 16) k = 4; else if (b == 8) k = 3; @@ -1038,13 +1038,13 @@ // (protected) clamp off excess high words - BigInteger.prototype.clamp = function() { + BigInteger.prototype.clamp = function () { var c = this.s & this.DM; while (this.t > 0 && this[this.t - 1] == c) --this.t; }; // (protected) r = this << n*DB - BigInteger.prototype.dlShiftTo = function(n, r) { + BigInteger.prototype.dlShiftTo = function (n, r) { var i; for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]; for (i = n - 1; i >= 0; --i) r[i] = 0; @@ -1053,7 +1053,7 @@ }; // (protected) r = this >> n*DB - BigInteger.prototype.drShiftTo = function(n, r) { + BigInteger.prototype.drShiftTo = function (n, r) { for (var i = n; i < this.t; ++i) r[i - n] = this[i]; r.t = Math.max(this.t - n, 0); r.s = this.s; @@ -1061,7 +1061,7 @@ // (protected) r = this << n - BigInteger.prototype.lShiftTo = function(n, r) { + BigInteger.prototype.lShiftTo = function (n, r) { var bs = n % this.DB; var cbs = this.DB - bs; var bm = (1 << cbs) - 1; @@ -1081,7 +1081,7 @@ // (protected) r = this >> n - BigInteger.prototype.rShiftTo = function(n, r) { + BigInteger.prototype.rShiftTo = function (n, r) { r.s = this.s; var ds = Math.floor(n / this.DB); if (ds >= this.t) { @@ -1103,7 +1103,7 @@ // (protected) r = this - a - BigInteger.prototype.subTo = function(a, r) { + BigInteger.prototype.subTo = function (a, r) { var i = 0, c = 0, m = Math.min(a.t, this.t); @@ -1139,7 +1139,7 @@ // (protected) r = this * a, r != this,a (HAC 14.12) // "this" should be the larger one if appropriate. - BigInteger.prototype.multiplyTo = function(a, r) { + BigInteger.prototype.multiplyTo = function (a, r) { var x = this.abs(), y = a.abs(); var i = x.t; @@ -1153,7 +1153,7 @@ // (protected) r = this^2, r != this (HAC 14.16) - BigInteger.prototype.squareTo = function(r) { + BigInteger.prototype.squareTo = function (r) { var x = this.abs(); var i = r.t = 2 * x.t; while (--i >= 0) r[i] = 0; @@ -1173,7 +1173,7 @@ // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) // r != q, this != m. q or r may be null. - BigInteger.prototype.divRemTo = function(m, q, r) { + BigInteger.prototype.divRemTo = function (m, q, r) { var pm = m.abs(); if (pm.t <= 0) return; var pt = this.abs(); @@ -1242,7 +1242,7 @@ // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. // JS multiply "overflows" differently from C/C++, so care is needed here. - BigInteger.prototype.invDigit = function() { + BigInteger.prototype.invDigit = function () { if (this.t < 1) return 0; var x = this[0]; if ((x & 1) == 0) return 0; @@ -1259,13 +1259,13 @@ // (protected) true iff this is even - BigInteger.prototype.isEven = function() { + BigInteger.prototype.isEven = function () { return ((this.t > 0) ? (this[0] & 1) : this.s) == 0; }; // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) - BigInteger.prototype.exp = function(e, z) { + BigInteger.prototype.exp = function (e, z) { if (e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), @@ -1286,7 +1286,7 @@ // (public) return string representation in given radix - BigInteger.prototype.toString = function(b) { + BigInteger.prototype.toString = function (b) { if (this.s < 0) return "-" + this.negate().toString(b); var k; if (b == 16) k = 4; @@ -1325,19 +1325,19 @@ // (public) -this - BigInteger.prototype.negate = function() { + BigInteger.prototype.negate = function () { var r = nbi(); BigInteger.ZERO.subTo(this, r); return r; }; // (public) |this| - BigInteger.prototype.abs = function() { + BigInteger.prototype.abs = function () { return (this.s < 0) ? this.negate() : this; }; // (public) return + if this > a, - if this < a, 0 if equal - BigInteger.prototype.compareTo = function(a) { + BigInteger.prototype.compareTo = function (a) { var r = this.s - a.s; if (r != 0) return r; var i = this.t; @@ -1349,13 +1349,13 @@ } // (public) return the number of bits in "this" - BigInteger.prototype.bitLength = function() { + BigInteger.prototype.bitLength = function () { if (this.t <= 0) return 0; return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM)); }; // (public) this mod a - BigInteger.prototype.mod = function(a) { + BigInteger.prototype.mod = function (a) { var r = nbi(); this.abs().divRemTo(a, null, r); if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); @@ -1363,7 +1363,7 @@ } // (public) this^e % m, 0 <= e < 2^32 - BigInteger.prototype.modPowInt = function(e, m) { + BigInteger.prototype.modPowInt = function (e, m) { var z; if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); @@ -1445,12 +1445,12 @@ // (protected) return x s.t. r^x < DV - BigInteger.prototype.chunkSize = function(r) { + BigInteger.prototype.chunkSize = function (r) { return Math.floor(Math.LN2 * this.DB / Math.log(r)); }; // (protected) convert to radix string - BigInteger.prototype.toRadix = function(b) { + BigInteger.prototype.toRadix = function (b) { if (b == null) b = 10; if (this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); @@ -1468,7 +1468,7 @@ }; // (protected) convert from radix string - BigInteger.prototype.fromRadix = function(s, b) { + BigInteger.prototype.fromRadix = function (s, b) { this.fromInt(0); if (b == null) b = 10; var cs = this.chunkSize(b); @@ -1498,7 +1498,7 @@ }; // (protected) alternate constructor - BigInteger.prototype.fromNumber = function(a, b, c) { + BigInteger.prototype.fromNumber = function (a, b, c) { if ("number" == typeof b) { // new BigInteger(int,int,RNG) if (a < 2) this.fromInt(1); @@ -1525,7 +1525,7 @@ }; // (protected) r = this op a (bitwise) - BigInteger.prototype.bitwiseTo = function(a, op, r) { + BigInteger.prototype.bitwiseTo = function (a, op, r) { var i, f, m = Math.min(a.t, this.t); for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]); if (a.t < this.t) { @@ -1542,14 +1542,14 @@ }; // (protected) this op (1<