Skip to content

Commit c82c457

Browse files
committed
🚧 Welcome page
1 parent df55e43 commit c82c457

File tree

5 files changed

+123
-22
lines changed

5 files changed

+123
-22
lines changed

src/components/installedPopup.svelte

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<script lang="ts" context="module">
2+
import AnimatedJavaIcon from '../assets/animated_java_icon.svg'
3+
</script>
4+
5+
<div class="content-container">
6+
<div class="header-container">
7+
<!-- svelte-ignore a11y-missing-attribute -->
8+
<img src={AnimatedJavaIcon} />
9+
<div>
10+
<h1>Welcome to Animated Java!</h1>
11+
<h3>
12+
A Blockbench plugin that makes complex animation a breeze in Minecraft: Java
13+
Edition.
14+
</h3>
15+
</div>
16+
</div>
17+
<div class="another-container">
18+
<h2>Not Sure Where to Start?</h2>
19+
<p>
20+
Check out our <a href="https://animated-java.dev/docs/getting-started"
21+
>getting started</a
22+
> page to learn how to use Animated Java.
23+
</p>
24+
<p>
25+
You can open our docs at any time via the Animated Java menu at the top of the screen.
26+
</p>
27+
<h2>Need more help?</h2>
28+
<p>
29+
Feel free to join our <a href="https://animated-java.dev/discord">Discord server</a> to ask
30+
questions via our support channel.
31+
</p>
32+
</div>
33+
</div>
34+
35+
<style>
36+
.another-container {
37+
display: flex;
38+
align-items: flex-start;
39+
flex-direction: column;
40+
padding: 0 10%;
41+
}
42+
43+
.content-container {
44+
display: flex;
45+
flex-direction: column;
46+
align-items: center;
47+
}
48+
49+
p {
50+
text-align: left;
51+
}
52+
53+
h2 {
54+
text-align: center;
55+
margin-top: 2rem;
56+
/* color: var(--color-subtle_text); */
57+
font-weight: 500;
58+
border-bottom: 1px solid var(--color-accent);
59+
margin-bottom: 1rem;
60+
}
61+
62+
.header-container {
63+
display: flex;
64+
align-items: center;
65+
margin-top: 1rem;
66+
justify-content: center;
67+
}
68+
.header-container div {
69+
display: flex;
70+
flex-direction: column;
71+
justify-content: center;
72+
margin-left: 2rem;
73+
}
74+
.header-container img {
75+
width: 128px;
76+
border-radius: 16px;
77+
box-shadow: 4px 4px 8px -4px black;
78+
}
79+
.header-container h1 {
80+
margin: 0px;
81+
border-bottom: 1px solid var(--color-accent);
82+
margin-bottom: 4px;
83+
}
84+
.header-container h3 {
85+
margin: 0px;
86+
color: var(--color-subtle_text);
87+
font-size: medium;
88+
max-width: 23rem;
89+
}
90+
</style>

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ import { VanillaBlockDisplay, debugBlockState, debugBlocks } from './outliner/va
8484
import { BLOCKSTATE_REGISTRY } from './systems/minecraft/blockstateManager'
8585
import { exportProject } from './systems/exporter'
8686
import { openBlueprintLoadingDialog } from './interface/blueprintLoadingPopup'
87+
import { openInstallPopup } from './interface/installedPopup'
8788

8889
// Show loading popup
8990
void showLoadingPopup().then(async () => {
@@ -139,6 +140,7 @@ globalThis.AnimatedJava = {
139140
BLOCKSTATE_REGISTRY,
140141
exportProject,
141142
openBlueprintLoadingDialog,
143+
openInstallPopup,
142144
},
143145
}
144146

@@ -160,12 +162,15 @@ BBPlugin.register(PACKAGE.name, {
160162
await_loading: true,
161163
onload() {
162164
events.LOAD.dispatch()
165+
// FIXME - Remove this
166+
openInstallPopup()
163167
},
164168
onunload() {
165169
events.UNLOAD.dispatch()
166170
},
167171
oninstall() {
168172
events.INSTALL.dispatch()
173+
openInstallPopup()
169174
},
170175
onuninstall() {
171176
events.UNINSTALL.dispatch()

src/interface/animatedJavaBarItem.ts

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,16 @@ export const MENU = createBarMenu(
3030
[],
3131
() => Format === BLUEPRINT_FORMAT
3232
) as BarMenu & { label: HTMLDivElement }
33-
MENU.label.style.display = 'none'
33+
MENU.label.style.display = 'inline-block'
3434
MENU.label.innerHTML = 'Animated Java'
3535
MENU.label.prepend(createIconImg())
3636
BLOCKBENCH_MENU_BAR.appendChild(MENU.label)
3737

38-
events.SELECT_PROJECT.subscribe(project => {
39-
MENU.label.style.display = project.format === BLUEPRINT_FORMAT ? 'inline-block' : 'none'
40-
})
41-
events.UNSELECT_AJ_PROJECT.subscribe(() => {
42-
MENU.label.style.display = 'none'
43-
})
44-
4538
MenuBar.addAction(
4639
createAction(`${PACKAGE.name}:about`, {
4740
icon: 'info',
4841
category: 'animated_java',
4942
name: translate('action.open_about.name'),
50-
condition() {
51-
return Format === BLUEPRINT_FORMAT
52-
},
5343
click() {
5444
openAboutDialog()
5545
},
@@ -58,30 +48,27 @@ MenuBar.addAction(
5848
)
5949

6050
MenuBar.addAction(
61-
createAction(`${PACKAGE.name}:blueprint_settings`, {
62-
icon: 'settings',
51+
createAction(`${PACKAGE.name}:documentation`, {
52+
icon: 'find_in_page',
6353
category: 'animated_java',
64-
name: translate('action.open_blueprint_settings.name'),
65-
condition() {
66-
return Format === BLUEPRINT_FORMAT
67-
},
54+
name: translate('action.open_documentation.name'),
6855
click() {
69-
openBlueprintSettingsDialog()
56+
Blockbench.openLink('https://animated-java.dev/docs')
7057
},
7158
}),
7259
MENU.id
7360
)
7461

7562
MenuBar.addAction(
76-
createAction(`${PACKAGE.name}:documentation`, {
77-
icon: 'find_in_page',
63+
createAction(`${PACKAGE.name}:blueprint_settings`, {
64+
icon: 'settings',
7865
category: 'animated_java',
79-
name: translate('action.open_documentation.name'),
66+
name: translate('action.open_blueprint_settings.name'),
8067
condition() {
8168
return Format === BLUEPRINT_FORMAT
8269
},
8370
click() {
84-
Blockbench.openLink('https://animated-java.dev/docs')
71+
openBlueprintSettingsDialog()
8572
},
8673
}),
8774
MENU.id

src/interface/installedPopup.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import InstalledPopup from '../components/installedPopup.svelte'
2+
import { PACKAGE } from '../constants'
3+
import { SvelteDialog } from '../util/svelteDialog'
4+
import { translate } from '../util/translation'
5+
6+
export function openInstallPopup() {
7+
new SvelteDialog({
8+
id: `${PACKAGE.name}:installedPopup`,
9+
title: translate('dialog.installed_popup.title'),
10+
width: 700,
11+
component: InstalledPopup,
12+
props: {},
13+
preventKeybinds: true,
14+
buttons: [translate('dialog.installed_popup.close_button')],
15+
}).show()
16+
}

src/lang/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ animated_java.popup.loading.offline: |-
1919
Animated Java Failed to Connect!
2020
Some features may be unavailable.
2121
22+
animated_java.dialog.installed_popup.title: Thank you for installing!
23+
animated_java.dialog.installed_popup.close_button: Let's Get Animating!
24+
2225
### Dialogs
2326

2427
## About

0 commit comments

Comments
 (0)