From 5bf33a9336a3d716bd66830aed8cc50dd2cae8ab Mon Sep 17 00:00:00 2001 From: Ron Ilan Date: Sat, 17 Aug 2024 19:04:39 -0700 Subject: [PATCH] 1.0.7 --- ...{blocklike-1.0.6.js => blocklike-1.0.7.js} | 2 +- ...n.js => blocklike-1.0.7.mascotless.min.js} | 0 ...ke-1.0.6.min.js => blocklike-1.0.7.min.js} | 0 docs/Backdrop.html | 16 +- docs/Costume.html | 22 +-- docs/Sprite.html | 138 +++++++++--------- docs/Stage.html | 72 ++++----- ...-1.0.6.js.html => blocklike-1.0.7.js.html} | 8 +- docs/index.html | 2 +- example/01-hello-world/hello-world.html | 2 +- example/02-setup/addBackdrop_addTo.html | 2 +- example/02-setup/addSprite_addTo.html | 2 +- example/02-setup/removeSprite_removeFrom.html | 2 +- example/02-setup/sprite_default_costume.html | 2 +- example/02-setup/sprite_from_image.html | 2 +- example/02-setup/sprite_implicit_costume.html | 2 +- example/02-setup/sprite_no_costume.html | 2 +- example/02-setup/stage_default_backdrop.html | 2 +- example/02-setup/stage_delete.html | 2 +- example/02-setup/stage_size.html | 2 +- example/03-events/boradcastMessage.html | 2 +- example/03-events/boradcastMessageWait.html | 2 +- example/03-events/event_named_function.html | 2 +- example/03-events/whenClicked.html | 2 +- example/03-events/whenEvent.html | 2 +- example/03-events/whenKeyPressed.html | 2 +- example/03-events/whenKeyPressed_ask.html | 2 +- example/03-events/whenLoaded.html | 2 +- example/03-events/whenReceiveMessage.html | 2 +- example/04-motion/changeX.html | 2 +- example/04-motion/changeY.html | 2 +- example/04-motion/glide.html | 2 +- example/04-motion/goTo.html | 2 +- example/04-motion/goTowards.html | 2 +- example/04-motion/move.html | 2 +- example/04-motion/pointInDirection.html | 2 +- example/04-motion/pointTowards.html | 2 +- example/04-motion/setRotationStyle.html | 2 +- example/04-motion/setX.html | 2 +- example/04-motion/setY.html | 2 +- example/04-motion/turnLeft.html | 2 +- example/04-motion/turnRight.html | 2 +- example/05-looks/backdrop.html | 2 +- example/05-looks/changeSize.html | 2 +- example/05-looks/costume_resizeToImage.html | 2 +- example/05-looks/looks_costumes.html | 2 +- example/05-looks/nextCostume.html | 2 +- example/05-looks/remove_default_costume.html | 2 +- example/05-looks/sendSpriteBackwards.html | 2 +- example/05-looks/sendSpriteForward.html | 2 +- example/05-looks/sendSpriteToBack.html | 2 +- example/05-looks/sendSpriteToFront.html | 2 +- example/05-looks/setSize.html | 2 +- example/05-looks/show_hide.html | 2 +- example/05-looks/sprite_resizeToImage.html | 2 +- example/05-looks/switchCostumeTo.html | 2 +- example/05-looks/switchCostumeToNum.html | 2 +- example/06-ui/ask_answer.html | 2 +- example/06-ui/ask_say_think.html | 2 +- example/06-ui/multi_ask.html | 2 +- example/06-ui/prompt_alert.html | 2 +- example/06-ui/sayWait.html | 2 +- example/06-ui/sayWait_thinkWait.html | 2 +- example/06-ui/say_think.html | 2 +- example/06-ui/thinkWait.html | 2 +- example/07-sensing/distanceTo.html | 2 +- example/07-sensing/distanceTo_sprite.html | 2 +- example/07-sensing/enable_stage_sensing.html | 2 +- example/07-sensing/isKeyPressed.html | 2 +- example/07-sensing/isTouching.html | 2 +- .../07-sensing/isTouchingBackdropColor.html | 2 +- example/07-sensing/isTouchingEdge.html | 2 +- example/07-sensing/mouse_down.html | 2 +- example/07-sensing/mouse_xy.html | 2 +- example/07-sensing/touching.html | 2 +- example/07-sensing/touchingBackdropColor.html | 2 +- example/07-sensing/touchingEdge.html | 2 +- example/08-sound/playSound.html | 2 +- example/08-sound/playSoundLoop.html | 2 +- example/08-sound/playSoundUntilDone.html | 2 +- example/08-sound/stopSounds.html | 2 +- example/09-pen/changePenSize.html | 2 +- example/09-pen/penClear.html | 2 +- example/09-pen/penDown.html | 2 +- example/09-pen/penUp.html | 2 +- example/09-pen/setPenColor.html | 2 +- example/09-pen/setPenSize.html | 2 +- example/10-patterns/clone.html | 2 +- example/10-patterns/event_protector.html | 2 +- example/10-patterns/forever.html | 2 +- example/10-patterns/functions.html | 2 +- example/10-patterns/invoke.html | 2 +- example/10-patterns/invoke_return.html | 2 +- example/10-patterns/nested_events.html | 2 +- example/10-patterns/nested_loops.html | 2 +- example/10-patterns/parameterized_wait.html | 2 +- example/11-css/css_backdrop_background.html | 2 +- example/11-css/css_classes.html | 2 +- example/11-css/css_clone.html | 2 +- example/11-css/css_filters.html | 2 +- example/11-css/css_fonts.html | 2 +- example/11-css/css_rules.html | 2 +- example/11-css/css_stage_background.html | 2 +- .../array_of_sprites_animation.html | 2 +- .../12-advanced/array_of_sprites_methods.html | 2 +- example/12-advanced/backdrop_bounce.html | 2 +- example/12-advanced/class_extend_input.html | 2 +- example/12-advanced/class_extend_paced.html | 2 +- example/12-advanced/class_extend_waited.html | 2 +- example/12-advanced/clone_events.html | 2 +- example/12-advanced/color_bubbles_clone.html | 2 +- .../color_bubbles_sprite_factory.html | 2 +- .../12-advanced/costume_resize_on_event.html | 2 +- .../12-advanced/costume_resize_to_image.html | 2 +- example/12-advanced/drag-and-drop.html | 2 +- example/12-advanced/homepage.html | 2 +- example/12-advanced/insert.html | 2 +- example/12-advanced/interactive_pattern.html | 2 +- example/12-advanced/invoke_sequence.html | 2 +- example/12-advanced/object_function.html | 2 +- example/12-advanced/pace.html | 2 +- example/12-advanced/prototype_function.html | 2 +- example/12-advanced/recursion_tree.html | 2 +- example/12-advanced/stage_parent.html | 2 +- example/12-advanced/stage_responsive.html | 2 +- .../12-advanced/stage_responsive_zooming.html | 2 +- example/12-advanced/stage_to_stage.html | 2 +- example/12-advanced/stage_zoom.html | 2 +- example/12-advanced/synth.html | 2 +- example/13-misc/code_comments.html | 2 +- example/13-misc/debug_mode.html | 2 +- example/13-misc/empty_loop.html | 2 +- example/13-misc/loop_protection.html | 2 +- example/14-games/avoid.html | 2 +- package-lock.json | 4 +- package.json | 2 +- 136 files changed, 258 insertions(+), 258 deletions(-) rename dist/{blocklike-1.0.6.js => blocklike-1.0.7.js} (99%) rename dist/{blocklike-1.0.6.mascotless.min.js => blocklike-1.0.7.mascotless.min.js} (100%) rename dist/{blocklike-1.0.6.min.js => blocklike-1.0.7.min.js} (100%) rename docs/{blocklike-1.0.6.js.html => blocklike-1.0.7.js.html} (99%) diff --git a/dist/blocklike-1.0.6.js b/dist/blocklike-1.0.7.js similarity index 99% rename from dist/blocklike-1.0.6.js rename to dist/blocklike-1.0.7.js index 7c8002e..fcf270e 100644 --- a/dist/blocklike-1.0.6.js +++ b/dist/blocklike-1.0.7.js @@ -4278,4 +4278,4 @@ __webpack_require__.r(__webpack_exports__); blockLike = __webpack_exports__; /******/ })() ; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tsaWtlLTEuMC42LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBeUI7O0FBRXpCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDZSx1QkFBdUIsNkNBQUk7QUFDMUM7QUFDQTtBQUNBO0FBQ0EsWUFBWSxRQUFRO0FBQ3BCLFlBQVksUUFBUTtBQUNwQixZQUFZLFFBQVE7QUFDcEI7QUFDQSwyQkFBMkI7QUFDM0I7QUFDQSxxQkFBcUI7O0FBRXJCOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFlBQVksUUFBUTtBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsWUFBWSxRQUFRO0FBQ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zLmRlZmF1bHRDU1N9XFxuXFxuIFxuICAgICR7c3R5bGVzLnVpQ1NTfVxcblxcbiBcbiAgICAke3N0eWxlcy50aGlua0NTU31cXG5cXG4gXG4gICAgJHtzdHlsZXMuc2F5Q1NTfSBcXG5cXG4gXG4gICAgJHtzdHlsZXMuYXNrQ1NTfWBcblxuICBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaGVhZCcpWzBdLmFwcGVuZENoaWxkKHN0eWxlKVxuXG4gIHBsYXRmb3JtcygpXG59KCkpXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/dist/blocklike-1.0.6.mascotless.min.js b/dist/blocklike-1.0.7.mascotless.min.js similarity index 100% rename from dist/blocklike-1.0.6.mascotless.min.js rename to dist/blocklike-1.0.7.mascotless.min.js diff --git a/dist/blocklike-1.0.6.min.js b/dist/blocklike-1.0.7.min.js similarity index 100% rename from dist/blocklike-1.0.6.min.js rename to dist/blocklike-1.0.7.min.js diff --git a/docs/Backdrop.html b/docs/Backdrop.html index 599b006..cb76f43 100644 --- a/docs/Backdrop.html +++ b/docs/Backdrop.html @@ -104,7 +104,7 @@

