Spaces:
Running
Running
Analyze the contents from this chat session and design a simple HTML portal: https://kwkvmf3jrprqduii.public.blob.vercel-storage.com/chat-%20%281%29.txt
f687d97 verified | class CustomChatCard extends HTMLElement { | |
| static get observedAttributes() { | |
| return ['title', 'date', 'participants', 'preview', 'link']; | |
| } | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: 'open' }); | |
| } | |
| connectedCallback() { | |
| this.render(); | |
| } | |
| attributeChangedCallback(name, oldValue, newValue) { | |
| this.render(); | |
| } | |
| render() { | |
| const title = this.getAttribute('title') || 'Untitled Chat'; | |
| const date = this.getAttribute('date') || 'No date'; | |
| const participants = this.getAttribute('participants') || '0'; | |
| const preview = this.getAttribute('preview') || 'No preview available'; | |
| const link = this.getAttribute('link') || '#'; | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| margin-bottom: 1rem; | |
| } | |
| .card { | |
| background-color: white; | |
| border-radius: 0.75rem; | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); | |
| overflow: hidden; | |
| transition: transform 0.2s, box-shadow 0.2s; | |
| height: 100%; | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .card:hover { | |
| transform: translateY(-4px); | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); | |
| } | |
| .card-header { | |
| padding: 1.25rem 1.5rem 0; | |
| } | |
| .card-title { | |
| font-size: 1.25rem; | |
| font-weight: 600; | |
| color: #111827; | |
| margin-bottom: 0.5rem; | |
| } | |
| .card-meta { | |
| display: flex; | |
| align-items: center; | |
| color: #6b7280; | |
| font-size: 0.875rem; | |
| margin-bottom: 1rem; | |
| } | |
| .card-meta-item { | |
| display: flex; | |
| align-items: center; | |
| margin-right: 1rem; | |
| } | |
| .card-meta-icon { | |
| margin-right: 0.25rem; | |
| width: 16px; | |
| height: 16px; | |
| } | |
| .card-body { | |
| padding: 0 1.5rem 1.25rem; | |
| flex-grow: 1; | |
| } | |
| .card-preview { | |
| color: #4b5563; | |
| line-height: 1.5; | |
| margin-bottom: 1.5rem; | |
| display: -webkit-box; | |
| -webkit-line-clamp: 3; | |
| -webkit-box-orient: vertical; | |
| overflow: hidden; | |
| } | |
| .card-footer { | |
| padding: 0 1.5rem 1.5rem; | |
| } | |
| .card-link { | |
| display: inline-flex; | |
| align-items: center; | |
| color: #4f46e5; | |
| font-weight: 500; | |
| text-decoration: none; | |
| transition: color 0.2s; | |
| } | |
| .card-link:hover { | |
| color: #4338ca; | |
| } | |
| .card-link-icon { | |
| margin-left: 0.25rem; | |
| width: 16px; | |
| height: 16px; | |
| } | |
| </style> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <h3 class="card-title">${title}</h3> | |
| <div class="card-meta"> | |
| <span class="card-meta-item"> | |
| <i data-feather="calendar" class="card-meta-icon"></i> | |
| ${date} | |
| </span> | |
| <span class="card-meta-item"> |