Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feature/capsule
Browse files Browse the repository at this point in the history
  • Loading branch information
azuic authored Mar 18, 2022
2 parents ee0f9e6 + e959744 commit 69f1878
Show file tree
Hide file tree
Showing 15 changed files with 731 additions and 477 deletions.
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
"@babel/runtime": "7.17.2",
"@koa/cors": "3.1.0",
"@koa/router": "10.1.1",
"@sentry/tracing": "6.17.9",
"@sentry/vue": "6.17.9",
"@walletconnect/web3-provider": "1.7.1",
"@sentry/tracing": "6.18.2",
"@sentry/vue": "6.18.1",
"@walletconnect/web3-provider": "1.7.4",
"assert": "2.0.0",
"async-lock": "1.3.1",
"axios": "0.26.0",
"boxicons": "2.1.1",
"buffer": "6.0.3",
"canvas-confetti": "1.5.1",
"crypto-browserify": "3.12.0",
"ejs": "3.1.6",
"ethers": "5.5.4",
Expand All @@ -65,7 +66,7 @@
"stream-browserify": "3.0.0",
"stream-http": "3.2.0",
"tailwind-scrollbar-hide": "1.1.7",
"typescript": "4.5.5",
"typescript": "4.6.2",
"vue": "3.2.31",
"vue-class-component": "8.0.0-rc.1",
"vue-gtag": "2.0.1",
Expand All @@ -86,9 +87,10 @@
"@tailwindcss/aspect-ratio": "0.4.0",
"@tailwindcss/line-clamp": "0.3.1",
"@types/async-lock": "1.1.3",
"@types/canvas-confetti": "1.4.2",
"@types/chrome": "0.0.178",
"@types/js-cookie": "3.0.1",
"@types/lodash": "4.14.178",
"@types/lodash": "4.14.179",
"@types/marked": "4.0.2",
"@types/qrcode": "1.4.2",
"@vue/compiler-sfc": "3.2.31",
Expand All @@ -97,17 +99,17 @@
"boxicons": "2.1.1",
"compression-webpack-plugin": "9.2.0",
"copy-webpack-plugin": "10.2.4",
"css-loader": "6.6.0",
"cssnano": "5.0.17",
"css-loader": "6.7.1",
"cssnano": "5.1.0",
"html-webpack-plugin": "5.5.0",
"husky": "7.0.4",
"js-conditional-compile-loader": "1.0.15",
"less-loader": "10.2.0",
"lint-staged": "12.3.4",
"postcss": "8.4.6",
"lint-staged": "12.3.5",
"postcss": "8.4.8",
"postcss-loader": "6.2.1",
"prettier": "2.5.1",
"prettier-plugin-tailwindcss": "0.1.7",
"prettier-plugin-tailwindcss": "0.1.8",
"tailwindcss": "3.0.23",
"terser-webpack-plugin": "5.3.1",
"ts-loader": "9.2.6",
Expand All @@ -116,7 +118,7 @@
"vue-router": "4.0.12",
"vue-style-loader": "4.1.3",
"vue-template-compiler": "2.6.14",
"webpack": "5.69.1",
"webpack": "5.70.0",
"webpack-cli": "4.9.2",
"webpack-dev-server": "4.7.4"
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
src: url('./fonts/SF-Compact-Rounded-Semibold.otf') format('opentype');
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@400;500&family=Noto+Serif&family=Vibur&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@400;500&family=Noto+Serif&family=Vibur&display=swap&family=Alfa+Slab+One&display=swap');
2 changes: 1 addition & 1 deletion src/common/rss3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export default {
}
if (isReloadRequired) {
const preinjectPageOwner = (window as any).USER;
if (typeof preinjectPageOwner !== 'undefined' && RSS3PageOwner.address === preinjectPageOwner.id) {
if (preinjectPageOwner && RSS3PageOwner.address === preinjectPageOwner.id) {
console.log('file hit', preinjectPageOwner);
RSS3PageOwner.file = preinjectPageOwner;
} else {
Expand Down
10 changes: 4 additions & 6 deletions src/components/Account/AccountModal.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
<template>
<Modal v-show="isShowingAccount">
<template #header>
<Button size="sm" class="absolute left-4 w-10 h-10" @click="emitCloseDialog">
<Button size="sm" class="absolute left-4 h-10 w-10" @click="emitCloseDialog">
<i class="bx bx-chevron-left bx-sm"></i>
</Button>
</template>
<template #body>
<div class="flex flex-col gap-y-4 items-center">
<div class="flex h-full flex-col items-center justify-between pt-6">
<EVMpAccountItem
class="m-auto mt-4"
v-if="showingAccountDetails.platform === 'EVM+'"
:size="90"
:address="showingAccountDetails.address"
/>
<AccountItem
class="m-auto mt-4"
v-else
:size="90"
:chain="showingAccountDetails.platform"
:address="showingAccountDetails.address"
/>
<span class="address mt-4 text-center break-all text-xl font-semibold">
<span class="address break-all text-center text-xl font-semibold">
{{ showingAccountDetails.address }}
</span>
<Button
size="sm"
class="text-md m-auto mt-4 w-1/4 text-white bg-primary-btn"
class="text-md w-1/4 bg-primary-btn text-white"
@click="
showingAccountDetails.isLink
? toExternalLink(showingAccountDetails.link)
Expand Down
6 changes: 2 additions & 4 deletions src/components/Account/RankingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class="my-auto inline-flex h-10 w-10 cursor-pointer"
:is-rounded="true"
:is-border="false"
:src="avatar || defaultAvatar"
:src="avatar"
/>
<div class="truncate text-base font-semibold md:text-xl">{{ name }}</div>
</div>
Expand All @@ -28,7 +28,6 @@
<script lang="ts">
import { Options, Vue } from 'vue-class-component';
import ImgHolder from '@/components/Common/ImgHolder.vue';
import config from '@/config';
@Options({
name: 'Leaderboard',
Expand All @@ -37,13 +36,12 @@ import config from '@/config';
avatar: String,
name: String,
ranking: String,
score: String,
score: Number,
isTop: Boolean,
isOwner: Boolean,
},
})
export default class RankingCard extends Vue {
defaultAvatar: string = config.defaultAvatar;
avatar!: string;
name!: string;
ranking!: string;
Expand Down
22 changes: 17 additions & 5 deletions src/components/ShareCard.vue → src/components/Card/ShareCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@
<div class="flex flex-row gap-4">
<ImgHolder class="flex h-8 w-8" :is-rounded="true" :is-border="false" :src="avatar" />
<div class="flex items-center text-lg font-normal md:text-xl">
{{ name || rns || formattedAddress }}'s NFT Score
{{ name || rns || formattedAddress }}'s NFTScore
</div>
</div>
<div class="self-center font-vibur text-6xl md:text-7xl">
{{ score }}
<div class="self-center text-center">
<div class="font-alfa-slab-one text-6xl md:text-7xl">
{{ score }}
</div>
<div class="md:text-xl">of {{ count }} NFTs</div>
</div>
<div class="flex flex-row justify-between">
<div class="flex flex-row items-end gap-2 font-vibur text-xl md:text-2xl">
<div>#</div>
<div class="flex flex-row items-end font-alfa-slab-one text-xl md:text-2xl">
<div>Rank #</div>
<div>
{{ rank }}
</div>
Expand All @@ -28,6 +31,9 @@
</div>
</div>
<div class="fixed bottom-10 flex w-full flex-row justify-center gap-4">
<Button size="sm" class="h-8 w-8 bg-secondary-btn-card text-btn-icon md:h-12 md:w-12" @click="tweet">
<i class="bx bx-share bx-flip-horizontal" />
</Button>
<Button size="sm" class="h-8 w-8 bg-secondary-btn-card text-btn-icon md:h-12 md:w-12" @click="setRandColor">
<i class="bx bx-refresh bx-flip-horizontal" />
</Button>
Expand Down Expand Up @@ -83,6 +89,7 @@ const colors = [
name: String, // Username setting in profile
score: String,
rank: String,
count: Number,
},
})
export default class ShareCard extends Vue {
Expand Down Expand Up @@ -145,6 +152,11 @@ export default class ShareCard extends Vue {
this.isDownloading = false;
}
}
async tweet() {
const URL = window.location;
window.open(`https://twitter.com/intent/tweet?text=Check out my NFTScore at ${URL}.`);
}
}
</script>

