-
Notifications
You must be signed in to change notification settings - Fork 0
Hribernik development #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
61d1a18
room user, user label and context menu
ILIveOnAHill d639820
user folder
ILIveOnAHill 3eb999b
chat text field and some formating
ILIveOnAHill d2d66ec
chat message and queue card
ILIveOnAHill 072d418
feat: media card
ILIveOnAHill 4da90e1
feat: prompts
ILIveOnAHill cd0beb5
fix: prompt centering
ILIveOnAHill 8562c1d
feat: a few popups
ILIveOnAHill fe93942
feat: room settings
ILIveOnAHill bb37b46
fix: Drop opacity of disabled input
MaticBabnik 315d6e2
fix: CR comments
MaticBabnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <script setup lang="ts"> | ||
| const props = defineProps<{ | ||
| username: string | ||
| image: string | ||
| timestamp: Date | ||
|
|
||
| text?: string | ||
| recommendation?: Object | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="c-msg"> | ||
| <img class="avatar" :src="props.image" :alt="`${props.username}'s Avatar'`" /> | ||
| <div class="c-msg-body"> | ||
| <div class="name-time-row"> | ||
| <span class="name">{{ props.username }}</span> | ||
| <span class="time">{{ | ||
| props.timestamp.toLocaleTimeString('en-US', { | ||
| hour: '2-digit', | ||
| minute: '2-digit', | ||
| hour12: false, | ||
| }) | ||
| }}</span> | ||
| </div> | ||
| <div v-if="text" class="c-msg-content text"> | ||
| <span>{{ props.text }}</span> | ||
| </div> | ||
| <div v-else class="c-msg-content recommendation"></div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .c-msg { | ||
| display: flex; | ||
| flex-direction: row; | ||
|
|
||
| padding: 8px; | ||
| gap: 8px; | ||
|
|
||
| font-family: var(--s-font); | ||
| } | ||
|
|
||
| .avatar { | ||
| width: 32px; | ||
| height: 32px; | ||
| border-radius: 50%; | ||
| } | ||
|
|
||
| .c-msg-body { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 4px; | ||
| } | ||
|
|
||
| .text { | ||
| font-size: 13px; | ||
| } | ||
|
|
||
| .name-time-row { | ||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: flex-end; | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| .name { | ||
| font-size: 16px; | ||
| font-weight: var(--s-weight-bold); | ||
| } | ||
|
|
||
| .time { | ||
| font-size: 12px; | ||
| color: var(--s-text-subtle); | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| <script setup lang="ts"> | ||
| import { ref, nextTick } from 'vue' | ||
| import SyncButton from '../button/sync-button.vue' | ||
|
|
||
| const message = ref('') | ||
|
|
||
| function send(e: Event) { | ||
| if (!message.value.trim()) return | ||
|
|
||
| emit('send', message.value) | ||
| message.value = '' | ||
| nextTick(() => autoResizeTextarea(e.target as HTMLInputElement)) | ||
| } | ||
|
|
||
| function onInput(e: Event) { | ||
| autoResizeTextarea(e.target as HTMLInputElement) | ||
| } | ||
|
|
||
| function autoResizeTextarea(textarea: HTMLInputElement) { | ||
| textarea.style.height = 'auto' | ||
| textarea.style.height = `${textarea.scrollHeight}px` | ||
| } | ||
|
|
||
| const emit = defineEmits<{ | ||
| (e: 'send', message: string): void | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="c-text-field"> | ||
| <div class="c-input"> | ||
| <textarea | ||
| v-model="message" | ||
| class="c-textarea" | ||
| name="c-textarea" | ||
| placeholder="Write something..." | ||
| rows="1" | ||
| maxlength="300" | ||
| @keydown.enter.exact.prevent="send" | ||
| @input="onInput" | ||
| /> | ||
| <SyncButton class="icon-gray" icon="smile" color="bgnb" bstyle="small" /> | ||
| </div> | ||
| <span class="char-limit">{{ message.length }}/300</span> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .c-text-field { | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| width: 100%; | ||
| background-color: var(--s-background-alt); | ||
|
|
||
| border-top: 1px solid var(--s-border); | ||
|
|
||
| font-family: var(--s-font); | ||
| } | ||
|
|
||
| .c-input { | ||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: baseline; | ||
| } | ||
|
|
||
| .c-textarea { | ||
| flex-grow: 1; | ||
| font-size: 14px; | ||
| line-height: 1.2; | ||
| max-height: 5lh; | ||
|
|
||
| padding-left: 10px; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .icon-gray { | ||
| flex-shrink: 1; | ||
| } | ||
|
|
||
| .char-limit { | ||
| padding: 0 5px 0 5px; | ||
| display: flex; | ||
| justify-content: flex-end; | ||
| font-size: 10px; | ||
| } | ||
|
|
||
| textarea { | ||
| border: none; | ||
| overflow-y: auto; | ||
| outline: none; | ||
| background: none; | ||
| padding: 0; | ||
|
|
||
| -webkit-box-shadow: none; | ||
| -moz-box-shadow: none; | ||
| box-shadow: none; | ||
|
|
||
| resize: none; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| <script setup lang="ts"> | ||
| import SyncButton from '../button/sync-button.vue' | ||
|
|
||
| const props = defineProps<{ | ||
| title: string | ||
| primaryBtnText: string | ||
| isDanger: boolean | ||
|
|
||
| secondaryBtnText?: string | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="prompt shadow-medium"> | ||
| <div class="prompt-head"> | ||
| <span class="title">{{ props.title }}</span> | ||
| <SyncButton @click="$emit('close')" icon="close" bstyle="none" color="bgnb" /> | ||
| </div> | ||
| <div class="prompt-body"><slot></slot></div> | ||
| <div class="prompt-footer"> | ||
| <SyncButton | ||
| v-if="props.secondaryBtnText" | ||
| @click="$emit(props.secondaryBtnText.toLowerCase())" | ||
| :text="props.secondaryBtnText" | ||
| bstyle="pill" | ||
| color="primary-lt" | ||
| /> | ||
| <SyncButton | ||
| @click="$emit(props.primaryBtnText.toLowerCase())" | ||
| :text="props.primaryBtnText" | ||
| bstyle="pill" | ||
| :color="props.isDanger ? 'danger-lt' : 'primary-lt'" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .prompt { | ||
| position: absolute; | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| left: 50%; | ||
| top: 50%; | ||
| transform: translate(-50%, -50%); | ||
|
|
||
| width: 374px; | ||
| padding: 16px; | ||
| gap: 16px; | ||
|
|
||
| border: 1px solid var(--s-border); | ||
| border-radius: 16px; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .prompt-head { | ||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| .title { | ||
| font-size: 24px; | ||
| font-weight: var(--s-weight-bold); | ||
| color: var(--s-primary); | ||
| } | ||
|
|
||
| .prompt-body { | ||
| font-size: 16px; | ||
| } | ||
|
|
||
| .prompt-footer { | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: flex-end; | ||
| gap: 10px; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <script setup lang="ts"> | ||
| function formattedTime(timeLeft: number) { | ||
| const minutes = Math.floor(timeLeft / 60) | ||
| const seconds = timeLeft % 60 | ||
| return `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}` | ||
| } | ||
|
|
||
| // TODO: props | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="r-prompt shadow-medium"> | ||
| <span style="font-size: 20px; font-weight: var(--s-weight-bold)">Reconnecting</span> | ||
| <span>{{ `WebSocket connection lost. Session death in ${formattedTime(13)}` }}</span> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .r-prompt { | ||
| position: absolute; | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| width: 246px; | ||
|
|
||
| left: 50%; | ||
| top: 50%; | ||
| transform: translate(-50%, -50%); | ||
|
|
||
| text-align: center; | ||
| font-size: 16px; | ||
| color: var(--s-background); | ||
| background-color: var(--s-error); | ||
|
|
||
| padding: 16px; | ||
| gap: 8px; | ||
|
|
||
| border-radius: 8px; | ||
| } | ||
| </style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixme: bad.