File tree Expand file tree Collapse file tree 2 files changed +50
-6
lines changed Expand file tree Collapse file tree 2 files changed +50
-6
lines changed Original file line number Diff line number Diff line change 7
7
import { writable } from ' svelte/store'
8
8
9
9
let index = writable (0 )
10
+ let container: HTMLDivElement
10
11
11
12
const VIDEOS = [
12
13
' fthlphRmsjY' , // I Added Mr Beast to Minecraft...
27
28
` //www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${id }&format=json `
28
29
)
29
30
const videoInfo = await res .json ()
30
-
31
31
return videoInfo ?.title
32
32
}
33
+
34
+ function setSelectedVideo(id : string ) {
35
+ $index = VIDEOS .indexOf (id )
36
+ container ?.scrollIntoView ({ behavior: ' smooth' })
37
+ }
33
38
</script >
34
39
35
- <div class =" container" >
40
+ <div class ="container" bind:this ={ container } >
36
41
{#key $index }
37
42
<Youtube id ={VIDEOS [$index ]} animations ={false } />
38
43
{/ key }
42
47
<!-- svelte-ignore a11y-no-static-element-interactions -->
43
48
<div
44
49
class =" thumbnail-container"
45
- on:click ={(e ) => {
46
- index . set ( VIDEOS . indexOf ( id ) )
50
+ on:click ={() => {
51
+ setSelectedVideo ( id )
47
52
}}
48
53
>
49
54
<Button class =" thumbnail-button" >
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import Youtube from ' svelte-youtube-embed'
3
2
import { onDestroy , onMount } from ' svelte'
4
3
5
- import { Button } from ' @svelteness/kit-docs'
4
+ // import { Button } from '@svelteness/kit-docs'
6
5
import { inView } from ' $lib'
7
6
import Carousel from ' ../components/VideoCarousel.svelte'
7
+ // import { fly } from 'svelte/transition'
8
+
9
+ import MaterialSymbolsClose from ' ~icons/material-symbols/close'
8
10
9
11
let sidebar: HTMLElement | null
10
12
let main: HTMLElement | null
103
105
<Carousel ></Carousel >
104
106
</div >
105
107
</div >
108
+
109
+ <!-- <div class="discord-widget-container">
110
+ <Button>
111
+ <svelte:component this={MaterialSymbolsClose} />
112
+ </Button>
113
+ <iframe
114
+ class="discord-widget"
115
+ title="Discord Widget"
116
+ src="https://discord.com/widget?id=785339959518953482&theme=dark"
117
+ width="350"
118
+ height="350"
119
+ allowtransparency="true"
120
+ frameborder="200"
121
+ sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
122
+ in:fly|global={{ y: 100, duration: 1000, delay: 1000 }}
123
+ ></iframe>
124
+ </div> -->
106
125
</div >
107
126
108
127
<style >
128
+ /* :global(.discord-widget-container) {
129
+ position: fixed;
130
+ bottom: 16px;
131
+ right: 16px;
132
+ background-color: rgb(88, 101, 242);
133
+ border-radius: 16px;
134
+ padding-top: 1rem;
135
+ }
136
+ :global(.discord-widget-container > button) {
137
+ position: absolute;
138
+ top: 0.25rem;
139
+ right: -0.5rem;
140
+ }
141
+ .discord-widget {
142
+ border-radius: 16px;
143
+ }
144
+ .discord-widget :global(.widgetBody-38iyIo) {
145
+ display: none;
146
+ } */
147
+
109
148
.section-title {
110
149
display : flex ;
111
150
flex-direction : column ;
You can’t perform that action at this time.
0 commit comments