diff --git a/package.json b/package.json index f47b7490..79cc6b5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mage-website", - "version": "0.1.0", + "version": "0.1.01", "license": "GPL-3.0", "private": true, "type": "module", diff --git a/src/lib/assets/svg-json/image_urls.json b/src/lib/assets/svg-json/image_urls.json index cdca8d41..cd43da8f 100644 --- a/src/lib/assets/svg-json/image_urls.json +++ b/src/lib/assets/svg-json/image_urls.json @@ -89,6 +89,7 @@ "Spring": "/category-optimized/web2/spring-logo.svg", "SQL": "/category-optimized/web2/sql.svg", "Stack Overflow": "/category-optimized/web2/stack-overflow.svg", + "Stripe": "/category-optimized/web2/stripe.svg", "Svelte": "/category-optimized/web2/svelte.svg", "Swift": "/category-optimized/web2/swift.svg", "Symfony": "/category-optimized/web2/symfony.svg", diff --git a/src/lib/assets/svg-json/web2.json b/src/lib/assets/svg-json/web2.json index 918e7b56..3bf107cb 100644 --- a/src/lib/assets/svg-json/web2.json +++ b/src/lib/assets/svg-json/web2.json @@ -89,6 +89,7 @@ "Spring": "/category-optimized/web2/spring-logo.svg", "SQL": "/category-optimized/web2/sql.svg", "Stack Overflow": "/category-optimized/web2/stack-overflow.svg", + "Stripe": "/category-optimized/web2/stripe.svg", "Svelte": "/category-optimized/web2/svelte.svg", "Swift": "/category-optimized/web2/swift.svg", "Symfony": "/category-optimized/web2/symfony.svg", diff --git a/src/lib/components/Channel/Chat/DrawerEditChannel.svelte b/src/lib/components/Channel/Chat/DrawerEditChannel.svelte index b8704a98..84c491c1 100644 --- a/src/lib/components/Channel/Chat/DrawerEditChannel.svelte +++ b/src/lib/components/Channel/Chat/DrawerEditChannel.svelte @@ -9,6 +9,7 @@ import { category_list } from '$lib/stores/channelStore' import { emitChannelUpdate } from '$lib/websocket' import IconChatScreenshot from '$lib/assets/icons/chat/IconChatScreenshot.svelte' + import { captureScreenShot } from '$lib/utils' export let channel: any, showDrawer: boolean @@ -18,7 +19,7 @@ showAddCategory = false, maxTag = 3, maxCategory = 4, - imageSrc = '' + imageSrc: string = '' $: maxTagLabel = channel?.tags.length == maxTag ? 'max reached' : 'max ' + maxTag $: maxCategoryLabel = @@ -55,30 +56,7 @@ e.preventDefault() showThumbnail = true if (channel.videoItems.length > 0) { - let screenElement = document.getElementById( - `screen-${channel.videoItems[0]._id}` - ) as HTMLVideoElement - let webcamElement = document.getElementById( - `webcam-${channel.videoItems[0]._id}` - ) as HTMLVideoElement - let canvas = document.createElement('canvas') - canvas.width = 1920 - canvas.height = 1080 - - let ctx = canvas.getContext('2d') - - console.log(screenElement) - console.log(webcamElement) - - if (ctx !== null && screenElement !== null && webcamElement !== null) { - ctx.drawImage(screenElement, 0, 0, canvas.width, canvas.height) - ctx.globalAlpha = 1 - ctx.drawImage(webcamElement, 1400, 750, canvas.width - 1400, canvas.height - 750) - } - - let screenshot = canvas.toDataURL('image/jpeg') - imageSrc = screenshot - //thumbnailRef.setAttribute('src', screenshot); + imageSrc = captureScreenShot(channel) } } diff --git a/src/lib/components/Channel/Chat/DropdownViewChannel.svelte b/src/lib/components/Channel/Chat/DropdownViewChannel.svelte index c831edf4..c21e25a2 100644 --- a/src/lib/components/Channel/Chat/DropdownViewChannel.svelte +++ b/src/lib/components/Channel/Chat/DropdownViewChannel.svelte @@ -91,6 +91,16 @@