nanosplash 3.1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.github/workflows/ci.yml +56 -49
  2. package/.github/workflows/vitepress.yml +52 -52
  3. package/README.md +22 -2
  4. package/dist/cjs/ns.cjs +1 -1
  5. package/dist/es/ns.js +40 -40
  6. package/dist/iife/ns.iife.js +1 -1
  7. package/docs/.vitepress/{config.mts → config.ts} +3 -0
  8. package/docs/.vitepress/theme/vue/PlayGround.vue +0 -2
  9. package/docs/api/start/customize.md +1 -1
  10. package/docs/api/start/install.md +9 -5
  11. package/docs/api/start/playground.md +6 -1
  12. package/package.json +12 -13
  13. package/src/ts/Nanosplash.ts +59 -59
  14. package/src/ts/main.ts +1 -1
  15. package/tests/Nanosplash.spec.ts +7 -5
  16. package/bun.lockb +0 -0
  17. package/docs/.vitepress/.temp/@localSearchIndexroot.Ba2B1gNE.js +0 -4
  18. package/docs/.vitepress/.temp/Card.Ce4dbGEn.js +0 -30
  19. package/docs/.vitepress/.temp/VPLocalSearchBox.DV6bivXX.js +0 -382
  20. package/docs/.vitepress/.temp/api_doc_hide.md.js +0 -25
  21. package/docs/.vitepress/.temp/api_doc_show.md.js +0 -25
  22. package/docs/.vitepress/.temp/api_start_customize.md.js +0 -42
  23. package/docs/.vitepress/.temp/api_start_features.md.js +0 -19
  24. package/docs/.vitepress/.temp/api_start_install.md.js +0 -35
  25. package/docs/.vitepress/.temp/api_start_playground.md.js +0 -213
  26. package/docs/.vitepress/.temp/api_start_usage.md.js +0 -36
  27. package/docs/.vitepress/.temp/app.js +0 -5090
  28. package/docs/.vitepress/.temp/assets/style.lcyfX_uc.css +0 -5374
  29. package/docs/.vitepress/.temp/index.md.js +0 -19
  30. package/docs/.vitepress/.temp/macos.jpg +0 -0
  31. package/docs/.vitepress/.temp/package.json +0 -1
  32. package/docs/.vitepress/.temp/plugin-vue_export-helper.1tPrXgE0.js +0 -10
  33. package/docs/.vitepress/theme/vue/Exe.vue +0 -117