new Backdrop<
Source:
@@ -365,7 +365,7 @@

addClassSource:
@@ -513,7 +513,7 @@

addToSource:
@@ -663,7 +663,7 @@

cssSource:
@@ -854,7 +854,7 @@

hasClassSource:
@@ -1032,7 +1032,7 @@

removeClas
Source:
@@ -1180,7 +1180,7 @@

removeFrom<
Source:
@@ -1295,7 +1295,7 @@

Example

- Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:00:19 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:04:39 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme.
diff --git a/docs/Costume.html b/docs/Costume.html index a3857b6..4de5b7a 100644 --- a/docs/Costume.html +++ b/docs/Costume.html @@ -104,7 +104,7 @@

new CostumeSource:
@@ -416,7 +416,7 @@

addClassSource:
@@ -564,7 +564,7 @@

addToSource:
@@ -714,7 +714,7 @@

cssSource:
@@ -905,7 +905,7 @@

hasClassSource:
@@ -1078,7 +1078,7 @@

innerSource:
@@ -1224,7 +1224,7 @@

insertSource:
@@ -1373,7 +1373,7 @@

removeClas
Source:
@@ -1521,7 +1521,7 @@

removeFrom<
Source:
@@ -1667,7 +1667,7 @@

resizeTo
Source:
@@ -1730,7 +1730,7 @@

