├── .gitignore
├── README.md
├── animation-explorer
├── Assets
│ └── FontAwesome.otf
├── BoxPage.js
├── BoxPage.ux
├── HomePanel.ux
├── ListPage.js
├── ListPage.ux
├── MainView.ux
├── Resources.ux
├── SelectPage.ux
└── animation-explorer.unoproj
├── bar-chart-basic
├── MainView.ux
├── State.js
├── State.ts
├── bar-char-basic.unoproj
└── tsconfig.json
├── bezier-split
├── Assets
│ ├── arrow.png
│ ├── cart.png
│ ├── drawing.svg
│ ├── pencil.png
│ └── plot_arrow.png
├── Bezier
│ ├── Growth.ux
│ ├── Loading.ux
│ ├── Name.ux
│ └── Plot.ux
├── MainView.ux
├── README.md
├── TestPage.ux
└── bezier-split.unoproj
├── card-manager
├── CardPage.ux
├── CardView.ux
├── MainView.ux
├── README.md
├── SampleAnim.ux
├── State.js
└── card-manager.unoproj
├── christmas-tree
├── Assets
│ ├── background.png
│ ├── bulb_1.png
│ ├── bulb_10.png
│ ├── bulb_11.png
│ ├── bulb_12.png
│ ├── bulb_13.png
│ ├── bulb_14.png
│ ├── bulb_15.png
│ ├── bulb_16.png
│ ├── bulb_2.png
│ ├── bulb_3.png
│ ├── bulb_4.png
│ ├── bulb_5.png
│ ├── bulb_6.png
│ ├── bulb_7.png
│ ├── bulb_8.png
│ ├── bulb_9.png
│ ├── candle_1.png
│ ├── candle_2.png
│ ├── gift_1.png
│ ├── gift_2.png
│ ├── gift_3.png
│ ├── gift_4.png
│ ├── lights.png
│ ├── lights.xcf
│ ├── lights_1.png
│ ├── lights_2.png
│ ├── lights_3.png
│ ├── lights_4.png
│ ├── santa.png
│ ├── snowflake_0.png
│ ├── snowflake_1.png
│ ├── snowflake_2.png
│ ├── snowflake_3.png
│ ├── snowflake_4.png
│ ├── snowflake_5.png
│ ├── snowflake_6.png
│ ├── snowman1.png
│ └── tree.png
├── BulbPalette.ux
├── FallingSnow.ux
├── GiftPalette.ux
├── MainView.ux
├── OrnamentPanel.ux
├── README.md
├── SantaPanel.ux
├── StarPalette.ux
├── StarPaths.ux
├── State.js
├── TreePanel.ux
└── christmas-tree.unoproj
├── de-casteljau
├── DeCasteljau.unoproj
├── MainView.ux
├── README.md
└── main.js
├── dupesy-christmas
├── .gitignore
├── Assets
│ ├── arrow_down.png
│ ├── arrow_left.png
│ ├── arrow_right.png
│ ├── arrow_up.png
│ ├── icon_128.png
│ ├── icon_check.png
│ ├── icon_cross.png
│ ├── icon_heart.png
│ ├── load_icon.png
│ ├── tile_00.png
│ ├── tile_01.png
│ ├── tile_02.png
│ ├── tile_03.png
│ ├── tile_04.png
│ ├── tile_05.png
│ ├── tile_06.png
│ ├── tile_07.png
│ ├── tile_08.png
│ ├── tile_09.png
│ ├── tile_10.png
│ ├── tile_11.png
│ ├── tile_12.png
│ ├── tile_13.png
│ ├── tile_14.png
│ ├── tile_15.png
│ ├── tile_16.png
│ ├── tile_17.png
│ ├── tile_18.png
│ ├── tile_19.png
│ ├── tile_20.png
│ ├── tile_21.png
│ ├── tile_22.png
│ ├── tile_23.png
│ ├── tile_24.png
│ ├── tile_25.png
│ ├── tile_26.png
│ ├── tile_27.png
│ ├── tile_28.png
│ ├── tile_29.png
│ ├── tile_30.png
│ ├── tile_31.png
│ ├── title.png
│ ├── title_back.png
│ └── title_background.jpg
├── Controls
│ ├── Button.ux
│ ├── FullPanel.ux
│ ├── Menu.ux
│ ├── Page.ux
│ ├── Panel.ux
│ ├── SimpleSelect.ux
│ └── TextBits.ux
├── Design
│ ├── icon.xcf
│ └── santa-31319.png
├── DupesyChristmas.unoproj
├── Game.PageGame.ux
├── Game.PageGameOver.ux
├── Game.PageHelp.ux
├── Game.PageStart.ux
├── GameConfig.js
├── GameRouting.js
├── GameState.js
├── GameStats.js
├── GameTiles.js
├── MainView.ux
├── MyApp.ux
├── PreloadPanel.ux
├── README.txt
├── main.js
├── makefile
└── release.keystore
├── misc
├── StepSlider
│ ├── MainView.ux
│ ├── MySlider.ux
│ ├── MyVSlider.ux
│ └── StepSlider.unoproj
├── attract
│ ├── MainView.ux
│ ├── MainView.ux.old
│ └── attract.unoproj
└── layout
│ ├── MainView.ux
│ └── layout.unoproj
├── page-product-paralax
├── Assets
│ ├── FontAwesome.otf
│ ├── background.jpg
│ ├── logo-1.png
│ ├── logo-2.png
│ ├── product-backpack.png
│ ├── product-boots.png
│ ├── product-hat.png
│ ├── product-shirt.png
│ ├── product-shoe.png
│ └── product-teddy.png
├── MainState.js
├── MainView.ux
├── README.md
└── page-product-paralax.unoproj
├── permission-popup
├── Assets
│ ├── airplane.png
│ ├── bell.png
│ ├── marker.png
│ ├── pattern.png
│ └── star.png
├── MainView.ux
├── README.md
└── permission-popup.unoproj
├── pixabay
├── Assets
│ ├── icon_cancel.png
│ ├── icon_config.png
│ ├── icon_info.png
│ ├── icon_search.png
│ ├── icon_star.png
│ ├── icon_thumbsup.png
│ ├── icon_user.png
│ └── pixabay_logo.png
├── MainView.ux
├── Modules
│ ├── .Searching.js.kate-swp
│ └── Searching.js
├── PageImageInfo.js
├── PageImageInfo.ux
├── PageSearch.js
├── PageSearch.ux
├── pixabay.js
└── pixabay.unoproj
├── signup-transition
├── Assets
│ └── background.png
├── MainState.js
├── MainView.ux
├── PageHome.ux
├── PageLoading.ux
├── PageLogout.ux
├── README.md
└── signup-transition.unoproj
├── smart-home-app
├── ItemPage.ux
├── ItemSelector.ux
├── MainState.js
├── MainView.ux
├── RoomsSelector.ux
└── smart-home-app.unoproj
├── stream
├── let-expression
│ ├── AppState.js
│ ├── MainView.ux
│ └── let-expression.unoproj
├── line-anim
│ ├── MainView.ux
│ └── line-anim.unoproj
├── material-design-input
│ ├── MainView.ux
│ └── material-design-input.unoproj
├── patch-line
│ ├── MainState.js
│ ├── MainView.ux
│ └── patch-line.unoproj
├── typescript-1
│ ├── Assets
│ │ ├── bowling.png
│ │ ├── clock.png
│ │ ├── mountain.png
│ │ └── rocket.png
│ ├── Currency.js
│ ├── Currency.ts
│ ├── MainView.ux
│ ├── State.js
│ ├── State.ts
│ ├── tsconfig.json
│ └── typescript-1.unoproj
└── ux-rest
│ ├── MainView.ux
│ └── ux-rest.unoproj
└── time-tracker
├── Assets
├── arrow_left.png
└── header.png
├── Includes
└── ItemGradient.xml
├── MainState.js
├── MainState.ux
├── PageDetails.ux
├── PageOverview.ux
├── README.md
├── lib
└── moment.js
└── time-tracker.unoproj
/.gitignore:
--------------------------------------------------------------------------------
1 | .uno
2 | build
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Fuse-Demos
2 |
3 | This is a collection of demo apps done on my [Fuse Twitch stream](https://www.twitch.tv/mortoray).
4 |
5 | - View my [Fuse demos stream](https://www.twitch.tv/mortoray).
6 | - Follow me on [Twitter](https://twitter.com/edaqa)
7 | - View [previous episodes](https://www.youtube.com/channel/UCOkkR7mihbnNnPD8yxhW56Q/featured)
8 | - Checkout [Fuse](https://fusetools.com/)
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/animation-explorer/Assets/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/animation-explorer/Assets/FontAwesome.otf
--------------------------------------------------------------------------------
/animation-explorer/BoxPage.js:
--------------------------------------------------------------------------------
1 | class Timelines {
2 | constructor() {
3 | this.triggers = {}
4 | }
5 |
6 | add( name, timeline ) {
7 | this.triggers[name] = timeline
8 | }
9 | }
10 |
11 | export default class BoxPage {
12 | constructor() {
13 | this.emailCount = 0
14 | this.alert = undefined
15 | this.important = false;
16 | this.timelines = new Timelines()
17 | }
18 |
19 | addEmail() {
20 | this.emailCount += 1
21 | }
22 | clearEmail() {
23 | this.emailCount = 0
24 | }
25 |
26 | setAlert() {
27 | this.alert = "Alert"
28 | }
29 | clearAlert() {
30 | this.alert = ""
31 | }
32 |
33 | setImportant() {
34 | this.important = true
35 | }
36 | clearImportant() {
37 | this.important = false
38 | }
39 |
40 | testTimeline() {
41 | this.timelines.triggers.pulseRed.pulseForward()
42 | }
43 | }
--------------------------------------------------------------------------------
/animation-explorer/HomePanel.ux:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/animation-explorer/ListPage.js:
--------------------------------------------------------------------------------
1 | var itemId = 0
2 | class Item {
3 | constructor() {
4 | this.id = itemId++
5 | }
6 | }
7 |
8 | class ChatItem extends Item {
9 | constructor() {
10 | super()
11 | this.type ="chat"
12 | this.loading = true
13 | setTimeout( () => {
14 | this.clearLoad()
15 | }, Math.random() * 2000 + 1000)
16 | }
17 |
18 | clearLoad() {
19 | this.loading = false
20 | }
21 | }
22 |
23 | class AdItem extends Item {
24 | constructor() {
25 | super()
26 | this.type = "ad"
27 | }
28 | }
29 |
30 | export default class ListPage {
31 | constructor() {
32 | this.items = [ new ChatItem(), new ChatItem(), new ChatItem() ]
33 | this.adLoc = 0
34 | this.isLoading = false
35 | }
36 |
37 | remove( args ) {
38 | let ndx = this.items.indexOf( args.data )
39 | this.items.splice( ndx, 1 )
40 | }
41 |
42 | add() {
43 | this.items.push( new ChatItem() )
44 | }
45 |
46 | insert() {
47 | this.items.splice( 1, 0, new ChatItem() )
48 | }
49 |
50 | insertAd() {
51 | this.items.splice( this.adLoc, 0, new AdItem() )
52 | this.adLoc += 2
53 | }
54 |
55 | clear() {
56 | this.items = []
57 | this.adLoc = 0
58 | }
59 |
60 | reload() {
61 | this.isLoading = true
62 | setTimeout( () => {
63 | this.isLoading = false
64 | this.items = [ new ChatItem(), new ChatItem(), new ChatItem() ]
65 | }, 5000)
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/animation-explorer/ListPage.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
103 |
104 |
105 |
106 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/animation-explorer/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/animation-explorer/Resources.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/animation-explorer/SelectPage.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/animation-explorer/animation-explorer.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*",
8 | "*.js:FuseJS",
9 | ]
10 | }
--------------------------------------------------------------------------------
/bar-chart-basic/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/bar-chart-basic/State.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var State = /** @class */ (function () {
4 | function State() {
5 | this.data = [];
6 | this.title = "Hello There";
7 | for (var i = 0; i < 10; i += 1) {
8 | this.data.push(i);
9 | }
10 | }
11 | State.prototype.randomize = function () {
12 | this.data = [];
13 | for (var i = 0; i < 10; i += 1) {
14 | this.data.push(Math.random() * 100);
15 | }
16 | };
17 | return State;
18 | }());
19 | exports.default = State;
20 |
--------------------------------------------------------------------------------
/bar-chart-basic/State.ts:
--------------------------------------------------------------------------------
1 | export default class State {
2 | title : string
3 | data : number[] = []
4 |
5 | constructor() {
6 | this.title = "Hello There"
7 |
8 | for (var i=0; i < 10; i += 1) {
9 | this.data.push(i)
10 | }
11 | }
12 |
13 | randomize() {
14 | this.data = []
15 | for (var i=0; i < 10; i += 1) {
16 | this.data.push( Math.random() * 100 )
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/bar-chart-basic/bar-char-basic.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "Fuse.Charting",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "**.js:FuseJS",
10 | ]
11 | }
--------------------------------------------------------------------------------
/bar-chart-basic/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Basic Options */
4 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6 | // "lib": [], /* Specify library files to be included in the compilation. */
7 | // "allowJs": true, /* Allow javascript files to be compiled. */
8 | // "checkJs": true, /* Report errors in .js files. */
9 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
11 | // "sourceMap": true, /* Generates corresponding '.map' file. */
12 | // "outFile": "./", /* Concatenate and emit output to single file. */
13 | // "outDir": "./", /* Redirect output structure to the directory. */
14 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
15 | // "removeComments": true, /* Do not emit comments to output. */
16 | // "noEmit": true, /* Do not emit outputs. */
17 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
18 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
19 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20 |
21 | /* Strict Type-Checking Options */
22 | "strict": true, /* Enable all strict type-checking options. */
23 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
24 | // "strictNullChecks": true, /* Enable strict null checks. */
25 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */
26 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
27 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
28 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
29 |
30 | /* Additional Checks */
31 | // "noUnusedLocals": true, /* Report errors on unused locals. */
32 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
33 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
34 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
35 |
36 | /* Module Resolution Options */
37 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
38 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
39 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
40 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
41 | // "typeRoots": [], /* List of folders to include type definitions from. */
42 | // "types": [], /* Type declaration files to be included in compilation. */
43 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
44 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
45 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
46 |
47 | /* Source Map Options */
48 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
49 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
50 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
51 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
52 |
53 | /* Experimental Options */
54 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
55 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
56 | }
57 | }
--------------------------------------------------------------------------------
/bezier-split/Assets/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/bezier-split/Assets/arrow.png
--------------------------------------------------------------------------------
/bezier-split/Assets/cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/bezier-split/Assets/cart.png
--------------------------------------------------------------------------------
/bezier-split/Assets/pencil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/bezier-split/Assets/pencil.png
--------------------------------------------------------------------------------
/bezier-split/Assets/plot_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/bezier-split/Assets/plot_arrow.png
--------------------------------------------------------------------------------
/bezier-split/Bezier/Growth.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/bezier-split/Bezier/Loading.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
9 |
11 |
13 |
14 |
16 |
18 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/bezier-split/Bezier/Plot.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | var Observable = require("FuseJS/Observable")
6 |
7 | exports.data = Observable(
8 | [0.0, 0.7],
9 | [0.2, 0.9],
10 | [0.4, 0.3],
11 | [0.6, 0.5],
12 | [0.8, 0.7],
13 | [1.0, 0.6])
14 |
15 | exports.markers = Observable({
16 | when: 0.3,
17 | text: "Big Things Happened",
18 | },{
19 | when: 0.75,
20 | text: "Kitten Effects",
21 | })
22 |
23 | exports.backStart = Observable(0.1)
24 | exports.backEnd = Observable(0.25)
25 |
26 | function back( start, end ) {
27 | return function() {
28 | exports.backStart.value = start
29 | exports.backEnd.value = end
30 | }
31 | }
32 | exports.back1 = back(0.1,0.25)
33 | exports.back2 = back(0.35,0.6)
34 | exports.back3 = back(0.81,0.95)
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
54 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
94 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/bezier-split/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/bezier-split/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## Resources
3 |
4 | https://pixabay.com/en/arrow-pink-right-1293376/
5 | https://pixabay.com/en/nature-logo-vector-icon-whole-2790294/
6 | https://pixabay.com/en/flower-rose-floral-fresh-blossom-2597154/
7 | https://pixabay.com/en/pencil-pen-write-office-note-1295313/
8 | https://pixabay.com/en/celtic-knot-patterns-designs-35300/
9 | https://pixabay.com/en/rollercoaster-roller-coaster-156027/
--------------------------------------------------------------------------------
/bezier-split/bezier-split.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/card-manager/CardPage.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/card-manager/CardView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/card-manager/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/card-manager/README.md:
--------------------------------------------------------------------------------
1 | # Card Manager
2 |
3 | This is the start of a card manager.
4 |
5 | It demos a transition of a element visually between navigation states.
6 |
7 | _more to come_
8 |
--------------------------------------------------------------------------------
/card-manager/SampleAnim.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/card-manager/State.js:
--------------------------------------------------------------------------------
1 | class Card {
2 | constructor() {
3 | this.type = "visa"
4 | this.name = "BoS Visa"
5 | this.number = "4859 3948 3948 5723"
6 | this.cardholder = "Luboš Volkov"
7 | this.expires = "07/21"
8 | this.cvc = "123"
9 | }
10 | }
11 |
12 | class PageCard {
13 | constructor( card ) {
14 | this.$path = "cardView"
15 | this.card = card
16 | }
17 | }
18 |
19 |
20 | class PageListing {
21 | constructor() {
22 | this.$path = "listing"
23 | this.cards = [ new Card(), new Card(), new Card(), new Card() ]
24 | }
25 | }
26 |
27 | export default class State {
28 | constructor() {
29 | this.pages = [ new PageListing() ]
30 | }
31 |
32 | gotoCard(args) {
33 | this.pages.push( new PageCard(args.data) )
34 | }
35 |
36 | goBack() {
37 | if (this.pages.length > 1) {
38 | this.pages.pop()
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/card-manager/card-manager.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "RootNamespace":"",
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "*.js:FuseJS",
10 | ]
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/christmas-tree/Assets/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/background.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_1.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_10.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_11.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_12.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_13.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_14.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_15.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_16.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_2.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_3.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_4.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_5.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_6.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_7.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_8.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/bulb_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/bulb_9.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/candle_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/candle_1.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/candle_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/candle_2.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/gift_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/gift_1.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/gift_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/gift_2.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/gift_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/gift_3.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/gift_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/gift_4.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/lights.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/lights.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/lights.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/lights.xcf
--------------------------------------------------------------------------------
/christmas-tree/Assets/lights_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/lights_1.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/lights_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/lights_2.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/lights_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/lights_3.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/lights_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/lights_4.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/santa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/santa.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_0.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_1.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_2.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_3.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_4.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_5.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowflake_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowflake_6.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/snowman1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/snowman1.png
--------------------------------------------------------------------------------
/christmas-tree/Assets/tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/christmas-tree/Assets/tree.png
--------------------------------------------------------------------------------
/christmas-tree/BulbPalette.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/christmas-tree/FallingSnow.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/christmas-tree/GiftPalette.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/christmas-tree/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/christmas-tree/OrnamentPanel.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/christmas-tree/README.md:
--------------------------------------------------------------------------------
1 | # Christmas Tree
2 |
3 | Christmas scene decoration.
4 |
5 |
6 | ## Resources
7 |
8 | https://pixabay.com/en/christmas-santa-claus-winter-gifts-2840575/
9 | https://pixabay.com/en/christmas-tree-star-decoration-308053/
10 | https://pixabay.com/en/winter-landscape-snow-mountains-767172/
11 | https://pixabay.com/en/bauble-christmas-baubles-christmas-1090864/
12 | https://pixabay.com/en/snowflake-hexagon-snow-winter-cold-161043/
13 | https://pixabay.com/en/gift-present-box-wrapped-bow-575400/
14 | https://pixabay.com/en/presents-wrapped-gifts-christmas-576256/
15 | https://pixabay.com/en/christmas-tree-christmas-background-41448/
16 | https://pixabay.com/en/christmas-holiday-ball-tree-1850829/
17 | https://pixabay.com/en/christmas-holiday-ball-decoration-1850600/
18 | https://pixabay.com/en/shuriken-throwing-star-ninja-star-153172/
19 | https://pixabay.com/en/ornament-the-structure-of-the-2002422/
20 | https://pixabay.com/en/solar-space-star-sun-2029600/
21 | https://pixabay.com/en/star-moon-sky-night-kids-little-1957919/
22 |
--------------------------------------------------------------------------------
/christmas-tree/SantaPanel.ux:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/christmas-tree/StarPalette.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/christmas-tree/State.js:
--------------------------------------------------------------------------------
1 | class Ornament {
2 | constructor( x, y, defn ) {
3 | this.x = x
4 | this.y = y
5 | this.defn = defn
6 | }
7 | }
8 |
9 | var snowflakeId = 0
10 | class Snowflake {
11 | constructor( x, y, image ) {
12 | this.x = x
13 | this.y = y
14 | this.image = image
15 | this.id = snowflakeId++
16 | }
17 | }
18 |
19 | class Gift {
20 | constructor( x, y, defn ) {
21 | this.x = x
22 | this.y = y
23 | this.defn = defn
24 | }
25 | }
26 |
27 | class OrnamentDefn {
28 | constructor( height, anchorY ) {
29 | this.height = height
30 | this.anchorY = anchorY
31 | // set below in loop
32 | // this.id
33 | // this.image
34 | }
35 | }
36 |
37 | var ornaments = {
38 | "bulb0": new OrnamentDefn( 0.07, 0.15 ),
39 | "bulb1": new OrnamentDefn( 0.07, 0.15 ),
40 | "bulb2": new OrnamentDefn( 0.07, 0.15 ),
41 | "bulb3": new OrnamentDefn( 0.07, 0.15 ),
42 | "candle0": new OrnamentDefn( 0.12, 0.98 ),
43 | "candle1": new OrnamentDefn( 0.12, 0.98 ),
44 | }
45 | var ornamentsVector = []
46 | for (var id in ornaments) {
47 | var orn = ornaments[id]
48 | orn.id = id
49 | orn.image = id
50 | ornamentsVector.push(orn)
51 | }
52 |
53 | class GiftDefn {
54 | constructor( ) {
55 | }
56 | }
57 | var gifts = {
58 | "gift0": new GiftDefn(),
59 | "gift1": new GiftDefn(),
60 | "gift2": new GiftDefn(),
61 | "gift3": new GiftDefn(),
62 | }
63 | var giftsVector = []
64 | for (var id in gifts) {
65 | var gift = gifts[id]
66 | gift.id = id
67 | gift.image = id
68 | giftsVector.push(gift)
69 | }
70 |
71 | class StarDefn {
72 | constructor(strokeWidth) {
73 | this.strokeWidth = strokeWidth
74 | }
75 | }
76 | var stars = {
77 | "star0": new StarDefn(1),
78 | "star1": new StarDefn(3),
79 | "star2": new StarDefn(1),
80 | "star3": new StarDefn(5),
81 | }
82 | var starsVector = []
83 | for (var id in stars) {
84 | var star = stars[id]
85 | star.id = id
86 | star.image = id
87 | starsVector.push(star)
88 | }
89 |
90 | var snowflakes = ["snowflake0", "snowflake1","snowflake2","snowflake3","snowflake4",
91 | "snowflake5","snowflake6" ]
92 |
93 | export default class State {
94 | constructor() {
95 | this.clear()
96 | this._treeSize = { }
97 | this.availableOrnaments = ornamentsVector
98 | this.selectedOrnamentId = ornamentsVector[0].id
99 |
100 | this.availableGifts = giftsVector
101 | this.selectedGiftId = giftsVector[0].id
102 |
103 | this.paletteIndex = 0
104 |
105 | this.availableStars = starsVector
106 | this.selectedStarId = starsVector[0].id
107 | }
108 |
109 | clear() {
110 | this.ornaments = [ ]
111 | this.snowflakes = [ ]
112 | this.gifts = []
113 | }
114 |
115 | get selectedStar() {
116 | return stars[this.selectedStarId]
117 | }
118 |
119 | get selectedOrnament() {
120 | return ornaments[this.selectedOrnamentId]
121 | }
122 |
123 | addOrnament(args) {
124 | let x = args.localX / this._treeSize.x
125 | let y = args.localY / this._treeSize.y
126 |
127 | var ornament = new Ornament(x,y, this.selectedOrnament)
128 | this.ornaments.push( ornament )
129 | }
130 |
131 | treePlaced(args) {
132 | this._treeSize = {
133 | x: args.width,
134 | y: args.height,
135 | }
136 | }
137 |
138 | addSnowflake(args) {
139 | let x = args.localX / this._fullSize.x
140 | let y = args.localY / this._fullSize.y
141 | let image = snowflakes[ Math.floor(Math.random() * snowflakes.length )]
142 | this.snowflakes.push( new Snowflake( x, y, image ) )
143 | }
144 |
145 | fullPlaced(args) {
146 | this._fullSize = {
147 | x: args.width,
148 | y: args.height,
149 | }
150 | }
151 |
152 | removeSnowflake(args) {
153 | var index = this.snowflakes.indexOf( args.data )
154 | this.snowflakes.splice(index, 1)
155 | let x = Math.random()
156 | let y = -0.05
157 | let image = snowflakes[ Math.floor(Math.random() * snowflakes.length )]
158 | this.snowflakes.push( new Snowflake( x, y, image ) )
159 | }
160 |
161 | giftsPlaced(args) {
162 | this._giftsSize = {
163 | x: args.width,
164 | y: args.height,
165 | }
166 | }
167 |
168 | get selectedGift() {
169 | return gifts[this.selectedGiftId]
170 | }
171 |
172 | addGift(args) {
173 | let x = args.localX / this._giftsSize.x
174 | let y = args.localY / this._giftsSize.y
175 | let defn = this.selectedGift
176 | this.gifts.push( new Gift( x, y, defn ) )
177 | }
178 |
179 | get frontGifts() {
180 | return this.gifts.filter( gift => gift.y > 0.3 )
181 | }
182 | get backGifts() {
183 | return this.gifts.filter( gift => gift.y <= 0.3 )
184 | }
185 |
186 |
187 | }
--------------------------------------------------------------------------------
/christmas-tree/TreePanel.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/christmas-tree/christmas-tree.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*",
8 | "*.js:FuseJS",
9 | ]
10 | }
--------------------------------------------------------------------------------
/de-casteljau/DeCasteljau.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/de-casteljau/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/de-casteljau/README.md:
--------------------------------------------------------------------------------
1 | # Curve splitting with de Casteljau's Algorithm
2 |
3 | A demonstration of how de Casteljau's algorithm can be used to find a point on a curve (draw it), or split the curve into two parts.
4 |
5 | [](http://www.youtube.com/watch?v=QaOeThzSi88)
6 |
7 | [de Casteljau's algorithm on Wikipedia](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm)
8 |
--------------------------------------------------------------------------------
/de-casteljau/main.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 |
3 | var points = [[0,0.8], [0.2,0.3], [0.9,0], [1,1]]
4 | exports.points4 = Observable( )
5 | exports.points4.replaceAll( points )
6 |
7 | exports.points3 = Observable()
8 | exports.points2 = Observable()
9 | exports.points1 = Observable()
10 |
11 | function recalc(t) {
12 | var p3 = deCasteljau( points, t )
13 | var p2 = deCasteljau( p3, t )
14 | var p1 = deCasteljau( p2, t )
15 |
16 | exports.points3.replaceAll( p3 )
17 | exports.points2.replaceAll( p2 )
18 | exports.points1.replaceAll( p1 )
19 | }
20 |
21 | exports.t = Observable(0.5)
22 | recalc(exports.t.value)
23 |
24 |
25 | function lerp( a, b, t ) {
26 | var q = []
27 | for (var i=0; i < a.length; ++i) {
28 | q[i] = a[i] * (1-t) + b[i] * t
29 | }
30 | return q
31 | }
32 |
33 | function deCasteljau( pts, t ) {
34 | var next = []
35 | for (var i=0; i < pts.length - 1; ++i ) {
36 | next.push( lerp(pts[i], pts[i+1], t) )
37 | }
38 | return next
39 | }
40 |
41 | exports.t.onValueChanged( module, recalc )
42 |
43 |
--------------------------------------------------------------------------------
/dupesy-christmas/.gitignore:
--------------------------------------------------------------------------------
1 | .uno
2 | build
3 |
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/arrow_down.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/arrow_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/arrow_left.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/arrow_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/arrow_right.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/arrow_up.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/icon_128.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/icon_check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/icon_check.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/icon_cross.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/icon_cross.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/icon_heart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/icon_heart.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/load_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/load_icon.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_00.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_01.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_02.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_03.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_04.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_05.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_06.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_07.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_08.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_09.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_10.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_11.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_12.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_13.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_14.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_15.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_16.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_17.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_18.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_19.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_20.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_21.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_22.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_23.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_24.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_25.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_26.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_27.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_28.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_29.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_30.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/tile_31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/tile_31.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/title.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/title_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/title_back.png
--------------------------------------------------------------------------------
/dupesy-christmas/Assets/title_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Assets/title_background.jpg
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/Button.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/FullPanel.ux:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/Menu.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/Page.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/Panel.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/SimpleSelect.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | var _this = this
9 | var value = this.Value
10 |
11 | var options = this.Options.inner()
12 | exports.dummy1 = options //TODO: why? to get subscription?
13 |
14 | exports.index = value.map( function(cur) {
15 | return selected(cur)
16 | })
17 | exports.hasPrev = exports.index.map( function(i) {
18 | return i > 0
19 | })
20 | exports.hasNext = exports.index.map( function(i) {
21 | return i < (options.length-1)
22 | })
23 |
24 | function selected(cur) {
25 | for (var i=0; i < options.length; ++i ) {
26 | if (cur == options.getAt(i).value) {
27 | return i
28 | }
29 | }
30 |
31 | return 0
32 | }
33 |
34 | function select( ndx ) {
35 | ndx = Math.max(0, Math.min( options.length-1, ndx ) )
36 | value.value = options.getAt(ndx).value
37 | }
38 |
39 | exports.left = function() {
40 | select( selected(value.value) - 1 )
41 | }
42 |
43 | exports.right = function() {
44 | select( selected(value.value) + 1 )
45 | }
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/dupesy-christmas/Controls/TextBits.ux:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
--------------------------------------------------------------------------------
/dupesy-christmas/Design/icon.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Design/icon.xcf
--------------------------------------------------------------------------------
/dupesy-christmas/Design/santa-31319.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/Design/santa-31319.png
--------------------------------------------------------------------------------
/dupesy-christmas/DupesyChristmas.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Copyright": "Copyright ©2016 edA-qa mort-ora-y",
3 | "Desiption": "A glorious image matching game with a delightful Christmas theme.",
4 | "Icon": "Assets/icon_128.png",
5 | "Title": "Dupesy Christmas",
6 | "Version": "1.0.0",
7 | "Publisher": "EverSystems",
8 |
9 | "iOS": {
10 | "BundleIdentifier": "eu.eversystems.dupesychristmas",
11 | },
12 | "Android":{
13 | "Key": {
14 | "Alias": "application",
15 | "AliasPassword": "Android",
16 | "Store": "release.keystore",
17 | "StorePassword": "Android",
18 | },
19 | "VersionCode": 1,
20 | "VersionName": "$(Version)",
21 | "Package": "eu.eversystems.dupesychristmas",
22 | },
23 | "InternalsVisibleTo": [],
24 | "Packages": [
25 | "Fuse",
26 | "FuseJS",
27 | "Fuse.Designer",
28 | "Fuse.Launcher",
29 | ],
30 | "Projects": [],
31 | "Includes": [
32 | "*",
33 | "Assets/*.png:Bundle",
34 | "*.js:Bundle",
35 | ]
36 | }
--------------------------------------------------------------------------------
/dupesy-christmas/Game.PageGame.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | var gameState = require("GameState.js")
5 | exports.gameState = gameState.getPublic()
6 | var gameTiles = require("GameTiles.js" )
7 | exports.gameTiles = gameTiles.getPublic()
8 |
9 | exports.selectedCorrect = gameState.selectedCorrect
10 | exports.selectedIncorrect = gameState.selectedIncorrect
11 |
12 | exports.onPlaced = function(args) {
13 | gameTiles.setSize( [args.width, args.height] )
14 | }
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
53 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
78 |
79 |
80 |
81 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
95 |
96 |
97 |
98 |
99 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/dupesy-christmas/Game.PageGameOver.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 | exports.gameStats = require("GameStats.js").getPublic()
4 | exports.gameRouting = require("GameRouting.js")
5 | exports.gameState = require("GameState.js").getPublic()
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/dupesy-christmas/Game.PageHelp.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | var InterApp = require("FuseJS/InterApp")
5 |
6 | exports.gameRouting = require("GameRouting.js")
7 |
8 | exports.goMortoray = function() {
9 | InterApp.launchUri("https://mortoray.com/DupesyChristmas/")
10 | }
11 | exports.goPixabay = function() {
12 | InterApp.launchUri("https://pixabay.com/")
13 | }
14 |
15 |
16 |
17 |
18 | Oh no! The elves had a bit of a party and totally messed up the gifts. Each delivery now has a duplicate mixed in it! Help Santa sort it out.
19 |
20 | Each screen has a set of presents. Find the two that are the same and tap on one them. Santa has to leave soon though, so you don't have much time.
21 |
22 | In "Rush Mode" when the timer reaches zero you lose a life. Lose them all and it's game over. Each correct answer restores the timer (well, almost).
23 |
24 | Visit Dupsey Christmas on mortoray.com
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/dupesy-christmas/Game.PageStart.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 | exports.gameRouting = require("GameRouting.js")
4 | exports.gameConfig = require("GameConfig.js")
5 |
6 |
7 |
8 |
9 | Find the duplicates!
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/dupesy-christmas/GameConfig.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 |
3 | // converts our own options object into an array of options for an `Each`
4 | function mapOptions(opts) {
5 | return Object.keys(opts).map( function(key) {
6 | opts[key].id = key //so we know the key when we just have the value
7 | return { value: key, label: opts[key].label }
8 | })
9 | }
10 |
11 | var difficultyOptions = {
12 | low: {
13 | label: "Quick Fun",
14 | tiles: {
15 | count: 12,
16 | sizeVariance: 0.1,
17 | spinFreq: 0,
18 | }
19 | },
20 | middle: {
21 | label: "Easy Going",
22 | tiles: {
23 | count: 16,
24 | sizeVariance: 0.3,
25 | spinFreq: 0.05,
26 | }
27 | },
28 | high: {
29 | label: "Difficult Now",
30 | tiles: {
31 | count: 20,
32 | sizeVariance: 0.4,
33 | spinFreq: 0.1,
34 | }
35 | },
36 | highest: {
37 | label: "Bloody Hard",
38 | tiles: {
39 | count: 22,
40 | sizeVariance: 0.5,
41 | spinFreq: 0.2,
42 | }
43 | },
44 | }
45 | exports.difficulty = Observable("middle")
46 | exports.difficultyOptions = mapOptions(difficultyOptions)
47 |
48 | exports.getDifficulty = function() {
49 | return difficultyOptions[exports.difficulty.value] || difficultyOptions.middle
50 | }
51 |
52 | var modeOptions = {
53 | fixed: {
54 | label: "60s Limit",
55 | rushMode: false,
56 | levelTime: 60,
57 | lives: 1,
58 | },
59 | panic: {
60 | label: "Rush Mode" ,
61 | rushMode: true,
62 | levelTime: 15,
63 | lives: 5,
64 | },
65 | }
66 | exports.mode = Observable("fixed")
67 | exports.modeOptions = mapOptions(modeOptions)
68 |
69 | exports.getMode = function() {
70 | return modeOptions[exports.mode.value] || modeOptions.fixed
71 | }
72 |
73 | exports.save = function() {
74 | return {
75 | difficulty: exports.difficulty.value,
76 | mode: exports.mode.value,
77 | }
78 | }
79 |
80 | exports.load = function(data) {
81 | if (difficultyOptions[data.difficulty]) {
82 | exports.difficulty.value = data.difficulty
83 | }
84 | if (modeOptions[data.mode]) {
85 | exports.mode.value = data.mode
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/dupesy-christmas/GameRouting.js:
--------------------------------------------------------------------------------
1 | var gameState = require("GameState.js")
2 | var gameConfig = require("GameConfig.js")
3 |
4 | var router
5 | exports.setRouter = function(router_) {
6 | router = router_
7 | }
8 |
9 | exports.restart = function() {
10 | router.goto( "game" )
11 | gameState.restart()
12 | }
13 |
14 | exports.returnMain = function() {
15 | router.goto( "start" )
16 | }
17 |
18 | exports.startGame = function() {
19 | router.goto( "game" )
20 | gameState.newGame( gameConfig.getDifficulty(), gameConfig.getMode() )
21 | }
22 |
23 | exports.help = function(args) {
24 | router.goto( "help" )
25 | }
26 |
--------------------------------------------------------------------------------
/dupesy-christmas/GameState.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 |
3 | var gameStats = require("GameStats.js")
4 |
5 | var gameOver = true
6 | var timePenalty = 5
7 |
8 | var score = Observable(0)
9 |
10 | var failCount = Observable(0)
11 |
12 | var timeLeft = Observable(0)
13 | var maxTime = Observable(1)
14 |
15 | var timer = null
16 | var lastTime
17 | var difficulty
18 | var mode
19 | var lives = Observable(0)
20 | var rushMode = Observable(false)
21 |
22 | /**
23 | Starts a new game
24 | */
25 | exports.newGame = function(difficulty_, mode_) {
26 | difficulty = difficulty_
27 | mode = mode_
28 |
29 | score.value = 0
30 | failCount.value = 0
31 | timeLeft.value = mode.levelTime
32 | maxTime.value = mode.levelTime
33 | lives.value = mode.lives,
34 | rushMode.value = mode.rushMode,
35 | gameOver = false
36 |
37 | lastTime = (new Date()).getTime()
38 | timer = setInterval( update, 100 )
39 |
40 | exports.onCreateLevel(difficulty.tiles)
41 | }
42 |
43 | exports.isRunning = function() {
44 | return !gameOver
45 | }
46 |
47 | exports.getConfigId = function() {
48 | return mode.id + "." + difficulty.id
49 | }
50 |
51 | /**
52 | Starts another round of the game in the same mode as last time.
53 | */
54 | exports.restart = function() {
55 | exports.newGame(difficulty, mode)
56 | }
57 |
58 | function update() {
59 | var next = (new Date()).getTime()
60 | var elapsed = next - lastTime
61 | lastTime = next
62 | step(elapsed/1000.0)
63 | }
64 |
65 | function step(elapsed) {
66 | var cur = timeLeft.value
67 | var next = cur - elapsed
68 | timeLeft.value = next
69 |
70 | if (next < 0) {
71 | lives.value -= 1
72 | if (lives.value <= 0) {
73 | endGame()
74 | } else {
75 | timeLeft.value = maxTime.value
76 | exports.onLostLife()
77 | exports.onCreateLevel(difficulty.tiles)
78 | }
79 | }
80 | }
81 |
82 | var statsResult = Observable()
83 |
84 | function endGame() {
85 | gameOver = true
86 | clearInterval(timer)
87 | exports.onGameOver()
88 |
89 | statsResult.value = gameStats.addScore( exports.getConfigId(), score.value )
90 | }
91 |
92 | /** Indicates a correct tile has been selected */
93 | exports.selectedCorrect = function() {
94 | if (gameOver) {
95 | return
96 | }
97 |
98 | score.value++
99 | exports.onGoodSelect()
100 | exports.onCreateLevel(difficulty.tiles)
101 | if (mode.rushMode) {
102 | //keep reducing to ensure a timely end to the game
103 | maxTime.value = maxTime.value * 0.95
104 | timeLeft.value = maxTime.value
105 | }
106 | }
107 |
108 | /** Indicates an incorrect file has been selected */
109 | exports.selectedIncorrect = function() {
110 | if (gameOver) {
111 | return
112 | }
113 |
114 | failCount.value++
115 |
116 | timeLeft.value -= timePenalty
117 | exports.onTimePenalty()
118 | }
119 |
120 | /** Return a map of the data that is meant to be accessible directly from UX */
121 | exports.getPublic = function() {
122 | return {
123 | score,
124 | failCount,
125 | timeLeft,
126 | maxTime,
127 | lives,
128 | rushMode,
129 | statsResult,
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/dupesy-christmas/GameStats.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 |
3 | var stats = {
4 | }
5 |
6 | function getStats(id) {
7 | if (stats[id]) {
8 | return stats[id]
9 | }
10 |
11 | var r = {}
12 | stats[id] = r
13 | return r
14 | }
15 |
16 | var bestScore = Observable(0)
17 |
18 | exports.addScore = function(id, score) {
19 | var modeStats = getStats(id)
20 |
21 | if (!modeStats.bestScore || score > modeStats.bestScore) {
22 | modeStats.bestScore = score
23 | modeStats.lastBest = true
24 | } else {
25 | modeStats.lastBest = false
26 | }
27 | modeStats.played = (modeStats.played || 0) + 1
28 | return modeStats
29 | }
30 |
31 | exports.getPublic = function() {
32 | return {
33 | }
34 | }
35 |
36 | exports.save = function() {
37 | return stats
38 | }
39 |
40 | exports.load = function(data) {
41 | stats = data
42 | }
--------------------------------------------------------------------------------
/dupesy-christmas/GameTiles.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 | var gameState = require("GameState.js")
3 |
4 | var items = Observable()
5 |
6 | exports.getPublic = function() {
7 | return {
8 | items,
9 | tileTypes, //just for preloading
10 | }
11 | }
12 |
13 | exports.clear = function() {
14 | items.clear()
15 | }
16 |
17 | function Item(tileType) {
18 |
19 | var _this = this
20 | this.tileType = tileType
21 | this.image = tileType.image
22 | this.used = false
23 | this.layout = Observable({})
24 |
25 | this.setup = function(x,y,radius,target, config) {
26 | //limit size variance on small devices, otherwise it just gets too small
27 | var sz = 2 * radius * (1 - Math.random() * config.sizeVariance)
28 |
29 | _this.layout.value = {
30 | x,
31 | y,
32 | size: Math.max(55,sz), //smallest still identifiable size on tiny phones (though still hard)
33 | rotation: Math.random() * 360,
34 | isTarget: target,
35 | spinFreq: Math.random() * config.spinFreq,
36 | }
37 | _this.used = true
38 | }
39 | }
40 |
41 | function pad(num, size) {
42 | var s = num+""
43 | while (s.length < size) {
44 | s = "0" + s
45 | }
46 | return s
47 | }
48 |
49 | var tileTypes = []
50 | for (var i=0; i <= 31; ++i) {
51 | tileTypes.push({
52 | index: i,
53 | image: "Assets/tile_" + pad( i, 2 ) + ".png",
54 | })
55 | }
56 |
57 | function length( ax, ay, bx, by ) {
58 | var x = bx - ax
59 | var y = by - ay
60 | return Math.sqrt( x * x + y * y )
61 | }
62 |
63 | function contained( x, y, r, szX, szY ) {
64 | return (x -r > 0) && (x + r < szX) &&
65 | (y - r > 0) && (y + r < szY)
66 | }
67 |
68 | //circle's packed into a snub square tiling
69 | function createLocations( width, height, stepSize ) {
70 | lefts = []
71 | rights = []
72 |
73 | var wide = width > height
74 |
75 | var primeAngle = Math.PI / 12
76 | var spokeLen =(stepSize/2) / Math.sin(Math.PI/2 - primeAngle)
77 | var radius = spokeLen * length( Math.cos(primeAngle), Math.sin(primeAngle),
78 | Math.cos(primeAngle+Math.PI/2), Math.sin(primeAngle+Math.PI/2) ) / 2
79 |
80 | var yAlt = true
81 | for (var y=0; y < height; y+= stepSize) {
82 | var alt = yAlt
83 | for (var x=0; x < width; x+= stepSize) {
84 | var base = alt ? -primeAngle : primeAngle;
85 |
86 | function add(angle) {
87 | var ax = spokeLen * Math.cos(angle) + x
88 | var ay = spokeLen * Math.sin(angle) + y
89 | if (contained(ax,ay, radius, width, height)) {
90 | //split into two sections, this makes it harder as it divides the player's attention
91 | if ( (wide && ax < (width / 2)) || (!wide && ay < (height/2)) ) {
92 | lefts.push( [ax,ay] )
93 | } else {
94 | rights.push( [ax,ay] )
95 | }
96 | }
97 | }
98 |
99 | add(base)
100 | add(base + Math.PI/2)
101 |
102 | alt = !alt
103 | }
104 |
105 | yAlt = !yAlt
106 | }
107 |
108 | return {
109 | lefts,
110 | rights,
111 | radius,
112 | }
113 | }
114 |
115 | /**
116 | Find an existing item with a matching template or create a new one.
117 | */
118 | function findOrCreateItem(tileType) {
119 | for (var i=0; i < items.length; ++i) {
120 | var item = items.getAt(i)
121 | if (!item.used && item.tileType == tileType) {
122 | return item
123 | }
124 | }
125 |
126 | var item = new Item(tileType)
127 | items.add(item)
128 | return item
129 | }
130 |
131 | function getLocations( count ) {
132 | //determine a decent size for the items
133 | function calcItemSize() {
134 | var area = areaSize[0] * areaSize[1]
135 | var itemArea = area / count
136 | return Math.sqrt(itemArea)
137 | }
138 |
139 | var cr
140 | while(true) {
141 | var sz = calcItemSize()
142 | cr = createLocations(areaSize[0], areaSize[1], sz )
143 | if ((cr.lefts.length + cr.rights.length) > (count+2)) {
144 | return cr
145 | }
146 | //it's really only very unusual layouts (like a strip) where this is ever needed
147 | sz *= 0.9
148 | }
149 | }
150 |
151 | //stores configuration (this is a default to just show the structure)
152 | var curConfig = {
153 | count: 20,
154 | sizeVariance: 0.3,
155 | spinFreq: 0.05,
156 | }
157 |
158 | /**
159 | Modify/create all items, positiong them, and creating one duplicate (the target tile).
160 | */
161 | exports.createLevel = function(config) {
162 | curConfig = config
163 | for (var i=0; i < items.length; ++i) {
164 | items.getAt(i).used = false
165 | }
166 |
167 | var count = config.count
168 |
169 | var cr = getLocations(count)
170 | shuffle(cr.lefts)
171 | shuffle(cr.rights)
172 | shuffle(tileTypes)
173 |
174 | function locs(i) {
175 | var lcs = i%2 ? cr.lefts : cr.rights
176 | var ndx = Math.floor(i/2)
177 | return lcs[ndx]
178 | }
179 |
180 | for (var i=0; i < count; ++i) {
181 | var loc = locs(i)
182 | var item = findOrCreateItem(tileTypes[i])
183 | item.setup( loc[0], loc[1], cr.radius, (i == count-1), config )
184 | }
185 |
186 | //duplicate last item (locations/tiles are shuffled, so this is effenctively a random duplicate)
187 | var loc = locs( count ) //since one past last will be on alternate side
188 | var item = findOrCreateItem(tileTypes[count-1])
189 | item.setup( loc[0], loc[1], cr.radius, true, config )
190 |
191 | //remove unsued items
192 | for (var i=items.length-1; i >= 0; --i) {
193 | if (!items.getAt(i).used) {
194 | items.removeAt(i)
195 | }
196 | }
197 | }
198 |
199 |
200 | function shuffle(array) {
201 | var counter = array.length;
202 |
203 | while (counter > 0) {
204 | var index = Math.floor(Math.random() * counter);
205 |
206 | counter--;
207 |
208 | var temp = array[counter];
209 | array[counter] = array[index];
210 | array[index] = temp;
211 | }
212 |
213 | return array;
214 | }
215 |
216 | var areaSize = [0,0]
217 | exports.setSize = function(nAreaSize) {
218 | var diff = Math.abs(areaSize[0]-nAreaSize[0]) + Math.abs(areaSize[1]-nAreaSize[1])
219 | areaSize = nAreaSize
220 |
221 | //recreate level if it's changed too much (mainly to handle rotation)
222 | if (diff > 10 && gameState.isRunning()) {
223 | exports.createLevel(curConfig)
224 | }
225 | }
--------------------------------------------------------------------------------
/dupesy-christmas/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/dupesy-christmas/MyApp.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/dupesy-christmas/PreloadPanel.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | exports.gameTiles = require("GameTiles.js").getPublic()
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dupesy-christmas/README.txt:
--------------------------------------------------------------------------------
1 | # Images
2 | https://pixabay.com/en/christmas-santa-claus-tux-xmas-cap-161316/
3 | https://pixabay.com/en/snowman-christmas-snow-cold-winter-160884/
4 | https://pixabay.com/en/reindeer-drummer-drumming-blue-160878/
5 | https://pixabay.com/en/gingerbread-ornament-embellish-cake-1809629/
6 | https://pixabay.com/en/christmas-ribbon-red-holly-green-160950/
7 | https://pixabay.com/en/santa-man-noel-santa-claus-160903/
8 | https://pixabay.com/en/gift-present-box-wrapped-bow-575400/
9 | https://pixabay.com/en/christmas-decorations-toys-trees-1293958/
10 | https://pixabay.com/en/christmas-christmas-pudding-dessert-1294201/
11 | https://pixabay.com/en/bear-candy-cane-christmas-holiday-1294048/
12 | https://pixabay.com/en/christmas-bouquet-flower-1111751/
13 | https://pixabay.com/en/holidays-christmas-elf-gnome-1062228/
14 | https://pixabay.com/en/bow-box-christmas-gift-holiday-1294066/
15 | https://pixabay.com/en/berry-christmas-holidays-holly-1296257/
16 | https://pixabay.com/en/ribbon-bow-decorative-ornamental-1227600/
17 | https://pixabay.com/en/decorative-blue-trees-woods-bright-575999/
18 | https://pixabay.com/en/candles-flame-holly-xmas-christmas-296790/
19 | https://pixabay.com/en/christmas-tree-snow-christmas-tree-152657/
20 | https://pixabay.com/en/ornament-christmas-xmas-decoration-576541/
21 | https://pixabay.com/en/christmas-cracker-xmas-christmas-576254/
22 | https://pixabay.com/en/decorative-red-trees-bright-plants-576001/
23 | https://pixabay.com/en/holly-christmas-christmas-ball-155210/
24 | https://pixabay.com/en/santa-claus-bearded-beard-159357/
25 | https://pixabay.com/en/candy-cane-candy-cane-candycane-575466/
26 | https://pixabay.com/en/sailing-christmas-caricature-flame-760342/
27 | https://pixabay.com/en/holly-ilex-leaves-silver-christmas-152062/
28 | https://pixabay.com/en/bells-christmas-xmas-holly-160841/
29 | https://pixabay.com/en/red-ribbon-star-adorn-christmas-160898/
30 | https://pixabay.com/en/presents-wrapped-gifts-christmas-576256/
31 | https://pixabay.com/en/christmas-tree-christmas-fir-tree-152059/
32 | https://pixabay.com/en/pudding-christmas-cake-holly-31290/
33 | https://pixabay.com/en/rabbit-easter-bunny-animal-152727/
34 |
35 | https://pixabay.com/en/santa-christmas-sign-border-frame-1719351/
36 | https://pixabay.com/en/santa-reindeer-shristmas-deliver-31319/
37 | https://pixabay.com/en/button-yes-no-red-green-icon-32259/
38 |
39 | https://pixabay.com/en/landscape-background-abstract-grey-1142626/
40 | https://pixabay.com/en/arrows-left-right-down-up-buttons-29567/
41 | https://pixabay.com/en/heart-hearts-love-passion-red-1297159/
42 | https://pixabay.com/en/gingerman-biscuit-gingerbread-162141/
43 |
44 |
45 | # Key
46 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiVGcCh4iZ+W36M+mvr4RaxDVkGpltgvTeT/uqKiSfVGL+z2ch8UwldSBt6FWSeTm43TXk072ZwSXJ0KhnI3shqsYL69Mix9WBme0VpWCI8xTT/E+7ziA/FwjRkmtUwF7kXXA1YsiX/xkpLVO6HlbEcdOxEqdIdGMsqlkYmxnVAluZpYXbej6qMKvtv0OnTFLaEuSBFEgfo8eTLhmW+FjulEKL6Is83F9E4ILyzqn8SmWk1zlRzaFBzSYIsvCljlkOSKC5jmq0MfC3HCsOvxghoolQmOsQ2u/KPus6i/HDNJ+7vDu8MP2WvwnmLK6uDzcNyGybgypb6NiKeB58pRTDwIDAQAB
47 |
--------------------------------------------------------------------------------
/dupesy-christmas/main.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 | var FileSystem = require("FuseJS/FileSystem")
3 | var Environment = require('FuseJS/Environment')
4 |
5 | var gameState = require("GameState.js")
6 | var gameStats = require("GameStats.js")
7 |
8 | var gameTiles = require("GameTiles.js")
9 | exports.gameTiles = gameTiles.getPublic()
10 |
11 | var gameRouting = require("GameRouting.js")
12 | gameRouting.setRouter( router )
13 |
14 | var gameConfig = require("GameConfig.js" )
15 |
16 | gameState.onGameOver = function() {
17 | gameTiles.clear()
18 | router.goto( "gameOver" )
19 | saveData()
20 | }
21 |
22 | gameState.onTimePenalty = function() {
23 | eventTimePenalty.raise()
24 | }
25 |
26 | gameState.onCreateLevel = function(tilesConfig) {
27 | gameTiles.createLevel(tilesConfig)
28 | }
29 |
30 | gameState.onLostLife = function() {
31 | eventLostLife.raise()
32 | }
33 |
34 | gameState.onGoodSelect = function() {
35 | eventGoodSelect.raise()
36 | }
37 |
38 | //https://github.com/fusetools/fuselibs/issues/3383
39 | var saveDir = FileSystem.dataDirectory
40 | if (Environment.ios) {
41 | saveDir = FileSystem.iosPaths.documents
42 | } else if (Environment.android) {
43 | saveDir = FileSystem.androidPaths.files
44 | }
45 | var savePath = saveDir + "/state"
46 |
47 |
48 | function saveData() {
49 | console.log( "Saving: " + savePath )
50 | FileSystem.writeTextToFile( savePath, JSON.stringify( {
51 | version: 1.0,
52 | config: gameConfig.save(),
53 | stats: gameStats.save(),
54 | }))
55 | }
56 |
57 | exports.loading = Observable(false)
58 |
59 | function loadData() {
60 | console.log( "Loading: " + savePath )
61 | exports.loading.value = true
62 | FileSystem.readTextFromFile( savePath ).then( function(contents) {
63 | var data = JSON.parse(contents)
64 | if (data.stats) {
65 | gameStats.load(data.stats)
66 | }
67 | if (data.config) {
68 | gameConfig.load(data.config)
69 | }
70 | exports.loading.value = false
71 |
72 | }, function(error) {
73 | exports.loading.value = false
74 | console.log(error)
75 | })
76 | }
77 |
78 | loadData()
--------------------------------------------------------------------------------
/dupesy-christmas/makefile:
--------------------------------------------------------------------------------
1 | default:
2 |
3 | release_ios:
4 | security unlock-keychain
5 | mono ~/src/fuselibs/Stuff/uno.exe build --target=iOS --configuration=Release DupesyChristmas.unoproj
6 |
7 | release_android:
8 | mono ~/src/fuselibs/Stuff/uno.exe build --target=Android --configuration=Release DupesyChristmas.unoproj
--------------------------------------------------------------------------------
/dupesy-christmas/release.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/dupesy-christmas/release.keystore
--------------------------------------------------------------------------------
/misc/StepSlider/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/misc/StepSlider/MySlider.ux:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/misc/StepSlider/MyVSlider.ux:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/misc/StepSlider/StepSlider.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/misc/attract/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 | var Observable = require("FuseJS/Observable")
4 |
5 | exports.temp = Observable(0.5)
6 |
7 | exports.move = function() {
8 | exports.temp.value = Math.random()
9 | }
10 | exports.goFull = function() {
11 | exports.temp.value = 1.0
12 | }
13 | exports.goZero = function() {
14 | exports.temp.value = 0.0
15 | }
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/misc/attract/MainView.ux.old:
--------------------------------------------------------------------------------
1 |
2 |
3 | var Observable = require("FuseJS/Observable")
4 |
5 | exports.x = Observable(0.5)
6 | exports.y = Observable(0.5)
7 |
8 | exports.move = function() {
9 | exports.x.value = Math.random()
10 | exports.y.value = Math.random()
11 | }
12 |
13 |
14 |
15 |
16 |
17 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/misc/attract/attract.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/misc/layout/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
38 |
39 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/misc/layout/layout.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/page-product-paralax/Assets/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/FontAwesome.otf
--------------------------------------------------------------------------------
/page-product-paralax/Assets/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/background.jpg
--------------------------------------------------------------------------------
/page-product-paralax/Assets/logo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/logo-1.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/logo-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/logo-2.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/product-backpack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/product-backpack.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/product-boots.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/product-boots.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/product-hat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/product-hat.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/product-shirt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/product-shirt.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/product-shoe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/product-shoe.png
--------------------------------------------------------------------------------
/page-product-paralax/Assets/product-teddy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/page-product-paralax/Assets/product-teddy.png
--------------------------------------------------------------------------------
/page-product-paralax/MainState.js:
--------------------------------------------------------------------------------
1 | export default class MainState {
2 | constructor() {
3 | this.products = [{
4 | name: "SHIRT",
5 | text: "Yup, it's really a shirt.",
6 | image: "Assets/product-shirt.png",
7 | color: "#88A",
8 | },{
9 | name: "BOOTS",
10 | text: "Something comfy to walk in",
11 | image: "Assets/product-boots.png",
12 | color: "#B77",
13 | },{
14 | name: "SHOE",
15 | text: "In case you don't like boots",
16 | image: "Assets/product-shoe.png",
17 | color: "#AAA",
18 | },{
19 | name: "HAT",
20 | text: "It's a hat, what more do you want?",
21 | image: "Assets/product-hat.png",
22 | color: "#CC8",
23 | },{
24 | name: "TEDDY",
25 | text: "Cuddly, for lonely forest nights",
26 | image: "Assets/product-teddy.png",
27 | color: "#BAA",
28 | }]
29 | }
30 | }
--------------------------------------------------------------------------------
/page-product-paralax/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
40 |
41 |
42 |
46 |
47 |
48 |
49 |
50 |
52 |
53 |
54 |
55 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
68 |
69 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
91 |
92 |
93 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/page-product-paralax/README.md:
--------------------------------------------------------------------------------
1 | # Product Browser with Parallax Effect
2 |
3 | This app is a product catalog that uses a parallax style effect for the scrolling of items.
4 |
5 | Programmed live on [my Twitch stream](https://www.twitch.tv/mortoray) using [Fuse](https://fusetools.com/).
6 |
7 | 
8 |
9 | Key points:
10 |
11 | - PageControl with custom transitions
12 | - the difference in scroll speeds of the various product elements
13 | - the point bar at bottom with progress connection
14 | - use of FontAwesome for icons
15 |
16 |
17 |
18 | ## Resources
19 |
20 | - https://pixabay.com/en/winter-boots-boots-winter-shoes-fur-3053462/
21 | - https://pixabay.com/en/teddy-costume-clothing-funny-cute-3114148/
22 | - https://pixabay.com/en/winter-boots-boots-winter-shoes-fur-3053462/
23 | - https://pixabay.com/en/hat-clothing-headwear-cowboy-hat-2738831/
24 | - https://pixabay.com/en/teddy-stuffed-animal-hat-straw-hat-3100391/
25 | - https://pixabay.com/en/animal-face-logo-raccoon-vicious-2028258/
26 | - https://pixabay.com/en/logo-spiral-shiny-silver-glossy-1914020/
27 | - Other items from our internal sources
28 |
--------------------------------------------------------------------------------
/page-product-paralax/page-product-paralax.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "RootNamespace":"",
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "*.js:FuseJS",
10 | "Assets/*.jpg:Bundle",
11 | "Assets/*.png:Bundle",
12 | ]
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/permission-popup/Assets/airplane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/permission-popup/Assets/airplane.png
--------------------------------------------------------------------------------
/permission-popup/Assets/bell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/permission-popup/Assets/bell.png
--------------------------------------------------------------------------------
/permission-popup/Assets/marker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/permission-popup/Assets/marker.png
--------------------------------------------------------------------------------
/permission-popup/Assets/pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/permission-popup/Assets/pattern.png
--------------------------------------------------------------------------------
/permission-popup/Assets/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/permission-popup/Assets/star.png
--------------------------------------------------------------------------------
/permission-popup/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
17 |
18 |
19 |
20 |
22 |
23 |
24 |
26 |
27 |
28 |
30 |
31 |
32 |
34 |
35 |
36 |
37 |
38 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
61 |
64 |
65 |
66 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/permission-popup/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## Resources
3 |
4 | https://pixabay.com/en/star-icon-flat-black-emblem-1915450/
5 | https://pixabay.com/en/eye-vector-figure-illustration-2635504/
6 | https://pixabay.com/en/marker-map-interesting-places-3365838/
7 | https://pixabay.com/en/bells-ribbon-metal-ringing-157961/
8 | https://pixabay.com/en/paper-plane-paper-dart-149424/
9 |
--------------------------------------------------------------------------------
/permission-popup/permission-popup.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*",
8 | "*.js:FuseJS",
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/pixabay/Assets/icon_cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_cancel.png
--------------------------------------------------------------------------------
/pixabay/Assets/icon_config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_config.png
--------------------------------------------------------------------------------
/pixabay/Assets/icon_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_info.png
--------------------------------------------------------------------------------
/pixabay/Assets/icon_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_search.png
--------------------------------------------------------------------------------
/pixabay/Assets/icon_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_star.png
--------------------------------------------------------------------------------
/pixabay/Assets/icon_thumbsup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_thumbsup.png
--------------------------------------------------------------------------------
/pixabay/Assets/icon_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/icon_user.png
--------------------------------------------------------------------------------
/pixabay/Assets/pixabay_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Assets/pixabay_logo.png
--------------------------------------------------------------------------------
/pixabay/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | router.modify({
5 | how: "Goto",
6 | transition: "Bypass",
7 | path: [ "search", {} ]
8 | })
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/pixabay/Modules/.Searching.js.kate-swp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Modules/.Searching.js.kate-swp
--------------------------------------------------------------------------------
/pixabay/Modules/Searching.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/pixabay/Modules/Searching.js
--------------------------------------------------------------------------------
/pixabay/PageImageInfo.js:
--------------------------------------------------------------------------------
1 | var Observable = require("FuseJS/Observable")
2 |
3 | console.log( "Huh" )
4 | console.dir(this.Parameter.value)
5 |
6 | exports.data = this.Parameter.map( function(param) {
7 | console.log( "Mapping!" )
8 | console.dir(param)
9 | param.size = param.imageWidth + " x " + param.imageHeight
10 | return param
11 | })
12 |
13 | exports.goBack = function() {
14 | router.goBack()
15 | }
--------------------------------------------------------------------------------
/pixabay/PageImageInfo.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/pixabay/PageSearch.js:
--------------------------------------------------------------------------------
1 | Observable = require("FuseJS/Observable")
2 | var pixabay = require("pixabay")
3 |
4 | exports.items = Observable()
5 | exports.term = Observable()
6 | exports.loading = Observable(false)
7 |
8 | var page = this
9 |
10 | page.Parameter.onValueChanged( function(param) {
11 | exports.term.value = param.term || ""
12 | })
13 |
14 | var pageNumber = 1
15 | var pageDone = false
16 |
17 | var baseUrl = page.Parameter.map( function(param) {
18 | var url = pixabay.search +
19 | "?key=" + encodeURIComponent(pixabay.key) +
20 | "&q=" + encodeURIComponent(param.term || "") +
21 | "&per_page=" + (param.perPage || 40)
22 |
23 | return url
24 | })
25 |
26 | baseUrl.onValueChanged( function(url) {
27 | pageNumber = 1
28 | pageDone = false
29 |
30 | theScroll.gotoRelative(0)
31 | exports.items.clear()
32 | search(url)
33 | })
34 |
35 | function search(url) {
36 | console.log( "Search: " + url )
37 | exports.loading.value = true
38 | fetch( url ).then( function(resp) {
39 |
40 | if (resp.status != 200) {
41 | console.log( "Failed: " + resp.statusText)
42 | pageDone = true
43 | }
44 |
45 | var data = resp.json().then( function(data) {
46 | if (data.hits.length == 0) {
47 | pageDone = true
48 | } else {
49 |
50 | data.hits.forEach( function(item) {
51 | exports.items.add(item)
52 | })
53 | scrolledToEnd.check()
54 | }
55 |
56 | exports.loading.value = false
57 | }).catch(function(err) {
58 |
59 | exports.loading.value = false
60 | console.log( "Data Error: " + err)
61 | })
62 |
63 | }).catch(function(err) {
64 | exports.loading.value = false
65 | console.log( "Fetch Error: " + err )
66 | })
67 | }
68 |
69 | exports.onEnd = function() {
70 | if (pageDone) {
71 | return
72 | }
73 |
74 | pageNumber++
75 | search(baseUrl.value + "&page=" + pageNumber)
76 | }
77 |
78 | exports.search = function() {
79 | var p = page.Parameter.value || {}
80 | p.term = exports.term.value
81 | page.Parameter.value = p
82 | }
83 |
84 | var selected = Observable()
85 | exports.select = function(args) {
86 | selected.value = args.data
87 | }
88 |
89 | exports.goInfo = function() {
90 | router.push( "info", selected.value )
91 | }
92 |
--------------------------------------------------------------------------------
/pixabay/pixabay.js:
--------------------------------------------------------------------------------
1 | // Put your pixabay key as a string here
2 | exports.key = "YOUR PIXABAY KEY FROM https://pixabay.com/api/docs/"
3 | exports.key = "401922-2c93ef5c961e023d90594333e"
4 |
5 | exports.search = "https://pixabay.com/api/"
6 |
--------------------------------------------------------------------------------
/pixabay/pixabay.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "InternalsVisibleTo": [],
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Projects": [],
8 | "Includes": [
9 | "*",
10 | "*.js:Bundle",
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/signup-transition/Assets/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/signup-transition/Assets/background.png
--------------------------------------------------------------------------------
/signup-transition/MainState.js:
--------------------------------------------------------------------------------
1 | class PageLogin {
2 | constructor(mainState) {
3 | this.mainState = mainState
4 | this.email = "login@smply.com"
5 | this.password = "1231312321"
6 | }
7 |
8 | get inputValid() {
9 | return this.email != "" && this.password != ""
10 | }
11 |
12 | forgotPassword() {
13 | }
14 |
15 | action() {
16 | this.mainState.gotoLoading()
17 | setTimeout( () => { this.mainState.gotoHome() }, 1000 )
18 | }
19 | }
20 |
21 | class PageRegister {
22 | constructor(mainState) {
23 | this.mainState = mainState
24 | this.email = "sample@smply.com"
25 | this.password = "1231312321"
26 | this.password2 = ""
27 | }
28 |
29 | get inputValid() {
30 | return this.email != "" && this.password != "" &&
31 | this.password == this.password2
32 | }
33 |
34 | action() {
35 | //TODO: implement
36 | }
37 | }
38 |
39 | class PageLogout {
40 | constructor(mainState) {
41 | this.$path = 'logout'
42 | this.mainState = mainState
43 | this.loginPages = [ new PageLogin(mainState), new PageRegister(mainState) ]
44 | }
45 | }
46 |
47 | class PageLoading {
48 | constructor(mainState) {
49 | this.$path = 'loading'
50 | }
51 | }
52 |
53 | class PageHome {
54 | constructor(mainState) {
55 | this.mainState = mainState
56 | this.$path = 'home'
57 |
58 | this.items = [ {
59 | name: "Ricky Bass",
60 | status: "Pending",
61 | date: "13 Apr 2017 10:13 AM",
62 | amount: "$2348.85"
63 | },{
64 | name: "Katie Roy",
65 | status: "Denied",
66 | date: "12 Apr 2017 11:13 AM",
67 | amount: "$148.27"
68 | },{
69 | name: "Tom Tailor",
70 | status: "Accepted",
71 | date: "11 Apr 2017 8:13 AM",
72 | amount: "$348.45"
73 | }]
74 | }
75 | }
76 |
77 | export default class MainState {
78 | constructor() {
79 | this.title ="Login Transitions"
80 |
81 | this.mainPages = [ new PageLogout(this) ]
82 | }
83 |
84 | gotoLoading() {
85 | this.mainPages[0] = new PageLoading(this)
86 | }
87 |
88 | gotoHome() {
89 | this.mainPages.splice(0, this.mainPages.length, new PageHome(this))
90 | //this.mainPages.pop();
91 | //this.mainPages[0] = new PageHome(this)
92 | }
93 |
94 | logout() {
95 | this.mainPages = [ new PageLogout(this) ]
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/signup-transition/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/signup-transition/PageHome.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
44 |
46 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
77 |
79 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/signup-transition/PageLoading.ux:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/signup-transition/PageLogout.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/signup-transition/README.md:
--------------------------------------------------------------------------------
1 | # Login Transitions
2 |
3 | Inspired by https://dribbble.com/shots/3668351-Funding-app-Home-screen
4 |
5 | ## Resources
6 |
7 | https://pixabay.com/en/color-triangle-geometric-textured-2174049/
8 |
--------------------------------------------------------------------------------
/signup-transition/signup-transition.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "RootNamespace":"",
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "*.js:FuseJS",
10 | ]
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/smart-home-app/ItemPage.ux:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/smart-home-app/ItemSelector.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/smart-home-app/MainState.js:
--------------------------------------------------------------------------------
1 | class Item {
2 | constructor( type, name, color, icon, energy ) {
3 | this.type = type
4 | this.name = name
5 | this.color = color
6 | this.energy = energy
7 | this.icon = icon
8 |
9 | this.status = true
10 | this.level = 0.7
11 | this.statusString = "Playing Good Song..."
12 | }
13 |
14 | toggleStatus() {
15 | this.status = !this.status
16 | }
17 |
18 | controlBack() {
19 | //device.sendControl( "BACK" )
20 | }
21 | controlPause() {
22 | }
23 | controlNext() {
24 | }
25 | }
26 |
27 | class ItemPage {
28 | constructor( item ) {
29 | this.$path = "item"
30 | this.item = item
31 | }
32 | }
33 |
34 |
35 | class Room {
36 | constructor(name, color, icon, items) {
37 | this.name = name
38 | this.color = color
39 | this.icon = icon
40 | this.items = items
41 | }
42 |
43 | get totalEnergy() {
44 | return this.items.reduce( (a,b) => a + b.energy, 0 )
45 | }
46 |
47 | addItem() {
48 | this.items.push( new Item( "generic", "Switch", "#2769ff", "👾", 5 ) )
49 | }
50 | }
51 |
52 | class Selector {
53 | constructor(mainState) {
54 | this.$path = "selector"
55 | this.mainState = mainState
56 |
57 | this.rooms = [
58 | new Room( "Bedroom", "#215eF9", "🛏", [
59 | new Item( "light","Light", "#ffc42e", "💡", 25 ),
60 | new Item( "generic","Fan", "#c4ff2e", "🌬", 15 ),
61 | new Item( "generic","Air Conditioner", "#2769ff", "❄️", 37 ),
62 | new Item( "generic","Television", "#aa88ff", "📺", 15 ),
63 | new Item( "generic","Computer", "#ffc42e", "🖥", 25 ),
64 | new Item( "generic","Playstation", "#2769ff", "🎮", 37 ),
65 | ] ),
66 | new Room( "Dining Room", "#29e27f", "🍲", [
67 | new Item( "light","Light", "#ffc42e", "💡", 25 ),
68 | new Item( "generic","Air Conditioner", "#2769ff", "❄️", 37 ),
69 | new Item( "generic","Television", "#aa88ff", "📺", 15 ),
70 | new Item( "stereo","Stereo", "#c4ff2e", "🎵", 15 ),
71 | ] ),
72 | new Room( "Kitchen", "#7f29e2", "🔌", [
73 | new Item( "light","Light", "#ffc42e", "💡", 25 ),
74 | new Item( "generic","Fan", "#c4ff2e", "🌬", 15 ),
75 | new Item( "generic","Water Heater", "#c4ff2e", "☀️", 15 ),
76 | new Item( "generic","Fridge", "#2769ff", "💧", 37 ),
77 | new Item( "generic","Washing Machine", "#aa88ff", "🎰", 15 ),
78 | new Item( "generic","Microwave", "#ffc42e", "😞", 25 ),
79 | ] ),
80 | new Room( "Storage", "#7f7f7f","📦", [
81 | new Item( "light","Light", "#ffc42e", "💡", 25 ),
82 | new Item( "generic","Heater", "#c4ff2e", "☀", 0 ),
83 | new Item( "generic","Distiller", "#FEBF2A", "🥃", 0 ),
84 | ] ),
85 | ]
86 |
87 | this.selectedRoom = this.rooms[0]
88 | }
89 |
90 | selectRoom(args) {
91 | this.selectedRoom = args.data
92 | }
93 |
94 | goItem(args) {
95 | this.mainState.push( new ItemPage(args.data) )
96 | }
97 | }
98 |
99 | class Welcome {
100 | constructor() {
101 |
102 | }
103 | }
104 |
105 | export default class MainState {
106 | constructor() {
107 | this.selector = new Selector(this)
108 | this.welcome = new Welcome()
109 |
110 | this.pages = [ this.welcome ]
111 | }
112 |
113 | goSelector() {
114 | this.pages = [ this.selector ]
115 | }
116 |
117 | push( page ) {
118 | this.pages.push( page )
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/smart-home-app/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/smart-home-app/RoomsSelector.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/smart-home-app/smart-home-app.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "RootNamespace":"",
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "*.js:FuseJS",
10 | ]
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/stream/let-expression/AppState.js:
--------------------------------------------------------------------------------
1 | export default class AppState {
2 | constructor() {
3 | this.title = "Fuse Coding"
4 | this.count = 0
5 | this.maxCount = 100
6 | }
7 |
8 | incr() {
9 | this.count += 5
10 | if( this.count >= this.maxCount ) {
11 | this.count -= this.maxCount
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/stream/let-expression/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/stream/let-expression/let-expression.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*",
8 | "*.js:FuseJS",
9 | ]
10 | }
--------------------------------------------------------------------------------
/stream/line-anim/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
9 |
11 |
13 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/stream/line-anim/line-anim.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/stream/material-design-input/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/stream/material-design-input/material-design-input.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/stream/patch-line/MainState.js:
--------------------------------------------------------------------------------
1 | export default class MainState {
2 | constructor() {
3 | this.accounts = [ "Savings", "Chequeing", "Credit Card" ]
4 | this.recipients = [ "Brother", "Parents", "Steam", "Shady Guy" ]
5 | }
6 | }
--------------------------------------------------------------------------------
/stream/patch-line/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
65 |
66 |
67 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/stream/patch-line/patch-line.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "RootNamespace":"",
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "*.js:FuseJS",
10 | ]
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/stream/typescript-1/Assets/bowling.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/stream/typescript-1/Assets/bowling.png
--------------------------------------------------------------------------------
/stream/typescript-1/Assets/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/stream/typescript-1/Assets/clock.png
--------------------------------------------------------------------------------
/stream/typescript-1/Assets/mountain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/stream/typescript-1/Assets/mountain.png
--------------------------------------------------------------------------------
/stream/typescript-1/Assets/rocket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/stream/typescript-1/Assets/rocket.png
--------------------------------------------------------------------------------
/stream/typescript-1/Currency.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | //can return undefined
3 | //TODO: why doesn't this work
4 | //var fxMap : Map> = new Map>
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | // where stirng is From_To standard currency exchange format
7 | var fxMap = new Map();
8 | var fxLoading = new Map();
9 | var watchers = [];
10 | function addWatcher(callback) {
11 | watchers.push(callback);
12 | }
13 | exports.addWatcher = addWatcher;
14 | function getExchange(from, to) {
15 | var sym = from + "_" + to;
16 | var val = fxMap.get(sym);
17 | if (val == undefined) {
18 | loadRate(sym);
19 | }
20 | return val;
21 | }
22 | exports.getExchange = getExchange;
23 | function storeRate(sym, value) {
24 | fxMap.set(sym, value);
25 | for (var _i = 0, watchers_1 = watchers; _i < watchers_1.length; _i++) {
26 | var w = watchers_1[_i];
27 | w(sym, value);
28 | }
29 | }
30 | function loadRate(sym) {
31 | if (fxLoading.get(sym) == true) {
32 | return;
33 | }
34 | fxLoading.set(sym, true);
35 | var url = "https://free.currencyconverterapi.com/api/v5/convert?q=" + sym + "&compact=y";
36 | console.log("Getting " + url);
37 | fetch(url).
38 | then(function (response) {
39 | return response.json();
40 | }).
41 | then(function (json) {
42 | console.dir(json);
43 | fxLoading.set(sym, false);
44 | storeRate(sym, json[sym].val);
45 | }).
46 | catch(function (err) {
47 | fxLoading.set(sym, false);
48 | //just for testing to see that the rest is working
49 | setTimeout(function () {
50 | storeRate(sym, Math.random() + 0.5);
51 | }, 1000 * (Math.random() + 1));
52 | console.log(err.message);
53 | });
54 | }
55 |
--------------------------------------------------------------------------------
/stream/typescript-1/Currency.ts:
--------------------------------------------------------------------------------
1 | //can return undefined
2 | //TODO: why doesn't this work
3 | //var fxMap : Map> = new Map>
4 |
5 | // where stirng is From_To standard currency exchange format
6 | var fxMap : Map = new Map()
7 | var fxLoading : Map = new Map()
8 |
9 | type WatcherCallback = ( sym : string, value : number ) => void
10 | var watchers : WatcherCallback[] = []
11 |
12 | export function addWatcher( callback : WatcherCallback ) {
13 | watchers.push( callback )
14 | }
15 |
16 | export function getExchange( from : string, to : string ) : number | undefined {
17 | let sym = `${from}_${to}`
18 | let val = fxMap.get(sym)
19 | if( val == undefined ) {
20 | loadRate(sym)
21 | }
22 |
23 | return val
24 | }
25 |
26 | function storeRate( sym : string, value : number ) {
27 | fxMap.set( sym, value )
28 | for( let w of watchers ) {
29 | w(sym, value)
30 | }
31 | }
32 |
33 | function loadRate( sym : string ) {
34 | if( fxLoading.get(sym) == true ) {
35 | return
36 | }
37 |
38 | fxLoading.set(sym, true)
39 | let url = `https://free.currencyconverterapi.com/api/v5/convert?q=${sym}&compact=y`
40 | console.log( "Getting " + url )
41 | fetch( url ).
42 | then( function(response) {
43 | return response.json()
44 | }).
45 | then( function(json) {
46 | console.dir(json)
47 | fxLoading.set(sym, false)
48 | storeRate( sym, json[sym].val )
49 | }).
50 | catch( function(err) {
51 | fxLoading.set(sym, false)
52 | //just for testing to see that the rest is working
53 | setTimeout( () => {
54 | storeRate( sym, Math.random() + 0.5)
55 | }, 1000 * (Math.random()+1) )
56 | console.log(err.message)
57 | })
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/stream/typescript-1/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/stream/typescript-1/State.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importStar = (this && this.__importStar) || function (mod) {
3 | if (mod && mod.__esModule) return mod;
4 | var result = {};
5 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6 | result["default"] = mod;
7 | return result;
8 | };
9 | Object.defineProperty(exports, "__esModule", { value: true });
10 | var currency = __importStar(require("./Currency"));
11 | function formatCurrency(currency) {
12 | switch (currency) {
13 | case "EUR": return "€";
14 | case "USD": return "$";
15 | case "GBP": return "£";
16 | }
17 | return currency;
18 | }
19 | var Config = /** @class */ (function () {
20 | function Config() {
21 | }
22 | Config.prototype.formatCurrency = function (mv) {
23 | if (this.showCurrency == undefined) {
24 | return mv.value + " " + formatCurrency(mv.currency);
25 | }
26 | var fx = currency.getExchange(mv.currency, this.showCurrency);
27 | if (fx == undefined) {
28 | return "?";
29 | }
30 | return (mv.value * fx).toFixed(2) + " " + formatCurrency(this.showCurrency);
31 | };
32 | return Config;
33 | }());
34 | var config = new Config();
35 | var MoneyValue = /** @class */ (function () {
36 | function MoneyValue(value, currency) {
37 | this.value = value;
38 | this.currency = currency;
39 | }
40 | Object.defineProperty(MoneyValue.prototype, "formatted", {
41 | get: function () {
42 | return this.value + " " + formatCurrency(this.currency);
43 | },
44 | enumerable: true,
45 | configurable: true
46 | });
47 | return MoneyValue;
48 | }());
49 | var Monies = /** @class */ (function () {
50 | function Monies() {
51 | }
52 | Monies.EUR = function (value) {
53 | return new MoneyValue(value, "EUR");
54 | };
55 | Monies.USD = function (value) {
56 | return new MoneyValue(value, "USD");
57 | };
58 | Monies.CAD = function (value) {
59 | return new MoneyValue(value, "CAD");
60 | };
61 | return Monies;
62 | }());
63 | var Item = /** @class */ (function () {
64 | function Item(name, image, value, tags) {
65 | this.name = name;
66 | this.image = image;
67 | this.value = value;
68 | this.tags = tags;
69 | }
70 | Object.defineProperty(Item.prototype, "formattedCurrent", {
71 | get: function () {
72 | return config.formatCurrency(this.value);
73 | },
74 | enumerable: true,
75 | configurable: true
76 | });
77 | Item.prototype.update = function () {
78 | };
79 | return Item;
80 | }());
81 | var State = /** @class */ (function () {
82 | function State() {
83 | var _this = this;
84 | this.showCurrency = [];
85 | this.config = config;
86 | this.title = "Typey Woo!";
87 | this.items = [
88 | new Item("Rickety Rocket", "Assets/rocket.png", Monies.EUR(13), ['fast', 'cool']),
89 | new Item("Black Bowling Ball", "Assets/bowling.png", Monies.USD(9), ['fast', 'noisy']),
90 | new Item("Clicking Tock Clock", "Assets/clock.png", Monies.EUR(1), ['slow', 'noisy']),
91 | new Item("Mountainous Mountain", "Assets/mountain.png", Monies.CAD(1), ['slow', 'cool']),
92 | ];
93 | this.currencies = ["USD", "EUR", "GBP"];
94 | currency.addWatcher(function (s, v) { _this.updatedCurrency(s, v); });
95 | }
96 | State.prototype.currencyChanged = function () {
97 | if (this.showCurrency.length == 0) {
98 | this.config.showCurrency = undefined;
99 | }
100 | else {
101 | this.config.showCurrency = this.showCurrency[0];
102 | }
103 | this.updateItems();
104 | };
105 | State.prototype.updateItems = function () {
106 | for (var _i = 0, _a = this.items; _i < _a.length; _i++) {
107 | var v = _a[_i];
108 | v.update();
109 | }
110 | };
111 | //TYPESCRIPT: no way to mark variable as ignored/unused
112 | State.prototype.updatedCurrency = function (sym, value) {
113 | exports.ignore = sym;
114 | exports.ignore = value;
115 | this.updateItems();
116 | };
117 | return State;
118 | }());
119 | exports.default = State;
120 |
--------------------------------------------------------------------------------
/stream/typescript-1/State.ts:
--------------------------------------------------------------------------------
1 | import * as currency from "./Currency"
2 |
3 | function formatCurrency( currency : string ) : string {
4 | switch( currency ) {
5 | case "EUR": return "€";
6 | case "USD": return "$";
7 | case "GBP": return "£";
8 | }
9 | return currency;
10 | }
11 |
12 | class Config {
13 | //if undefined do no conversion
14 | showCurrency? : string
15 |
16 | formatCurrency( mv : MoneyValue ) : string {
17 | if( this.showCurrency == undefined ) {
18 | return `${mv.value} ${formatCurrency(mv.currency)}`
19 | }
20 |
21 | var fx = currency.getExchange(mv.currency, this.showCurrency)
22 | if( fx == undefined ) {
23 | return "?"
24 | }
25 | return `${(mv.value*fx).toFixed(2)} ${formatCurrency(this.showCurrency)}`
26 | }
27 | }
28 | var config : Config = new Config()
29 |
30 | class MoneyValue {
31 | get formatted() : string {
32 | return `${this.value} ${formatCurrency(this.currency)}`
33 | }
34 |
35 | constructor(
36 | public readonly value :number,
37 | public readonly currency : string ) {
38 | }
39 | }
40 |
41 | class Monies {
42 | static EUR( value : number ) : MoneyValue {
43 | return new MoneyValue( value, "EUR" )
44 | }
45 |
46 | static USD( value : number ) : MoneyValue {
47 | return new MoneyValue( value, "USD" )
48 | }
49 |
50 | static CAD( value : number ) : MoneyValue {
51 | return new MoneyValue( value, "CAD" )
52 | }
53 | }
54 |
55 | class Item {
56 | constructor(
57 | public name : string,
58 | public image : string,
59 | public value : MoneyValue,
60 | public tags : string[] ) {
61 | }
62 |
63 | get formattedCurrent() : string {
64 | return config.formatCurrency(this.value)
65 | }
66 |
67 | update() {
68 | }
69 | }
70 |
71 | export default class State {
72 | title : string
73 | items : Item[]
74 | currencies : string[]
75 | showCurrency : string[] = []
76 | config : Config
77 |
78 | constructor() {
79 | this.config = config
80 | this.title = "Typey Woo!"
81 | this.items = [
82 | new Item( "Rickety Rocket", "Assets/rocket.png",
83 | Monies.EUR(13),
84 | [ 'fast', 'cool' ] ),
85 | new Item( "Black Bowling Ball", "Assets/bowling.png",
86 | Monies.USD(9),
87 | [ 'fast', 'noisy' ] ),
88 | new Item( "Clicking Tock Clock", "Assets/clock.png",
89 | Monies.EUR(1),
90 | [ 'slow', 'noisy' ] ),
91 | new Item( "Mountainous Mountain", "Assets/mountain.png",
92 | Monies.CAD(1),
93 | [ 'slow', 'cool' ] ),
94 | ]
95 |
96 | this.currencies = [ "USD", "EUR", "GBP" ]
97 |
98 | currency.addWatcher( (s,v) => { this.updatedCurrency(s,v) } )
99 | }
100 |
101 | currencyChanged() {
102 | if( this.showCurrency.length == 0 ) {
103 | this.config.showCurrency = undefined
104 | } else {
105 | this.config.showCurrency = this.showCurrency[0]
106 | }
107 |
108 | this.updateItems()
109 | }
110 |
111 | updateItems() {
112 | for( let v of this.items ){
113 | v.update()
114 | }
115 | }
116 |
117 | //TYPESCRIPT: no way to mark variable as ignored/unused
118 | updatedCurrency( sym : string, value : number ) {
119 | ignore = sym
120 | ignore = value
121 | this.updateItems()
122 | }
123 | }
124 |
125 | export var ignore : any
126 |
--------------------------------------------------------------------------------
/stream/typescript-1/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Basic Options */
4 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6 | "lib": ["es5","es6","dom"], /* Specify library files to be included in the compilation. */
7 | // "allowJs": true, /* Allow javascript files to be compiled. */
8 | // "checkJs": true, /* Report errors in .js files. */
9 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
11 | // "sourceMap": true, /* Generates corresponding '.map' file. */
12 | // "outFile": "./", /* Concatenate and emit output to single file. */
13 | // "outDir": "./", /* Redirect output structure to the directory. */
14 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
15 | // "removeComments": true, /* Do not emit comments to output. */
16 | // "noEmit": true, /* Do not emit outputs. */
17 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
18 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
19 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20 |
21 | /* Strict Type-Checking Options */
22 | "strict": true, /* Enable all strict type-checking options. */
23 | "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
24 | "strictNullChecks": true, /* Enable strict null checks. */
25 | "strictFunctionTypes": true, /* Enable strict checking of function types. */
26 | "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
27 | "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
28 | "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
29 |
30 | /* Additional Checks */
31 | "noUnusedLocals": true, /* Report errors on unused locals. */
32 | "noUnusedParameters": true, /* Report errors on unused parameters. */
33 | "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
34 | "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
35 |
36 | /* Module Resolution Options */
37 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
38 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
39 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
40 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
41 | // "typeRoots": [], /* List of folders to include type definitions from. */
42 | // "types": [], /* Type declaration files to be included in compilation. */
43 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
44 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
45 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
46 |
47 | /* Source Map Options */
48 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
49 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
50 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
51 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
52 |
53 | /* Experimental Options */
54 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
55 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
56 | }
57 | }
--------------------------------------------------------------------------------
/stream/typescript-1/typescript-1.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "RootNamespace":"",
3 | "Packages": [
4 | "Fuse",
5 | "FuseJS"
6 | ],
7 | "Includes": [
8 | "*",
9 | "*.js:FuseJS",
10 | "Assets/*.png:Bundle",
11 | ]
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/stream/ux-rest/MainView.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 | var Observable = require("FuseJS/Observable")
4 | exports.items = Observable( "Hello", "World" )
5 |
6 | var count = 0
7 | exports.add = function() {
8 | exports.items.add( "New Item: " + (count++) )
9 | }
10 |
11 | exports.remove = function( args ) {
12 | exports.items.remove( args.data )
13 | }
14 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
68 |
69 |
70 |
71 |
75 |
76 |
77 |
78 |
79 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/stream/ux-rest/ux-rest.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*"
8 | ]
9 | }
--------------------------------------------------------------------------------
/time-tracker/Assets/arrow_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/time-tracker/Assets/arrow_left.png
--------------------------------------------------------------------------------
/time-tracker/Assets/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mortoray/fuse-demos/1f91a62d81dac692e7e22b21aac9e4f48b71d975/time-tracker/Assets/header.png
--------------------------------------------------------------------------------
/time-tracker/Includes/ItemGradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/time-tracker/MainState.js:
--------------------------------------------------------------------------------
1 | var moment = require( "lib/moment.js" )
2 |
3 | function formatHours( dur ) {
4 | var pad = "00"
5 | return Math.floor(dur) + ":" + (pad + Math.floor((dur %1)*60)).slice(-pad.length)
6 | }
7 |
8 | class TimeItem {
9 | constructor(name, icon, color, value) {
10 | this.name = name
11 | this.color = color
12 | this.value = value
13 | this.icon = icon
14 |
15 | //simulate some data
16 | this.timeStart = moment().subtract( -(Math.random() *10), 'hours' )
17 | this.timeEnd = this.timeStart.clone().add( value*300, 'minutes' )
18 | }
19 |
20 | get hours() {
21 | return moment.duration(this.timeEnd.diff(this.timeStart)).asHours()
22 | }
23 |
24 | get durationStr() {
25 | return formatHours(this.hours)
26 | }
27 |
28 | get startStr() {
29 | return this.timeStart.format( "HH:MM" )
30 | }
31 |
32 | get endStr() {
33 | return this.timeEnd.format( "HH:MM" )
34 | }
35 |
36 | }
37 |
38 | class PageDetails {
39 | constructor( collection ) {
40 | this.item = collection
41 | this.productivity = Math.floor(Math.random() * 500) / 60
42 | }
43 |
44 | get prodStr() {
45 | return formatHours(this.productivity)
46 | }
47 | }
48 |
49 | class TimeCollection {
50 | constructor( name ) {
51 | this.name = name
52 | this.values = [
53 | new TimeItem("Sketch", "S", "#1F8", Math.random() ),
54 | new TimeItem("Dribbble", "D", "#F1F", Math.random() ),
55 | new TimeItem("Learning", "L", [1.0, 0.8, 0.1], Math.random() ),
56 | new TimeItem("Chat", "C", "#18F", Math.random() ),
57 | new TimeItem("Sport", "P", "#F81", Math.random() ),
58 | new TimeItem("TV", "T", "#888", Math.random() ),
59 | ]
60 | }
61 |
62 | get sortedValues() {
63 | var q = this.values.slice()
64 | q.sort( (a,b) => b.hours - a.hours )
65 | return q
66 | }
67 | }
68 |
69 | class PageOverview {
70 | constructor() {
71 | this.days = [
72 | new TimeCollection( "Friday" ),
73 | new TimeCollection( "Thursday" ),
74 | new TimeCollection( "Wednesday" ),
75 | new TimeCollection( "Tuesday" ),
76 | new TimeCollection( "Monday" ),
77 | new TimeCollection( "Sunday" ),
78 | new TimeCollection( "Saturday" ),
79 | ]
80 |
81 | this.weeks = [
82 | new TimeCollection( "1 Jan" ),
83 | new TimeCollection( "8 Jan" ),
84 | new TimeCollection( "15 Jan" ),
85 | new TimeCollection( "22 Jan" ),
86 | new TimeCollection( "29 Jan" ),
87 | new TimeCollection( "5 Feb" ),
88 | new TimeCollection( "12 Feb" ),
89 | new TimeCollection( "19 Feb" ),
90 | new TimeCollection( "26 Feb" ),
91 | ]
92 |
93 | this.months = [
94 | new TimeCollection( "December" ),
95 | new TimeCollection( "November" ),
96 | new TimeCollection( "October" ),
97 | new TimeCollection( "September" ),
98 | new TimeCollection( "August" ),
99 | new TimeCollection( "July" ),
100 | ]
101 | }
102 | }
103 |
104 | export default class MainState {
105 | constructor() {
106 | this.pages = [ new PageOverview() ]
107 | }
108 |
109 | showItem( args ) {
110 | var item = args.data
111 | this.pages.push( new PageDetails(item) )
112 | }
113 |
114 | goBack() {
115 | this.pages.pop()
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/time-tracker/MainState.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/time-tracker/PageDetails.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/time-tracker/PageOverview.ux:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
41 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/time-tracker/README.md:
--------------------------------------------------------------------------------
1 | # Time Tracker
2 |
3 | Based on the work of Johny vino™: https://dribbble.com/shots/3960480-Your-Tracker
4 |
5 | ## Resources
6 |
7 | https://pixabay.com/en/silhouette-set-transparent-black-1229849/
--------------------------------------------------------------------------------
/time-tracker/time-tracker.unoproj:
--------------------------------------------------------------------------------
1 | {
2 | "Packages": [
3 | "Fuse",
4 | "FuseJS"
5 | ],
6 | "Includes": [
7 | "*",
8 | "*.js:FuseJS",
9 | ]
10 | }
--------------------------------------------------------------------------------