From 51730dc3474f4deca116c52b83e0efa220d15ab1 Mon Sep 17 00:00:00 2001 From: Aleksandr Bautin Date: Sat, 4 Nov 2023 21:14:42 +0300 Subject: [PATCH] added helpers texts & template setting. fixed some bugs --- src/api.ts | 3 + src/assets/main.css | 209 ++++++++++++----------- src/components/DomainBar.vue | 54 +++--- src/components/DomainTable.vue | 44 +++-- src/components/SiteSettings.vue | 109 ++++++++++-- src/components/TemplatesList.vue | 6 +- src/components/Tooltip.vue | 17 +- src/components/ZonePricing.vue | 15 +- src/components/ZoneTable.vue | 89 +++++++--- src/result.ts | 276 +++++++++++++++++++------------ src/router/index.ts | 2 +- src/views/Explore.vue | 69 ++++++-- src/views/Find.vue | 26 ++- 13 files changed, 593 insertions(+), 326 deletions(-) diff --git a/src/api.ts b/src/api.ts index 9ff7fd6..1a37984 100644 --- a/src/api.ts +++ b/src/api.ts @@ -12,16 +12,19 @@ export class Api { public readonly tonscan_url: string; public agorata_adnl: string = "ed4f2afebb5e49dda9684a474c5771141be1f7d85a2fa39f1823844dd476c52d"; + public readonly tonviewer_url: string; constructor() { if (process.env.NODE_ENV === "development") { this.api_url = "http://localhost:5170/"; this.ton_api_url = "https://testnet.tonapi.io/v2/"; this.tonscan_url = "https://testnet.tonscan.org/"; + this.tonviewer_url = "https://testnet.tonviewer.com/"; } else { this.api_url = "https://api.agorata.io/"; this.ton_api_url = "https://tonapi.io/v2/"; this.tonscan_url = "https://tonscan.org/"; + this.tonviewer_url = "https://testnet.tonviewer.com/"; } } } diff --git a/src/assets/main.css b/src/assets/main.css index ab2c248..a0f528a 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,197 +1,196 @@ -@import './base.css'; +@import "./base.css"; @tailwind base; @tailwind components; @tailwind utilities; #app { - margin: 0 auto; - padding: 0; - min-width: 100vw; - min-height: 100vh; + margin: 0 auto; + padding: 0; + min-width: 100vw; + min-height: 100vh; } a, .green { - text-decoration: none; - color: hsl(201, 100%, 37%); - transition: 0.4s; + text-decoration: none; + color: hsl(201, 100%, 37%); + transition: 0.4s; } @media (min-width: 1024px) { - body { - display: flex; - place-items: center; - } + body { + display: flex; + place-items: center; + } - #app { - display: grid; - grid-template-columns: 1fr 1fr; - padding: 0; - } + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0; + } } .b { - border: 2px solid transparent; - border-radius: 5px; - padding: 16px 26px; - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 1.55rem; - margin: 4px 2px; - cursor: pointer; - font-weight: bold; + border: 2px solid transparent; + border-radius: 5px; + padding: 16px 26px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 1.55rem; + margin: 4px 2px; + cursor: pointer; + font-weight: bold; } @media (max-width: 800px) { - .b { - font-size: 1.4rem; - } + .b { + font-size: 1.4rem; + } } .b.white { - background-color: white; - color: #282e46; + background-color: white; + color: #282e46; } .b.white:hover { - background-color: #282e46; - color: white; - border: 2px solid white; + background-color: #282e46; + color: white; + border: 2px solid white; } .b.blue { - background-color: #0088cc; - color: white; - border-radius: 1rem; + background-color: #0088cc; + color: white; + border-radius: 1rem; } .b > img:first-child { - max-height: 1.4rem; - margin-right: 0.7rem; + max-height: 1.4rem; + margin-right: 0.7rem; } .b > img:not(:first-child) { - max-height: 1.4rem; - margin-left: 2rem; + max-height: 1.4rem; + margin-left: 2rem; } .wide.b { - min-width: 16rem; - margin: 0.5rem; + min-width: 16rem; + margin: 0.5rem; } /* A #edeef1 box with rounded corners with black content color and content centered vertically and horizontally */ .rbox { - background-color: #edeef1; - border-radius: 2rem; - padding: 2.5rem 32px; - text-align: center; - display: flex; - align-items: center; - place-content: center; - justify-content: center; - font-size: 1.6rem; - font-weight: bold; - color: #282e46; - min-width: 16rem; - margin: 0.5rem 3rem; + background-color: #edeef1; + border-radius: 2rem; + padding: 2.5rem 32px; + text-align: center; + display: flex; + align-items: center; + place-content: center; + justify-content: center; + font-size: 1.6rem; + font-weight: bold; + color: #282e46; + min-width: 16rem; + margin: 0.5rem 3rem; } /* small margin on mobile */ @media (max-width: 800px) { - .rbox { - margin: 0.5rem 0.5rem; - } + .rbox { + margin: 0.5rem 0.5rem; + } } .rbox > p:not(:first-child) { - margin-top: 1rem; + margin-top: 1rem; } .center { - display: flex; - justify-content: center; - align-items: center; - place-items: center; - flex-direction: column; + display: flex; + justify-content: center; + align-items: center; + place-items: center; + flex-direction: column; } .b.darkish { - background-color: #4e5a88; - color: white; - border-radius: 0.5rem; - font-size: 1rem; + background-color: #4e5a88; + color: white; + border-radius: 0.5rem; + font-size: 1rem; } .mono { - font-family: 'Inconsolata', monospace; + font-family: "Inconsolata", monospace; } :root { - --popper-theme-background-color: #fff; - --popper-theme-background-color-hover: #fff; - --popper-theme-text-color: black; - --popper-theme-border-width: 0px; - --popper-theme-border-style: solid; - --popper-theme-border-radius: 6px; - --popper-theme-padding: 4px; - --popper-theme-box-shadow: 0 6px 30px -6px rgba(0, 0, 0, 0.25); + --popper-theme-background-color: #fff; + --popper-theme-background-color-hover: #fff; + --popper-theme-text-color: black; + --popper-theme-border-width: 0px; + --popper-theme-border-style: solid; + --popper-theme-border-radius: 6px; + --popper-theme-padding: 4px; + --popper-theme-box-shadow: 0 6px 30px -6px rgba(0, 0, 0, 0.25); } .popper { - font-size: 0.8rem; - font-family: 'Inconsolata', monospace; + font-size: 0.8rem; + font-family: "Inconsolata", monospace; } .mobile-scale { - scale: 100%; + scale: 100%; } @media (max-width: 800px) { - .mobile-scale { - scale: 80%; - } + .mobile-scale { + scale: 80%; + } } .get_b { - background-color: #e36464; - color: #363e5e; - border-radius: 0.5rem; - padding: 0.2rem 0.8rem; - margin-left: 0.9rem; - cursor: pointer; + background-color: #e36464; + color: #363e5e; + border-radius: 0.5rem; + padding: 0.2rem 0.8rem; + cursor: pointer; } @media only screen and (max-width: 800px) { - .get_b { - margin-left: 0.1rem; - padding-left: 0.4rem; - padding-right: 0.4rem; - } + .get_b { + margin-left: 0.1rem; + padding-left: 0.4rem; + padding-right: 0.4rem; + } } .flex { - display: flex; + display: flex; } .b.back { - font-family: 'Inconsolata', monospace; - font-size: 1.5rem; - padding: 0.8rem; + font-family: "Inconsolata", monospace; + font-size: 1.5rem; + padding: 0.8rem; } .b.back > img { - max-height: 1rem; - margin-right: 0.4rem; + max-height: 1rem; + margin-right: 0.4rem; } .material-icons.language { - position:relative; - display:inline-block; + position: relative; + display: inline-block; } .material-icons.language:after { - content: "language"; + content: "language"; } diff --git a/src/components/DomainBar.vue b/src/components/DomainBar.vue index ff99d85..456e316 100644 --- a/src/components/DomainBar.vue +++ b/src/components/DomainBar.vue @@ -1,8 +1,18 @@ \ No newline at end of file + diff --git a/src/components/DomainTable.vue b/src/components/DomainTable.vue index aded7ec..779b124 100644 --- a/src/components/DomainTable.vue +++ b/src/components/DomainTable.vue @@ -85,20 +85,36 @@ onMounted(async () => { zonesAddresses.value = zones.map(({ address }) => address?.toLowerCase()); if (address.value) { - const { data } = await axios.get<{ nft_items: CollectionItem[] }>( - `${config.ton_api_url}accounts/${address.value}/nfts` - ); - - items.value = data.nft_items - .map((item) => ({ - ...item, - formattedCollectionAddress: item.collection?.address - ? convertAddress(item.collection?.address).toLowerCase() - : "", - })) - .filter(({ formattedCollectionAddress }) => - zonesAddresses.value.includes(formattedCollectionAddress) - ); + const [ + resultNfts = { data: { nft_items: [] } }, + resultTonNfts = { data: { nft_items: [] } }, + ] = await Promise.all([ + axios.get<{ nft_items: CollectionItem[] }>( + `${config.ton_api_url}accounts/${address.value}/nfts` + ), + axios.get<{ nft_items: CollectionItem[] }>( + `${config.ton_api_url}accounts/${address.value}/nfts`, + { + params: { + collection: "EQC3dNlesgVD8YbAazcauIrXBPfiVhMMr5YYk2in0Mtsz0Bz", + }, + } + ), + ]); + + items.value = [ + ...resultTonNfts.data.nft_items, + ...resultNfts.data.nft_items + .map((item) => ({ + ...item, + formattedCollectionAddress: item.collection?.address + ? convertAddress(item.collection?.address).toLowerCase() + : "", + })) + .filter(({ formattedCollectionAddress }) => + zonesAddresses.value.includes(formattedCollectionAddress) + ), + ]; } }); diff --git a/src/components/SiteSettings.vue b/src/components/SiteSettings.vue index c493f05..94d3147 100644 --- a/src/components/SiteSettings.vue +++ b/src/components/SiteSettings.vue @@ -1,24 +1,53 @@