Example

- Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:00:19 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:04:39 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme.
diff --git a/docs/Sprite.html b/docs/Sprite.html index 7842ad8..383a043 100644 --- a/docs/Sprite.html +++ b/docs/Sprite.html @@ -104,7 +104,7 @@

new SpriteSource:
@@ -508,7 +508,7 @@

addClassSource:
@@ -652,7 +652,7 @@

addCostume<
Source:
@@ -799,7 +799,7 @@

addToSource:
@@ -947,7 +947,7 @@

askSource:
@@ -1106,7 +1106,7 @@

broad
Source:
@@ -1258,7 +1258,7 @@

b
Source:
@@ -1413,7 +1413,7 @@

changePe
Source:
@@ -1561,7 +1561,7 @@

changeSize<
Source:
@@ -1707,7 +1707,7 @@

changeXSource:
@@ -1855,7 +1855,7 @@

changeYSource:
@@ -2003,7 +2003,7 @@

cloneSource:
@@ -2106,7 +2106,7 @@

cssSource:
@@ -2288,7 +2288,7 @@

distanceTo<
Source:
@@ -2500,7 +2500,7 @@

glideSource:
@@ -2701,7 +2701,7 @@

goToSource:
@@ -2875,7 +2875,7 @@

goTowardsSource:
@@ -3031,7 +3031,7 @@

hasClassSource:
@@ -3204,7 +3204,7 @@

hideSource:
@@ -3298,7 +3298,7 @@

innerSource:
@@ -3446,7 +3446,7 @@

