Switching to official ID

This commit is contained in:
sairaj mote 2022-11-04 02:54:33 +05:30
parent 44456a6eaf
commit 914d1628a3
5 changed files with 63 additions and 200 deletions

View File

@ -6,7 +6,7 @@
}
:root {
font-size: clamp(16px, 1.2vmax, 20px);
font-size: clamp(16px, 1.2vmax, 32px);
}
html,
@ -17,7 +17,6 @@ body {
body {
--accent-color: #2353ff;
--light-shade: rgba(var(--text-color), 0.06);
--text-color: 20, 20, 20;
--foreground-color: 252, 253, 255;
--background-color: 241, 243, 248;
@ -29,7 +28,7 @@ body {
}
body[data-theme=dark] {
--accent-color: #2353ff;
--accent-color: #7e9aff;
--text-color: 200, 200, 200;
--foreground-color: 27, 28, 29;
--background-color: 21, 22, 22;
@ -40,15 +39,6 @@ body[data-theme=dark] {
body[data-theme=dark] ::-webkit-calendar-picker-indicator {
filter: invert(1);
}
body[data-theme=dark] a:-webkit-any-link {
filter: saturate(0.5) brightness(2);
}
body[data-theme=dark] a:-moz-any-link {
filter: saturate(0.5) brightness(2);
}
body[data-theme=dark] a:any-link {
filter: saturate(0.5) brightness(2);
}
.overpass {
font-family: "Overpass", sans-serif;
@ -76,7 +66,6 @@ h6 {
.h3 {
font-size: 3rem;
line-height: 1.1;
letter-spacing: -0.02em;
}
.h4 {
@ -99,10 +88,6 @@ h6 {
font-size: 0.85rem;
}
.full-bleed {
grid-column: 1/4 !important;
}
.uppercase {
text-transform: uppercase;
}
@ -128,15 +113,15 @@ a {
}
a:-webkit-any-link:focus-visible {
outline: rgba(var(--text-color), 1) 0.1rem solid;
outline: var(--accent-color) medium solid;
}
a:-moz-any-link:focus-visible {
outline: rgba(var(--text-color), 1) 0.1rem solid;
outline: var(--accent-color) medium solid;
}
a:any-link:focus-visible {
outline: rgba(var(--text-color), 1) 0.1rem solid;
outline: var(--accent-color) medium solid;
}
button,
@ -205,7 +190,8 @@ button:not(:disabled),
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
filter: saturate(0);
}
.cta {
@ -324,10 +310,6 @@ sm-textarea {
--background: rgba(var(--text-color), 0.06);
}
sm-button {
--border-radius: 0.5rem;
}
ul {
list-style: none;
}
@ -750,7 +732,7 @@ ul {
gap: 1.5rem;
padding: 1rem;
align-items: center;
background-color: var(--accent-color);
background-color: #2353ff;
color: white;
}
@ -820,11 +802,6 @@ ul {
fill: white;
}
#theme_switcher {
overflow: hidden;
width: 100%;
}
.page-layout {
display: grid;
grid-template-columns: 1rem minmax(0, 1fr) 1rem;
@ -843,10 +820,10 @@ ul {
#homepage__hero-section {
color: white;
padding: 2rem var(--side-padding) 9rem var(--side-padding);
margin: 0 calc(-1 * max(1rem, var(--side-padding))) -5.5rem calc(-1 * max(1rem, var(--side-padding)));
padding: 2rem var(--side-padding) 6rem var(--side-padding);
margin: 0 calc(-1 * max(1rem, var(--side-padding))) -1.8rem calc(-1 * max(1rem, var(--side-padding)));
background-image: url(../assets/bg-1.svg);
background-color: var(--accent-color);
background-color: #2353ff;
background-size: cover;
}
#homepage__hero-section p {
@ -855,15 +832,12 @@ ul {
#refresh_button {
color: var(--accent-color);
background-color: white;
border: solid thin rgba(0, 0, 0, 0.2);
}
.fund-list__header {
display: flex;
align-items: center;
color: white;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
}
@ -967,56 +941,6 @@ form select option {
margin-bottom: 2rem;
}
.fund-placeholder {
gap: 1rem;
padding: 1rem;
border-radius: 0.3rem;
background-color: rgba(var(--foreground-color), 1);
box-shadow: 0 1rem 2rem -1rem rgba(0, 0, 0, 0.16);
}
.fund-placeholder .placeholder__block:first-of-type {
width: min(24rem, 100%);
}
.fund-placeholder:nth-of-type(2) .placeholder__block {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s;
}
.fund-placeholder:nth-of-type(3) .placeholder__block {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
}
.fund-placeholder:nth-of-type(4) .placeholder__block {
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.placeholder__block {
display: flex;
border-radius: 0.3rem;
min-width: 9rem;
padding: 1.2rem 1rem;
-webkit-animation: pulse alternate 0.6s ease infinite;
animation: pulse alternate 0.6s ease infinite;
background-color: rgba(var(--text-color), 0.1);
}
@-webkit-keyframes pulse {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
@keyframes pulse {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
.investors-list {
display: grid;
gap: 1rem;
@ -1035,12 +959,11 @@ form select option {
.fund-investor > .grid:first-of-type {
width: min(40ch, 100%);
}
.fund-investor__redeem {
.fund-investor__withdraw {
background-color: var(--accent-color);
border-radius: 3rem;
padding: 0.8rem 1.5rem;
color: white;
filter: saturate(0.8);
color: rgba(var(--background-color), 1);
align-self: flex-start;
}
.fund-investor .tag {

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
font-family: "Roboto", sans-serif;
}
:root {
font-size: clamp(16px, 1.2vmax, 20px);
font-size: clamp(16px, 1.2vmax, 32px);
}
html,
body {
@ -14,7 +14,6 @@ body {
}
body {
--accent-color: #2353ff;
--light-shade: rgba(var(--text-color), 0.06);
--text-color: 20, 20, 20;
--foreground-color: 252, 253, 255;
--background-color: 241, 243, 248;
@ -25,7 +24,7 @@ body {
background: rgba(var(--background-color), 1);
}
body[data-theme="dark"] {
--accent-color: #2353ff;
--accent-color: #7e9aff;
--text-color: 200, 200, 200;
--foreground-color: 27, 28, 29;
--background-color: 21, 22, 22;
@ -35,9 +34,6 @@ body[data-theme="dark"] {
::-webkit-calendar-picker-indicator {
filter: invert(1);
}
a:any-link {
filter: saturate(0.5) brightness(2);
}
}
.overpass {
font-family: "Overpass", sans-serif;
@ -61,7 +57,6 @@ h6 {
.h3 {
font-size: 3rem;
line-height: 1.1;
letter-spacing: -0.02em;
}
.h4 {
font-size: 2rem;
@ -78,11 +73,6 @@ h6 {
.body-2 {
font-size: 0.85rem;
}
.full-bleed {
grid-column: 1/4 !important;
}
.uppercase {
text-transform: uppercase;
}
@ -106,7 +96,7 @@ a {
}
a:any-link:focus-visible {
outline: rgba(var(--text-color), 1) 0.1rem solid;
outline: var(--accent-color) medium solid;
}
button,
@ -176,7 +166,8 @@ button,
}
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
filter: saturate(0);
}
.cta {
text-transform: uppercase;
@ -247,9 +238,6 @@ sm-textarea {
--border-radius: 0.5rem;
--background: rgba(var(--text-color), 0.06);
}
sm-button {
--border-radius: 0.5rem;
}
ul {
list-style: none;
}
@ -565,7 +553,7 @@ ul {
gap: 1.5rem;
padding: 1rem;
align-items: center;
background-color: var(--accent-color);
background-color: #2353ff;
color: white;
}
#main_header__logo {
@ -630,11 +618,6 @@ ul {
}
}
#theme_switcher {
overflow: hidden;
width: 100%;
}
.page-layout {
display: grid;
grid-template-columns: 1rem minmax(0, 1fr) 1rem;
@ -652,10 +635,10 @@ ul {
}
#homepage__hero-section {
color: white;
padding: 2rem var(--side-padding) 9rem var(--side-padding);
margin: 0 calc(-1 * max(1rem, var(--side-padding))) -5.5rem calc(-1 * max(1rem, var(--side-padding)));
padding: 2rem var(--side-padding) 6rem var(--side-padding);
margin: 0 calc(-1 * max(1rem, var(--side-padding))) -1.8rem calc(-1 * max(1rem, var(--side-padding)));
background-image: url(../assets/bg-1.svg);
background-color: var(--accent-color);
background-color: #2353ff;
background-size: cover;
p {
color: rgba($color: #fff, $alpha: 0.8);
@ -663,15 +646,12 @@ ul {
}
#refresh_button {
color: var(--accent-color);
background-color: white;
border: solid thin rgba(0, 0, 0, 0.2);
}
.fund-list__header {
display: flex;
align-items: center;
color: white;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
}
@ -772,42 +752,6 @@ form {
line-height: 1.7;
margin-bottom: 2rem;
}
.fund-placeholder {
gap: 1rem;
padding: 1rem;
border-radius: 0.3rem;
background-color: rgba(var(--foreground-color), 1);
box-shadow: 0 1rem 2rem -1rem rgba($color: #000000, $alpha: 0.16);
.placeholder__block:first-of-type {
width: min(24rem, 100%);
}
&:nth-of-type(2) .placeholder__block {
animation-delay: 0.3s;
}
&:nth-of-type(3) .placeholder__block {
animation-delay: 0.6s;
}
&:nth-of-type(4) .placeholder__block {
animation-delay: 0.8s;
}
}
.placeholder__block {
display: flex;
border-radius: 0.3rem;
min-width: 9rem;
padding: 1.2rem 1rem;
animation: pulse alternate 0.6s ease infinite;
background-color: rgba(var(--text-color), 0.1);
}
@keyframes pulse {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
.investors-list {
display: grid;
gap: 1rem;
@ -824,12 +768,11 @@ form {
& > .grid:first-of-type {
width: min(40ch, 100%);
}
&__redeem {
&__withdraw {
background-color: var(--accent-color);
border-radius: 3rem;
padding: 0.8rem 1.5rem;
color: white;
filter: saturate(0.8);
color: rgba(var(--background-color), 1);
align-self: flex-start;
}
.tag {

View File

@ -16,7 +16,7 @@
/* Constants for FLO blockchain operations !!Make sure to add this at begining!! */
const floGlobals = {
blockchain: "FLO",
adminID: "FT9qkvuWXWBDRhHd42tDr5nMYFSx7bEhV7",
adminID: "FFXy5pJnfzu2fCDLhpUremyXQjGtFpgCDN",
application: "BobsFund"
}
</script>
@ -59,7 +59,7 @@
<path
d="M20.46,21.32C20,19.78,18.6,18.59,15.3,17a12.67,12.67,0,0,1-2.64-1.56,4.27,4.27,0,0,1-.79-1,2.6,2.6,0,0,1,0-1.41c.24-.68.49-1,2.43-2.85a7.18,7.18,0,0,0,2.09-2.92,4.25,4.25,0,0,0,0-1.77,6.52,6.52,0,0,0-2.85-3.11c-.56-.36-.81-.4-.81-.15a2.33,2.33,0,0,1-.18.45L12.4,3l-.53-.36c-.28-.21-.64-.41-.77-.49s-.46-.11-.46,0a6.21,6.21,0,0,1-.37.83s-.08,0-.17-.08c-1.15-.83-1.64-1-1.64-.73A7.33,7.33,0,0,1,7.7,3.65C6.48,5.68,5.24,6.7,4,6.7c-.56,0-.54,0-.37.64s.2.58.68.43a3.37,3.37,0,0,0,1.09-.54.86.86,0,0,1,.3-.17,1.34,1.34,0,0,1,.13.39.79.79,0,0,0,.17.4A3.5,3.5,0,0,0,7.37,7.3L7.8,7l.09.34c.12.45.19.51.62.39a4.25,4.25,0,0,0,2.17-1.54l.38-.45,0,.39A5.92,5.92,0,0,1,8.89,9.54L7.67,10.71c-2,1.93-1.89,3.51.37,5a27.41,27.41,0,0,0,2.89,1.51c.17.07.62.32,1,.54C14,19,15,20.23,15,21.48a2,2,0,0,0,0,.49h0c0,.05,0,.05.56-.1a1.89,1.89,0,0,0,.53-.21,2.41,2.41,0,0,0-.34-1.15,7.05,7.05,0,0,0-1.68-1.77,21.91,21.91,0,0,0-3.2-1.83A9.53,9.53,0,0,1,8.16,15.2a2.18,2.18,0,0,1-.74-1.55C7.42,12.79,7.86,12,9,11c1.77-1.64,2.45-2.45,2.92-3.55a2.28,2.28,0,0,0,.26-1.26A2,2,0,0,0,12,5.06l-.2-.45L12,4.3l.28-.49.09-.18L12.6,4a3.69,3.69,0,0,1,.61,1.76A3.47,3.47,0,0,1,12.94,7l-.09.25s-.21.37-.41.69A17.78,17.78,0,0,1,9.91,10.6c-1.07,1-1.43,1.62-1.47,2.47a2.05,2.05,0,0,0,.7,1.73,10.47,10.47,0,0,0,3.28,2.08c2.28,1.13,3.26,1.81,4,2.73a2.94,2.94,0,0,1,.74,1.75,1.26,1.26,0,0,0,.09.57.48.48,0,0,0,.26,0l.51-.13.29-.08,0-.28c-.13-1-1-2-2.47-3a25.52,25.52,0,0,0-3.26-1.77,8.59,8.59,0,0,1-2.23-1.43,2.09,2.09,0,0,1-.5-2.62c.26-.53.5-.83,2.35-2.6,1.51-1.45,2.15-2.58,2.15-3.79A3.67,3.67,0,0,0,13,3.48a3,3,0,0,1-.4-.42A1.85,1.85,0,0,1,13,2.33a6.74,6.74,0,0,1,1.83,1.73,2.62,2.62,0,0,1,.47,1.68,3,3,0,0,1-.55,1.84c-.45.78-.79,1.14-2.67,2.93a5.56,5.56,0,0,0-1.3,1.64,1.77,1.77,0,0,0-.21,1,1.76,1.76,0,0,0,.19.92,6.28,6.28,0,0,0,2.9,2.34,21.6,21.6,0,0,1,3.66,2c1.35,1,2,2,2,3a1.06,1.06,0,0,0,.05.47,2.83,2.83,0,0,0,1-.24C20.56,21.68,20.56,21.66,20.46,21.32ZM7.29,6.4h0a2.23,2.23,0,0,1-.9.28L6,6.72l.43-.53a15.22,15.22,0,0,0,1.89-3,3.52,3.52,0,0,1,.38-.67c.07-.08.49.2,1,.64l.39.35L9.66,4A6.7,6.7,0,0,1,7.29,6.4Zm3.58-1.11A5.8,5.8,0,0,1,9.25,6.51h0a3.3,3.3,0,0,1-.74.17l-.35,0,.39-.49a15.64,15.64,0,0,0,1.32-2,4.63,4.63,0,0,1,.28-.49c.06-.08.33.26.57.77l.28.57Zm1-1.4a1.63,1.63,0,0,1-.28.4A6.63,6.63,0,0,1,11,3.72l-.53-.56.12-.29c.2-.49.24-.51.64-.19a5.57,5.57,0,0,1,.85.78A2.78,2.78,0,0,1,11.87,3.89Z" />
</svg>
<h4 class="h4 color-0-8 weight-500">RanchiMall</h4>
<h4 class="weight-500">RanchiMall</h4>
</footer>
</article>
<article id="error_page" class="page hidden">
@ -144,10 +144,6 @@
every investor, thus the interests of fund manager, and fund investors are totally aligned.
</p>
</section>
<header class="fund-list__header">
<h4 class="h4">Funds</h4>
<button id="refresh_button" class="button justify-right">Refresh</button>
</header>
<sm-input id="search_investor" type="search" placeholder="Search investor with FLO address">
<svg class="icon" slot="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24"
width="24px" fill="#000000">
@ -156,9 +152,10 @@
d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
</svg>
</sm-input>
<!-- <div class="warning-container grid gap-1">
<strong style="color: #fb3640">Do not enter private key in similar looking pages.</strong>
</div> -->
<header class="fund-list__header">
<h4 class="h4">Funds</h4>
<button id="refresh_button" class="button justify-right">Refresh</button>
</header>
<section>
<ul id="fund_list"></ul>
<div id="fund_list__empty-state" class="grid hidden">
@ -319,7 +316,7 @@
Fund</button>
</form>
</article>
<sm-popup id="redeem_popup">
<sm-popup id="withdraw_popup">
<header slot="header" class="popup__header">
<button class="popup__header__close" onclick="closePopup()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
@ -330,11 +327,11 @@
</button>
<h3>Withdraw fund</h3>
</header>
<div id="redeem_process">
<div id="redeem_precess__get_priv_key">
<div id="withdraw_process">
<div id="withdraw_precess__get_priv_key">
<sm-form class="grid gap-1-5">
<div id="redeem__id"></div>
<sm-input id="redeem_private_key" class="password-field" type="password"
<div id="withdraw__id"></div>
<sm-input id="withdraw_private_key" class="password-field" type="password"
placeholder="FLO private key" error-text="Private key is invalid" autofocus data-private-key
required>
<label slot="right" class="interact">
@ -357,7 +354,8 @@
</label>
</sm-input>
<div class="multi-state-button">
<button id="redeem_private_key_button" type="submit" class="button button--primary cta">Confirm
<button id="withdraw_private_key_button" type="submit"
class="button button--primary cta">Confirm
withdrawal</button>
</div>
</sm-form>
@ -379,7 +377,7 @@
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" />
</svg>
<h3>Failed</h3>
<p id="redeem_failed_message"></p>
<p id="withdraw_failed_message"></p>
</div>
</div>
</sm-popup>
@ -554,10 +552,10 @@
})
document.addEventListener('popupclosed', e => {
switch (e.detail.popup.id) {
case 'redeem_popup':
showChildElement(getRef('redeem_process'), 0);
buttonLoader('redeem_private_key_button', false)
getRef('redeem_private_key_button').disabled = true;
case 'withdraw_popup':
showChildElement(getRef('withdraw_process'), 0);
buttonLoader('withdraw_private_key_button', false)
getRef('withdraw_private_key_button').disabled = true;
break;
}
if (popupStack.items.length === 0) {
@ -748,7 +746,7 @@
<span class="value net-value" style="color: var(--green)">${formatAmount(netValue[preferredCurrency], preferredCurrency)}</span>
</div>
</div>
<button class="button fund-investor__redeem" ?disabled=${!isRedeemable}>Withdraw</button>
<button class="button fund-investor__withdraw" ?disabled=${!isRedeemable}>Withdraw</button>
</li>
`
},
@ -816,7 +814,7 @@
<span class="value net-value" style="color: var(--green)">${formatAmount(netValue[preferredCurrency], preferredCurrency)}</span>
</div>
</div>
<button class="button fund-investor__redeem" ?disabled=${!isRedeemable}>Withdraw</button>
<button class="button fund-investor__withdraw" ?disabled=${!isRedeemable}>Withdraw</button>
</li>
`
},
@ -1303,32 +1301,31 @@
}
})
getRef('fund_list').addEventListener('click', e => {
if (e.target.closest('.fund-investor__redeem')) {
const button = e.target.closest('.fund-investor__redeem')
floGlobals.redeemId = button.closest('.fund-investor').id.split('_')
const [fundId, investorId] = floGlobals.redeemId
renderElem(getRef('redeem__id'), html`<div class='label'>Investor address</div> <strong class="value">${investorId}</strong>`)
openPopup('redeem_popup')
if (e.target.closest('.fund-investor__withdraw')) {
floGlobals.withdrawId = e.target.closest('.fund-investor').id.split('_')
const [fundId, investorId] = floGlobals.withdrawId
renderElem(getRef('withdraw__id'), html`<div class='label'>Investor address</div> <strong class="value">${investorId}</strong>`)
openPopup('withdraw_popup')
}
})
getRef('redeem_private_key_button').addEventListener('click', e => {
buttonLoader('redeem_private_key_button', true)
const privKey = getRef('redeem_private_key').value
const [fundId, investorId] = floGlobals.redeemId
getRef('withdraw_private_key_button').addEventListener('click', e => {
buttonLoader('withdraw_private_key_button', true)
const privKey = getRef('withdraw_private_key').value
const [fundId, investorId] = floGlobals.withdrawId
floExchangeAPI.closeBobsFundInvestment(fundId, investorId, privKey).then(result => {
console.log(result)
showChildElement(getRef('redeem_process'), 1, { entry: slideInLeft, exit: slideOutLeft });
const redeemButton = document.getElementById(floGlobals.redeemId.join('_'))?.querySelector('.fund-investor__redeem')
if (redeemButton) {
redeemButton.textContent = 'Redeemed'
redeemButton.disabled = true
showChildElement(getRef('withdraw_process'), 1, { entry: slideInLeft, exit: slideOutLeft });
const withdrawButton = document.getElementById(floGlobals.withdrawId.join('_'))?.querySelector('.fund-investor__withdraw')
if (withdrawButton) {
withdrawButton.textContent = 'Withdrawn'
withdrawButton.disabled = true
}
}).catch(error => {
getRef('redeem_failed_message').textContent = error.message
showChildElement(getRef('redeem_process'), 2, { entry: slideInLeft, exit: slideOutLeft });
getRef('withdraw_failed_message').textContent = error.message
showChildElement(getRef('withdraw_process'), 2, { entry: slideInLeft, exit: slideOutLeft });
console.error(error)
}).finally(() => {
buttonLoader('redeem_private_key_button', false)
buttonLoader('withdraw_private_key_button', false)
})
})
</script>

View File

@ -4,7 +4,7 @@
const exchangeAPI = EXPORTS;
const DEFAULT = {
marketID: floGlobals.marketID || "FKAEdnPfjXLHSYwrXQu377ugN4tXU7VGdf",
marketID: floGlobals.marketID || "FMxYC7gYZhouzqtHZukGnPiQ8nvG4CMzXM",
marketApp: "exchange"
}