Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4aefe41
create 'htmldocuments.js'
ScrTwPm Aug 22, 2026
4764423
Add new directory for images
ScrTwPm Aug 22, 2026
4797e08
Delete static/images/s
ScrTwPm Aug 22, 2026
0703807
Create ds
ScrTwPm Aug 22, 2026
9c28ffc
Add files via upload
ScrTwPm Aug 22, 2026
cb0fd0e
Delete static/images/ScrTwPm/ds
ScrTwPm Aug 22, 2026
15346e3
Add HTML Documents extension with details
ScrTwPm Aug 22, 2026
357697a
edits for suggestions
ScrTwPm Aug 22, 2026
2eff3ae
Format if statements for consistency
ScrTwPm Aug 22, 2026
d7db603
Refactor HTMLtoCanvas to use Map for pages
ScrTwPm Aug 25, 2026
e9b09b1
removed access to add script tags in text
ScrTwPm Aug 25, 2026
79425e8
converted to DOM
ScrTwPm Aug 26, 2026
0089c67
Refactor HTMLDocuments class to remove 'ids' property
ScrTwPm Aug 26, 2026
f0c6b26
fixed all pages
ScrTwPm Aug 26, 2026
95be974
prettier!
ScrTwPm Aug 26, 2026
14cdadd
fixed class setting
ScrTwPm Aug 26, 2026
d458f2a
big bug fix
ScrTwPm Aug 27, 2026
70d0d85
ok maybe this is the last fix
ScrTwPm Aug 27, 2026
b32cb82
more options for types
ScrTwPm Aug 27, 2026
3d95283
got rid on 67 console logs
ScrTwPm Aug 27, 2026
45b732b
added what u did
ScrTwPm Aug 27, 2026
f75c800
fixed all!
ScrTwPm Aug 27, 2026
8828cd1
added menu icon uri
ScrTwPm Aug 27, 2026
46508db
changed menu icon uri
ScrTwPm Aug 27, 2026
0b4c5dd
Refactor event listener to use startHats method
ScrTwPm Aug 27, 2026
987dab1
added hr or br element with no id
ScrTwPm Aug 28, 2026
eb348fd
Added dynamic content change
ScrTwPm Aug 30, 2026
8367e28
changed some names
ScrTwPm Aug 30, 2026
c6bf4b2
changed the get html
ScrTwPm Aug 30, 2026
0ec15f2
capitalized the D in documents
ScrTwPm Aug 31, 2026
170edc7
fixed bugs
ScrTwPm Aug 31, 2026
2d70b13
Change color1 from '#ff9900' to '#e34f26'
ScrTwPm Aug 31, 2026
677ef81
color
ScrTwPm Aug 31, 2026
5df1728
new style css
ScrTwPm Aug 31, 2026
8b16854
fixed phew
ScrTwPm Aug 31, 2026
caa8fef
bugs-be-gone
ScrTwPm Aug 31, 2026
c854055
added listener block
ScrTwPm Aug 31, 2026
3256df5
try catch
ScrTwPm Aug 31, 2026
b8f142f
Add HTML Documents documentation
ScrTwPm Aug 31, 2026
2b85b9a
Add HTMLDocuments to documentation export
ScrTwPm Aug 31, 2026
765c278
Add documentation field to HTMLDocuments entry
ScrTwPm Aug 31, 2026
a7c4483
Enhance HTML Documents documentation
ScrTwPm Aug 31, 2026
349452f
Fix typo in remove event listener block
ScrTwPm Aug 31, 2026
f122340
Merge branch 'main' into main
ScrTwPm Sep 1, 2026
453b87f
serializer
ScrTwPm Sep 5, 2026
98b4d34
Merge branch 'main' into main
ScrTwPm Sep 5, 2026
9b3c5d5
fixed
ScrTwPm Sep 8, 2026
a905636
Refactor HTMLDocuments class and add duplicatePage method
ScrTwPm Sep 9, 2026
dbbd9ff
Refactor createPage to use Map.has for page check
ScrTwPm Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions src/lib/Documentation/HtmlDocuments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
# HTML Documents
Create HTML webpages and display them on the stage!

## Blocks

```scratch
create new page named [my-page] :: #e34f26
```

Create a new blank page
(Clicking this after you have already made a page with that name will clear all content and reset all display settings)

---

```scratch
clear content of [my-page] :: #e34f26
```

Clear HTML content of the page, but keep display settings

---

```scratch
all pages :: #e34f26 reporter
```

Returns an array of all created pages

---

```scratch
[my-page] html [code v] :: #e34f26 reporter
```

Based on the dropdown:
* **code:** Returns the html code of the page
* **preview:** Returns a visual preview of the page
Both options return the same value, just in different visual forms

---

```scratch
display page [my-page] :: #e34f26
```

Display the page on the stage

---

```scratch
hide page [my-page] :: #e34f26
```

Hide the page

---

```scratch
hide all pages :: #e34f26
```