insertSource:
@@ -3598,7 +3598,7 @@

invokeSource:
@@ -3770,7 +3770,7 @@

isTouching<
Source:
@@ -3954,7 +3954,7 @@

Source:
@@ -4135,7 +4135,7 @@

isTouch
Source:
@@ -4259,7 +4259,7 @@

moveSource:
@@ -4407,7 +4407,7 @@

nextCostum
Source:
@@ -4503,7 +4503,7 @@

penClearSource:
@@ -4600,7 +4600,7 @@

penDownSource:
@@ -4697,7 +4697,7 @@

penUpSource:
@@ -4800,7 +4800,7 @@

playSoundSource:
@@ -4953,7 +4953,7 @@

playSoun
Source:
@@ -5107,7 +5107,7 @@

pla
Source:
@@ -5255,7 +5255,7 @@

point
Source:
@@ -5403,7 +5403,7 @@

pointTowa
Source:
@@ -5555,7 +5555,7 @@

refreshSource:
@@ -5643,7 +5643,7 @@

removeClas
Source:
@@ -5788,7 +5788,7 @@

removeCo
Source:
@@ -5937,7 +5937,7 @@

remov
Source:
@@ -6085,7 +6085,7 @@

removeFrom<
Source:
@@ -6180,7 +6180,7 @@

resizeTo
Source:
@@ -6278,7 +6278,7 @@

saySource:
@@ -6424,7 +6424,7 @@

sayWaitSource:
@@ -6596,7 +6596,7 @@

setPenColo
Source:
@@ -6744,7 +6744,7 @@

setPenSize<
Source:
@@ -6893,7 +6893,7 @@

setRo
Source:
@@ -7041,7 +7041,7 @@

setSizeSource:
@@ -7187,7 +7187,7 @@

setXSource:
@@ -7335,7 +7335,7 @@

setYSource:
@@ -7483,7 +7483,7 @@

showSource:
@@ -7583,7 +7583,7 @@

stopSounds<
Source:
@@ -7683,7 +7683,7 @@

switch
Source:
@@ -7831,7 +7831,7 @@

swi
Source:
@@ -7979,7 +7979,7 @@

thinkSource:
@@ -8125,7 +8125,7 @@

thinkWaitSource:
@@ -8301,7 +8301,7 @@

touchingSource:
@@ -8485,7 +8485,7 @@

Source:
@@ -8614,7 +8614,7 @@

touchingE
Source:
@@ -8738,7 +8738,7 @@

turnLeftSource:
@@ -8886,7 +8886,7 @@

turnRightSource:
@@ -9039,7 +9039,7 @@

waitSource:
@@ -9190,7 +9190,7 @@

whenClicke
Source:
@@ -9340,7 +9340,7 @@

whenCloned<
Source:
@@ -9499,7 +9499,7 @@

whenEventSource:
@@ -9679,7 +9679,7 @@

whenFlagSource:
@@ -9833,7 +9833,7 @@

whenKey
Source:
@@ -10013,7 +10013,7 @@

whenLoaded<
Source:
@@ -10167,7 +10167,7 @@

whe
Source:
@@ -10310,7 +10310,7 @@

Example

- Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:00:19 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:04:39 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme.
diff --git a/docs/Stage.html b/docs/Stage.html index d63b2eb..9bc7eab 100644 --- a/docs/Stage.html +++ b/docs/Stage.html @@ -103,7 +103,7 @@

new StageSource:
@@ -465,7 +465,7 @@

addBackdro
Source:
@@ -615,7 +615,7 @@

addClassSource:
@@ -759,7 +759,7 @@

addSpriteSource:
@@ -909,7 +909,7 @@

broad
Source:
@@ -1061,7 +1061,7 @@

b
Source:
@@ -1221,7 +1221,7 @@

cssSource:
@@ -1403,7 +1403,7 @@

deleteSource:
@@ -1500,7 +1500,7 @@

hasClassSource:
@@ -1679,7 +1679,7 @@

invokeSource:
@@ -1851,7 +1851,7 @@

isKeyPres
Source:
@@ -2023,7 +2023,7 @@

nextBackd
Source:
@@ -2122,7 +2122,7 @@

playSoundSource:
@@ -2275,7 +2275,7 @@

playSoun
Source:
@@ -2429,7 +2429,7 @@

pla
Source:
@@ -2578,7 +2578,7 @@

refreshSource:
@@ -2661,7 +2661,7 @@