@@ -1,19 +0,0 @@
1
- import { ssrRenderAttrs } from "vue/server-renderer";
2
- import { useSSRContext } from "vue";
3
- import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js";
4
- const __pageData = JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"Nanosplash","text":"","tagline":"The tiny loading screen for web artisans","actions":[{"theme":"brand","text":"Get started","link":"/api/start/install.md"},{"theme":"alt","text":"Playground","link":"/api/start/playground.md"},{"theme":"alt","text":"API Documentation","link":"/api/doc/show.md"}]},"features":[{"title":"✨ Tiny","details":"Less than 2KB minified and gzipped.","link":"/api/start/features#small-bundle-size"},{"title":"✌️ 2 Function API","details":"Start using Nanosplash in seconds.","link":"/api/start/features#simple-api"},{"title":"🪴 Spawning","details":"Spawn a splash element anywhere in your DOM.","link":"/api/start/features#spawning"},{"title":"🚀 Node recycling","details":"Nanosplash will recycle existing elements.","link":"/api/start/features#element-recycling"}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}');
5
- const _sfc_main = { name: "index.md" };
6
- function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7
- _push(`<div${ssrRenderAttrs(_attrs)}></div>`);
8
- }
9
- const _sfc_setup = _sfc_main.setup;
10
- _sfc_main.setup = (props, ctx) => {
11
- const ssrContext = useSSRContext();
12
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("index.md");
13
- return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
14
- };
15
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
16
- export {
17
- __pageData,
18
- index as default
19
- };
Binary file
@@ -1 +0,0 @@
1
- { "private": true, "type": "module" }
@@ -1,10 +0,0 @@
1
- const _export_sfc = (sfc, props) => {
2
- const target = sfc.__vccOpts || sfc;
3
- for (const [key, val] of props) {
4
- target[key] = val;
5
- }
6
- return target;
7
- };
8
- export {
9
- _export_sfc as _
10
- };
@@ -1,117 +0,0 @@
1
- <script setup>
2
- import { ref } from 'vue'
3
- import { useNs } from '../../../../dist/es/ns.js'
4
- const ns = useNs()
5
-
6
- const Commands = {
7
- ShowInsideA: 'ns.show("Loading A", "#a")',
8
- ShowInsideB: 'ns.show("Loading B", "#b")',
9
- ShowInsideC: 'ns.show("Loading C", "#c")',
10
- ShowInsideD: 'ns.show("Loading D", "#d")',
11
- ShowInsideWrapper: 'ns.show("Loading Wrapper", "#wrapper")',
12
- ShowFullScreen: 'ns.show("Loading window")',
13
- Progress: 'Progressive Demo',
14
- Hide: 'ns.hide()',
15
- HideAll: 'ns.hide("*")',
16
- }
17
-
18
- const rCommandString = ref('')
19
-
20
- const wait = ms => new Promise(r => setTimeout(r, ms))
21
-
22
- async function onClickExe() {
23
- const value = rCommandString.value
24
- const phrases = [
25
- 'Generating witty dialog',
26
- 'Swapping time and space',
27
- 'sudo rm -rf /**/*',
28
- 'Tokenizing real life',
29
- 'Pushing pixels',
30
- "Don't think of purple hippos",
31
- 'One mississippi, two mississippi...',
32
- ]
33
- switch (value) {
34
- case Commands.ShowInsideA:
35
- ns.show('Loading A', '#a')
36
- break
37
- case Commands.ShowInsideB:
38
- ns.show('Loading B', '#b')
39
- break
40
- case Commands.ShowInsideC:
41
- ns.show('Loading C', '#c')
42
- break
43
- case Commands.ShowInsideD:
44
- ns.show('Loading D', '#d')
45
- break
46
- case Commands.ShowInsideWrapper:
47
- ns.show('Loading Wrapper', '#wrapper')
48
- break
49
- case Commands.ShowFullScreen:
50
- const id = ns.show('Loading window')
51
- await wait(4000)
52
- ns.hide(id)
53
- break
54
- case Commands.Hide:
55
- ns.hide()
56
- break
57
- case Commands.HideAll:
58
- ns.hide('*')
59
- break
60
- case Commands.Progress:
61
- for (const phrase of phrases) {
62
- ns.show(phrase)
63
- await wait(1500)
64
- }
65
- ns.hide('*')
66
- }
67
- }
68
- </script>
69
-
70
- <template>
71
- <div class="container">
72
- <select class="select" v-model="rCommandString">
73
- <option value="" selected disabled>Click and select</option>
74
- <option v-for="(command, i) in Commands" :key="i" :value="command">
75
- {{ command }}
76
- </option>
77
- </select>
78
- <div class="exe" @click="onClickExe">Run</div>
79
- </div>
80
- </template>
81
-
82
- <style lang="sass" scoped>
83
- @use "sass:color"
84
-
85
- $border-radius: 5px
86
- .container
87
- position: relative
88
- display: flex
89
- border-radius: $border-radius
90
- z-index: 1
91
- & > *
92
- padding: 10px 20px
93
-
94
- .select
95
- position: relative
96
- display: flex
97
- flex-grow: 1
98
- font-family: monospace
99
- font-size: 14px
100
- background-color: var(--vp-c-bg-alt)
101
- border-radius: $border-radius 0 0 $border-radius
102
- border: 1px solid rgba(Black, 0.1)
103
- cursor: pointer
104
- width: 100%
105
-
106
- $btn-bg: RoyalBlue
107
- .exe
108
- position: relative
109
- display: inline-flex
110
- color: White
111
- background-color: $btn-bg
112
- cursor: pointer
113
- border-radius: 0 $border-radius $border-radius 0
114
- border: 1px solid rgba(Black, 0.1)
115
- &:hover
116
- background-color: darken($btn-bg, 10%)
117
- </style>