Skip to content

Commit e19640e

Browse files
committed
build: code split for demo code
1 parent bc62ed5 commit e19640e

File tree

3 files changed

+105
-109
lines changed

3 files changed

+105
-109
lines changed

packages/core/demo/index.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@font-face {
2+
font-family: 'Whitney';
3+
src: url('https://cdn.skyra.pw/whitney-font/v2/Book.woff') format('woff');
4+
font-weight: 400;
5+
}
6+
7+
@font-face {
8+
font-family: 'Whitney';
9+
src: url('https://cdn.skyra.pw/whitney-font/v2/Medium.woff') format('woff');
10+
font-weight: 500;
11+
}
12+
13+
@font-face {
14+
font-family: 'Whitney';
15+
src: url('https://cdn.skyra.pw/whitney-font/v2/Semibold.woff') format('woff');
16+
font-weight: 600;
17+
}
18+
19+
@font-face {
20+
font-family: 'Whitney';
21+
src: url('https://cdn.skyra.pw/whitney-font/v2/Bold.woff') format('woff');
22+
font-weight: 700;
23+
}
24+
25+
body {
26+
color: #eee;
27+
background-color: #2a2a2a;
28+
font-family: Arial, Helvetica, sans-serif;
29+
}
30+
31+
.logo {
32+
display: inline-block;
33+
font-weight: bold;
34+
font-size: 2em;
35+
margin: 0;
36+
}
37+
38+
.title {
39+
border-bottom: 1px solid #4a4a4a;
40+
padding-bottom: 0.25em;
41+
}

packages/core/demo/index.html