Hide all pages

---

```scratch
current pages displayed:: #e34f26 reporter
```

Returns an array of all pages currently displayed on the stage

---

```scratch
add [div v] if [new-el] to [my-page] {
}:: #e34f26
```

Add an element to the page. These elements can have children, like ```div``` and ```h1```

---

```scratch
add [input v] if [new-el] to [my-page]:: #e34f26
```

Add a self-closing element to the page. These elements cannot have children, like ```input``` and ```img```

---

```scratch
add [hr v] to [my-page]:: #e34f26
```

Add a self-closing unidentified element to the page. Only ```hr``` and ```br``` elements can be unidentified. iF an element is unidentified it cannot be removed, styled, or accessed alone.

---

```scratch
remove element with id [new-el] from [my-page]:: #e34f26
```

Remove an element from the page. If it has children, they will be removed, too.

---

```scratch
set [class v] of [new-el] to [new-class] in [my-page]:: #e34f26
```

Set an attribute for an element

---

```scratch
change [new-el] in [my-page] to {
}:: #e34f26
```

Change the inner HTML, or content, of an element. Not used for self-closing elements.

---

```scratch
set (color v) for [id v] [new-el] to [red] in [my-page]:: #2965f1
```

Set a CSS property

---

```scratch
get (color v) for [id v] [new-el] in [my-page]:: #2965f1 reporter
```

Get the defined property of an element

---

```scratch
clear styling for [id v] [new-el] in [my-page]:: #2965f1
```

Clear the styling for a certain selector

---

```scratch
clear styling of [my-page]:: #2965f1
```

Clear all styling in the page

---

```scratch
when listener for [new-el] activated in [my-page]:: #e34f26 hat
```

Hat is started when the event listener is triggered

---

```scratch
add event listener [click v] for [new-el] n [my-page]:: #e34f26
```

Add an event listener for an element. Use this after the element has been added.

---

```scratch
remove event listener from [new-el] in [my-page]:: #e34f26
```

Remove the event listener from the element

---

```scratch
listener of [new-el] in [my-page]:: #e34f26 reporter
```

Returns the current listener attached to the element

---

```scratch
all elements in [my-page]:: #e34f26 reporter
```

Returns an array of all elements in the page

---

```scratch
[inner HTML v] in [my-page]:: #e34f26 reporter
```

Returns a value based on the dropdown:
* **inner HTML:** The html contnt inside of the element
* **text content:** The text content inside of the element
* **children:** An array of all elements inside of the element
* **parent element:** The element's parent
* **tag name:** The element's tag name
* **value:** The value of the element, if an input
* **checked:** The status of an element, if a checkbox input
* **class list:** The classes of an element
* **offset width:** Thw width of an element when displayed
* **offset height:** Thw height of an element when displayed
* **scroll width:** Thw scroll width of an element when displayed
* **scroll height:** Thw scroll height of an element when displayed
* **disabled:** If the inout is disabled

---

```scratch
move [my-page] to x: [50] y: [50]:: #e34f26
```

Move the page to a different location on the stage

---

```scratch
resize [my-page] to x: [50] y: [50]:: #e34f26
```

Resize the page

---

```scratch
set [my-page] display settings to stage size :: #e34f26
```

Automatically set the display settings to fit the stage size

---

```scratch
[x position v] of [my-page] :: #e34f26 reporter
```

Returns the page display settings. Based on the dropdown:
* **x position:** The x position of the page
* **y position:** The y position of the page
* **width:** The width of the page
* **height:** The height of the page

---

```scratch
[width v] of the stage:: #e34f26 reporter
```

Get the width or height of the stage in pixels

6 changes: 6 additions & 0 deletions src/lib/Documentation/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import ProjectInterfaces from "./ProjectInterfaces.md?raw";
// Date Format V2
import DateFormatV2 from "./DateFormatV2.md?raw";

// HTML Documents
import HTMLDocuments from "./HtmlDocuments.md?raw";
// ODE
import ODE from "./ODE.md?raw";

Expand Down Expand Up @@ -84,6 +86,10 @@ export default {
// Project Interfaces
"ProjectInterfaces": ProjectInterfaces,

"DateFormatV2": DateFormatV2

// HTML Documents
"HTMLDocuments": HTMLDocuments,
"DateFormatV2": DateFormatV2,

// ODE
Expand Down
9 changes: 9 additions & 0 deletions src/lib/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,15 @@ export default [
banner: "NamelessCat/corsproxy.avif",
creator: "NamelessCat",
},
{
name: "HTML Documents",
description: "Create HTML webpages and display them on the stage.",
code: "ScrTwPm/htmldocuments.js",
banner: "ScrTwPm/htmldocs.png",
creator: "ScrTwPm",
documentation: "HTMLDocuments",
isGitHub: true,
},
{
name: "Translation Keys",
description: "Use translation keys in your projects for multi-language support",
Expand Down
Loading