From 82e2b0993eae6c7c8271236b90044c10e0089d87 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 28 Mar 2023 23:51:08 +0530 Subject: [PATCH] Showing revocation details --- css/main.css | 6 +++++- css/main.min.css | 2 +- css/main.scss | 6 +++++- index.html | 30 +++++++++++++++++++++++++----- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/css/main.css b/css/main.css index e2c9971..d36b678 100644 --- a/css/main.css +++ b/css/main.css @@ -404,7 +404,7 @@ header { #kyc_section, #verification_section { - width: min(100%, 34rem); + width: min(100%, 40rem); padding: max(1rem, 2vw); margin: 0 auto; border-radius: 0.5rem; @@ -439,6 +439,10 @@ header { color: rgba(var(--text-color), 0.8); gap: 0.3rem 1rem; } +.info span:first-of-type { + font-weight: 500; + min-width: 5rem; +} .error { color: var(--danger-color); diff --git a/css/main.min.css b/css/main.min.css index 1a40dd2..38ea9f6 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: #3d5afe;--secondary-color: #ffac2e;--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);color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1)}body[data-theme=dark]{--accent-color: #6d83ff;--secondary-color: #d60739;--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)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1);background-color:var(--accent-color)}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--danger{background-color:rgba(255,115,115,.062745098);color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--filled{background-color:rgba(var(--text-color), 0.06)}.button--small{padding:.4rem .6rem}.button--rounded{border-radius:4em !important}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}button:disabled{opacity:.4;cursor:not-allowed;filter:saturate(0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:1.05rem 1.4rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;background-color:rgba(0,0,0,0);aspect-ratio:1/1;flex-shrink:0}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[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between}details .down-arrow{margin-left:.5rem}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.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}.justify-items-center{justify-items:center}.align-self-center{align-self:center}.align-self-end{align-self:end}.align-items-start{align-items:flex-start}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-block-1{margin-block:1rem}.margin-block-1-5{margin-block:1.5rem}.margin-inline-1{margin-inline:1rem}.margin-inline-1-5{margin-inline:1.5rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.6rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none}sm-chip[selected]{color:rgba(var(--background-color), 1);--background: var(--accent-color)}.multi-state-button{display:grid;text-align:center;align-items:center;justify-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1;width:100%}#loading{position:fixed;display:grid;top:0;left:0;bottom:0;right:0;place-content:center;justify-items:center;background:rgba(var(--foreground-color), 1);z-index:10}#loading h4{margin-top:1.5rem;font-weight:500}header{padding:1rem}#kyc_section,#verification_section{width:min(100%,34rem);padding:max(1rem,2vw);margin:0 auto;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.address-input sm-input{width:100%}#verification_result{display:grid;gap:1rem;background-color:rgba(var(--text-color), 0.05);border-radius:.5rem;padding:max(1rem,2vw);line-height:1.7}#verification_result .icon{width:3rem;height:3rem}#verification_result[data-status=valid] .icon{fill:var(--green)}#verification_result[data-status=invalid] .icon{fill:var(--danger-color)}.info{font-size:.9rem;color:rgba(var(--text-color), 0.8);gap:.3rem 1rem}.error{color:var(--danger-color)}.hidden{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: #3d5afe;--secondary-color: #ffac2e;--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);color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1)}body[data-theme=dark]{--accent-color: #6d83ff;--secondary-color: #d60739;--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)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1);background-color:var(--accent-color)}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--danger{background-color:rgba(255,115,115,.062745098);color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--filled{background-color:rgba(var(--text-color), 0.06)}.button--small{padding:.4rem .6rem}.button--rounded{border-radius:4em !important}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}button:disabled{opacity:.4;cursor:not-allowed;filter:saturate(0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:1.05rem 1.4rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;background-color:rgba(0,0,0,0);aspect-ratio:1/1;flex-shrink:0}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[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between}details .down-arrow{margin-left:.5rem}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.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}.justify-items-center{justify-items:center}.align-self-center{align-self:center}.align-self-end{align-self:end}.align-items-start{align-items:flex-start}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-block-1{margin-block:1rem}.margin-block-1-5{margin-block:1.5rem}.margin-inline-1{margin-inline:1rem}.margin-inline-1-5{margin-inline:1.5rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.6rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none}sm-chip[selected]{color:rgba(var(--background-color), 1);--background: var(--accent-color)}.multi-state-button{display:grid;text-align:center;align-items:center;justify-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1;width:100%}#loading{position:fixed;display:grid;top:0;left:0;bottom:0;right:0;place-content:center;justify-items:center;background:rgba(var(--foreground-color), 1);z-index:10}#loading h4{margin-top:1.5rem;font-weight:500}header{padding:1rem}#kyc_section,#verification_section{width:min(100%,40rem);padding:max(1rem,2vw);margin:0 auto;border-radius:.5rem;background-color:rgba(var(--foreground-color), 1)}.address-input sm-input{width:100%}#verification_result{display:grid;gap:1rem;background-color:rgba(var(--text-color), 0.05);border-radius:.5rem;padding:max(1rem,2vw);line-height:1.7}#verification_result .icon{width:3rem;height:3rem}#verification_result[data-status=valid] .icon{fill:var(--green)}#verification_result[data-status=invalid] .icon{fill:var(--danger-color)}.info{font-size:.9rem;color:rgba(var(--text-color), 0.8);gap:.3rem 1rem}.info span:first-of-type{font-weight:500;min-width:5rem}.error{color:var(--danger-color)}.hidden{display:none !important} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index 5944f7c..be6bdc2 100644 --- a/css/main.scss +++ b/css/main.scss @@ -384,7 +384,7 @@ header { } #kyc_section, #verification_section { - width: min(100%, 34rem); + width: min(100%, 40rem); padding: max(1rem, 2vw); margin: 0 auto; border-radius: 0.5rem; @@ -424,6 +424,10 @@ header { font-size: 0.9rem; color: rgba(var(--text-color), 0.8); gap: 0.3rem 1rem; + span:first-of-type { + font-weight: 500; + min-width: 5rem; + } } .error { color: var(--danger-color); diff --git a/index.html b/index.html index c2f0294..12c5e8a 100644 --- a/index.html +++ b/index.html @@ -50,7 +50,7 @@
-
+

KYC verification

Enter the address you want to verify @@ -174,10 +174,10 @@ if (address === '') return renderElem(getRef('verification_result'), html`Please enter an address`); getRef('verification_result').classList.remove('hidden'); if (floGlobals.approvedKyc[address]) { - const { validFrom, validTo, verifiedBy } = floGlobals.approvedKyc[address]; + const { validFrom, validTo, verifiedBy, revokedBy } = floGlobals.approvedKyc[address]; + const validFromFormatted = getFormattedTime(validFrom, 'date-only'); + const validToFormatted = getFormattedTime(validTo, 'date-only'); if (validFrom <= Date.now() && Date.now() <= validTo) { - const validFromFormatted = getFormattedTime(validFrom, 'date-only'); - const validToFormatted = getFormattedTime(validTo, 'date-only'); getRef('verification_result').dataset.status = 'valid'; renderElem(getRef('verification_result'), html`

@@ -186,10 +186,14 @@
Verified on + ${getFormattedTime(Date.now(), 'date-only')} +
+
+ Issued on ${validFromFormatted}
- Verified By + Issued by
`); @@ -199,6 +203,22 @@

KYC verification expired

+
+ Issued on + ${validFromFormatted} +
+
+ Issued by + +
+
+ Expired on + ${validToFormatted} +
+
+ Revoked by + +
`); getRef('verification_result').dataset.status = 'invalid'; }