Lines changed: 16 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -3,100 +3,10 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
6-
<title>Discord Components Core</title>
7-
<style>
8-
@font-face {
9-
font-family: 'Whitney';
10-
src: url('https://cdn.skyra.pw/whitney-font/v2/Book.woff') format('woff');
11-
font-weight: 400;
12-
}
13-
14-
@font-face {
15-
font-family: 'Whitney';
16-
src: url('https://cdn.skyra.pw/whitney-font/v2/Medium.woff') format('woff');
17-
font-weight: 500;
18-
}
19-
20-
@font-face {
21-
font-family: 'Whitney';
22-
src: url('https://cdn.skyra.pw/whitney-font/v2/Semibold.woff') format('woff');
23-
font-weight: 600;
24-
}
25-
26-
@font-face {
27-
font-family: 'Whitney';
28-
src: url('https://cdn.skyra.pw/whitney-font/v2/Bold.woff') format('woff');
29-
font-weight: 700;
30-
}
31-
32-
body {
33-
color: #eee;
34-
background-color: #2a2a2a;
35-
font-family: Arial, Helvetica, sans-serif;
36-
}
37-
38-
.logo {
39-
display: inline-block;
40-
font-weight: bold;
41-
font-size: 2em;
42-
margin: 0;
43-
}
44-
45-
.title {
46-
border-bottom: 1px solid #4a4a4a;
47-
padding-bottom: 0.25em;
48-
}
49-
</style>
50-
<script>
51-
window.$discordMessage = {
52-
profiles: {
53-
maximillian: {
54-
author: 'Maximillian Osborn',
55-
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/avaone.png',
56-
roleColor: '#f9d61b'
57-
},
58-
willard: {
59-
author: 'Willard Walton',
60-
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/avatwo.png',
61-
roleColor: '#ffb12f'
62-
},
63-
skyra: {
64-
author: 'Skyra',
65-
avatar: 'https://github.com/NM-EEA-Y.png',
66-
roleColor: '#1e88e5',
67-
bot: true,
68-
verified: true
69-
},
70-
favna: {
71-
author: 'Favna',
72-
avatar: 'https://github.com/favna.png',
73-
roleColor: '#a155ab',
74-
roleIcon: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/booster.png',
75-
roleName: 'Booster'
76-
},
77-
discordjs: {
78-
author: 'Discord.js Official #announcements',
79-
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/discordjs.png',
80-
roleColor: '#ffffff',
81-
server: true
82-
}
83-
},
84-
emojis: {
85-
diamond: {
86-
name: 'diamond',
87-
url: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/diamond.png'
88-
},
89-
dragonite: {
90-
name: 'dragonite',
91-
url: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/dragonite.png'
92-
},
93-
sapphire: {
94-
name: 'sapphire',
95-
url: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/sapphire.png'
96-
}
97-
}
98-
};
99-
</script>
6+
<meta name="description" content="Sample for Discord Components using no particular framework" />
7+
<title>No Framework Sample</title>
8+
<link rel="stylesheet" href="./index.css" />
9+
<script src="./index.js"></script>
10010
<script async type="module">
10111
import '../src/index.ts';
10212
</script>
@@ -265,10 +175,7 @@ <h3 class="title">Custom Discord Emojis</h3>
265175
name="blobparty"
266176
url="https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/blobparty.gif"
267177
></discord-custom-emoji>
268-
<discord-custom-emoji
269-
name="skyra"
270-
url="https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/skyra.png"
271-
></discord-custom-emoji>
178+
<discord-custom-emoji name="skyra" url="https://github.com/NM-EEA-Y.png"></discord-custom-emoji>
272179
<discord-embed slot="embeds" color="#0F52BA" embed-title="diamond Emojis in the embed title">
273180
<discord-embed-description slot="description">
274181
Custom emojis in the embed description:
@@ -299,15 +206,15 @@ <h3 class="title">Server Invites</h3>
299206
url="https://discord.gg/djs"
300207
online="16417"
301208
members="87147"
302-
verified="true"
209+
verified
303210
></discord-invite>
304211
<discord-invite
305212
name="The Coding Den"
306213
icon="https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/tcd.png"
307214
url="https://discord.gg/code"
308215
online="18456"
309216
members="73548"
310-
partnered="true"
217+
partnered
311218
></discord-invite>
312219
<discord-invite
313220
name="Skyra Lounge"
@@ -321,7 +228,7 @@ <h3 class="title">Server Invites</h3>
321228
</discord-messages>
322229
<h3 class="title">Image Attachments with small images</h3>
323230
<discord-messages>
324-
<discord-message profile="Alyx Vargas">
231+
<discord-message>
325232
That's a very small logo image!
326233
<discord-image-attachment
327234
slot="attachments"
@@ -462,7 +369,7 @@ <h3 class="title">Reactions</h3>
462369
reacted
463370
></discord-reaction>
464371
<discord-reaction
465-
interactive="true"
372+
interactive
466373
name="dragonite"
467374
emoji="https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/dragonite.png"
468375
count="10"
@@ -583,7 +490,7 @@ <h3 class="title">Full embed example</h3>
583490
</discord-embed-description>
584491
<discord-embed-fields slot="fields">
585492
<discord-embed-field field-title="Created"><discord-time>1 year ago</discord-time></discord-embed-field>
586-
<discord-embed-field field-title="Installation"> yarn add @sapphire/framework </discord-embed-field>
493+
<discord-embed-field field-title="Installation"> yarn add &#64;sapphire/framework </discord-embed-field>
587494
<discord-embed-field field-title="Key Features">
588495
<ul style="padding-inline-start: 20px; margin-block-start: 0.5em">
589496
<li>
@@ -656,13 +563,13 @@ <h3 class="title">Embedded video</h3>
656563
<discord-message profile="skyra">
657564
<discord-embed
658565
slot="embeds"
659-
provider="Blender"
660-
author-name="Blender"
661-
author-url="https://peach.blender.org/download/"
566+
provider="MDN"
567+
author-name="MDN"
568+
author-url="https://developer.mozilla.org/en-US/"
662569
color="#019DD8"
663-
embed-title="Big Buck Bunny"
664-
video="https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg"
665-
url="https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg"
570+
embed-title="Flower blooming"
571+
video="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
572+
url="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
666573
>
667574
</discord-embed>
668575
</discord-message>

packages/core/demo/index.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
window.$discordMessage = {
2+
profiles: {
3+
maximillian: {
4+
author: 'Maximillian Osborn',
5+
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/avaone.png',
6+
roleColor: '#f9d61b'
7+
},
8+
willard: {
9+
author: 'Willard Walton',
10+
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/avatwo.png',
11+
roleColor: '#ffb12f'
12+
},
13+
skyra: {
14+
author: 'Skyra',
15+
avatar: 'https://github.com/NM-EEA-Y.png',
16+
roleColor: '#1e88e5',
17+
bot: true,
18+
verified: true
19+
},
20+
favna: {
21+
author: 'Favna',
22+
avatar: 'https://github.com/favna.png',
23+
roleColor: '#a155ab',
24+
roleIcon: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/booster.png',
25+
roleName: 'Booster'
26+
},
27+
discordjs: {
28+
author: 'Discord.js Official #announcements',
29+
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/discordjs.png',
30+
roleColor: '#ffffff',
31+
server: true
32+
}
33+
},
34+
emojis: {
35+
diamond: {
36+
name: 'diamond',
37+
url: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/diamond.png'
38+
},
39+
dragonite: {
40+
name: 'dragonite',
41+
url: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/dragonite.png'
42+
},
43+
sapphire: {
44+
name: 'sapphire',
45+
url: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/sapphire.png'
46+
}
47+
}
48+
};

0 commit comments

Comments
 (0)