Expand Down
81 changes: 81 additions & 0 deletions src/components/Common/Confetti.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template></template>

<script lang="ts">
import { Options, Vue } from 'vue-class-component';
import confetti from 'canvas-confetti';
@Options({
props: {
isPCLayout: Boolean,
},
})
export default class Confetii extends Vue {
isPCLayout!: boolean;
mounted() {
const end = Date.now() + 1.5 * 1000;
// cheers!
const colors = ['#ED7F55', '#FED581'];
if (this.isPCLayout) {
(function frame() {
confetti({
particleCount: 2,
angle: 60,
spread: 55,
origin: { x: 0 },
colors: colors,
});
confetti({
particleCount: 2,
angle: 120,
spread: 55,
origin: { x: 1 },
colors: colors,
});
if (Date.now() < end) {
requestAnimationFrame(frame);
}
})();
} else {
var count = 200;
var defaults = {
origin: { y: 0.7 },
colors: colors,
};
function fire(particleRatio, opts) {
confetti(
Object.assign({}, defaults, opts, {
particleCount: Math.floor(count * particleRatio),
}),
);
}
fire(0.25, {
spread: 26,
startVelocity: 55,
});
fire(0.2, {
spread: 60,
});
fire(0.35, {
spread: 100,
decay: 0.91,
scalar: 0.8,
});
fire(0.1, {
spread: 120,
startVelocity: 25,
decay: 0.92,
scalar: 1.2,
});
fire(0.1, {
spread: 120,
startVelocity: 45,
});
}
}
}
</script>

