openhands openhands commited on
Commit ·
fedc54f
1
Parent(s): 5e4cd17
Deploy React Chat App
Browse files- Three.js 3D background
- Chat components (ChatBox, MessageItem, EmojiBar, InputBox)
- Group components (GroupChat, MemberList, GroupInfo)
- UI components (Avatar, Modal, Button)
- Zustand state management
- Login/Register pages
Co-authored-by: openhands <openhands@all-hands.dev>
- .gitattributes +9 -0
- README.md +0 -14
- assets/index-CQxv4P1h.css +1 -0
- assets/index-D-0NzOas.js +0 -0
- index.html +14 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,12 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
|
| 37 |
+
# Static files - do NOT use LFS
|
| 38 |
+
*.js !filter !lfs
|
| 39 |
+
*.css !filter !lfs
|
| 40 |
+
*.html !filter !lfs
|
| 41 |
+
*.png !filter !lfs
|
| 42 |
+
*.jpg !filter !lfs
|
| 43 |
+
*.svg !filter !lfs
|
| 44 |
+
*.ico !filter !lfs
|
README.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Chat App
|
| 3 |
-
emoji: 🏆
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: indigo
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 6.11.0
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
license: bigscience-openrail-m
|
| 11 |
-
short_description: 'Demo View Mode '
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/index-CQxv4P1h.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:none;border-radius:8px;font-weight:500;cursor:pointer;transition:all .2s ease}.btn:disabled{opacity:.6;cursor:not-allowed}.btn-primary{background:#6366f1;color:#fff}.btn-primary:hover:not(:disabled){background:#4f46e5}.btn-secondary{background:#f3f4f6;color:#374151}.btn-secondary:hover:not(:disabled){background:#e5e7eb}.btn-danger{background:#ef4444;color:#fff}.btn-danger:hover:not(:disabled){background:#dc2626}.btn-ghost{background:transparent;color:#6b7280}.btn-ghost:hover:not(:disabled){background:#f3f4f6}.btn-small{padding:6px 12px;font-size:13px}.btn-medium{padding:10px 16px;font-size:14px}.btn-large{padding:12px 24px;font-size:16px}.btn-spinner{width:16px;height:16px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:spin .8s linear infinite}.btn-icon{display:flex;align-items:center;font-size:18px}.auth-page{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#667eea,#764ba2);position:relative;z-index:1}.auth-form .form-group{display:flex;flex-direction:column;gap:6px}.auth-form label{font-size:14px;font-weight:500;color:#374151}.auth-form input{padding:12px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;outline:none;transition:border-color .2s}.auth-form input:focus{border-color:#6366f1}.error-message{color:#ef4444;font-size:14px;text-align:center;padding:10px;background:#fef2f2;border-radius:8px}.auth-switch p{margin:0}.auth-switch button{background:none;border:none;color:#6366f1;cursor:pointer;font-weight:500;font-size:inherit}.avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;flex-shrink:0;position:relative}.avatar-small{width:32px;height:32px;font-size:12px}.avatar-medium{width:40px;height:40px;font-size:14px}.avatar-large{width:56px;height:56px;font-size:18px}.avatar img{width:100%;height:100%;object-fit:cover}.avatar-initials{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:#fff;font-weight:600;text-transform:uppercase}.avatar.clickable{cursor:pointer;transition:transform .2s ease}.avatar.clickable:hover{transform:scale(1.05)}.avatar-status{position:absolute;bottom:0;right:0;width:10px;height:10px;border-radius:50%;border:2px solid white}.status-online{background-color:#22c55e}.status-offline{background-color:#9ca3af}.status-away{background-color:#f59e0b}.status-busy{background-color:#ef4444}.emoji-bar{position:absolute;bottom:100%;left:0;margin-bottom:4px;display:flex;flex-direction:column;gap:8px;z-index:10}.message-item.own .emoji-bar{left:auto;right:0}.emoji-reactions{display:flex;gap:4px;flex-wrap:wrap}.reaction-pill{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;font-size:12px;cursor:pointer;transition:all .2s}.reaction-pill:hover{background:#f3f4f6;border-color:#d1d5db}.reaction-emoji{font-size:14px}.reaction-count{color:#6b7280}.emoji-picker{display:flex;gap:4px;padding:8px;background:#fff;border-radius:8px;box-shadow:0 4px 12px #0000001a}.emoji-btn{background:none;border:none;font-size:18px;padding:4px;cursor:pointer;border-radius:4px;transition:background .2s}.emoji-btn:hover{background:#f3f4f6}.message-item{display:flex;gap:8px;margin-bottom:8px;position:relative}.message-item.own{flex-direction:row-reverse}.message-item.own .message-bubble{background:#6366f1;color:#fff;border-bottom-right-radius:4px}.message-item.other .message-bubble{background:#f3f4f6;color:#1f2937;border-bottom-left-radius:4px}.message-avatar{flex-shrink:0}.message-content{max-width:70%;display:flex;flex-direction:column}.message-item.other .message-content{align-items:flex-start}.message-item.own .message-content{align-items:flex-end}.sender-name{font-size:12px;color:#6b7280;margin-bottom:4px;margin-left:4px}.message-bubble{padding:10px 14px;border-radius:16px;word-wrap:break-word}.message-text{margin:0;line-height:1.4;white-space:pre-wrap}.message-image{max-width:250px;border-radius:8px}.deleted-message{font-style:italic;color:#9ca3af;font-size:13px}.message-meta{display:flex;align-items:center;gap:4px;margin-top:4px;padding:0 4px}.message-time{font-size:11px;color:#9ca3af}.message-status{font-size:12px;color:#9ca3af}.input-box{display:flex;align-items:flex-end;gap:8px;padding:16px;background:#fff;border-top:1px solid #e5e7eb}.input-container{flex:1;display:flex;align-items:center;background:#f3f4f6;border-radius:24px;padding:8px 16px}.message-input{flex:1;border:none;background:transparent;resize:none;font-size:14px;line-height:1.4;max-height:120px;outline:none;font-family:inherit}.message-input::placeholder{color:#9ca3af}.input-actions{display:flex;gap:4px}.action-btn{background:none;border:none;font-size:18px;cursor:pointer;padding:4px;border-radius:4px;transition:background .2s}.action-btn:hover{background:#e5e7eb}.send-btn{width:40px;height:40px;border-radius:50%;background:#6366f1;color:#fff;border:none;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.send-btn:hover:not(:disabled){background:#4f46e5}.send-btn:disabled{background:#d1d5db;cursor:not-allowed}.empty-state h3{margin:0 0 8px;color:#111827;font-size:18px}.empty-state p{margin:0;font-size:14px}.chat-header{padding:16px 20px;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;gap:12px}.chat-header-info{display:flex;flex-direction:column}@keyframes spin{to{transform:rotate(360deg)}}.message-date-divider{text-align:center;color:#9ca3af;font-size:12px;margin:16px 0;position:relative}.message-date-divider:before,.message-date-divider:after{content:"";position:absolute;top:50%;width:30%;height:1px;background:#e5e7eb}.message-date-divider:before{left:0}.message-date-divider:after{right:0}.modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}.modal-content{background:#fff;border-radius:12px;width:100%;max-width:480px;max-height:90vh;overflow-y:auto;box-shadow:0 25px 50px -12px #00000040}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7eb}.modal-header h3{margin:0;font-size:18px;font-weight:600;color:#111827}.modal-close{background:none;border:none;font-size:24px;color:#6b7280;cursor:pointer;padding:0;line-height:1;transition:color .2s}.modal-close:hover{color:#111827}.modal-body{padding:20px}.profile-modal{text-align:center}.profile-modal .avatar-large{width:80px;height:80px;font-size:24px;margin:0 auto 16px}.profile-modal h2{margin:0 0 4px;font-size:20px;color:#111827}.profile-modal .username{color:#6b7280;font-size:14px;margin-bottom:12px}.profile-modal .status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;background:#f3f4f6;border-radius:16px;font-size:13px;color:#4b5563}.profile-modal .status-dot{width:8px;height:8px;border-radius:50%}.profile-modal .bio{margin:16px 0;color:#4b5563;font-size:14px}.profile-modal .actions{display:flex;gap:8px;justify-content:center;margin-top:16px}.chat-page{display:flex;height:100vh;background:#f8fafc}.chat-sidebar{width:320px;background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column}.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:20px;border-bottom:1px solid #e5e7eb}.sidebar-header h2{font-size:20px;font-weight:600;color:#111827}.new-chat-btn{width:32px;height:32px;border-radius:8px;background:#6366f1;color:#fff;border:none;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center}.search-box{padding:16px;position:relative}.search-box input{width:100%;padding:10px 14px;border:1px solid #e5e7eb;border-radius:8px;font-size:14px;outline:none}.search-box input:focus{border-color:#6366f1}.search-results{position:absolute;top:100%;left:16px;right:16px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 12px #0000001a;z-index:10;max-height:200px;overflow-y:auto}.search-result{display:flex;align-items:center;gap:10px;padding:10px 14px;cursor:pointer}.search-result:hover{background:#f3f4f6}.conversations-list{flex:1;overflow-y:auto}.conversation-item{display:flex;align-items:center;gap:12px;padding:14px 20px;cursor:pointer;transition:background .2s}.conversation-item.active{background:#f3f4f6}.conv-info{display:flex;flex-direction:column;gap:2px;overflow:hidden}.conv-name{font-weight:500;color:#111827}.conv-preview{font-size:13px;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-main{flex:1;display:flex;flex-direction:column}.chat-box{display:flex;flex-direction:column;height:100%;background:#fff}.chat-box.empty{align-items:center;justify-content:center}.empty-state{text-align:center;color:#6b7280}.empty-icon{font-size:48px;display:block;margin-bottom:16px}.empty-state h3{margin:0 0 8px;color:#111827}.empty-state p{margin:0}.chat-header{padding:16px 20px;border-bottom:1px solid #e5e7eb}.chat-header-info h3{margin:0;font-size:16px;color:#111827}.chat-header-info .status{font-size:13px;color:#6b7280}.chat-messages{flex:1;overflow-y:auto;padding:20px}.loading-messages,.no-messages{text-align:center;color:#6b7280;padding:40px}.loading-spinner{width:24px;height:24px;border:2px solid #e5e7eb;border-top-color:#6366f1;border-radius:50%;animation:spin .8s linear infinite;margin:0 auto 12px}.auth-page{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#667eea,#764ba2)}.auth-card{background:#fff;border-radius:16px;padding:40px;width:100%;max-width:400px;box-shadow:0 20px 40px #0003}.auth-header{text-align:center;margin-bottom:32px}.auth-header h1{margin:0 0 8px;font-size:24px;color:#111827}.auth-header p{margin:0;color:#6b7280}.auth-form{display:flex;flex-direction:column;gap:20px}.form-group{display:flex;flex-direction:column;gap:6px}.form-group label{font-size:14px;font-weight:500;color:#374151}.form-group input{padding:12px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;outline:none;transition:border-color .2s}.form-group input:focus{border-color:#6366f1}.error-message{color:#ef4444;font-size:14px;text-align:center}.auth-btn{width:100%;margin-top:8px}.auth-switch{text-align:center;margin-top:24px;color:#6b7280}.auth-switch button{background:none;border:none;color:#6366f1;cursor:pointer;font-weight:500}.three-background{position:fixed;top:0;left:0;width:100%;height:100%;z-index:-1}.group-page{display:flex;height:100vh}.group-sidebar{width:280px;background:#fff;border-right:1px solid #e5e7eb}.group-main{flex:1}.group-item{display:flex;align-items:center;gap:12px;padding:14px 20px;cursor:pointer}.group-item.active{background:#f3f4f6}.group-avatar-placeholder{width:40px;height:40px;border-radius:8px;background:#6366f1;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600}.group-info{display:flex;flex-direction:column}.group-preview{font-size:13px;color:#6b7280}.no-groups{padding:20px;text-align:center}.no-groups p{color:#6b7280;margin-bottom:12px}.member-list h4{margin:0 0 12px;font-size:14px;color:#6b7280;font-weight:500}.member-list li{display:flex;align-items:center;gap:10px;padding:8px;cursor:pointer;border-radius:8px;transition:background .2s}.member-name{font-weight:500;color:#111827;font-size:14px}.group-info h3{margin:0 0 8px;text-align:center;color:#111827;font-size:18px}.group-chat{display:flex;height:100%;background:#fff}.group-sidebar{width:280px;border-left:1px solid #e5e7eb;display:flex;flex-direction:column}.group-page{display:flex;height:100vh;background:#f8fafc}.group-sidebar{width:280px;background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column}.group-sidebar .sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:20px;border-bottom:1px solid #e5e7eb}.group-sidebar .sidebar-header h2{font-size:20px;font-weight:600;color:#111827;margin:0}.new-group-btn{width:32px;height:32px;border-radius:8px;background:#6366f1;color:#fff;border:none;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center}.groups-list{flex:1;overflow-y:auto}.group-item{display:flex;align-items:center;gap:12px;padding:14px 20px;cursor:pointer;transition:background .2s}.group-item:hover,.group-item.active{background:#f3f4f6}.group-avatar-placeholder{width:40px;height:40px;border-radius:8px;background:#6366f1;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:18px}.group-info{display:flex;flex-direction:column;gap:2px;overflow:hidden}.group-name{font-weight:500;color:#111827}.group-preview{font-size:13px;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.no-groups{padding:40px 20px;text-align:center}.no-groups p{color:#6b7280;margin-bottom:16px}.group-chat{display:flex;height:100%}.group-chat.empty{align-items:center;justify-content:center}.group-main{flex:1;display:flex;flex-direction:column}.group-header{padding:16px 20px;border-bottom:1px solid #e5e7eb;background:#fff}.group-header h2{margin:0 0 4px;font-size:18px;color:#111827}.group-desc{margin:0;font-size:14px;color:#6b7280}.group-sidebar{width:280px;background:#fff;border-left:1px solid #e5e7eb;display:flex;flex-direction:column}.member-list{padding:16px;border-bottom:1px solid #e5e7eb}.member-list h4{margin:0 0 12px;font-size:14px;color:#6b7280}.member-list ul{list-style:none;padding:0;margin:0}.member-list li{display:flex;align-items:center;gap:10px;padding:8px;cursor:pointer;border-radius:8px}.member-list li:hover{background:#f3f4f6}.member-info{display:flex;flex-direction:column}.member-name{font-weight:500;color:#111827}.member-role{font-size:12px;color:#6b7280}.member-role.role-admin{color:#ef4444}.member-role.role-co_admin{color:#f59e0b}.group-info{padding:16px}.group-avatar{display:flex;justify-content:center;margin-bottom:16px}.group-info h3{margin:0 0 8px;text-align:center;color:#111827}.group-info .description{margin:0 0 16px;text-align:center;font-size:14px;color:#6b7280}.info-stats{display:flex;justify-content:space-around;margin-bottom:16px}.stat{display:flex;flex-direction:column;align-items:center}.stat-value{font-size:18px;font-weight:600;color:#111827}.stat-label{font-size:12px;color:#6b7280}.info-actions{display:flex;gap:8px;justify-content:center}.create-group-form{display:flex;flex-direction:column;gap:16px}.create-group-form .form-group{display:flex;flex-direction:column;gap:6px}.create-group-form label{font-size:14px;font-weight:500;color:#374151}.create-group-form input,.create-group-form textarea{padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;outline:none}.create-group-form input:focus,.create-group-form textarea:focus{border-color:#6366f1}.form-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:8px}*{margin:0;padding:0;box-sizing:border-box}:root{--primary: #6366f1;--primary-hover: #4f46e5;--secondary: #f3f4f6;--danger: #ef4444;--text: #111827;--text-secondary: #6b7280;--border: #e5e7eb;--background: #f8fafc}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background:var(--background);color:var(--text)}#root{min-height:100vh}.app{min-height:100vh;position:relative}button{font-family:inherit}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
|
assets/index-D-0NzOas.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
index.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<title>ChatApp - Modern Messaging</title>
|
| 8 |
+
<script type="module" crossorigin src="./assets/index-D-0NzOas.js"></script>
|
| 9 |
+
<link rel="stylesheet" crossorigin href="./assets/index-CQxv4P1h.css">
|
| 10 |
+
</head>
|
| 11 |
+
<body>
|
| 12 |
+
<div id="root"></div>
|
| 13 |
+
</body>
|
| 14 |
+
</html>
|