diff --git a/app/assets/css/tailwind.css b/app/assets/css/tailwind.css index 5609026..abfe71f 100644 --- a/app/assets/css/tailwind.css +++ b/app/assets/css/tailwind.css @@ -1,5 +1,6 @@ @import "tailwindcss"; @import "tw-animate-css"; +@import '@clerk/themes/shadcn.css'; @custom-variant dark (&:is(.dark *)); @@ -123,4 +124,8 @@ h1 { @apply scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl; } -} \ No newline at end of file +} + +.cl-avatarBox { + @apply size-8; +} diff --git a/app/components/app/PresetSelect.vue b/app/components/app/PresetSelect.vue new file mode 100644 index 0000000..050778b --- /dev/null +++ b/app/components/app/PresetSelect.vue @@ -0,0 +1,31 @@ + + + diff --git a/app/components/app/SignInDialog.vue b/app/components/app/SignInDialog.vue index 2ba417b..209a556 100644 --- a/app/components/app/SignInDialog.vue +++ b/app/components/app/SignInDialog.vue @@ -8,11 +8,17 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { Button } from "@/components/ui/button"; +import { LogIn } from "lucide-vue-next"; diff --git a/app/components/ui/select/Select.vue b/app/components/ui/select/Select.vue new file mode 100644 index 0000000..c94bbe8 --- /dev/null +++ b/app/components/ui/select/Select.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/ui/select/SelectContent.vue b/app/components/ui/select/SelectContent.vue new file mode 100644 index 0000000..adf04ec --- /dev/null +++ b/app/components/ui/select/SelectContent.vue @@ -0,0 +1,51 @@ + + + diff --git a/app/components/ui/select/SelectGroup.vue b/app/components/ui/select/SelectGroup.vue new file mode 100644 index 0000000..e981c6c --- /dev/null +++ b/app/components/ui/select/SelectGroup.vue @@ -0,0 +1,15 @@ + + + diff --git a/app/components/ui/select/SelectItem.vue b/app/components/ui/select/SelectItem.vue new file mode 100644 index 0000000..9371764 --- /dev/null +++ b/app/components/ui/select/SelectItem.vue @@ -0,0 +1,44 @@ + + + diff --git a/app/components/ui/select/SelectItemText.vue b/app/components/ui/select/SelectItemText.vue new file mode 100644 index 0000000..b6700b1 --- /dev/null +++ b/app/components/ui/select/SelectItemText.vue @@ -0,0 +1,15 @@ + + + diff --git a/app/components/ui/select/SelectLabel.vue b/app/components/ui/select/SelectLabel.vue new file mode 100644 index 0000000..5b6650c --- /dev/null +++ b/app/components/ui/select/SelectLabel.vue @@ -0,0 +1,17 @@ + + + diff --git a/app/components/ui/select/SelectScrollDownButton.vue b/app/components/ui/select/SelectScrollDownButton.vue new file mode 100644 index 0000000..7dc7670 --- /dev/null +++ b/app/components/ui/select/SelectScrollDownButton.vue @@ -0,0 +1,26 @@ + + + diff --git a/app/components/ui/select/SelectScrollUpButton.vue b/app/components/ui/select/SelectScrollUpButton.vue new file mode 100644 index 0000000..07fe87e --- /dev/null +++ b/app/components/ui/select/SelectScrollUpButton.vue @@ -0,0 +1,26 @@ + + + diff --git a/app/components/ui/select/SelectSeparator.vue b/app/components/ui/select/SelectSeparator.vue new file mode 100644 index 0000000..4b5c885 --- /dev/null +++ b/app/components/ui/select/SelectSeparator.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/ui/select/SelectTrigger.vue b/app/components/ui/select/SelectTrigger.vue new file mode 100644 index 0000000..667908b --- /dev/null +++ b/app/components/ui/select/SelectTrigger.vue @@ -0,0 +1,33 @@ + + + diff --git a/app/components/ui/select/SelectValue.vue b/app/components/ui/select/SelectValue.vue new file mode 100644 index 0000000..d5ce58b --- /dev/null +++ b/app/components/ui/select/SelectValue.vue @@ -0,0 +1,15 @@ + + + diff --git a/app/components/ui/select/index.ts b/app/components/ui/select/index.ts new file mode 100644 index 0000000..96eae60 --- /dev/null +++ b/app/components/ui/select/index.ts @@ -0,0 +1,11 @@ +export { default as Select } from "./Select.vue" +export { default as SelectContent } from "./SelectContent.vue" +export { default as SelectGroup } from "./SelectGroup.vue" +export { default as SelectItem } from "./SelectItem.vue" +export { default as SelectItemText } from "./SelectItemText.vue" +export { default as SelectLabel } from "./SelectLabel.vue" +export { default as SelectScrollDownButton } from "./SelectScrollDownButton.vue" +export { default as SelectScrollUpButton } from "./SelectScrollUpButton.vue" +export { default as SelectSeparator } from "./SelectSeparator.vue" +export { default as SelectTrigger } from "./SelectTrigger.vue" +export { default as SelectValue } from "./SelectValue.vue" diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 906aff8..99c03dd 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -5,7 +5,8 @@ import ThemeDropdown from '~/components/ui/ThemeDropdown.vue'; diff --git a/app/pages/stream.vue b/app/pages/stream.vue index 6d3df9a..34583b3 100644 --- a/app/pages/stream.vue +++ b/app/pages/stream.vue @@ -3,10 +3,11 @@ import { useWebSocket } from '@vueuse/core'; import { Button } from "@/components/ui/button" import { useStreamerStore } from '~/state/streamer'; import { useWebSocketUrl } from '~/composables/useWebSocketUrl'; +import PresetSelect from '~/components/app/PresetSelect.vue'; const streamerStore = useStreamerStore() -const videofeedRef = ref(null); -const localStream = ref(null); +const videofeedRef = ref(null); +const localStream = ref(null); const wsUrl = useWebSocketUrl() const { send } = useWebSocket(wsUrl, { @@ -17,11 +18,11 @@ const { send } = useWebSocket(wsUrl, { }, onMessage: async (ws, ev) => { const message = JSON.parse(ev.data) - + if (message.event === 'room-created') { streamerStore.setCode(message.roomId) } - + if (message.event === 'viewer-joined') { const peerConnection = new RTCPeerConnection({ iceServers: [ @@ -57,14 +58,12 @@ const { send } = useWebSocket(wsUrl, { }); streamerStore.addPeerConnection(message.viewerId, peerConnection) - // Add media tracks to peer connection if (localStream.value) { localStream.value.getTracks().forEach(track => { peerConnection.addTrack(track, localStream.value!); }); } - // Handle ICE candidates peerConnection.onicecandidate = (event) => { if (event.candidate) { send(JSON.stringify({ @@ -77,21 +76,21 @@ const { send } = useWebSocket(wsUrl, { const offer = await peerConnection.createOffer(); await peerConnection.setLocalDescription(offer); - + send(JSON.stringify({ event: 'offer', targetId: message.viewerId, sdp: offer, })) } - + if (message.event === 'ice-candidate') { const pc = streamerStore.peerConnections[message.from]; if (pc) { await pc.addIceCandidate(new RTCIceCandidate(message.candidate)); } } - + if (message.event === 'answer') { const pc = streamerStore.peerConnections[message.from]; if (pc) { @@ -121,9 +120,12 @@ async function startScreenShare() {