<style></style>
26 changes: 0 additions & 26 deletions src/components/Common/Footer.vue

This file was deleted.

22 changes: 15 additions & 7 deletions src/components/Common/Header.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
<template>
<div class="relative flex items-center justify-between pb-4 text-body-text">
<Logo v-if="displayLogo" class="cursor-pointer" @click="toHomePage" :size="55" />
<div v-else class="flex items-center justify-center w-10 h-10 cursor-pointer" @click="back">
<div v-else class="flex h-10 w-10 cursor-pointer items-center justify-center" @click="back">
<i class="bx bx-chevron-left bx-sm" />
</div>
<h1 v-if="title" class="text-2xl font-bold">{{ title }}</h1>
<ImgHolder
v-if="isLogin"
class="inline-flex my-auto w-10 h-10 cursor-pointer"
class="my-auto inline-flex h-10 w-10 cursor-pointer"
:is-rounded="true"
:is-border="false"
:src="avatar || defaultAvatar"
:alt="rns || ethAddress || ''"
@click="toggleDialog()"
/>
<Button v-else size="sm" class="w-32 text-body-text bg-primary-btn" @click="toHomePage"> Connect </Button>
<Button v-else size="sm" class="w-32 bg-primary-btn text-body-text" @click="toHomePage"> Connect </Button>
<transition name="fade">
<template v-if="isdisplayDialog">
<div
class="absolute z-50 bottom-0 right-0 flex flex-col gap-2 justify-center -my-2 mx-2 p-5 w-32 bg-white rounded shadow-md transform translate-y-full"
class="absolute bottom-0 right-0 z-50 -my-2 mx-2 flex w-32 translate-y-full transform flex-col justify-center gap-2 rounded bg-white p-5 shadow-md"
>
<div class="flex flex-row gap-2 items-center cursor-pointer" @click="toPublicPage">
<div class="flex cursor-pointer flex-row items-center gap-2" @click="toPublicPage">
<i class="bx bx-user bx-xs text-btn-icon" />
Home
</div>
<div class="flex flex-row gap-2 items-center cursor-pointer" @click="logout">
<div class="flex cursor-pointer flex-row items-center gap-2" @click="logout">
<i class="bx bx-log-out bx-xs text-btn-icon" />
Logout
</div>
<div class="flex cursor-pointer flex-row items-center gap-2" @click="toPrivacy">
<i class="bx bx-lock bx-xs text-btn-icon" />
Privacy
</div>
</div>
</template>
</transition>
<div
v-if="isdisplayDialog && isLogin"
class="fixed z-10 left-0 top-0 m-0 p-0 w-screen h-screen"
class="fixed left-0 top-0 z-10 m-0 h-screen w-screen p-0"
@click="toggleDialog()"
/>
</div>
Expand Down Expand Up @@ -125,6 +129,10 @@ export default class Header extends Vue {
}
}
toPrivacy() {
window.location.href = 'https://rss3.io/#/privacy';
}
async logout() {
if (confirm('Are you sure to logout?')) {
(<HTMLLinkElement>document.getElementById('favicon')).href = '/favicon.ico';
Expand Down
Loading

0 comments on commit 69f1878

Please sign in to comment.