diff --git a/css/main.css b/css/main.css index 8e70ea8..94c1d98 100644 --- a/css/main.css +++ b/css/main.css @@ -998,6 +998,14 @@ theme-toggle { font-size: 0.9rem; } +.badge { + font-size: 0.8rem; + padding: 0.2rem 0.5rem; + border-radius: 0.5rem; + background-color: rgba(var(--text-color), 0.1); + color: rgba(var(--text-color), 0.8); +} + #loading { position: fixed; display: grid; diff --git a/css/main.min.css b/css/main.min.css index d75e6f3..0cd85b3 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -*{padding:0;margin:0;box-sizing:border-box;font-family:"Inter",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #3d5afe;--secondary-color: #ffac2e;--text-color: 34, 34, 34;--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: #92a2ff;--secondary-color: #d60739;--text-color: 200, 200, 200;--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] ::-webkit-calendar-picker-indicator{filter:invert(1)}h1,h2,h3,h4,h5,h6{letter-spacing:-0.01em;font-weight:700}p,strong{line-height:1.7;color:rgba(var(--text-color), 0.9);max-width:70ch}img{-o-object-fit:cover;object-fit:cover}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{color:var(--accent-color)}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}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:inherit;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center;flex-shrink:0}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--small{padding:.4rem .6rem}.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:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;aspect-ratio:1/1}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 summary{display:flex;-webkit-user-select:none;-moz-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{--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-spinner{--size: 1.5rem;--stroke-width: 0.1rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.8rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-weight:500}sm-chip[selected]{--background: var(--accent-color);color:rgba(var(--background-color), 1)}ul{list-style:none}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word}.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}.flex-shrink-0{flex-shrink:0}.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}.text-align-left{text-align:left}.align-items-start{align-items:flex-start}.align-items-center{align-items:center}.align-content-start{align-content:flex-start}.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-content-start{justify-content:start}.justify-content-center{justify-content:center}.justify-right{margin-left:auto}.align-self-start{align-self:start}.align-self-center{align-self:center}.align-self-end{align-self:end}.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}.space-evenly{justify-content:space-evenly}.w-100{width:100%}.h-100{height:100%}.padding-block-1{padding-block:1rem}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-right-1{margin-right:1rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-top-1{margin-top:1rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-bottom-2{margin-bottom:2rem}.margin-block-0-5{margin-block:.5rem}.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}.hidden{display:none !important}.h1{font-size:2.5rem}.h2{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.w-100{width:100%}.color-0-8{color:rgba(var(--text-color), 0.8)}.weight-400{font-weight:400}.weight-500{font-weight:500}.ws-pre-line{white-space:pre-line}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:max(1rem,3vw)}.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}.interactive{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.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}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-size:1.2rem;margin-bottom:1rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}.popup__header{position:relative;display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center}.popup__header>*{grid-row:1}.popup__header h3,.popup__header h4{grid-column:1/-1;justify-self:center;align-self:center}.popup__header__close{grid-column:1;margin-left:-1rem;justify-self:flex-start}section{position:relative}section .dark-background{display:grid;grid-template-rows:auto 1fr}ul[type=circle]{padding:1.5rem 2.5rem;list-style:circle}ul[type=circle] li{margin-bottom:1rem}ul[type=circle] li:last-of-type{margin-bottom:0}ul{list-style:none}.top-bottom-padding{padding:1.5rem 0}.margin,.page{margin:0 1rem}.page{display:flex;flex-direction:column}.card{padding:2rem 1.5rem;border-radius:.5rem;background:rgba(var(--text-color), 0.06);margin:1.5rem 0}.card h2{margin-bottom:1.5rem}.transaction-container{display:grid;margin-top:1.5rem;gap:.5rem}.label{text-transform:capitalize;font-size:.8rem;margin-bottom:.3rem;color:rgba(var(--text-color), 0.8);margin-top:1.5rem;font-weight:500}.label:first-of-type{margin-top:0}.label+*{font-weight:700}.header{justify-items:center;flex-direction:column}#homepage{padding-top:0}#first_section{display:grid}header.grid-2{margin-top:2rem}@-webkit-keyframes flyInLeft{from{opacity:0;transform:translateX(-0.5rem)}to{opacity:1;transform:none}}@keyframes flyInLeft{from{opacity:0;transform:translateX(-0.5rem)}to{opacity:1;transform:none}}@-webkit-keyframes flyInRight{from{opacity:0;transform:translateX(0.5rem)}to{opacity:1;transform:none}}@keyframes flyInRight{from{opacity:0;transform:translateX(0.5rem)}to{opacity:1;transform:none}}#highlights{padding:1.5rem 0;display:grid;grid-template-columns:repeat(auto-fit, minmax(14rem, 1fr));gap:1.5rem}#highlights .highlight-item{opacity:0;display:flex;flex-direction:column;padding:1rem 1.5rem;border-left:.1rem solid rgba(var(--text-color), 0.2);--animation-duration: 0.3s}#highlights .highlight-item .label{margin-top:auto}#highlights .highlight-item h1{font-size:2rem;letter-spacing:.1rem;font-weight:500;text-transform:uppercase;overflow-wrap:break-word}#highlights .highlight-item:first-of-type{text-transform:uppercase}#highlights .highlight-item:nth-of-type(2){text-transform:capitalize}#highlights .highlight-item:first-of-type{-webkit-animation:flyInLeft var(--animation-duration) forwards;animation:flyInLeft var(--animation-duration) forwards}#highlights .highlight-item:nth-of-type(2){-webkit-animation:flyInLeft var(--animation-duration) .1s forwards;animation:flyInLeft var(--animation-duration) .1s forwards}#highlights .highlight-item:nth-of-type(3){-webkit-animation:flyInLeft var(--animation-duration) .2s forwards;animation:flyInLeft var(--animation-duration) .2s forwards}#highlights .highlight-item:last-of-type{-webkit-animation:flyInLeft var(--animation-duration) .3s forwards;animation:flyInLeft var(--animation-duration) .3s forwards}#main_header{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"logo theme" "search search";margin-top:1rem;gap:1rem}#logo{grid-area:logo;color:inherit}theme-toggle{grid-area:theme;justify-self:end;align-self:center}#search_wrapper{grid-area:search;width:min(28rem,100%);position:relative}#main_search_field{width:100%;--min-height: 2.8rem}#suggestions{position:absolute;top:100%;left:0;width:100%;background:rgba(var(--foreground-color), 1);border-radius:.5rem;z-index:1;overflow:hidden;max-height:0;transition:max-height .2s ease-in-out}#suggestions:not(:empty){max-height:20rem;overflow-y:auto}.suggestion{padding:.8rem 1rem;display:flex;align-items:center;cursor:pointer}.suggestion:hover,.suggestion:active,.suggestion:focus{background:rgba(var(--text-color), 0.06);outline:none}.suggestion .address{font-size:.8rem;color:rgba(var(--text-color), 0.6);margin-left:auto}#page_header{padding:1rem 0;align-items:center}#page_header h3{text-transform:capitalize}.page{padding:0 0 1rem 0}.page h3.heading{text-transform:capitalize;font-weight:500}.page>h3.heading{margin-top:2rem}.balance-card{display:flex;flex-direction:column;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' style='fill:none; stroke: %23ffffff08'%3E%3Ccircle cx='3.5' cy='3.5' r='2.12'/%3E%3Ccircle cx='5' cy='10' r='1'/%3E%3Ccircle cx='8.5' cy='4.5' r='1.5'/%3E%3Ccircle cx='6' cy='33' r='2'/%3E%3Ccircle cx='14' cy='29' r='1'/%3E%3Ccircle cx='9.5' cy='22.5' r='1.5'/%3E%3Ccircle cx='29.5' cy='17.5' r='4.5'/%3E%3Ccircle cx='22' cy='8' r='1'/%3E%3Ccircle cx='15.5' cy='12.5' r='2.5'/%3E%3Ccircle cx='27.5' cy='30.5' r='0.5'/%3E%3Ccircle cx='18.5' cy='35.5' r='2.5'/%3E%3Ccircle cx='32' cy='36' r='1'/%3E%3Ccircle cx='35' cy='25' r='1'/%3E%3Ccircle cx='23' cy='21' r='2'/%3E%3Ccircle cx='36.5' cy='1.5' r='0.5'/%3E%3Ccircle cx='30.5' cy='3.5' r='1.5'/%3E%3Ccircle cx='34.5' cy='6.5' r='1.5'/%3E%3C/svg%3E"),linear-gradient(135deg, rgb(77, 32, 167), rgb(33, 16, 110));background-size:cover;color:#fff;border-radius:.5rem;padding:max(1.5rem,3vw);margin-bottom:2rem}.balance-card h2,.balance-card h3,.balance-card h4,.balance-card h5{opacity:.8}.balance-card h3{font-size:1.5rem}.balance-card .label{color:#fff;opacity:.7}.choice,.status{padding:.5rem .8rem;border-radius:2rem;display:inline-flex;align-items:center;margin-bottom:.5rem;text-transform:capitalize;margin-right:auto}.choice-container{display:flex;flex-wrap:wrap}.choice{border:solid 1px rgba(var(--text-color), 0.2)}.choice:last-of-type{margin-bottom:0}.status{font-size:.8rem}.status.active{background:rgba(var(--text-color), 0.1);color:var(--accent-color)}.status.closed{background:rgba(var(--foreground-color), 1);border:solid 1px rgba(var(--text-color), 0.2)}.address,.token,.hash,.contract,.block-height{cursor:pointer;color:var(--accent-color)}.address{text-transform:none !important;word-break:break-all}.contract-choice{display:grid;gap:.5rem 1rem}.contract-choice:last-of-type{margin-bottom:0}#token_balance_list{display:flex;flex-wrap:wrap;gap:.5rem}.token-balance{display:flex;flex-direction:column;padding:1rem;background-color:rgba(0,0,0,.2);border-radius:.5rem;font-size:1.2rem}.transaction{display:grid;gap:1.5rem;padding:max(1rem,2vw);border-radius:.5rem;background-color:rgba(var(--foreground-color), 0.8);content-visibility:auto}.transaction .contract-info{align-items:flex-start;display:grid;gap:1.5rem}.transaction>.icon:first-of-type{fill:none;stroke:rgba(var(--text-color), 0.8);stroke-width:4;stroke-linecap:round;stroke-linejoin:round;overflow:visible;height:2.5rem;width:2.5rem;padding:.7rem;border-radius:1rem;background:rgba(var(--text-color), 0.1)}.transaction time{font-size:.9rem}#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}#all_blocks_page,#top_blocks_container{display:grid;grid-template-columns:repeat(auto-fit, minmax(20rem, 1fr));gap:1rem;margin-top:1rem}.block-card{grid-template-columns:5rem 1fr auto;gap:1rem;background-color:rgba(var(--foreground-color), 1);padding:1rem;border-radius:.5rem}.block-card time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}#token_balance_container{display:grid;gap:.5rem;margin-top:1.5rem}#token_balance_container .holder-balance{padding:1rem;border-radius:.5rem;background:rgba(var(--foreground-color), 1)}#error_page{padding:1.5rem 0}#view-wrappe .view-wrapper{display:grid;align-items:flex-start}#view-wrappe .view-wrapper>*{grid-area:1/1}.info-row{flex-direction:column;margin-bottom:1.3rem}#participant_container,#deposits_container{display:grid;gap:.5rem;background-color:rgba(0,0,0,0);padding:0}.participant,.deposit-card{flex-wrap:wrap;gap:2rem;background-color:rgba(var(--foreground-color), 1);padding:max(1rem,1.5vw);border-radius:.5rem}.participant .address,.deposit-card .address{min-width:12rem}@media only screen and (min-width: 640px){.margin,.page{margin:0 4vw}section header h1{font-size:2rem}#main_header{grid-template-areas:"logo theme"}#search_wrapper{grid-area:1/1/2/-1;margin:0 auto;max-width:calc(100% - 16rem)}#page_header{padding:1.5rem 0}#transaction_page{display:grid;gap:0 1.5rem;grid-template-columns:40% 60%;grid-template-areas:"header header" ". ."}#transaction_page .head{grid-area:header}.transaction{grid-template-columns:auto 1fr}.transaction>.icon:first-of-type{grid-area:1/1/3/2}.contract-choice{grid-template-columns:2fr 1fr 1fr;align-items:center}#contract_info{-moz-columns:24rem auto;columns:24rem auto;-moz-column-gap:4rem;column-gap:4rem}.info-row{flex-direction:row;gap:.5rem}.info-row h5{min-width:11rem;margin-bottom:0;margin-top:.2rem !important}}@media only screen and (min-width: 1280px){.margin,.page{margin:0 10vw}}@media(hover: hover){button{transition:background-color .3s}button:hover{background:var(--accent-color);color:rgba(var(--foreground-color), 1)}.hover{cursor:pointer}} \ No newline at end of file +*{padding:0;margin:0;box-sizing:border-box;font-family:"Inter",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #3d5afe;--secondary-color: #ffac2e;--text-color: 34, 34, 34;--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: #92a2ff;--secondary-color: #d60739;--text-color: 200, 200, 200;--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] ::-webkit-calendar-picker-indicator{filter:invert(1)}h1,h2,h3,h4,h5,h6{letter-spacing:-0.01em;font-weight:700}p,strong{line-height:1.7;color:rgba(var(--text-color), 0.9);max-width:70ch}img{-o-object-fit:cover;object-fit:cover}a:where([class]){color:inherit;text-decoration:none}a:where([class]):focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}a{color:var(--accent-color)}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}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:inherit;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center;flex-shrink:0}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--small{padding:.4rem .6rem}.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:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;aspect-ratio:1/1}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 summary{display:flex;-webkit-user-select:none;-moz-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{--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-spinner{--size: 1.5rem;--stroke-width: 0.1rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.8rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-weight:500}sm-chip[selected]{--background: var(--accent-color);color:rgba(var(--background-color), 1)}ul{list-style:none}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word}.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}.flex-shrink-0{flex-shrink:0}.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}.text-align-left{text-align:left}.align-items-start{align-items:flex-start}.align-items-center{align-items:center}.align-content-start{align-content:flex-start}.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-content-start{justify-content:start}.justify-content-center{justify-content:center}.justify-right{margin-left:auto}.align-self-start{align-self:start}.align-self-center{align-self:center}.align-self-end{align-self:end}.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}.space-evenly{justify-content:space-evenly}.w-100{width:100%}.h-100{height:100%}.padding-block-1{padding-block:1rem}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-right-1{margin-right:1rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-top-1{margin-top:1rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-bottom-2{margin-bottom:2rem}.margin-block-0-5{margin-block:.5rem}.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}.hidden{display:none !important}.h1{font-size:2.5rem}.h2{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.w-100{width:100%}.color-0-8{color:rgba(var(--text-color), 0.8)}.weight-400{font-weight:400}.weight-500{font-weight:500}.ws-pre-line{white-space:pre-line}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:max(1rem,3vw)}.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}.interactive{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.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}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-size:1.2rem;margin-bottom:1rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}.popup__header{position:relative;display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center}.popup__header>*{grid-row:1}.popup__header h3,.popup__header h4{grid-column:1/-1;justify-self:center;align-self:center}.popup__header__close{grid-column:1;margin-left:-1rem;justify-self:flex-start}section{position:relative}section .dark-background{display:grid;grid-template-rows:auto 1fr}ul[type=circle]{padding:1.5rem 2.5rem;list-style:circle}ul[type=circle] li{margin-bottom:1rem}ul[type=circle] li:last-of-type{margin-bottom:0}ul{list-style:none}.top-bottom-padding{padding:1.5rem 0}.margin,.page{margin:0 1rem}.page{display:flex;flex-direction:column}.card{padding:2rem 1.5rem;border-radius:.5rem;background:rgba(var(--text-color), 0.06);margin:1.5rem 0}.card h2{margin-bottom:1.5rem}.transaction-container{display:grid;margin-top:1.5rem;gap:.5rem}.label{text-transform:capitalize;font-size:.8rem;margin-bottom:.3rem;color:rgba(var(--text-color), 0.8);margin-top:1.5rem;font-weight:500}.label:first-of-type{margin-top:0}.label+*{font-weight:700}.header{justify-items:center;flex-direction:column}#homepage{padding-top:0}#first_section{display:grid}header.grid-2{margin-top:2rem}@-webkit-keyframes flyInLeft{from{opacity:0;transform:translateX(-0.5rem)}to{opacity:1;transform:none}}@keyframes flyInLeft{from{opacity:0;transform:translateX(-0.5rem)}to{opacity:1;transform:none}}@-webkit-keyframes flyInRight{from{opacity:0;transform:translateX(0.5rem)}to{opacity:1;transform:none}}@keyframes flyInRight{from{opacity:0;transform:translateX(0.5rem)}to{opacity:1;transform:none}}#highlights{padding:1.5rem 0;display:grid;grid-template-columns:repeat(auto-fit, minmax(14rem, 1fr));gap:1.5rem}#highlights .highlight-item{opacity:0;display:flex;flex-direction:column;padding:1rem 1.5rem;border-left:.1rem solid rgba(var(--text-color), 0.2);--animation-duration: 0.3s}#highlights .highlight-item .label{margin-top:auto}#highlights .highlight-item h1{font-size:2rem;letter-spacing:.1rem;font-weight:500;text-transform:uppercase;overflow-wrap:break-word}#highlights .highlight-item:first-of-type{text-transform:uppercase}#highlights .highlight-item:nth-of-type(2){text-transform:capitalize}#highlights .highlight-item:first-of-type{-webkit-animation:flyInLeft var(--animation-duration) forwards;animation:flyInLeft var(--animation-duration) forwards}#highlights .highlight-item:nth-of-type(2){-webkit-animation:flyInLeft var(--animation-duration) .1s forwards;animation:flyInLeft var(--animation-duration) .1s forwards}#highlights .highlight-item:nth-of-type(3){-webkit-animation:flyInLeft var(--animation-duration) .2s forwards;animation:flyInLeft var(--animation-duration) .2s forwards}#highlights .highlight-item:last-of-type{-webkit-animation:flyInLeft var(--animation-duration) .3s forwards;animation:flyInLeft var(--animation-duration) .3s forwards}#main_header{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"logo theme" "search search";margin-top:1rem;gap:1rem}#logo{grid-area:logo;color:inherit}theme-toggle{grid-area:theme;justify-self:end;align-self:center}#search_wrapper{grid-area:search;width:min(28rem,100%);position:relative}#main_search_field{width:100%;--min-height: 2.8rem}#suggestions{position:absolute;top:100%;left:0;width:100%;background:rgba(var(--foreground-color), 1);border-radius:.5rem;z-index:1;overflow:hidden;max-height:0;transition:max-height .2s ease-in-out}#suggestions:not(:empty){max-height:20rem;overflow-y:auto}.suggestion{padding:.8rem 1rem;display:flex;align-items:center;cursor:pointer}.suggestion:hover,.suggestion:active,.suggestion:focus{background:rgba(var(--text-color), 0.06);outline:none}.suggestion .address{font-size:.8rem;color:rgba(var(--text-color), 0.6);margin-left:auto}#page_header{padding:1rem 0;align-items:center}#page_header h3{text-transform:capitalize}.page{padding:0 0 1rem 0}.page h3.heading{text-transform:capitalize;font-weight:500}.page>h3.heading{margin-top:2rem}.balance-card{display:flex;flex-direction:column;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' style='fill:none; stroke: %23ffffff08'%3E%3Ccircle cx='3.5' cy='3.5' r='2.12'/%3E%3Ccircle cx='5' cy='10' r='1'/%3E%3Ccircle cx='8.5' cy='4.5' r='1.5'/%3E%3Ccircle cx='6' cy='33' r='2'/%3E%3Ccircle cx='14' cy='29' r='1'/%3E%3Ccircle cx='9.5' cy='22.5' r='1.5'/%3E%3Ccircle cx='29.5' cy='17.5' r='4.5'/%3E%3Ccircle cx='22' cy='8' r='1'/%3E%3Ccircle cx='15.5' cy='12.5' r='2.5'/%3E%3Ccircle cx='27.5' cy='30.5' r='0.5'/%3E%3Ccircle cx='18.5' cy='35.5' r='2.5'/%3E%3Ccircle cx='32' cy='36' r='1'/%3E%3Ccircle cx='35' cy='25' r='1'/%3E%3Ccircle cx='23' cy='21' r='2'/%3E%3Ccircle cx='36.5' cy='1.5' r='0.5'/%3E%3Ccircle cx='30.5' cy='3.5' r='1.5'/%3E%3Ccircle cx='34.5' cy='6.5' r='1.5'/%3E%3C/svg%3E"),linear-gradient(135deg, rgb(77, 32, 167), rgb(33, 16, 110));background-size:cover;color:#fff;border-radius:.5rem;padding:max(1.5rem,3vw);margin-bottom:2rem}.balance-card h2,.balance-card h3,.balance-card h4,.balance-card h5{opacity:.8}.balance-card h3{font-size:1.5rem}.balance-card .label{color:#fff;opacity:.7}.choice,.status{padding:.5rem .8rem;border-radius:2rem;display:inline-flex;align-items:center;margin-bottom:.5rem;text-transform:capitalize;margin-right:auto}.choice-container{display:flex;flex-wrap:wrap}.choice{border:solid 1px rgba(var(--text-color), 0.2)}.choice:last-of-type{margin-bottom:0}.status{font-size:.8rem}.status.active{background:rgba(var(--text-color), 0.1);color:var(--accent-color)}.status.closed{background:rgba(var(--foreground-color), 1);border:solid 1px rgba(var(--text-color), 0.2)}.address,.token,.hash,.contract,.block-height{cursor:pointer;color:var(--accent-color)}.address{text-transform:none !important;word-break:break-all}.contract-choice{display:grid;gap:.5rem 1rem}.contract-choice:last-of-type{margin-bottom:0}#token_balance_list{display:flex;flex-wrap:wrap;gap:.5rem}.token-balance{display:flex;flex-direction:column;padding:1rem;background-color:rgba(0,0,0,.2);border-radius:.5rem;font-size:1.2rem}.transaction{display:grid;gap:1.5rem;padding:max(1rem,2vw);border-radius:.5rem;background-color:rgba(var(--foreground-color), 0.8);content-visibility:auto}.transaction .contract-info{align-items:flex-start;display:grid;gap:1.5rem}.transaction>.icon:first-of-type{fill:none;stroke:rgba(var(--text-color), 0.8);stroke-width:4;stroke-linecap:round;stroke-linejoin:round;overflow:visible;height:2.5rem;width:2.5rem;padding:.7rem;border-radius:1rem;background:rgba(var(--text-color), 0.1)}.transaction time{font-size:.9rem}.badge{font-size:.8rem;padding:.2rem .5rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.1);color:rgba(var(--text-color), 0.8)}#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}#all_blocks_page,#top_blocks_container{display:grid;grid-template-columns:repeat(auto-fit, minmax(20rem, 1fr));gap:1rem;margin-top:1rem}.block-card{grid-template-columns:5rem 1fr auto;gap:1rem;background-color:rgba(var(--foreground-color), 1);padding:1rem;border-radius:.5rem}.block-card time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}#token_balance_container{display:grid;gap:.5rem;margin-top:1.5rem}#token_balance_container .holder-balance{padding:1rem;border-radius:.5rem;background:rgba(var(--foreground-color), 1)}#error_page{padding:1.5rem 0}#view-wrappe .view-wrapper{display:grid;align-items:flex-start}#view-wrappe .view-wrapper>*{grid-area:1/1}.info-row{flex-direction:column;margin-bottom:1.3rem}#participant_container,#deposits_container{display:grid;gap:.5rem;background-color:rgba(0,0,0,0);padding:0}.participant,.deposit-card{flex-wrap:wrap;gap:2rem;background-color:rgba(var(--foreground-color), 1);padding:max(1rem,1.5vw);border-radius:.5rem}.participant .address,.deposit-card .address{min-width:12rem}@media only screen and (min-width: 640px){.margin,.page{margin:0 4vw}section header h1{font-size:2rem}#main_header{grid-template-areas:"logo theme"}#search_wrapper{grid-area:1/1/2/-1;margin:0 auto;max-width:calc(100% - 16rem)}#page_header{padding:1.5rem 0}#transaction_page{display:grid;gap:0 1.5rem;grid-template-columns:40% 60%;grid-template-areas:"header header" ". ."}#transaction_page .head{grid-area:header}.transaction{grid-template-columns:auto 1fr}.transaction>.icon:first-of-type{grid-area:1/1/3/2}.contract-choice{grid-template-columns:2fr 1fr 1fr;align-items:center}#contract_info{-moz-columns:24rem auto;columns:24rem auto;-moz-column-gap:4rem;column-gap:4rem}.info-row{flex-direction:row;gap:.5rem}.info-row h5{min-width:11rem;margin-bottom:0;margin-top:.2rem !important}}@media only screen and (min-width: 1280px){.margin,.page{margin:0 10vw}}@media(hover: hover){button{transition:background-color .3s}button:hover{background:var(--accent-color);color:rgba(var(--foreground-color), 1)}.hover{cursor:pointer}} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index c820f24..42a17a5 100644 --- a/css/main.scss +++ b/css/main.scss @@ -908,6 +908,13 @@ theme-toggle { font-size: 0.9rem; } } +.badge { + font-size: 0.8rem; + padding: 0.2rem 0.5rem; + border-radius: 0.5rem; + background-color: rgba(var(--text-color), 0.1); + color: rgba(var(--text-color), 0.8); +} #loading { position: fixed; display: grid; diff --git a/index.html b/index.html index ebd18ed..0a3ee3d 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@ @@ -641,8 +641,7 @@ let frag = document.createDocumentFragment(); const render = { homepage(obj) { - let { topToken, totalTransactions, walletAddresses, latestBlock } = obj; - const { height, time } = latestBlock + let { topToken, totalTransactions, walletAddresses, latestBlock: { height, time } } = obj; return html`
@@ -744,12 +743,11 @@ `; }, transactionPage(obj) { + console.log(obj) let { type, name, blockHeight, amount, sender, receiver, floData, hash, confirmations, nftHash } = obj; - // todo : This is a temporary fix. Fix this on the Database and API level if (type == 'smartContractPays' || type == ' smartContractPays') { name = '' } - if (type.trim() === 'nftIncorporation') type = 'NFT Incorporation' else if (type.trim() === 'nft transfer') @@ -799,10 +797,9 @@
Block Confirmations

${confirmations}

${nftHash ? html` -
NFT hash
- - `: '' - } +
NFT hash
+ + `: ''}
`; @@ -1100,10 +1097,8 @@
-
Sender
- - ${sender} - +
Sender (Smart contract)
+ ${contractName}-${sender}
Receiver
@@ -1112,10 +1107,6 @@
-
-
Contract name
-

${contractName}

-
Amount

${formatAmount(amount, token.toLowerCase() === 'rupee' ? 'inr' : 'usd')} ${token}

@@ -1373,6 +1364,50 @@
`; + }, + offChainTransferCard(transferDetails) { + const { tokenAmount, transactionTrigger, tokenIdentification, contractName, senderAddress, receiverAddress, time, type } = transferDetails; + return html` +
  • + transfer +
    +
    +
    Token transfer
    +
    Off-chain
    +
    + ${tokenIdentification} +
    +
    + +
    +
    Contract name
    +

    ${contractName}

    +
    +
    +
    Sender address
    + + ${senderAddress} + +
    +
    +
    Receiver address
    + + ${receiverAddress} + +
    +
    +
    Amount
    +

    ${tokenAmount} ${tokenIdentification}

    +
    +
    +
    +
    Transfer trigger ID
    + +
    + View details +
    +
    +
  • `; } }; @@ -1408,6 +1443,9 @@ case 'contracttrigger': return render.contractTriggerCard(tx); break; + case 'offChainTransfer': + return render.offChainTransferCard(tx); + break; } }) renderElem(document.getElementById(container), html`${renderedTransactions.length ? renderedTransactions : html`
    No transactions found
    `}`) @@ -1590,135 +1628,153 @@ let latestTxArray = []; txList.forEach(tx => { const { - transactionDetails: { - txid, blockHeight, vin, vout, time, - receiverAddress, - senderAddress, - }, - parsedFloData: { - contractAddress, - contractType, - contractConditions: { expiryTime, accepting_token, selling_token, subtype, price } = {}, - contractAmount, - type, - tokenAmount, - tokenIdentification, - transferType, - contractName, - triggerCondition, - userChoice, - nftHash, - depositAmount, - } + txid, + blockHeight, + vin, + vout, + time, + receiverAddress, + senderAddress, + contractAddress, + contractType, + contractConditions: { expiryTime, accepting_token, selling_token, subtype, price } = {}, + contractAmount, + type, + tokenAmount, + transferType, + triggerCondition, + userChoice, + nftHash, + depositAmount, + contractName, + tokenIdentification, + transactionTrigger, + onChain } = tx; let obj = { hash: txid, blockHeight, time }; - if (type != "smartContractPays") { - // determine token - obj["token"] = tokenIdentification; - switch (type) { - case 'transfer': - if (transferType == "token" || transferType == 'nft') { + if (onChain) { + if (type != "smartContractPays") { + // determine token + obj["token"] = tokenIdentification; + switch (type) { + case 'transfer': + if (transferType == "token" || transferType == 'nft') { + obj = Object.assign({}, obj, { + sender: senderAddress, + receiver: receiverAddress, + amount: tokenAmount, + type: transferType == "token" ? "tokentransfer" : "nfttransfer", + }); + latestTxArray.push(obj); + break; + } else if (transferType == 'smartContract') { + // smart contract transfer + obj = Object.assign({}, obj, { + sender: senderAddress, + receiver: receiverAddress, + amount: tokenAmount, + contractName, + userChoice, + type: "contracttransfer", + }); + latestTxArray.push(obj); + break; + } + case 'tokenIncorporation': + // token incorporation + // smart contract incorporation obj = Object.assign({}, obj, { - sender: senderAddress, - receiver: receiverAddress, - amount: tokenAmount, - type: transferType == "token" ? "tokentransfer" : "nfttransfer", + incAddress: senderAddress, + supply: tokenAmount, + type: "tokenincorp", }); latestTxArray.push(obj); break; - } else if (transferType == 'smartContract') { - // smart contract transfer + case 'smartContractIncorporation': + // smart contract incorporation + // todo : add checks to determine obj for different types of smart contract incorporation + switch (subtype) { + case 'tokenswap': + obj = Object.assign({}, obj, { + contractName, + incAddress: contractAddress, + contractType, + type: "contractincorp", + sellingToken: selling_token, + acceptingToken: accepting_token, + price, + }); + delete obj["token"]; + break; + default: + obj = Object.assign({}, obj, { + contractName, + incAddress: contractAddress, + contractType, + expiration: expiryTime, + participationFees: contractAmount, + availableChoices: "", + type: "contractincorp", + }); + break; + } + latestTxArray.push(obj); + break; + case 'nftIncorporation': + // nft incorporation + obj = Object.assign({}, obj, { + incAddress: senderAddress, + supply: tokenAmount, + type: "nftincorp", + nftHash + }); + latestTxArray.push(obj); + break; + case 'smartContractDeposit': + // smart contract deposit obj = Object.assign({}, obj, { - sender: senderAddress, - receiver: receiverAddress, - amount: tokenAmount, contractName, - userChoice, - type: "contracttransfer", + contractAddress, + contractType, + amount: depositAmount, + type: "contractdeposit", + sender: senderAddress, + receiver: receiverAddress, }); latestTxArray.push(obj); break; - } - case 'tokenIncorporation': - // token incorporation - // smart contract incorporation - obj = Object.assign({}, obj, { - incAddress: senderAddress, - supply: tokenAmount, - type: "tokenincorp", - }); - latestTxArray.push(obj); - break; - case 'smartContractIncorporation': - // smart contract incorporation - // todo : add checks to determine obj for different types of smart contract incorporation - switch (subtype) { - case 'tokenswap': - obj = Object.assign({}, obj, { - contractName, - incAddress: contractAddress, - contractType, - type: "contractincorp", - sellingToken: selling_token, - acceptingToken: accepting_token, - price, - }); - delete obj["token"]; - break; - default: - obj = Object.assign({}, obj, { - contractName, - incAddress: contractAddress, - contractType, - expiration: expiryTime, - participationFees: contractAmount, - availableChoices: "", - type: "contractincorp", - }); - break; - } - latestTxArray.push(obj); - break; - case 'nftIncorporation': - // nft incorporation - obj = Object.assign({}, obj, { - incAddress: senderAddress, - supply: tokenAmount, - type: "nftincorp", - nftHash - }); - latestTxArray.push(obj); - break; - case 'smartContractDeposit': - // smart contract deposit - obj = Object.assign({}, obj, { - contractName, - contractAddress, - contractType, - amount: depositAmount, - type: "contractdeposit", - sender: senderAddress, - receiver: receiverAddress, - }); - latestTxArray.push(obj); - break; + } + + } else { + // transaction is a FLO Smart Contract Committee trigger + + obj = Object.assign({}, obj, { + hash: txid, + blockHeight, + contractName, + contractAddress: receiverAddress, + winningChoice: triggerCondition, + committeeAddress: senderAddress, + type: 'contracttrigger' + }); + latestTxArray.push(obj); } - } else { - // transaction is a FLO Smart Contract Committee trigger - obj = Object.assign({}, obj, { - hash: txid, - blockHeight, + transactionTrigger, contractName, - contractAddress: receiverAddress, - winningChoice: triggerCondition, - committeeAddress: senderAddress, - type: 'contracttrigger' + contractAddress, + onChain: false, + type: 'offChainTransfer', + senderAddress, + receiverAddress, + tokenAmount, + tokenIdentification, + time }); latestTxArray.push(obj); } @@ -1754,38 +1810,38 @@ async function getTxInfo(thisTx) { try { const transaction = await fetchJson(`${floGlobals.tokenApiUrl}/api/v2/transactionDetails/${thisTx}`) + console.log(transaction) if (transaction.result === 'error') { return [false, transaction.description] } else { - let transactionHash = transaction.transactionHash, - { flodata, tokenAmount, tokenIdentification, type, nftHash } = transaction.parsedFloData, - { blockheight, vin, vout, confirmations } = transaction.transactionDetails; - let sender = vin[0].addr; - let receiver = sender - for (let i = 0; i < vout.length; i++) { - if (vout[i]["scriptPubKey"]["addresses"][0] !== vin[0]["addr"]) { - receiver = vout[i]["scriptPubKey"]["addresses"][0]; - } - } - // todo - temporary fixes below. Fix these on the Database and API level - let transactionType = '' - if (type == 'transfer') { - transactionType = transaction.parsedFloData?.transferType - } + let { + floData, + tokenAmount, + tokenIdentification, + type, + nftHash, + blockheight, + vin, + vout, + confirmations, + transferType, + senderAddress, + receiverAddress, + txid + } = transaction; if (type == 'smartContractPays') { tokenAmount = '-' - flodata = transaction.transactionDetails.floData } return [ true, { - type: `${transactionType} ${type}`, + type: `${transferType || ''} ${type}`, name: tokenIdentification, blockHeight: blockheight, amount: tokenAmount, - sender, - receiver, - floData: flodata, - hash: transactionHash, + sender: senderAddress, + receiver: receiverAddress, + floData, + hash: txid, confirmations, nftHash }