removeB
Source:
@@ -2808,7 +2808,7 @@

remo
Source:
@@ -2959,7 +2959,7 @@

removeClas
Source:
@@ -3104,7 +3104,7 @@

removeSpr
Source:
@@ -3250,7 +3250,7 @@

se
Source:
@@ -3398,7 +3398,7 @@

send
Source:
@@ -3546,7 +3546,7 @@

sendS
Source:
@@ -3694,7 +3694,7 @@

send
Source:
@@ -3847,7 +3847,7 @@

stopSounds<
Source:
@@ -3947,7 +3947,7 @@

switc
Source:
@@ -4093,7 +4093,7 @@

sw
Source:
@@ -4244,7 +4244,7 @@

waitSource:
@@ -4395,7 +4395,7 @@

whenClicke
Source:
@@ -4549,7 +4549,7 @@

whenEventSource:
@@ -4729,7 +4729,7 @@

whenFlagSource:
@@ -4883,7 +4883,7 @@

whenKey
Source:
@@ -5063,7 +5063,7 @@

whenLoaded<
Source:
@@ -5217,7 +5217,7 @@

whe
Source:
@@ -5391,7 +5391,7 @@

zoomSource:
@@ -5504,7 +5504,7 @@
Example

- Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:00:19 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:04:39 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme.
diff --git a/docs/blocklike-1.0.6.js.html b/docs/blocklike-1.0.7.js.html similarity index 99% rename from docs/blocklike-1.0.6.js.html rename to docs/blocklike-1.0.7.js.html index 4fc9fb4..472118e 100644 --- a/docs/blocklike-1.0.6.js.html +++ b/docs/blocklike-1.0.7.js.html @@ -3,7 +3,7 @@ - blocklike-1.0.6.js - Documentation + blocklike-1.0.7.js - Documentation @@ -29,7 +29,7 @@
-

blocklike-1.0.6.js

+

blocklike-1.0.7.js

@@ -4319,7 +4319,7 @@

blocklike-1.0.6.js

blockLike = __webpack_exports__; /******/ })() ; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tsaWtlLTEuMC42LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBeUI7O0FBRXpCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDZSx1QkFBdUIsNkNBQUk7QUFDMUM7QUFDQTtBQUNBO0FBQ0EsWUFBWSxR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tbGluZSBuby11bnVzZWQtdmFyc1xuaW1wb3J0IENvc3R1bWUgZnJvbSAnLi9jb3N0dW1lJyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG5cbmV4cG9ydCB7IFN0YWdlIH1cbmV4cG9ydCB7IEJhY2tkcm9wIH1cbmV4cG9ydCB7IFNwcml0ZSB9XG5leHBvcnQgeyBDb3N0dW1lIH07XG5cbihmdW5jdGlvbiBpbml0ICgpIHtcbiAgY29uc3Qgc3R5bGUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzdHlsZScpXG5cbiAgc3R5bGUudHlwZSA9ICd0ZXh0L2NzcydcbiAgc3R5bGUuaW5uZXJIVE1MID0gYFxuICAgICR7c3R5bGVzLmRlZmF1bHRDU1N9XFxuXFxuIFxuICAgICR7c3R5bGVzLnVpQ1NTfVxcblxcbiBcbiAgICAke3N0eWxlcy50aGlua0NTU31cXG5cXG4gXG4gICAgJHtzdHlsZXMuc2F5Q1NTfSBcXG5cXG4gXG4gICAgJHtzdHlsZXMuYXNrQ1NTfWBcblxuICBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaGVhZCcpWzBdLmFwcGVuZENoaWxkKHN0eWxlKVxuXG4gIHBsYXRmb3JtcygpXG59KCkpXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= @@ -4331,7 +4331,7 @@

blocklike-1.0.6.js


- Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:00:18 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:04:39 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme.
diff --git a/docs/index.html b/docs/index.html index d0d870d..fa19f06 100644 --- a/docs/index.html +++ b/docs/index.html @@ -77,7 +77,7 @@

Source code


- Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:00:19 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Sat Aug 17 2024 19:04:39 GMT-0700 (Pacific Daylight Saving Time) using the Minami theme.
diff --git a/example/01-hello-world/hello-world.html b/example/01-hello-world/hello-world.html index 21a3f4b..4162e4d 100644 --- a/example/01-hello-world/hello-world.html +++ b/example/01-hello-world/hello-world.html @@ -7,7 +7,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +