Skip to content

Commit e728aa5

Browse files
committed
Merge branch 'main' into extension-dogeiscutObject
2 parents 8f44b6f + 7941c69 commit e728aa5

26 files changed

Lines changed: 1419 additions & 104 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ Each extension is incased in `{}` brackets. Look below on how to copy it.
223223
documentation: "page-name", // This is the page name for the documentation you created.
224224

225225
// These next ones are optional. You can choose not to include them.
226+
tags: ["new", "graphics"], // Optional. A list of tags to add to your extension. You can put anything here, but it may be adjusted later.
227+
example: "Username/extension.pmp", // Optional. An example project to show off how to use the extension.
226228
creatorAlias: "Joe", // Optional. This will not change the creator link, but change the name that links to it.
227229
notes: "Additional help by someguy", // Optional. Allows you to note anyone else who helped you or any small info.
228230
unstable: false, // Optional. Will add a warning message that your extension is unstable.

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"type": "module",
1717
"dependencies": {
18+
"localforage": "^1.10.0",
1819
"markdown-it": "^14.1.0"
1920
}
2021
}

src/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<meta name="viewport" content="width=device-width" />
2323
<style>
24-
:root {
24+
:root, button {
2525
font-family: Arial, Helvetica, sans-serif;
2626
}
2727
.sb3-comment-label {

src/lib/Checkbox/Checkbox.svelte

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<script>
2+
import { onMount } from 'svelte';
3+
import { page } from '$app/stores';
4+
5+
import IconEnabled from './icon-enabled.svg';
6+
7+
let {
8+
checked = $bindable(),
9+
onclick,
10+
onchange,
11+
oninput,
12+
} = $props();
13+
const onClick = (event) => {
14+
if (onclick) onclick(event);
15+
16+
// oninput comes first before checked change
17+
if (oninput) oninput(checked);
18+
19+
// change the checked
20+
checked = !checked;
21+
// onchange goes after
22+
if (onchange) onchange(checked);
23+
};
24+
</script>
25+
26+
<!-- TODO: Add this to svelteui -->
27+
<button
28+
class="checkbox"
29+
data-checked={checked}
30+
data-penguinmodsvelteui-checkbox="true"
31+
onclick={onClick}
32+
>
33+
{#if checked}
34+
<img src={IconEnabled} alt="" />
35+
{/if}
36+
</button>
37+
38+
<style>
39+
.checkbox {
40+
position: relative;
41+
display: block;
42+
width: 20px;
43+
height: 20px;
44+
margin: 2px 0;
45+
46+
flex-shrink: 0;
47+
48+
background: transparent;
49+
border: 1px solid rgba(0, 0, 0, 0.5);
50+
border-radius: 3px;
51+
52+
cursor: pointer;
53+
}
54+
.checkbox img {
55+
position: absolute;
56+
width: calc(20px - 4px);
57+
height: calc(20px - 4px);
58+
left: 1px;
59+
top: 1px;
60+
61+
filter: brightness(0.25);
62+
63+
pointer-events: none;
64+
}
65+
:global(body.dark-mode) .checkbox {
66+
border-color: rgba(255, 255, 255, 0.5);
67+
}
68+
:global(body.dark-mode) .checkbox img {
69+
filter: brightness(1);
70+
}
71+
72+
.checkbox[data-checked="true"] {
73+
background: dodgerblue;
74+
}
75+
.checkbox[data-checked="true"] img {
76+
filter: brightness(1);
77+
}
78+
</style>

src/lib/Checkbox/icon-enabled.svg

Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)