diff --git a/src/App.vue b/src/App.vue index c99bc14..732bc86 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,8 +3,8 @@ import { LayoutVue } from '@/components' const config = { token: { - colorPrimary: '#ff7789', - borderRadius: 0, + colorPrimary: '#007FCF', + borderRadius: 4, }, } diff --git a/src/assets/scss/__animations.scss b/src/assets/scss/__animations.scss new file mode 100644 index 0000000..176d67d --- /dev/null +++ b/src/assets/scss/__animations.scss @@ -0,0 +1,10 @@ +@keyframes fadeIn { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} diff --git a/src/assets/scss/__base.scss b/src/assets/scss/__base.scss index fca5cdb..fb5eb84 100644 --- a/src/assets/scss/__base.scss +++ b/src/assets/scss/__base.scss @@ -1,12 +1,16 @@ -@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;200;300;400;500;600;700;800;900&display=swap'); +html { + font-family: 'Noto Sans JP'; + font-size: 15px; +} + *, *::before, *::after { margin: 0; padding: 0; - font-family: 'Noto Sans JP'; + position: unset; } img { @@ -14,303 +18,6 @@ img { height: auto; } -body { - min-height: 100vh; - color: var(--vt-c-gray-2); - background: var(--color-background); - transition: - color 0.5s, - background-color 0.5s; - line-height: 1.6; - font-family: 'Noto Sans JP'; - font-size: 15px; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -* { - &::-webkit-scrollbar { - width: 6px; - height: 6px; - } - - &::-webkit-scrollbar-thumb { - background-color: var(--vt-c-main-gray-v1); - } - - &::-webkit-scrollbar-thumb { - background-color: var(--vt-c-main-gray-v2); - border-radius: 10px; - transition: all 0.2s ease-in-out; - } - - &::-webkit-scrollbar-track { - border-radius: 10px; - } -} - -*, -*::before, -*::after { - position: unset; -} - -.box { - // padding: 20px; - &.full { - min-height: calc(100% - 20px); - } - &.no-border { - border: none; - } - - .box-head { - display: flex; - align-items: center; - justify-content: space-between; - min-height: 66px; - padding: 0 20px; - background-color: var(--vt-c-white-mute); - - .box-search { - display: flex; - gap: 35px; - align-items: center; - - .ant-input-search { - width: 322px; - - .ant-input { - border: none; - background: unset; - outline: unset; - box-shadow: unset; - } - - .ant-input-group-addon { - background: unset; - .ant-input-search-button { - background: unset; - border: unset; - box-shadow: unset; - .anticon { - svg { - fill: var(--vt-c-gray-2); - } - } - } - } - } - } - - .title { - font-weight: 900; - font-size: 18px; - line-height: 26px; - color: var(--vt-c-gray-2); - .title-page { - color: var(--vt-c-gray-v9); - } - - &.manga { - color: var(--vt-c-gray-v9); - } - } - - .box-btn { - @include center_flex; - width: 140px; - height: 40px; - border-radius: 6px; - color: var(--vt-c-main); - background-color: var(--vt-c-white); - box-shadow: var(--vt-box-shadow); - border: 1px solid var(--vt-c-main); - font-weight: 700; - font-size: 14px; - } - } - - .box-body { - padding: 0 20px; - overflow-y: auto; - height: calc(100vh - 135px); - position: relative; - - &.no-pagination { - height: calc(100vh - 66px); - } - - &:has(.form-create-chap) { - .ant-tabs { - overflow-y: auto; - height: calc(100vh - 235px); - } - } - - &.no_padding { - padding: 0; - } - - .btn-save-setting { - &:disabled { - border-color: var(--vt-c-gray-1); - background-color: var(--vt-c-gray-1); - } - } - } -} - -.btn-base { - margin-right: 12px; - - &.btn-delete { - background-color: var(--vt-c-red-v3); - color: var(--vt-c-white); - - &:hover { - border-color: unset !important; - color: var(--vt-c-white); - } - } -} - -.ant-tag { - &.custom { - width: 72px; - height: 28px; - border: none; - @include center_flex; - } -} - -.ant-picker { - width: 100%; - &.has-value { - border-color: var(--vt-c-main); - } -} - -.rounded-btn { - border-radius: 100px !important; -} -.bold-label { - label { - font-weight: 700; - } -} - -.ant-input-number { - width: 100%; -} - -.full-width { - width: 100%; -} - -.ant-input[disabled] { - background-color: var(--vt-c-background-dark-1); - color: var(--vt-c-text-dark-3); -} - -.ant-tabs { - &.custom { - .ant-tabs-nav { - background-color: var(--vt-c-white-mute); - padding: 0 20px; - } - .ant-tabs-content-holder { - padding: 0 20px; - } - .ant-tabs-nav-list { - .ant-tabs-tab { - min-width: 68px; - justify-content: center; - padding: 0 16px 6px; - .ant-tabs-tab-btn { - font-size: 16px; - font-weight: 700; - line-height: 23.17px; - } - - &:not(.ant-tabs-tab-active) { - color: var(--vt-c-gray-v9); - } - } - } - .ant-tabs-ink-bar { - height: 3px; - } - - .ant-tabs-content { - &:has(.tab-report) { - height: calc(100vh - 180px); - overflow-y: scroll; - } - - &:has(.tab-ranking) { - height: calc(100vh - 180px); - overflow-y: auto; - } - } - } - - &.manga-tabs { - .ant-tabs-content-holder { - margin-bottom: 150px; - } - } - - &.master-tabs { - .ant-tabs-content-holder { - margin-bottom: 70px; - } - } -} - -.ant-form-item { - .ant-form-item-explain-error { - font-size: 12px; - } -} - -.ant-spin-spinning { - width: 100%; -} - -.flex-center { - @include center_flex; -} - -.flex-col-center { - display: flex; - flex-direction: column; - align-items: center; -} - -.btn-common { - @include baseBtn( - $bg: var(--vt-c-main-color), - $width: unset, - $height: unset, - $borderRadius: unset - ); - margin: 0 auto 5px; - padding: var(--vt-btn-padding); - color: var(--vt-c-white); - font-weight: 500; - outline: none; - cursor: pointer; - border-radius: 8px; - border: 2px solid transparent; - transition: all 0.3s ease; - &:hover { - border: 2px solid var(--vt-c-black-bold); - color: var(--vt-c-black-bold); - } -} - p { font-size: 1rem; margin: 1em; @@ -324,97 +31,3 @@ h2 { margin-bottom: 1rem; text-align: center; } - -.highlight { - color: var(--vt-c-main-color); -} - -.spacer { - height: 1px; - width: 90%; - background: linear-gradient(to right, transparent, rgb(224, 224, 224), transparent); - margin: 2rem auto; -} - -.note { - margin-top: 1rem; - font-size: 0.9rem; - color: --vt-c-gray-note; -} - -.auth-container { - @include center_flex; - min-height: 100vh; - background-color: var(--vt-c-white); - padding: 20px; -} - -.auth-card { - background-color: var(--vt-c-white); - border: 2px solid var(--vt-c-main-color); - width: 100%; - max-width: 600px; - padding: 0; - - &-header { - padding: 5px 10px; - min-height: 30px; - display: flex; - align-items: center; - border-bottom: 2px solid var(--vt-c-main-color); - - h2 { - font-size: 1rem; - margin: 0; - color: var(--vt-c-black-bold); - } - } - - &-content { - padding: 20px; - text-align: center; - } -} - -.wallet-icon { - margin: 20px 0 30px 0; - - .icon-circle { - @include center_flex; - width: 60px; - height: 60px; - background-color: var(--vt-c-main-color); - border-radius: 50%; - margin: 0 auto; - } -} - -.password-section { - margin-bottom: 20px; -} - -.auth-button-group { - display: flex; - gap: 10px; - margin-top: 20px; - - .auth-btn { - flex: 1; - border-radius: 4px; - padding: 12px 16px; - font-size: 14px; - font-weight: 500; - cursor: pointer; - transition: all 0.2s; - - &.secondary { - background-color: var(--vt-c-white); - color: var(--vt-c-black-bold); - border: 1px solid var(--vt-c-black-bold); - - &:hover { - background-color: var(--vt-c-white-soft); - } - } - } -} diff --git a/src/assets/scss/__common.scss b/src/assets/scss/__common.scss new file mode 100644 index 0000000..0f6755c --- /dev/null +++ b/src/assets/scss/__common.scss @@ -0,0 +1,27 @@ +.flex-center { + @include center_flex; +} + +.flex-col-center { + display: flex; + flex-direction: column; + align-items: center; +} + +.card-base { + @include card-base; +} + +// ==================== TEXT UTILITIES ==================== + +.text-primary { + color: var(--text-primary); +} + +.text-secondary { + color: var(--text-secondary); +} + +.text-muted { + color: var(--text-muted); +} diff --git a/src/assets/scss/__mixin.scss b/src/assets/scss/__mixin.scss index e2519e5..16f3fcb 100644 --- a/src/assets/scss/__mixin.scss +++ b/src/assets/scss/__mixin.scss @@ -118,53 +118,40 @@ $fw: 100; justify-content: center; } -@mixin center_pos { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} +@mixin btn-primary { + background: var(--primary-color); + border-color: var(--primary-color); + font-weight: var(--font-semibold); + height: auto; + padding: var(--btn-padding-y) var(--btn-padding-x); + transition: var(--transition-all); -@mixin line_clamp($line) { - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: $line; - -webkit-box-orient: vertical; -} - -@mixin position($pos: absolute, $left: 0, $right: 0, $top: 0, $bottom: 0) { - position: $pos; - top: $top; - left: $left; - right: $right; - bottom: $bottom; -} - -// function -@function sum($numbers...) { - $sum: 0; - @each $number in $numbers { - $sum: $sum + $number; + &:hover { + background: var(--primary-hover); + border-color: var(--primary-hover); + } + + &:active, + &:focus { + background: var(--primary-hover); + border-color: var(--primary-hover); } - @return $sum; } -@function calc_v2($size) { - @return calc(100% - $size); -} +@mixin card-base { + background: var(--bg-white); + border-radius: var(--card-radius); + padding: var(--card-padding); + box-shadow: var(--card-shadow); + transition: var(--transition-all); + animation: fadeIn 0.6s ease-out; -@mixin baseBtn( - $bg: var(--vt-c-main), - $width: 92px, - $height: 36px, - $borderRadius: var(--vt-br-btn) -) { - display: flex; - justify-content: center; - align-items: center; - width: $width; - height: $height; - background-color: $bg; - border-radius: $borderRadius; - box-shadow: unset; + @media (max-width: 768px) { + padding: var(--card-padding-mobile); + } + + &:hover { + transform: translateY(-4px); + box-shadow: var(--card-shadow-hover); + } } diff --git a/src/assets/scss/__variables.scss b/src/assets/scss/__variables.scss index c35fed8..23b170d 100644 --- a/src/assets/scss/__variables.scss +++ b/src/assets/scss/__variables.scss @@ -1,113 +1,154 @@ :root { - --vt-btn-padding: 11px 8px; - --vt-c-main-color: #009688; - --vt-c-badge-caption-shadow: rgba(0, 151, 115, 1); - --vt-input-shadow: 0 0 0 2px rgba(0, 150, 136, 0.1); - --vt-input-shadow-focus: 0 0 0 2px rgba(0, 150, 136, 0.1); - --vt-c-gray-note: rgb(85, 85, 85); - --vt-c-white: #ffffff; - --vt-c-white-soft: #f8f8f8; - --vt-c-white-mute: #f2f2f2; - --vt-c-white-v2: #d9d9d9; - --vt-c-white-v5: #fafafa; - --vt-c-white-v7: #f0f5f8; - --vt-c-white-v8: #fbfbfb; + // ==================== COLORS ==================== - --vt-c-black: #181818; - --vt-c-black-v1: #5d6679; - --vt-c-black-soft: #222222; - --vt-c-black-mute: #282828; - --vt-c-black-bold: #000000; - --vt-c-black-bold-v2: #131523; - --vt-c-black-bold-v3: #252c32; - --vt-c-black-bold-v3: #00000026; - --vt-c-black-bold-v4: #00000080; - --vt-c-black-bold-v5: #00000008; + // Primary Colors + --primary-color: #007FCF; + --primary-hover: #0066A6; + --primary-light: #E8F4FC; + --primary-bg: #F5FBFF; - --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); - --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); - --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); - --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); + // Secondary Colors + --secondary-color: #FF9500; + --secondary-hover: #E68600; - --vt-c-text-light-1: var(--vt-c-indigo); - --vt-c-text-light-2: rgba(60, 60, 60, 0.66); - --vt-c-text-dark-1: var(--vt-c-white); - --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); - --vt-c-text-dark-3: rgba(0, 0, 0, 0.88); + // Text Colors + --text-primary: #2c3e50; + --text-secondary: #5a6c7d; + --text-muted: #8b95a5; + --text-light: #ffffff; - --vt-c-background-dark-1: rgba(0, 0, 0, 0.04); + // Background Colors + --bg-gradient-start: #F0F8FF; + --bg-gradient-end: #E6F2FF; + --bg-white: #ffffff; + --bg-light: #F8FCFF; + --bg-hover: #E8F4FC; - --vt-box-shadow-1: 0px 0px 8px rgba(78, 37, 0, 0.78); - --vt-box-shadow-2: 0px 4px 4px rgba(0, 0, 0, 0.25); - --vt-box-shadow-3: 0px 0px 5px 0px var(--vt-c-black-bold-v5) inset; + // Border Colors + --border-light: #E6F2FF; + --border-color: #EBF5FF; + --border-primary: #007FCF; - --vt-c-main: #ff7789; - --vt-c-main-title: #519fb0; - --vt-c-main-light: #6659ff; - --vt-c-main-bg: #eff1f7; - --vt-c-main-bg-v1: #f4f7ff; - --vt-c-main-black: #051121; - --vt-c-main-clear: #e6e8ef; - --vt-c-main-link: #4335ef; - --vt-c-main-red: red; - --vt-c-main-gray: #7e84a3; - --vt-c-main-gray-v1: #fff3; - --vt-c-main-gray-v2: #0003; - --vt-c-gray-v4: #a9a5a3; - --vt-c-gray-v5: #666666; - --vt-c-gray-v6: #999999; - --vt-c-gray-v9: #888888; - --vt-c-gray-v10: #444444; - --vt-c-gray-v11: #6d6d6d; - --vt-c-gray-v12: #b9bdc7; - --vt-c-gray-v17: #e6e6e6; - --vt-c-blue: #3375f3; - --vt-c-blue-v3: #162dff; - --vt-c-blue-v4: #67abba; - --vt-c-blue-v5: #20aee5; - --vt-c-red-v3: #ff0f0f; + // Status Colors + --success-color: #10B981; + --warning-color: #F59E0B; + --error-color: #EF4444; + --info-color: #007FCF; - --vt-c-violet: #5671fb; - --vt-c-pink: #ffe6ea; - --vt-c-pink-2: #ff6d6d; - --vt-c-pink-3: #e05266; - --vt-c-green: #1e8e3e; - --vt-c-green-2: #93cb9c; - --vt-c-green-3: #429d7c; + // ==================== SPACING ==================== - --vt-c-turquoise: #3fb3ce; + --spacing-xs: 0.25rem; // 4px + --spacing-sm: 0.5rem; // 8px + --spacing-md: 0.75rem; // 12px + --spacing-lg: 1rem; // 16px + --spacing-xl: 1.5rem; // 24px + --spacing-2xl: 2rem; // 32px + --spacing-3xl: 2.5rem; // 40px + --spacing-4xl: 3rem; // 48px - --color-background: #f5f7fb; - --color-background-event: #3fb3ce; - --color-background-sidebar: #e6e6e6; - --color-background-soft: var(--vt-c-white-soft); + // ==================== BORDER RADIUS ==================== - --color-border: #b8b7b7; - --color-border-v1: #cdd4e7; - --color-border-shadow: #dfdfdf40; - --color-border-hover: var(--vt-c-divider-light-1); + --radius-sm: 8px; + --radius-md: 10px; + --radius-lg: 12px; + --radius-xl: 16px; + --radius-full: 9999px; - --color-heading: var(--vt-c-text-light-1); - --color-text: var(--vt-c-text-light-1); + // ==================== BOX SHADOWS ==================== - --font-size: 14px; - --vt-font-btn: 92px; - --vt-br-btn: 3px; - --section-gap: 160px; + --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05); + --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05); + --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08); + --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12); + --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15); + --shadow-primary: 0 4px 12px rgba(0, 127, 207, 0.25); + --shadow-secondary: 0 4px 12px rgba(255, 149, 0, 0.25); - --vt-c-gray-1: #e9e9e9; - --vt-c-gray-2: #444444; - --vt-c-gray-3: #adadad66; - --vt-c-gray-4: #f9f9f9; - --vt-c-gray-5: #b4b4b4; - --vt-c-gray-6: #d9d9d9; - --vt-c-gray-7: #ececec; - --vt-c-gray-8: #636363; - --vt-c-gray-9: #aaaaaa; - --vt-c-green-dark: #435855; + // ==================== TRANSITIONS ==================== - --vt-c-orange: #f3a964; + --transition-fast: 0.2s ease; + --transition-normal: 0.3s ease; + --transition-slow: 0.5s ease; + --transition-all: all 0.3s ease; - --vt-box-shadow: 0px 0px 4px 0px var(--vt-c-gray-3); - --vt-box-shadow-active: 0px 0px 4px 0px var(--vt-c-main); + // ==================== TYPOGRAPHY ==================== + + // Font Families + --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + --font-mono: 'Courier New', monospace; + --font-noto: 'Noto Sans JP'; + + // Font Sizes + --font-xs: 0.75rem; // 12px + --font-sm: 0.85rem; // 13.6px + --font-base: 0.9rem; // 14.4px + --font-md: 0.95rem; // 15.2px + --font-lg: 1rem; // 16px + --font-xl: 1.1rem; // 17.6px + --font-2xl: 1.2rem; // 19.2px + --font-3xl: 1.5rem; // 24px + --font-4xl: 3rem; // 48px + + // Font Weights + --font-normal: 400; + --font-medium: 500; + --font-semibold: 600; + --font-bold: 700; + + // Line Heights + --leading-tight: 1.2; + --leading-normal: 1.5; + --leading-relaxed: 1.75; + + // Letter Spacing + --tracking-tight: -1px; + --tracking-normal: 0; + --tracking-wide: 0.5px; + --tracking-wider: 1px; + + // ==================== Z-INDEX ==================== + + --z-base: 1; + --z-dropdown: 10; + --z-sticky: 20; + --z-fixed: 30; + --z-modal-backdrop: 40; + --z-modal: 50; + --z-popover: 60; + --z-tooltip: 70; + + // ==================== BREAKPOINTS ==================== + + --breakpoint-xs: 480px; + --breakpoint-sm: 640px; + --breakpoint-md: 768px; + --breakpoint-lg: 1024px; + --breakpoint-xl: 1280px; + --breakpoint-2xl: 1536px; + + // ==================== COMPONENTS SPECIFIC ==================== + + // Card + --card-padding: var(--spacing-2xl); + --card-padding-mobile: var(--spacing-xl); + --card-radius: var(--radius-xl); + --card-shadow: var(--shadow-md); + --card-shadow-hover: var(--shadow-lg); + + // Button + --btn-padding-y: 0.75rem; + --btn-padding-x: 1rem; + --btn-radius: var(--radius-md); + --btn-transition: var(--transition-all); + + // QR Code + --qr-size: 200px; + --qr-border: 3px solid var(--border-light); + --qr-radius: var(--radius-lg); + --qr-shadow: var(--shadow-sm); + + // Tabs + --tabs-height: 3px; + --tabs-padding: 12px 20px; + --tabs-padding-mobile: 10px 16px; } diff --git a/src/assets/scss/main.scss b/src/assets/scss/main.scss index b85cc1e..df4d4ee 100644 --- a/src/assets/scss/main.scss +++ b/src/assets/scss/main.scss @@ -1,3 +1,5 @@ +@import '__base'; @import '__variables'; @import '__mixin'; -@import '__base'; +@import '__animations'; +@import '__common'; diff --git a/src/components/WalletInfo.vue b/src/components/WalletInfo.vue new file mode 100644 index 0000000..d4a09e2 --- /dev/null +++ b/src/components/WalletInfo.vue @@ -0,0 +1,235 @@ + + + + + diff --git a/src/components/auth/CreateWalletComponent.vue b/src/components/auth/CreateWalletComponent.vue index 05b9292..05a7e18 100644 --- a/src/components/auth/CreateWalletComponent.vue +++ b/src/components/auth/CreateWalletComponent.vue @@ -1,61 +1,441 @@ - + diff --git a/src/components/common/ButtonCommon.vue b/src/components/common/ButtonCommon.vue index 8d81e39..07b0157 100644 --- a/src/components/common/ButtonCommon.vue +++ b/src/components/common/ButtonCommon.vue @@ -1,5 +1,67 @@ + + + + diff --git a/src/components/common/FormCommon.vue b/src/components/common/FormCommon.vue index 6bf9595..098a969 100644 --- a/src/components/common/FormCommon.vue +++ b/src/components/common/FormCommon.vue @@ -98,7 +98,7 @@ const handleBlur = (e: FocusEvent) => { } &.error { border-color: var(--vt-c-red-v3); - background-color: var() + background-color: var(); } &.disabled { background-color: var(--vt-c-gray-4); diff --git a/src/helpers/index.ts b/src/helpers/index.ts deleted file mode 100644 index 9934b9f..0000000 --- a/src/helpers/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './constants/code' -export * from './constants/constants' -export * from './constants/localStorage' diff --git a/src/interface/common.ts b/src/interface/common.ts new file mode 100644 index 0000000..61352fd --- /dev/null +++ b/src/interface/common.ts @@ -0,0 +1,20 @@ +import type { ButtonType, ButtonSize } from 'ant-design-vue/es/button' + +// Button Component Props +export interface ButtonProps { + type?: ButtonType + size?: ButtonSize + block?: boolean + disabled?: boolean + loading?: boolean + htmlType?: 'button' | 'submit' | 'reset' +} + +// Icon Component Props +export interface IconProps { + name?: string + size?: number | string + color?: string + class?: string + icon: string +} diff --git a/src/interface/home.ts b/src/interface/home.ts new file mode 100644 index 0000000..c35e132 --- /dev/null +++ b/src/interface/home.ts @@ -0,0 +1,19 @@ +// Network Status Interface +export interface NetworkStatus { + network: string + daaScore: number + dagHeader: number + dagBlocks: number + difficulty: number + medianOffset: string + medianTimeUTC: string +} + +// Wallet Tab Props +export interface WalletTabProps { + network: string +} + +export interface DebugTabProps {} + +export interface TransactionsTabProps {} diff --git a/src/interface/index.ts b/src/interface/index.ts index 5da786c..e2116e3 100644 --- a/src/interface/index.ts +++ b/src/interface/index.ts @@ -1,9 +1,2 @@ -interface Props { - name?: string - size?: number | string - color?: string - class?: string -} -export interface IconProps extends Props { - icon: string -} +export * from './common' +export * from './home' diff --git a/src/router/route.ts b/src/router/route.ts index b061a14..ea2e5c2 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -1,5 +1,5 @@ import * as Page from '@/views' -import { getToken } from '@/helpers' +import { getToken } from '@/utils' const ifAuthenticated = (to: any, from: any, next: any) => { if (getToken()) { @@ -20,24 +20,18 @@ const ifNotAuthenticated = (to: any, from: any, next: any) => { export const routes: any = [ { path: '/', - redirect: '/home', - children: [ - { - path: 'home', - name: 'home', - component: Page.Home, - }, - { - path: ':pathMatch(.*)*', - component: Page.NotFound, - name: 'page-not-found', - }, - ], + name: 'index', + component: Page.Home, }, { - path: '/onboarding', - name: 'onboarding', + path: '/login', + name: 'login', component: Page.Login, beforeEnter: ifNotAuthenticated, }, + { + path: '/:pathMatch(.*)*', + component: Page.NotFound, + name: 'page-not-found', + }, ] diff --git a/src/helpers/constants/code.ts b/src/utils/constants/code.ts similarity index 100% rename from src/helpers/constants/code.ts rename to src/utils/constants/code.ts diff --git a/src/helpers/constants/constants.ts b/src/utils/constants/constants.ts similarity index 77% rename from src/helpers/constants/constants.ts rename to src/utils/constants/constants.ts index 1bb801a..a0562e9 100644 --- a/src/helpers/constants/constants.ts +++ b/src/utils/constants/constants.ts @@ -10,7 +10,3 @@ export const CURRENT_YEAR = dayjs(new Date()).format('YYYY') export const MONTHS = Array.from({ length: 12 }, (item, i) => { return dayjs(new Date(0, i)).format('MM') }) - -export const FORMAT_DAY = (day: any, format = 'YYYY-MM-DD') => { - return dayjs(new Date(day)).format(format) -} diff --git a/src/utils/helpers/format.ts b/src/utils/helpers/format.ts new file mode 100644 index 0000000..b74fd2d --- /dev/null +++ b/src/utils/helpers/format.ts @@ -0,0 +1,9 @@ +import dayjs from 'dayjs' + +export const formatNumberToLocaleString = (num: number): string => { + return num.toLocaleString('en-US') +} + +export const formatDate = (day: any, format = 'YYYY-MM-DD') => { + return dayjs(new Date(day)).format(format) +} diff --git a/src/helpers/constants/localStorage.ts b/src/utils/helpers/localStorage.ts similarity index 100% rename from src/helpers/constants/localStorage.ts rename to src/utils/helpers/localStorage.ts diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..155706b --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,4 @@ +export * from './constants/code' +export * from './constants/constants' +export * from './helpers/format' +export * from './helpers/localStorage' diff --git a/src/views/Home/HomeView.vue b/src/views/Home/HomeView.vue index 2c7418e..9d0c577 100644 --- a/src/views/Home/HomeView.vue +++ b/src/views/Home/HomeView.vue @@ -1,7 +1,89 @@ - + - + diff --git a/src/views/Home/components/DebugTab.vue b/src/views/Home/components/DebugTab.vue new file mode 100644 index 0000000..d9e0fcf --- /dev/null +++ b/src/views/Home/components/DebugTab.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/Home/components/NetworkTab.vue b/src/views/Home/components/NetworkTab.vue new file mode 100644 index 0000000..6389d35 --- /dev/null +++ b/src/views/Home/components/NetworkTab.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/views/Home/components/TransactionsTab.vue b/src/views/Home/components/TransactionsTab.vue new file mode 100644 index 0000000..6f78448 --- /dev/null +++ b/src/views/Home/components/TransactionsTab.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/views/Home/components/WalletTab.vue b/src/views/Home/components/WalletTab.vue new file mode 100644 index 0000000..24d5f26 --- /dev/null +++ b/src/views/Home/components/WalletTab.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/src/views/Home/components/index.ts b/src/views/Home/components/index.ts new file mode 100644 index 0000000..cd0e616 --- /dev/null +++ b/src/views/Home/components/index.ts @@ -0,0 +1,4 @@ +export { default as TransactionsTab } from './TransactionsTab.vue' +export { default as WalletTab } from './WalletTab.vue' +export { default as NetworkTab } from './NetworkTab.vue' +export { default as DebugTab } from './DebugTab.vue' diff --git a/vite.config.ts b/vite.config.ts index fa8cf62..8f1179e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,21 +4,26 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import VueDevTools from 'vite-plugin-vue-devtools' -import tailwindcss from '@tailwindcss/vite' // https://vitejs.dev/config/ export default defineConfig({ - server: { - port: 3008, -}, - plugins: [ - vue(), - vueJsx(), - VueDevTools(), - ], - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - } - } + server: { + port: 3008, + }, + plugins: [vue(), vueJsx(), VueDevTools()], + css: { + preprocessorOptions: { + scss: { + additionalData: ` + @import "@/assets/scss/__variables.scss"; + @import "@/assets/scss/__mixin.scss"; + `, + }, + }, + }, + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, })