Creating landing page

This commit is contained in:
sairaj mote 2021-09-26 16:23:29 +05:30
parent 5150990922
commit c44f8c1c9f
4 changed files with 168 additions and 27 deletions

View File

@ -96,12 +96,17 @@ button,
}
.button {
white-space: nowrap;
padding: 0.6rem 1rem;
border-radius: 0.3rem;
font-weight: 500;
font-size: 0.8rem;
background-color: rgba(var(--text-color), 0.06);
}
.button--primary {
background-color: var(--accent-color);
color: rgba(var(--background-color), 1);
}
button:disabled {
opacity: 0.5;
@ -175,19 +180,19 @@ ul {
}
.h1 {
font-size: 2.5rem;
font-size: 1.5rem;
}
.h2 {
font-size: 2rem;
font-size: 1.2rem;
}
.h3 {
font-size: 1.4rem;
font-size: 1rem;
}
.h4 {
font-size: 1rem;
font-size: 0.9rem;
}
.h5 {
@ -470,6 +475,19 @@ details[open] > summary .icon {
height: 100%;
}
#landing {
grid-template-rows: auto 1fr;
}
#landing header {
padding: 1.5rem 0;
}
#landing > .grid {
-ms-flex-line-pack: start;
align-content: flex-start;
text-align: center;
gap: 1rem;
}
#sign_in,
#sign_up {
grid-template-rows: auto 1fr;
@ -730,7 +748,7 @@ strip-option:last-of-type {
#user_accounts:not(:empty) {
margin-top: 1.5rem;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
gap: 0.5rem;
padding-bottom: 5rem;
}
@ -761,6 +779,9 @@ strip-option:last-of-type {
margin-top: 0.3rem;
font-size: 1.1rem;
}
.activity-card--account .activity-card__interest {
font-size: 0.8rem;
}
.activity-card--request,
.activity-card--pending {
@ -1442,8 +1463,28 @@ strip-option:last-of-type {
.account-step .button {
margin-top: 0.5rem;
}
.activity-card--account .grid {
text-align: right;
}
}
@media screen and (min-width: 640px) {
.h1 {
font-size: 2rem;
}
.h2 {
font-size: 1.8rem;
}
.h3 {
font-size: 1.3rem;
}
.h4 {
font-size: 1rem;
}
#confirmation_popup {
--width: 24rem;
}
@ -1536,6 +1577,23 @@ strip-option:last-of-type {
grid-area: b-link;
align-self: flex-start;
}
#user_accounts:not(:empty) {
gap: 1rem;
}
.activity-card--account {
grid-template-columns: minmax(0, 1fr);
text-align: left;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
}
.activity-card--account .activity-card__icon {
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
}
}
@media screen and (max-width: 1024px) {
#user_section {

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -89,11 +89,16 @@ button,
-webkit-tap-highlight-color: transparent;
}
.button {
white-space: nowrap;
padding: 0.6rem 1rem;
border-radius: 0.3rem;
font-weight: 500;
font-size: 0.8rem;
background-color: rgba(var(--text-color), 0.06);
&--primary {
background-color: var(--accent-color);
color: rgba(var(--background-color), 1);
}
}
button:disabled {
@ -164,19 +169,19 @@ ul {
}
.h1 {
font-size: 2.5rem;
font-size: 1.5rem;
}
.h2 {
font-size: 2rem;
font-size: 1.2rem;
}
.h3 {
font-size: 1.4rem;
font-size: 1rem;
}
.h4 {
font-size: 1rem;
font-size: 0.9rem;
}
.h5 {
@ -426,6 +431,18 @@ details {
.page {
height: 100%;
}
#landing {
grid-template-rows: auto 1fr;
header {
padding: 1.5rem 0;
}
& > .grid {
align-content: flex-start;
text-align: center;
gap: 1rem;
}
}
#sign_in,
#sign_up {
grid-template-rows: auto 1fr;
@ -638,7 +655,7 @@ strip-option {
}
#user_accounts:not(:empty) {
margin-top: 1.5rem;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
gap: 0.5rem;
padding-bottom: 5rem;
}
@ -662,6 +679,9 @@ strip-option {
margin-top: 0.3rem;
font-size: 1.1rem;
}
.activity-card__interest {
font-size: 0.8rem;
}
}
.activity-card--request,
.activity-card--pending {
@ -1205,8 +1225,28 @@ strip-option {
margin-top: 0.5rem;
}
}
.activity-card--account {
.grid {
text-align: right;
}
}
}
@media screen and (min-width: 640px) {
.h1 {
font-size: 2rem;
}
.h2 {
font-size: 1.8rem;
}
.h3 {
font-size: 1.3rem;
}
.h4 {
font-size: 1rem;
}
#confirmation_popup {
--width: 24rem;
}
@ -1285,6 +1325,17 @@ strip-option {
}
}
}
#user_accounts:not(:empty) {
gap: 1rem;
}
.activity-card--account {
grid-template-columns: minmax(0, 1fr);
text-align: left;
justify-content: flex-start;
.activity-card__icon {
justify-content: flex-start;
}
}
}
@media screen and (max-width: 1024px) {
#user_section {

View File

@ -57,6 +57,31 @@
<sm-button variant="no-outline" class="submit-btn">OK</sm-button>
</div>
</sm-popup>
<article id="landing" class="page page-layout hide-completely">
<header class="flex space-between">
<div class="logo">
<svg class="main-logo" viewBox="0 0 27.25 32">
<title>RanchiMall</title>
<path
d="M27.14,30.86c-.74-2.48-3-4.36-8.25-6.94a20,20,0,0,1-4.2-2.49,6,6,0,0,1-1.25-1.67,4,4,0,0,1,0-2.26c.37-1.08.79-1.57,3.89-4.55a11.66,11.66,0,0,0,3.34-4.67,6.54,6.54,0,0,0,.05-2.82C20,3.6,18.58,2,16.16.49c-.89-.56-1.29-.64-1.3-.24a3,3,0,0,1-.3.72l-.3.55L13.42.94C13,.62,12.4.26,12.19.15c-.4-.2-.73-.18-.72.05a9.39,9.39,0,0,1-.61,1.33s-.14,0-.27-.13C8.76.09,8-.27,8,.23A11.73,11.73,0,0,1,6.76,2.6C4.81,5.87,2.83,7.49.77,7.49c-.89,0-.88,0-.61,1,.22.85.33.92,1.09.69A5.29,5.29,0,0,0,3,8.33c.23-.17.45-.29.49-.26a2,2,0,0,1,.22.63A1.31,1.31,0,0,0,4,9.34a5.62,5.62,0,0,0,2.27-.87L7,8l.13.55c.19.74.32.82,1,.65a7.06,7.06,0,0,0,3.46-2.47l.6-.71-.06.64c-.17,1.63-1.3,3.42-3.39,5.42L6.73,14c-3.21,3.06-3,5.59.6,8a46.77,46.77,0,0,0,4.6,2.41c.28.13,1,.52,1.59.87,3.31,2,4.95,3.92,4.95,5.93a2.49,2.49,0,0,0,.07.77h0c.09.09,0,.1.9-.14a2.61,2.61,0,0,0,.83-.32,3.69,3.69,0,0,0-.55-1.83A11.14,11.14,0,0,0,17,26.81a35.7,35.7,0,0,0-5.1-2.91C9.37,22.64,8.38,22,7.52,21.17a3.53,3.53,0,0,1-1.18-2.48c0-1.38.71-2.58,2.5-4.23,2.84-2.6,3.92-3.91,4.67-5.65a3.64,3.64,0,0,0,.42-2A3.37,3.37,0,0,0,13.61,5l-.32-.74.29-.48c.17-.27.37-.63.46-.8l.15-.3.44.64a5.92,5.92,0,0,1,1,2.81,5.86,5.86,0,0,1-.42,1.94c0,.12-.12.3-.15.4a9.49,9.49,0,0,1-.67,1.1,28,28,0,0,1-4,4.29C8.62,15.49,8.05,16.44,8,17.78a3.28,3.28,0,0,0,1.11,2.76c.95,1,2.07,1.74,5.25,3.32,3.64,1.82,5.22,2.9,6.41,4.38A4.78,4.78,0,0,1,21.94,31a3.21,3.21,0,0,0,.14.92,1.06,1.06,0,0,0,.43-.05l.83-.22.46-.12-.06-.46c-.21-1.53-1.62-3.25-3.94-4.8a37.57,37.57,0,0,0-5.22-2.82A13.36,13.36,0,0,1,11,21.19a3.36,3.36,0,0,1-.8-4.19c.41-.85.83-1.31,3.77-4.15,2.39-2.31,3.43-4.13,3.43-6a5.85,5.85,0,0,0-2.08-4.29c-.23-.21-.44-.43-.65-.65A2.5,2.5,0,0,1,15.27.69a10.6,10.6,0,0,1,2.91,2.78A4.16,4.16,0,0,1,19,6.16a4.91,4.91,0,0,1-.87,3c-.71,1.22-1.26,1.82-4.27,4.67a9.47,9.47,0,0,0-2.07,2.6,2.76,2.76,0,0,0-.33,1.54,2.76,2.76,0,0,0,.29,1.47c.57,1.21,2.23,2.55,4.65,3.73a32.41,32.41,0,0,1,5.82,3.24c2.16,1.6,3.2,3.16,3.2,4.8a1.94,1.94,0,0,0,.09.76,4.54,4.54,0,0,0,1.66-.4C27.29,31.42,27.29,31.37,27.14,30.86ZM6.1,7h0a3.77,3.77,0,0,1-1.46.45L4,7.51l.68-.83a25.09,25.09,0,0,0,3-4.82A12,12,0,0,1,8.28.76c.11-.12.77.32,1.53,1l.63.58-.57.84A10.34,10.34,0,0,1,6.1,7Zm5.71-1.78A9.77,9.77,0,0,1,9.24,7.18h0a5.25,5.25,0,0,1-1.17.28l-.58,0,.65-.78a21.29,21.29,0,0,0,2.1-3.12c.22-.41.42-.76.44-.79s.5.43.9,1.24L12,5ZM13.41,3a2.84,2.84,0,0,1-.45.64,11,11,0,0,1-.9-.91l-.84-.9.19-.45c.34-.79.39-.8,1-.31A9.4,9.4,0,0,1,13.8,2.33q-.18.34-.39.69Z" />
</svg>
<div class="grid">
<h4>RanchiMall Bank</h4>
</div>
</div>
<div class="flex">
<!-- <a href="#/sign_up" class="button">Sign up</a> -->
<a href="#/sign_in" class="button button--primary">Sign in</a>
</div>
</header>
<div class="grid justify-center">
<h1 class="h1">Decentralized banking <br> made simple</h1>
<p>*Interest rates are re-calculated with each new transaction done on network</p>
<div class="interest-container">
</div>
</div>
</article>
<article id="sign_in" class="page page-layout hide-completely">
<header>
<div class="logo">
@ -244,7 +269,7 @@
<strip-option value="closed">Closed</strip-option>
</strip-select>
</div>
<div id="user_accounts" class="observe-empty-state"></div>
<div id="user_accounts" class="observe-empty-state grid"></div>
<div id="accounts_empty_state" class="empty-state grid justify-center gap-0-5">
<div class="empty-state__icon">
<svg id="e3240b06-2be0-4689-aadf-44984a5d5a54" data-name="Layer 1"
@ -675,11 +700,11 @@
<template id="account_template">
<a class="activity-card activity-card--account interact">
<div class="activity-card__icon"></div>
<div class="activity-card__type"></div>
<div class="grid gap-0-5">
<div class="activity-card__type"></div>
<time class="activity-card__time"></time>
<h4 class="activity-card__amount"></h4>
<p class="activity-card__interest"></p>
</div>
<h4 class="activity-card__amount"></h4>
</a>
</template>
<template id="account_step_template">
@ -960,8 +985,12 @@
let searchParams
let params
if (targetPage === '') {
pageId = 'home'
subPageId = floGlobals.adminID === myFloID ? 'admin' : 'dashboard'
if (typeof myFloID === "undefined") {
pageId = 'landing'
} else {
pageId = 'home'
subPageId = floGlobals.adminID === myFloID ? 'admin' : 'dashboard'
}
} else {
if (targetPage.includes('/')) {
if (targetPage.includes('?')) {
@ -979,7 +1008,7 @@
pageId = targetPage
}
}
if (typeof myFloID === "undefined" && !(['sign_up', 'sign_in', 'loading'].includes(pageId))) return
if (typeof myFloID === "undefined" && !(['sign_up', 'sign_in', 'loading', 'landing'].includes(pageId))) return
if (searchParams) {
const urlSearchParams = new URLSearchParams('?' + searchParams);
params = Object.fromEntries(urlSearchParams.entries());
@ -1358,7 +1387,7 @@
card.setAttribute('href', `#/account?index=${index}`)
card.querySelector('.activity-card__icon').innerHTML = icon
card.querySelector('.activity-card__type').textContent = type
card.querySelector('.activity-card__time').textContent = getFormattedTime(parseInt(status === 'active' ? openTime : closeTime), true)
card.querySelector('.activity-card__interest').innerHTML = `Interest ${type === 'deposit' ? 'earned' : 'accrued'} <span ${type === 'deposit' ? 'class="positive"' : ''}>${utils.formatAmount(netAmt - amount)}</span>`
card.querySelector('.activity-card__amount').textContent = utils.formatAmount(netAmt)
return card
},
@ -1385,7 +1414,7 @@
if (window.location.hash.includes('sign_in') || window.location.hash.includes('sign_up')) {
showPage(window.location.hash)
} else {
window.location.hash = '#/sign_in'
showPage('landing')
}
getRef('sign_in_button').onclick = () => {
resolve(getRef('private_key_field').value.trim())
@ -1766,9 +1795,10 @@
})
})
getRef('get_deposit_amount').addEventListener('input', e => {
getRef('get_deposit_amount').addEventListener('input', handleDepositAmountInput)
function handleDepositAmountInput(e) {
let message = ''
if (getRef(`deposit_button_wrapper`).children[0].tagName === 'SM-BUTTON') {
if (getRef(`deposit_button_wrapper`).children[0]?.tagName === 'SM-BUTTON') {
message = `Deposit`
} else {
message = `Slide to deposit`
@ -1776,10 +1806,12 @@
if (e.target.value.trim() !== '') {
getRef(`deposit_button_wrapper`).children[0].textContent = `${message} ${utils.formatAmount(parseFloat(e.target.value))}`
} else {
getRef(`deposit_button_wrapper`).children[0].textContent = message
if (getRef(`deposit_button_wrapper`).firstElementChild)
getRef(`deposit_button_wrapper`).firstElementChild.textContent = message
}
})
getRef('get_loan_amount').addEventListener('input', e => {
}
getRef('get_loan_amount').addEventListener('input', handleDepositAmountInput)
function handleLoanAmountInput(e) {
let message = ''
if (e.target.value.trim() !== '') {
if (getRef(`loan_button_wrapper`).children[0].tagName === 'SM-BUTTON') {
@ -1789,14 +1821,14 @@
}
getRef(`loan_button_wrapper`).children[0].textContent = `${message} ${utils.formatAmount(parseFloat(e.target.value))}`
} else {
if (getRef(`loan_button_wrapper`).children[0].tagName === 'SM-BUTTON') {
if (getRef(`loan_button_wrapper`).children[0]?.tagName === 'SM-BUTTON') {
message = `Request loan`
} else {
message = `Slide to request loan`
}
getRef(`loan_button_wrapper`).children[0].textContent = message
}
})
}
function showActionResult(details = {}) {
const { type, amount, status, reason = '' } = details