diff --git a/frontend/package.json b/frontend/package.json index f140d7e..e7aede2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,7 +16,9 @@ "axios": "^1.8.4", "buffer": "^6.0.3", "connect-pg-simple": "^10.0.0", + "dompurify": "^3.2.4", "ethers": "6.13.5", + "marked": "^15.0.7", "siwe": "^2.1.4", "sortablejs": "^1.15.6", "vue": "^3.2.47", diff --git a/frontend/src/assets/styles/home.css b/frontend/src/assets/styles/home.css new file mode 100644 index 0000000..63936ff --- /dev/null +++ b/frontend/src/assets/styles/home.css @@ -0,0 +1,378 @@ +.app-container { + display: flex; + height: 100vh; + width: 100%; + background-color: #f5f5f5; + position: relative; +} + +/* Стили для боковой панели */ +.sidebar { + width: 84px; + min-width: 84px; + background-color: #FFDA58; + display: flex; + flex-direction: column; + align-items: center; + padding-top: 20px; + position: fixed; + height: 100vh; + z-index: 2; +} + +.sidebar.sidebar-expanded { + width: 250px; + min-width: 250px; +} + +.menu-button { + width: 40px; + height: 40px; + background: white; + border: 1px solid #333; + border-radius: 4px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 68px; + position: fixed; + left: 22px; +} + +.hamburger { + width: 24px; + height: 3px; + background-color: #333; + position: relative; +} + +.hamburger::before, +.hamburger::after { + content: ''; + position: absolute; + width: 24px; + height: 3px; + background-color: #333; + left: 0; +} + +.hamburger::before { + top: -8px; +} + +.hamburger::after { + bottom: -8px; +} + +.nav-buttons { + display: flex; + flex-direction: column; + gap: 20px; + width: 84px; + padding: 0; + position: fixed; + left: 22px; + top: 108px; +} + +.nav-btn { + width: 40px; + height: 40px; + border: 1px solid #333; + border-radius: 4px; + background: white; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + position: relative; + padding: 0; + font-size: 16px; +} + +.nav-btn-text { + font-size: 16px; + color: #333; + opacity: 0; + visibility: hidden; + white-space: nowrap; + position: absolute; + left: 60px; +} + +.sidebar-expanded .nav-btn-text { + opacity: 1; + visibility: visible; +} + +/* Стили для основного контента */ +.main-content { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + margin-left: 84px; +} + +.sidebar-expanded ~ .main-content { + margin-left: 250px; +} + +.header { + padding: 20px; +} + +.title { + font-size: 24px; + font-weight: bold; + display: flex; + align-items: center; + gap: 10px; +} + +.hand-emoji { + font-size: 24px; +} + +.subtitle { + font-size: 14px; + color: #555; + margin-top: 5px; +} + +/* Стили для чата */ +.chat-container { + flex: 1; + display: flex; + flex-direction: column; + padding: 0 20px 20px; + overflow: hidden; +} + +.chat-messages { + flex: 1; + overflow-y: auto; + background-color: white; + border-radius: 8px; + padding: 20px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); + margin-bottom: 20px; +} + +.message { + margin-bottom: 15px; + padding: 10px 15px; + border-radius: 8px; + max-width: 80%; +} + +.user-message { + background-color: #EFFAFF; + align-self: flex-end; + margin-left: auto; +} + +.ai-message { + background-color: #F8F8F8; + align-self: flex-start; +} + +.message-content { + margin-bottom: 5px; + white-space: pre-wrap; + word-break: break-word; +} + +.message-time { + font-size: 12px; + color: #777; + text-align: right; +} + +.chat-input { + display: flex; + background-color: white; + border-radius: 8px; + padding: 10px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); +} + +.chat-input textarea { + flex: 1; + border: none; + resize: none; + padding: 10px; + height: 40px; + font-family: inherit; + border-radius: 4px; +} + +.chat-input textarea:focus { + outline: none; +} + +.chat-input button { + background-color: #E8E8E8; + color: #555; + border: none; + border-radius: 4px; + padding: 0 20px; + cursor: pointer; + height: 40px; + margin-left: 10px; +} + +.chat-input button:hover:not(:disabled) { + background-color: #d8d8d8; +} + +.chat-input button:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +/* Стили для правой панели с информацией о кошельке */ +.wallet-sidebar { + width: 250px; + background-color: #FFDA58; + padding: 20px; + display: flex; + flex-direction: column; +} + +.wallet-connect-btn { + background-color: #4CAF50; + color: white; + border: none; + border-radius: 8px; + padding: 12px 20px; + font-size: 16px; + cursor: pointer; + margin-bottom: 30px; +} + +.wallet-disconnect-btn { + background-color: #f44336; + color: white; + border: none; + border-radius: 8px; + padding: 12px 20px; + font-size: 16px; + cursor: pointer; + margin-bottom: 30px; +} + +.balance-container { + margin-top: 20px; +} + +.balance-container h3 { + margin-bottom: 15px; + font-size: 18px; +} + +.token-balance { + display: flex; + margin-bottom: 10px; + font-size: 16px; +} + +.token-name { + width: 60px; +} + +.token-amount { + flex: 1; + text-align: right; + padding-right: 10px; +} + +.token-symbol { + width: 60px; + text-align: right; +} + +.wallet-address { + margin-top: 30px; +} + +.wallet-address h3 { + margin-bottom: 10px; + font-size: 18px; +} + +.address { + font-family: monospace; + font-size: 14px; + word-break: break-all; +} + +.language-selector { + margin-top: auto; + align-self: flex-end; + background-color: white; + padding: 5px 10px; + border-radius: 4px; + display: flex; + align-items: center; + gap: 5px; + cursor: pointer; +} + +.dropdown-icon { + font-size: 10px; +} + +/* Стили для кнопок авторизации */ +.auth-buttons { + display: flex; + flex-direction: column; + gap: 10px; + margin-top: 20px; +} + +.auth-btn { + padding: 12px 16px; + border: none; + border-radius: 8px; + cursor: pointer; + font-size: 14px; + display: flex; + align-items: center; + justify-content: center; +} + +.email-btn { + background-color: #2196F3; + color: white; +} + +.telegram-btn { + background-color: #0088cc; + color: white; +} + +.user-info { + margin-top: 20px; +} + +.user-info h3 { + margin-bottom: 10px; + font-size: 18px; +} + +.user-info-item { + display: flex; + margin-bottom: 8px; + font-size: 14px; +} + +.user-info-label { + min-width: 80px; + color: #555; +} + +.user-info-value { + font-weight: bold; +} diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue index 0ecaa36..9fd6531 100644 --- a/frontend/src/views/HomeView.vue +++ b/frontend/src/views/HomeView.vue @@ -1,217 +1,199 @@ - - diff --git a/frontend/src/views/HomeView.vue.bak b/frontend/src/views/HomeView.vue.bak new file mode 100644 index 0000000..0b830bb --- /dev/null +++ b/frontend/src/views/HomeView.vue.bak @@ -0,0 +1,663 @@ + + + diff --git a/frontend/yarn.lock b/frontend/yarn.lock index bcf170f..a108017 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -459,6 +459,11 @@ dependencies: undici-types "~6.19.2" +"@types/trusted-types@^2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11" + integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== + "@vitejs/plugin-vue@^5.2.1": version "5.2.1" resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz#d1491f678ee3af899f7ae57d9c21dc52a65c7133" @@ -740,6 +745,13 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== +dompurify@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.2.4.tgz#af5a5a11407524431456cf18836c55d13441cd8e" + integrity sha512-ysFSFEDVduQpyhzAob/kkuJjf5zWkZD8/A9ywSp1byueyuCfHamrCBa14/Oc2iiB0e51B+NpxSl5gmzn+Ms/mg== + optionalDependencies: + "@types/trusted-types" "^2.0.7" + dunder-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" @@ -1226,6 +1238,11 @@ magic-string@^0.30.11, magic-string@^0.30.3: dependencies: "@jridgewell/sourcemap-codec" "^1.5.0" +marked@^15.0.7: + version "15.0.7" + resolved "https://registry.yarnpkg.com/marked/-/marked-15.0.7.tgz#f67d7e34d202ce087e6b879107b5efb04e743314" + integrity sha512-dgLIeKGLx5FwziAnsk4ONoGwHwGPJzselimvlVskE9XLN4Orv9u2VA3GWw/lYUqjfA0rUT/6fqKwfZJapP9BEg== + math-intrinsics@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"