diff --git a/package.json b/package.json index 025e8663..4d8c5181 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "watch-client": "npm run build-client-js -- --watch", "watch-browser": "npm run build-client-js -- --watch", "watch-css": "nodemon --watch src/scss -e scss -x \"npm run build-css -- --reload\"", - "deploy-docs": "node scripts/build-widgets-reference.js > resources/docs/widgets-reference.md && cd resources && mkdocs gh-deploy --clean && rm -rf site", + "build-docs": "node scripts/build-widgets-reference.js > resources/docs/docs/widgets-reference.md && cd resources && mkdocs build --clean", "test": "eslint src && npm run build && node tests/test.js" }, "engines": { diff --git a/resources/README.md b/resources/README.md index 9bc74a6d..c7520065 100644 --- a/resources/README.md +++ b/resources/README.md @@ -3,9 +3,9 @@ ```bash $ sudo apt-get install python python-pip # python package manager $ sudo pip install mkdocs # docs site builder -$ sudo pip install mkdocs-material # theme +$ sudo pip install mkdocs-material # theme $ mkdocs serve # make docs available on http://127.0.0.1:8000 -$ mkdocs build # build docs static site -$ mkdocs gh-deploy --clean # deploy static site on gh-pages branch +# or +$ mkdocs build # build docs in site/ ``` diff --git a/resources/docs/CNAME b/resources/docs/CNAME deleted file mode 100644 index a5d26395..00000000 --- a/resources/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -osc.ammd.net diff --git a/resources/docs/css/extra.css b/resources/docs/css/extra.css deleted file mode 100644 index 641a57d6..00000000 --- a/resources/docs/css/extra.css +++ /dev/null @@ -1,85 +0,0 @@ - -.md-header, .md-tabs { - background:rgb(49, 63, 85)!important; -} - -@media only screen and (max-width: 76.1875em) { -.md-header, .md-nav__title--site { - background:rgb(49, 63, 85)!important; -} -} - -.md-header-nav__button.md-logo { - margin-right:-1rem!important; -} - -.md-nav__title--site, .md-header-nav__title { - padding-top: 1px; - text-transform: uppercase; - font-size: 1.4rem!important; - /* font-weight:500!important; */ - letter-spacing:1px; -} - -a.button { - background:rgb(82, 168, 255); - color:white!important; - display: inline-block; - padding: 5px 10px; - border-radius: 3px; - transition: opacity .2s; -} - -a.button:hover { - opacity: 0.90; -} - -.align-center { - text-align: center; -} - -article img { - border-radius: 3px; -} - -.dynamic-prop-icon { - vertical-align:super; - font-size: 75%; - /* margin-left: -5px; */ - opacity: 0.65!important; -} - -.dynamic-prop-icon:after { - content:"flash_on"; - font-family: Material Icons; - font-style: normal; - font-variant: normal; - font-weight: 400; - line-height: 1; - text-transform: none; - white-space: nowrap; - speak: none; - word-wrap: normal; - direction: ltr; -} - -table code { - white-space: nowrap; -} - -table .thead2 { - background: rgba(0,0,0,0.05); - color: #555; - text-transform: capitalize; - white-space: nowrap; -} - -table thead { - text-transform: capitalize; -} - -table h4 { - margin:0!important; - font-size: 1.28rem!important; - font-weight: normal!important; -} diff --git a/resources/docs/docs.md b/resources/docs/docs.md new file mode 120000 index 00000000..2539e41e --- /dev/null +++ b/resources/docs/docs.md @@ -0,0 +1 @@ +docs/getting-started.md \ No newline at end of file diff --git a/resources/docs/extras/advanced-property-syntax.md b/resources/docs/docs/advanced-property-syntax.md similarity index 100% rename from resources/docs/extras/advanced-property-syntax.md rename to resources/docs/docs/advanced-property-syntax.md diff --git a/resources/docs/credits.md b/resources/docs/docs/credits.md similarity index 62% rename from resources/docs/credits.md rename to resources/docs/docs/credits.md index 32d01f19..a96eecfb 100644 --- a/resources/docs/credits.md +++ b/resources/docs/docs/credits.md @@ -1,11 +1,11 @@ -# License +## License Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2018. -This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license. +This program is a free software released under the [GNU/GPL3](https://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license. ## Dependencies -Open Stage Control relies on several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [babel](http://babeljs.io/), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [stacktracejs](stacktracejs.com), [mathjs](http://mathjs.org/). A comprehensive and up-to-date list can be found [here](https://github.com/jean-emmanuel/open-stage-control/network/dependencies). +Open Stage Control relies on several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [babel](http://babeljs.io/), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [stacktracejs](http://stacktracejs.com), [mathjs](http://mathjs.org/). A comprehensive and up-to-date list can be found [here](https://github.com/jean-emmanuel/open-stage-control/network/dependencies). ## Contributors @@ -14,7 +14,7 @@ https://github.com/jean-emmanuel/open-stage-control/graphs/contributors ----
-[![BrowserStack](img/logo-browserstack.png)](http://browserstack.com/) +[![BrowserStack](/img/logo-browserstack.png)](http://browserstack.com/)
BrowserStack supports Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows. diff --git a/resources/docs/extras/css-tips.md b/resources/docs/docs/css-tips.md similarity index 100% rename from resources/docs/extras/css-tips.md rename to resources/docs/docs/css-tips.md diff --git a/resources/docs/extras/custom-module.md b/resources/docs/docs/custom-module.md similarity index 100% rename from resources/docs/extras/custom-module.md rename to resources/docs/docs/custom-module.md diff --git a/resources/docs/editing-sessions.md b/resources/docs/docs/editing-sessions.md similarity index 95% rename from resources/docs/editing-sessions.md rename to resources/docs/docs/editing-sessions.md index 77484497..352e6f8d 100644 --- a/resources/docs/editing-sessions.md +++ b/resources/docs/docs/editing-sessions.md @@ -45,7 +45,7 @@ By default, widget resizing / dragging snaps to a 10 pixel wide grid. Its width ## Properties -Selected widget's properties are displayed and can be modified in the sidepanel. The [widgets reference](widgets/widgets) section lists the available properties for each widget type. Property fields are all multiline (press `shift + enter` for new line). +Selected widget's properties are displayed and can be modified in the sidepanel. The [widgets reference](/docs/widgets-reference) section lists the available properties for each widget type. Property fields are all multiline (press `shift + enter` for new line). Properties are written in JSON, with some flexibility brought by the [JSON5](https://github.com/json5/json5) format. For example, doubles quotes around object keys are not mandatory. All input will be converted to standard JSON. diff --git a/resources/docs/examples.md b/resources/docs/docs/examples.md similarity index 100% rename from resources/docs/examples.md rename to resources/docs/docs/examples.md diff --git a/resources/docs/getting-started.md b/resources/docs/docs/getting-started.md similarity index 88% rename from resources/docs/getting-started.md rename to resources/docs/docs/getting-started.md index 5ea6f8bc..e874a277 100644 --- a/resources/docs/getting-started.md +++ b/resources/docs/docs/getting-started.md @@ -3,6 +3,16 @@ !!! tip "" Prebuilt binaries for Linux, Windows and OS X can be found on the [release](https://github.com/jean-emmanuel/open-stage-control/releases) page. +## Supported platforms + +Open Stage Control is a *desktop* server application. It runs on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/) or [Node](https://nodejs.org/en/) (in headless mode only, see [Running without Electron](#running-without-electron)). Any device running a compatible browser can connect to the server : + +- Chrome/Chromium version `50` or later (Linux, MacOS, Windows, Android, etc) +- iOS version `9.3` or later + +!!! tip "Android / iOS native app ?" + There is no native mobile application. The server's url can be added to the home screen to launch the interface in fullscreen. + ## Options @@ -26,9 +36,9 @@ Below are the available command-line options. Note that when running without any | `-d` | `--debug` | log received osc messages in the console | | `-n` | `--no-gui` | disable default gui | | `-g` | `--gui-only` | app server's url. If true, local port (--port) is used | -| `-t` | `--theme` | theme name or path (mutliple values allowed) see [theming](extras/theming/) | +| `-t` | `--theme` | theme name or path (mutliple values allowed) see [theming](/docs/theming/) | | `-e` | `--examples` | list examples instead of recent sessions | -| | `--url-options` | [url options](extras/url-options) (opt=value pairs) | +| | `--url-options` | [url options](/docs/url-options) (opt=value pairs) | | |`--disable-vsync` | disable gui's vertical synchronization | | |`--disable-gpu` | disable hardware acceleration | | |`--read-only` | disable session editing and session history changes | diff --git a/resources/docs/interface.md b/resources/docs/docs/interface.md similarity index 96% rename from resources/docs/interface.md rename to resources/docs/docs/interface.md index b32e1cb7..8b43588d 100644 --- a/resources/docs/interface.md +++ b/resources/docs/docs/interface.md @@ -23,7 +23,7 @@ When traversing gestures are set to "Smart", these will only affect widgets that ### Editor -See [Editing sessions](editing-sessions.md). +See [Editing sessions](/docs/editing-sessions.md). ## Interactions diff --git a/resources/docs/extras/midi.md b/resources/docs/docs/midi.md similarity index 89% rename from resources/docs/extras/midi.md rename to resources/docs/docs/midi.md index 49a05b10..9734b221 100644 --- a/resources/docs/extras/midi.md +++ b/resources/docs/docs/midi.md @@ -1,7 +1,3 @@ -# Sending / Receiving MIDI - -Open Stage Control can send and receive MIDI messages. - ## Requirements MIDI support requires additional software to be installed on the server's system: @@ -33,7 +29,7 @@ In order to send MIDI messages, a widget must have at least one `target` formatt ## Supported MIDI messages !!! warning "" - Define static argument values using the [`preArgs`](/widgets/widgets/#preargs) option in order to complete the respective MIDI message. + Define static argument values using the [`preArgs`](/docs/widgets-reference/#preArgs) option in order to complete the respective MIDI message. @@ -91,6 +87,6 @@ PitchWheel event. System exclusive message. - `msg`: hexadecimal sysex data string of the form `f0 ... f7`. You may include placeholders of the form `nn` which will be replaced by `v1, .., vN` respectively. -- `v1, .., vN`: values encoded as hexadecimal data strings to include in `msg`. Most probably, you will need to sepcify a [custom module](/extras/custom-module/) in order to convert numeric widget values into the required hexadecimal format. In general, this conversion will be different for each manufacturer / device. +- `v1, .., vN`: values encoded as hexadecimal data strings to include in `msg`. Most probably, you will need to sepcify a [custom module](/docs/custom-module/) in order to convert numeric widget values into the required hexadecimal format. In general, this conversion will be different for each manufacturer / device. For a very simple example, refer to session 'sysex.json' found in the application's sub folder 'resources/app/examples/'. Please remember to adjust the button's `target` to the `device_name` used in your MIDI setup. diff --git a/resources/docs/extras/remote-control.md b/resources/docs/docs/remote-control.md similarity index 100% rename from resources/docs/extras/remote-control.md rename to resources/docs/docs/remote-control.md diff --git a/resources/docs/extras/theming.md b/resources/docs/docs/theming.md similarity index 93% rename from resources/docs/extras/theming.md rename to resources/docs/docs/theming.md index 6cdc5541..9e1ef226 100644 --- a/resources/docs/extras/theming.md +++ b/resources/docs/docs/theming.md @@ -1,5 +1,3 @@ -# Theming - ## Built-in themes Themes can be loaded with the `--theme` option. Multiple themes can be combined. Built-in themes can be loaded using their name, custom theme files can be loaded using their path. @@ -38,7 +36,7 @@ This will change the default text color to blue for all elements in panel widget ## Scss / autoreload -When running the app [from sources](../getting-started), custom themes can be written in scss: +When running the app [from sources](/docs/getting-started), custom themes can be written in scss: - the scss file must be located in `src/browser/scss/themes/` - run `npm run watch-css` diff --git a/resources/docs/extras/url-options.md b/resources/docs/docs/url-options.md similarity index 100% rename from resources/docs/extras/url-options.md rename to resources/docs/docs/url-options.md diff --git a/resources/docs/widgets-reference.md b/resources/docs/docs/widgets-reference.md similarity index 99% rename from resources/docs/widgets-reference.md rename to resources/docs/docs/widgets-reference.md index 53bdd87a..26fc5264 100644 --- a/resources/docs/widgets-reference.md +++ b/resources/docs/docs/widgets-reference.md @@ -140,6 +140,7 @@ |

horizontal

| `boolean` | false | Set to `true` to display values horizontally | |

showValues

| `boolean` | false | If values is an object, set to `true` to display both values and labels instead of labels only | |

values

| `array`\|
`object` | {
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | +|

traversing

| `boolean` | true | Set to `false` to disable traversing gestures | ### dropdown @@ -453,7 +454,7 @@ | --- | --- | --- | --- | |

keys

|||| |

binding

| `string`\|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation) | -|

keydown

| `string` | "" | This property is evaluated each time the key combo is pressed and defines the widget's own value. Formulas are given extras variables in this context:
- `key`: pressed key name (usefull for handling multiple keys with a single keys widget)
- `ctrl`: control key state
- `alt`: alt key state
- `shift`: shift key state
- `super`: command/windows key state | +|

keydown

| `string` | "" | This property is evaluated each time the key combo is pressed and defines the widget's own value. Formulas are given extras variables in this context:
- `key`: pressed key name (usefull for handling multiple keys with a single keys widget, lowercased when referencing a character key)
- `code`: pressed key code name (full list)
- `ctrl`: control key state
- `alt`: alt key state
- `shift`: shift key state
- `super`: command/windows key state | |

keyup

| `string` | "" | Same as `keydown`, but evaluated when releasing the key combo | |

repeat

| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed | diff --git a/resources/docs/extras/property-maths.md b/resources/docs/extras/property-maths.md deleted file mode 100644 index 70a96129..00000000 --- a/resources/docs/extras/property-maths.md +++ /dev/null @@ -1,30 +0,0 @@ -# Property maths - -The following syntax allow writing mathematical formulas in widgets' properties: - -``` -#{ FORMULA } -``` - -Where FORMULA is a valid [MathJS](http://mathjs.org/docs/expressions/syntax.html) expression: - -- [syntax documentation](http://mathjs.org/docs/expressions/syntax.html) -- [available functions](http://mathjs.org/docs/reference/functions.html) -- [available constants](http://mathjs.org/docs/reference/constants.html) -- formulas can be [multiline](http://mathjs.org/docs/expressions/syntax.html#multiline-expressions) -- property inheritance calls (`@{...}`) are always resolved before formulas -- arrays / matrices indexes are **zero-based** (ie `["a","b"][0]` returns `"a"`) -- strings can be multiline when enclosed in backticks (``` ` ` ```) -- inner closing brackets (`}`) must be escaped with a backslash (`\}`) - -Additionnal functions: - -- `unpack(x)`: remove an array's brackets (`unpack([1,2])` returns `"1, 2"`) -- `pad(x, padding)`: add leading zeros if the length the integer part of `x` is smaller than `padding` (`pad(1,2)` returns `"01"`) -- `length(x)`: returns the length of an array or string -- `values(x)`: returns an array of a given object's own property values -- `keys(x)`: returns an array of a given object's own property names -- `timestamp()`: returns the number of milliseconds elapsed since January 1, 1970 - -!!! tip "" - A single widget property can contain multiple formulas. Variables and functions declared in a formula are available to subsequent formulas in the same property definition. diff --git a/resources/docs/img/logo_discourse.png b/resources/docs/img/logo_discourse.png new file mode 120000 index 00000000..fe0933c4 --- /dev/null +++ b/resources/docs/img/logo_discourse.png @@ -0,0 +1 @@ +../../images/logo_discourse.png \ No newline at end of file diff --git a/resources/docs/index.md b/resources/docs/index.md index bf24e97e..2ee8686f 100644 --- a/resources/docs/index.md +++ b/resources/docs/index.md @@ -1,61 +1 @@ - - -# Open Stage Control - -*Libre and modular OSC / MIDI controller* - -Open Stage Control is a desktop OSC bi-directional control surface application. It's built on web technologies and run as an [Electron](http://electron.atom.io/) web server that accepts any number of clients. - -Try the online demo (Chrome 50+ required) - -Download the latest release - - -![](img/ardour-osc.png) - -## Supported platforms - -The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/) or [Node](https://nodejs.org/en/) (in headless mode only, see [Running without Electron](getting-started/#running-without-electron)). Clients just need to connect to the server with a compatible browser : - -- any system running Chrome/Chromium version `50` or later (Linux, MacOS, Windows, Android, etc) -- iOS version `9.3` or later - -Firefox is *not* supported. - -## Is there an Android / iOS app ? - -No, Open Stage Control is a *desktop* server app. Mobile devices can open the app by connecting to the server using Chrome. - -!!! tip "Add to home screen" - Once connected, mobile devices can add the server's url to the home screen and launch it from there directly. - - -## Need help ? Found a bug ? - -Head over the [issue tracker](https://github.com/jean-emmanuel/open-stage-control/issues) :) - -## Free what ? - -Open Stage Control is a [free software](https://www.fsf.org/), as in *gratis* and — most importantly — **libre**. It always will be. If you want to support the project financially, consider using liberapay or [flattr](https://flattr.com/@jean-emmanuel) : - - - - ----- - -## Table of contents - -- [Getting started](getting-started) -- [User interface](interface) -- [Editing sessions](editing-sessions) -- [Widgets reference](widgets-reference) -- Extras: - - [Advanced property syntax](extras/advanced-property-syntax) - - [CSS Tips](extras/css-tips) - - [Theming](extras/theming) - - [URL options](extras/url-options) - - [Remote control](extras/remote-control) - - [Custom module](extras/custom-module) - - [Midi](extras/midi) -- [Examples](examples) -- [Credits](credits) +![](/img/ardour-osc.png) diff --git a/resources/docs/widgets/buttons.md b/resources/docs/widgets/buttons.md deleted file mode 100644 index b1c8d384..00000000 --- a/resources/docs/widgets/buttons.md +++ /dev/null @@ -1,109 +0,0 @@ -# Buttons - -Buttons are exactly what you think they are. - - - -## Toggle -```js -{ - type:'toggle', - // etc -} -``` - -### `doubleTap` -- type: `boolean` -- default: `false` -- usage: set to `true` to make the button require a double tap to be toggled instead of a single tap - -### `led` -- type: `boolean` -- default: `false` -- usage: set to `true` to display the toggle's state with a led - -### `on` -- type: `string|number|object` -- default: `1` -- usage: defines which value is sent on `on` position - - set to `null` to send send no argument in the osc message - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - -### `off` -- type: `string|number|object` -- default: `0` -- usage: defines which value is sent on `off` position - - set to `null` to send send no argument in the osc message - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - - - - -## Push -```js -{ - type:'push', - // etc -} -``` - -### `on` -- type: `string|number|object` -- default: `1` -- usage: defines which value is sent when pushing the button - - set to `null` to send send no argument in the osc message - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - -### `off` -- type: `string|number|object` -- default: `0` -- usage: defines which value is sent when releasing the button - - set to `null` to send send no argument in the osc message - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - -### `norelease` -- type: `bool` -- default: `false` -- usage: set to true to prevent sending any osc message when releasing the button - -Setting the `push`'s value externally (via osc) will toggle it's inner light. - - - - -## Switch - -```js -{ - type:'switch', - // etc -} -``` -### `values` -- type: `array|object` -- default: `{"Value 1":1,"Value 2":2}` -- usage: - - `array` of possible values to switch between : `[1,2,3]` - - `object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept. - -### `showValues` -- type: `boolean` -- default: `false` -- usage: if `values` is an `object`, set to `true` to display both values and labels instead of labels only - - -## Dropdown -```js -{ - type:'dropdown', - // etc -} -``` - -### `values` -- type: `array|object` -- default: `{"Value 1":1,"Value 2":2}` -- usage: - - `array` of possible values to switch between : `[1,2,3]` - - `object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept. - - an empty option will always be prepended to `values` (sends an osc message without any value); it can be hidden by adding `option:first-child{display:none}` to the widget's `css` diff --git a/resources/docs/widgets/containers.md b/resources/docs/widgets/containers.md deleted file mode 100644 index b61a8c83..00000000 --- a/resources/docs/widgets/containers.md +++ /dev/null @@ -1,166 +0,0 @@ -# Containers - -Containers can contain any widgets. - - -## Panel - -Panels can contains tabs or widgets. These can be absolutely positioned and can overflow their parent's size (which will then display scrollbars). When a panel contains tabs, it can send and receive its active tab's index through osc. - - -```js -{ - type:'panel', - // etc -} -``` - -### `scroll` -- type: `boolean` -- default: `true` -- usage: set to `false` to disable scrollbars - -### `border` -- type: `boolean` -- default: `true` -- usage: by default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the panel too. - -### `widgets` -- type: `array` -- default: `[]` -- usage: each element of the `array` must be a widget `object`. A panel cannot contain widgets and tabs simultaneously. - -### `tabs` -- type: `array` -- default: `[]` -- usage: each element of the `array` must be a tab `object`. A panel cannot contain widgets and tabs simultaneously. - - -### `variables` -- type: `*` -- default: `@{parent.variables}` -- usage: defines one or more arbitrary variables that can be inherited by children widgets. -- examples: - - `1` (`@{parent.variables}` will return `1`) - - `{a: [1, 2], b: 2}` (`@{parent.variables.a}` will return `[1, 2]`) - - `[1, 2]` (`@{parent.variables.0}` will return `1`) - - `@{parent.variables}` useful when nesting containers - - -### `layout` -- type: `string` -- default: `''` -- usage: `layout` must be a valid [Visual Format Language](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html) expression. It accepts the [Extended Visual Format Language](https://github.com/IjzerenHein/autolayout.js#extended-visual-format-language-evfl) as well. Widgets are targeted using their `id` or their index prefixed with a `$` (`$0, $1, etc`), the latter method being incompatible with the [range spread operator](https://github.com/IjzerenHein/autolayout.js#view-ranges-spread-operator). Expressions can be tested and debugged with the online [Visual Format Editor](https://rawgit.com/IjzerenHein/visualformat-editor/master/dist/index.html). -- note: this only applies when the panel contains widgets, not tabs - -### `spacing` -- type: `integer|array` -- default: `0` -- usage: spacing size used in `layout` expression, can be set as a `[vertical,horizontal]` array. -- note: this only applies when the panel contains widgets, not tabs - -### `css` -```css ---nav-height: number[rem|%]; -``` - -## Strip - -Unidirectional panel with stretching capability. By default, children widgets that don't have an explicit `width`/`height` set will be shrinked to respect the sizes specified by others. Adding `flex:1;` to a children's `css` will give it the ability the fill the remaining space. Multiple children can have a `flex:x;` css property (`x` will ponderate their expansion). - -```js -{ - type:'strip', - // etc -} -``` - -### `horizontal` -- type: `boolean` -- default: `false` -- usage: set to `true` to display widgets horizontally - -### `stretch` -- type: `boolean` -- default: `false` -- usage: set to `true` to stretch widgets evenly - -### `spacing` -- type: `integer|percentage` -- default: `0` -- usage: adds space between widgets. Percents are always relative to the strips width. - -### `border` -- type: `boolean` -- default: `true` -- usage: by default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the strip too. - -### `widgets` -- type: `array` -- default: `[]` -- usage: each element of the `array` must be a widget `object` - - - - -## Modal - -Modals are buttons that turn into a centered popup panels when enabled. They can only contain widgets. They can send and receive their state via osc (1 to enable, 0 to disable). - -```js -{ - type:'modal', - // etc -} -``` - -### `doubleTap` -- type: `boolean` -- default: `false` -- usage: set to `true` to make the modal require a double tap to open instead of a single tap - -### `popupWidth` / `popupHeight` -- type: `number|percentage` -- default: `100%` -- usage: sets the modal's size once opened - -### `popupLeft` / `popupTop` -- type: `number|percentage` -- default: `auto` -- usage: sets the modal's position once opened (centered by default) - - -### `popupLabel` -- type: `string` -- default: `empty` -- usage: alternative label for the popup - -### `options` -- see panel's [`options`](#panel) - - -## Clone - -```js -{ - type:'clone', - // etc -} -``` - -### `widgetId` -- type: `string` -- default: `empty` -- usage: `id` of the widget to clone - -### `props` -- type: `object` -- default: `{}` -- usage: cloned widget's properties to override -- example: -```json -{ - "variables": { "n": 2 }, - "color": "orange" -} -``` diff --git a/resources/docs/widgets/inputs.md b/resources/docs/widgets/inputs.md deleted file mode 100644 index ea69f38c..00000000 --- a/resources/docs/widgets/inputs.md +++ /dev/null @@ -1,156 +0,0 @@ -# inputs - -## Input - - -```js -{ - type:'input', - // etc -} -``` - -### `editable` -- type: `boolean` -- default: `true` -- usage: set to `false` to make the input non-editable - -### `horizontal` -- type: `boolean` -- default: `false` -- usage: set to `true` to display the input horizontally - -### `align` -- type: `string` -- default: `''` -- usage: set to `left` or `right` to change text alignment (otherwise `center`) - -### `unit` -- type: `string` -- default: `empty` -- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages) - - -## Keys - - -```js -{ - type:'keys', - // etc -} -``` - -### `binding` -- type: `string|array` -- default: `''` -- usage: [keyboardjs](https://github.com/RobertWHurst/KeyboardJS) key combo string or array of strings. - -### `keydown` -- type: `string` -- default: `''` -- usage: this property is evaluated each time the key combo is pressed. [Formulas](../extras/advanced-property-syntax/#formulas) are given extras variables in this context: - - `key`: pressed key name (usefull for handling multiple keys with a single `keys` widget) - - `ctrl`: control key state - - `alt`: alt key state - - `shift`: shift key state - - `super`: command/windows key state - -### `keyup` -- type: `string` -- default: `''` -- usage: same as `keydown`, but evaluated when releasing the key combo. - -### `repeat` -- type: `boolean` -- default: `true` -- usage: set to `false` to prevent `keydown` repeats when holding the key combo pressed. - - -## Script - - -```js -{ - type:'script', - // etc -} -``` - -### `condition` -- type: `string` -- default: `''` -- usage: when the widget receives a value, if this property return a falsy value, the `script` property won't be evaluated. If it's non-falsy, it will be evaluated normally. [Formulas](../extras/advanced-property-syntax/#formulas) are given 1 extra variable in this context: - - `value`: the value received by the widget - -### `script` -- type: `string` -- default: `''` -- usage: this property is evaluated each time the widget receives a value if `condition` is non-falsy. [Formulas](../extras/advanced-property-syntax/#formulas) are given extras variables in this context: - - `value`: the value received by the widget - - `send`: `function` for sending osc messages - - `set`: `function` for setting a widget's value - -#### `send(target, address, arg1, arg2, ...)` -- `target` (`string` or `array` or `false`): one or several osc targets. Default targets (`--send` and the script's `target` property) are ignored unless `target` is `false` -- `address` (`string`): a valid osc address -- `arg`: one or several osc arguments to be sent. The script's `preArgs` property is ignored - - -#### `set(id, value)` -- `id` (`string`): a widget's id -- `value`: the widget's new value - - -## Gyroscope - - -```js -{ - type:'gyroscope', - // etc -} -``` - -The gyroscope's value is an object containing multiple values, which can be used by other widgets via the [property maths syntax](../extras/advanced-property-syntax.md) : - -``` -// value.do.alpha ( deviceorientation event alpha value ) -// value.do.beta ( deviceorientation event beta value ) -// value.do.gamma ( deviceorientation event gamma value ) -// value.do.absolute ( deviceorientation event absolute value ) - -// value.dm.x ( devicemotion event acceleration x value ) -// value.dm.y ( devicemotion event acceleration y value ) -// value.dm.z ( devicemotion event acceleration z value ) - -// value.dm.gx ( devicemotion event accelerationIncludingGravity x value ) -// value.dm.gy ( devicemotion event accelerationIncludingGravity y value ) -// value.dm.gz ( devicemotion event accelerationIncludingGravity z value ) - -// value.dm.alpha ( devicemotion event rotationRate alpha value ) -// value.dm.beta ( devicemotion event rotationRate beta value ) -// value.dm.gamma ( devicemotion event rotationRate gamma value ) - -``` - - -### `frequency` -- type: `number` -- default: `30` -- usage: update frequency in Hz (value updates per seconds) - -### `normalize` -- type: `boolean` -- default: `true` -- usage: normalize gravity related values - -### `compass` -- type: `boolean` -- default: `false` -- usage: set to `true` to return the orientation values with respect to the actual north direction of the world instead of the head direction of the device - -### `screenAdjusted` -- type: `boolean` -- default: `false` -- usage: set to `true` to return screen adjusted values diff --git a/resources/docs/widgets/maths.md b/resources/docs/widgets/maths.md deleted file mode 100644 index 60efc629..00000000 --- a/resources/docs/widgets/maths.md +++ /dev/null @@ -1,44 +0,0 @@ -# Maths - -Maths do the maths ! - -## Formula - -!!! warning "Deprecated" - Since `v0.24.0`, any widget property can be defined using math expressions. Formula widget is deprecated and will be removed in a future release. - -Formula evaluates mathematical expressions over other widgets' values each one of these widgets changes. - -```js -{ - type:'formula', - // etc -} -``` - - -### `formula` -- type: `string` -- default: `''` -- usage: a [mathjs](http://mathjs.org/docs/expressions/syntax.html) expression in which - - `${id}` will be replaced the `id`'s value - - example: `${fader_1} * 2 + ${fader_2}` -- **important note**: contrary to what is stated in *mathjs*' documentation, **matrix indexes are zero-based** here - -### `condition` -- type: `string` -- default: `''` -- usage: - - a [mathjs](http://mathjs.org/docs/expressions/syntax.html) comparison expression that bypasses widget's osc sending when returning`false` - - example: `${fader_1} > 0.5` - -### `unit` -- type: `string` -- default: `empty` -- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages) - -### `split` -- type: `object` -- default: `[]` -- usage: specify a different `address` for each item of the widget's value : `['/a', '/b']` -- note: only use this is the formula return an `array` diff --git a/resources/docs/widgets/matrices.md b/resources/docs/widgets/matrices.md deleted file mode 100644 index b1913a1a..00000000 --- a/resources/docs/widgets/matrices.md +++ /dev/null @@ -1,236 +0,0 @@ -# Matrices - -Matrices are special containers that only contain one type of widget. All contained widgets will be traversed by single dragging gestures. - -!!! note "" - When using the [property inheritance syntax](../extras/advanced-property-syntax) to retreive a matrix' value, the returned value is an array containing all it's children's values. - -## Matrix - -Creates grid of widgets of a given type - -```js -{ - type:'matrix', - // etc -} -``` - -### `widgetType` -- type: `string` -- default: `toggle` -- usage: set the type of the widgets in the matrix - - -### `matrix` -- type: `array` -- default: `[2,2]` -- usage: defines the number of columns and and rows in the matrix - -### `start` -- type: `integer` -- default: `0` -- usage: first widget's index - -### `traversing` -- type: `boolean` -- default: `true` -- usage: set to false to disable traversing gestures - -### `props` -- type: `object` -- default: `{}` -- usage: define a set of property to override the widgets' defaults. [Formulas](../extras/advanced-property-syntax/#formulas) in this field are resolved with an extra variable `$` representing each widget's index - - - - -## Multifader - -Multifader creates a row of vertical faders that respond to the same gestures. - -```js -{ - type:'multifader', - // etc -} -``` - -### `strips` -- type: `integer` -- default: `2` -- usage: number of faders in the row, each fader will inherit its parent's properties and the following ones (where `i` is the fader's index in the row) - - `id`: same as the widget's with `/i` appended to it - - `label`: `i` - - `address`: see `split` - -### `start` -- type: `integer` -- default: `0` -- usage: first faders's index - -### `traversing` -- type: `boolean` -- default: `true` -- usage: set to false to disable traversing gestures - -### `borders` -- type: `boolean` -- default: `true` -- usage: set to false to disable widgets borders - - -### `split` -- type: `boolean|string` -- default: `false` -- usage: - - `true`: the widget's index will be appended to the matrice's osc `address` - - `false`: it will be prepended to the widget's `preArgs` - - `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)). - -### `options` -- see fader's [`options`](sliders/#fader) - - - - - -## Multitoggle -```js -{ - type:'multitoggle', - // etc -} -``` - -### `matrix` -- type: `array` -- default: `[2,2]` -- usage: defines the number of columns and and rows. Each cell will contain a toggle button that will inherit its parent's properties and the following ones (where `i` is the fader's index in the row) - - `id`: same as the widget's with `/i` appended to it - - `label`: `i` - - `address`: see `split` - -### `start` -- type: `integer` -- default: `0` -- usage: first toggle's index - -### `spacing` -- type: `integer` -- default: `0` -- usage: adds space between widgets - -### `traversing` -- type: `boolean` -- default: `true` -- usage: set to false to disable traversing gestures - -### `split` -- type: `boolean|string` -- default: `false` -- usage: - - `true`: the widget's index will be appended to the matrice's osc `address` - - `false`: it will be prepended to the widget's `preArgs` - - `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)). - - -### `options` -- see toggle's [`options`](buttons/#toggle) - - - -## Multipush -```js -{ - type:'multipush', - // etc -} -``` - -### `matrix` -- type: `array` -- default: `[2,2]` -- usage: defines the number of columns and and rows. Each cell will contain a push button that will inherit its parent's properties and the following ones (where `i` is the fader's index in the row) - - `id`: same as the widget's with `/i` appended to it - - `label`: `i` - - `address`: see `split` - -### `start` -- type: `integer` -- default: `0` -- usage: first push's index - -### `spacing` -- type: `integer` -- default: `0` -- usage: adds space between widgets - -### `traversing` -- type: `boolean` -- default: `true` -- usage: set to false to disable traversing gestures - -### `split` -- type: `boolean|string` -- default: `false` -- usage: - - `true`: the widget's index will be appended to the matrice's osc `address` - - `false`: it will be prepended to the widget's `preArgs` - - `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)). - -### `options` -- see push's [`options`](buttons/#push) - - - -## Keyboard - -This one works pretty much like the multipush, excepts it looks like a piano keyboard. - -```js -{ - type:'keyboard', - // etc -} -``` - -### `keys` -- type: `integer` -- default: `24` -- usage: defines the number keys - -### `start` -- type: `integer` -- default: `60` -- usage: MIDI note number to start with (default is C4) - -!!! note "" - Standard keyboards settings are: - 25 keys - start 48 - 49 keys - start 36 - 61 keys - start 36 - 88 keys - start 21 - - -### `traversing` -- type: `boolean` -- default: `true` -- usage: set to false to disable traversing gestures - -### `split` -- type: `boolean|string` -- default: `false` -- usage: - - `true`: the widget's index will be appended to the matrice's osc `address` - - `false`: it will be prepended to the widget's `preArgs` - - `string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)). - -### `options` -- see push's [`options`](buttons/#push) - -### `css` -```css ---color-white:color; /* white keys color */ ---color-black:color; /* black keys color */ -``` diff --git a/resources/docs/widgets/pads.md b/resources/docs/widgets/pads.md deleted file mode 100644 index 67c81b57..00000000 --- a/resources/docs/widgets/pads.md +++ /dev/null @@ -1,163 +0,0 @@ -# Pads - -Pads are multidimensional widgets that output multiple values. - - - -## XY - -```js -{ - type:'xy', - // etc -} -``` - -### `input` -- type: `boolean` -- default: `true` -- usage: set to `false` to hide the built-in input - -### `rangeX` -- type: `object` -- default: - `{"min":0,"max":1}` -- usage: defines the `min` and `max` values for the `x` axis. Same as fader's [`range`](sliders/#fader) - -### `rangeY` -- type: `object` -- default: - `{"min":0,"max":1}` -- usage: defines the `min` and `max` values for the `y` axis. Same as fader's [`range`](sliders/#fader) - - -### `logScaleX` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `x` axis (log10) - -### `logScaleY` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `y` axis (log10) - -### `snap` -- type: `boolean` -- default: `false` -- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position. - -### `spring` -- type: `boolean` -- default: `false` -- usage: when set to `true`, the widget will go back to its `default` value when released. - -### `doubleTap` -- type: `boolean|string` -- default: `false` -- usage: set to `true` to make the fader reset to its `default` value when receiving a double tap. `doubleTap` can also be an osc address, which case the widget will just send an osc message (`/ `), - - -### `split` -- type: `boolean|object` -- default: `false` -- usage: - - set to `true` to send separate osc messages for `x` and `y` axis. The `address` will be the same as the widget's with `/x` or `/y` appended to it - - can be set as an object to specify a different `address` : `['/osc_address_x', '/osc_address_y']` -- note: the widget will only respond to its original osc address, not to the splitted version - - - -## MultiXy - -```js -{ - type:'multixy', - // etc -} -``` - -### `points` -- type: `integer|array` -- default: `2` -- usage: defines the number of points on the pad. Can be an `array` of `strings` that will be used as labels for the points (ex: `['A', 'B']`) - -### `pointSize` -- type: `integer` -- default: `15` -- usage: defines the points's size - -### `rangeX` -- type: `object` -- default: - `{"min":0,"max":1}` -- usage: defines the `min` and `max` values for the `x` axis. Same as fader's [`range`](sliders/#fader) - -### `rangeY` -- type: `object` -- default: - `{"min":0,"max":1}` -- usage: defines the `min` and `max` values for the `y` axis. Same as fader's [`range`](sliders/#fader) - - -### `logScaleX` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `x` axis (log10) - -### `logScaleY` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `y` axis (log10) - -### `split` -- type: `boolean|object` -- default: `false` -- usage: - - set to `true` to send separate osc messages for each point's `x` and `y` axis. The `address` will be the same as the widget's with `/N/x` or `/N/y` appended to it, where `N` is the point's id (or the point's label if `points` is an `array`). - - can be set as an object to specify a different `address` : `['/0/x', '/0/y', '/1/x', '/2/y']` -- note: the widget will only respond to its original osc address, not to the splitted version - -### `snap` -- type: `boolean` -- default: `false` -- usage: by default, the points are dragged from their initial position; if set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates (one per touch). - - - -## RGB - -RGB is a variant of XY, it outputs rgb values between 0 and 255. - - -```js -{ - type:'rgb', - // etc -} -``` - -### `input` -- type: `boolean` -- default: `true` -- usage: set to `false` to hide the built-in input - -### `precision` -- default:`0` - -### `snap` -- type: `boolean` -- default: `false` -- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position. - -### `range` -- type: `object` -- default: `{"min":0,"max":255}` -- usage: `range` defines the widget's output scale. - -### `split` -- type: `boolean|object` -- default: `false` -- usage: - - set to `true` to send separate osc messages for `r` and `g` & `b`. The `address` will be the same as the widget's with `/r`, `/g` or `/b` appended to it - - can be set as an object to specify a different `address` : `['/r', '/b', '/b']` -- note: the widget will only respond to its original osc address, not to the splitted version diff --git a/resources/docs/widgets/plots.md b/resources/docs/widgets/plots.md deleted file mode 100644 index 22895405..00000000 --- a/resources/docs/widgets/plots.md +++ /dev/null @@ -1,330 +0,0 @@ -# Plots - -Plots are tools that display other widgets' state or incomming osc messages. They are not sensitive to mouse and touch interactions. - -## Led -```js -{ - type:'led', - // etc -} -``` - -### `range` -- type: `object` -- default: `{"min":0,"max":1}` -- usage: defines the `min` and `max` value the led's intensity will be mapped to - -### `logScale` -- type: `boolean` -- default: `false` -- usage: set to true to use logarithmic scaling - -## RgbLed - -```js -{ - type:'rgbled', - // etc -} -``` - -This one is like the `led` except it takes either three arguments (red, green and blue values between 0 and 255) with an optionnal forth argument (alpha, between 0 and 1), or one argument (a valid css color name). - -## Plot - -The plot receives an array of coordinates and draws them on a chart. Coordinates can be : -- `y` values evenly spaced on the `x` axis -- `[x, y]` coordinates arrays - -!!! info - Coordinates also can be sent as a stringified array (`[]`). A stringified object can also be sent to change specific points' coordinates (e.g. `{0:1, 4:0}` will change the 1st and 5th points' coordinates) . - -```js -{ - type:'plot', - // etc -} -``` - -### `value` -- type: `array|string` -- default: `['']` -- usage: - - as an `array`: where items can be - - `number` - - `string` (widget's `id`) - - `[x, y]`: array of `number` or `string` - -### `range` -- type: `object` -- default: - `{ - x:{"min":0,"max":1}, - y:{"min":0,"max":1} - }` -- usage: defines the `min` and `max` values for the `x` and `y` axis - -### `bars` -- type: `boolean` -- default: `false` -- usage: set to `true` to use draw bars instead (disables `logScaleX` and forces `x-axis` even spacing) - -### `logScaleX` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `x` axis (log10) - -### `logScaleY` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `y` axis (log10) - -### `smooth` -- type: `boolean` -- default: `false` -- usage: set to `true` to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5) - -### `origin` -- type: `number` -- default: `auto` -- usage: defines the y-axis origin. Set to `false` to disable it. - -## Eq - -The Eq receives an array of filter objects and draws their frequency response between 20Hz and 22050Hz. - -```js -{ - type:'eq', - // etc -} -``` - -### `value` -- type: `array` -- default: `[]` -- usage: - - each item must be an object of the form below - - all filters parameters can be filled with widget ids, whose value will be used - -``` -{ - type:[string], // "highpass", "highshelf", "lowpass", "lowshelf", "peak", "notch" - freq:[number], // - q:[number], // - gain:[number], // - on:[bool] // 1 or true = active, 0 or false = bypassed -} -``` - -### `resolution` -- type: `number` -- default: `128` -- usage: defines the number of points used to compute the frequency response - -### `rangeY` -- type: `object` -- default: - `{"min":-20,"max":20}` -- usage: defines the `min` and `max` values for the `y` axis (dB level) - -### `logScaleX` -- type: `boolean` -- default: `false` -- usage: set to `true` to use logarithmic scale for the `x` axis (log10) - -### `smooth` -- type: `boolean` -- default: `false` -- usage: set to true to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5) - -### `origin` -- type: `number` -- default: `auto` -- usage: defines the y-axis origin. Set to `false` to disable it. - -## Visualizer - -The visualizer displays the evolution in time of a received value (through osc) *or* another widget's value. - -```js -{ - type:'visualizer', - // etc -} -``` - -### `duration` -- type: `number` -- default: `1` -- usage: window size in seconds - -### `range` -- type: `object` -- default: `{"min":0,"max":1}` -- usage: defines the `min` and `max` values for the `y` axis - -### `logScale` -- type: `boolean` -- default: `false` -- usage: set to `true` use logarithmic scaling (log10) - -### `smooth` -- type: `boolean` -- default: `false` -- usage: set to true to make the line smooth. Float values are also acceptable (works fine between 0 and 0.5) - -### `origin` -- type: `number` -- default: `auto` -- usage: defines the y-axis origin. Set to `false` to disable it. - -## Text - -Text displays incoming values (via osc) as text. Sending a message with no argument to the widget will reset it to its default text. - -```js -{ - type:'text', - // etc -} -``` - -### `vertical` -- type: `boolean` -- default: `false` -- usage: set to `true` display vertically - -### `wrap` -- type: `boolean` -- default: `false` -- usage: set to `true` to wrap long lines automatically. This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property. - -### `align` -- type: `string` -- default: `''` -- usage: set to `left` or `right` to change text alignment (otherwise `center`) - -## Meter - -Meter displays incoming numerical values (via osc) as a gauge level - -```js -{ - type:'meter', - // etc -} -``` - - -### `horizontal` -- type: `boolean` -- default: `false` -- usage: set to `true` to display the meter horizontally - -### `range` -- see fader's [`range`](sliders/#fader) - -### `logScale` -- see fader's [`logScale`](sliders/#fader) - -### `gradient` -- type: `array` -- default: `[]` -- usage: when set, the meter's gauge will be filled with a linear color gradient : each item must be a color string. Example: `["blue", "red"]` - -### `css` -```css ---color-gauge:color; ---color-knob:color; /* transparent by default */ ---color-pips:color; ---gauge-opacity:number; -``` - -## Image - -Image displays an image from a file path/url or from a base64 encoded image string. Sending an empty message resets the widget to its initial `value`. - -```js -{ - type:'image', - // etc -} -``` - -### `size` -- type: `string` -- default: `cover` -- usage: css [background-size](https://www.w3schools.com/CSSref/css3_pr_background-size.asp) - - -### `position` -- type: `string` -- default: `cover` -- usage: css [background-position](https://www.w3schools.com/CSSref/pr_background-position.asp) - - -### `repeat` -- type: `string` -- default: `no-repeat` -- usage: css [background-repeat](https://www.w3schools.com/CSSref/pr_background-repeat.asp) - - -### `border` -- type: `boolean` -- default: `false` -- usage: set to `true` to disable the image's borders and background-color. - -### `cache` -- type: `boolean` -- default: `true` -- usage: set to `false` to disable image caching (forces file reload when updating or editing the widget). When `true`, sending `'reload'` to the widget reloads its image without changing its value. - -### `value` -- type: `string` -- default: `''` -- usage : initial image - - file url or absolute path - - [base64 encoded image](https://duckduckgo.com/?q=base64+encode+image&ia=web) : `data:image/...` - - -## Svg - -```js -{ - type:'svg', - // etc -} -``` - -### `svg` -- type: `string` -- default: `''` -- usage : svg xml definition - - will be wrapped in a `` element - - `` commands support a special percent notation (`%x` and `%y`) - - -!!! tip "" - An exemple session called `svg.json` is shipped with the app. - - -## Frame - -Frame loads and diplays an external web page, using its own value as URL. Only local URLs are allowed (starting with `http://127.0.0.1/`, `http://10.x.x.x/`, `http://192.168.x.x/`, etc). - -```js -{ - type:'frame', - // etc -} -``` - -### `border` -- type: `boolean` -- default: `false` -- usage: set to `true` to disable the frame's borders and background-color. - -!!! note "" - If `label` is set to `false`, all pointer-events will be disabled on the frame as long as the editor is enabled to ensure it can be selected. diff --git a/resources/docs/widgets/sliders.md b/resources/docs/widgets/sliders.md deleted file mode 100644 index 6644139a..00000000 --- a/resources/docs/widgets/sliders.md +++ /dev/null @@ -1,272 +0,0 @@ -# Sliders - -Sliders are unidimensional widgets that output one value at a time. - - - -## Fader -```js -{ - type:'fader', - // etc -} -``` - -### `horizontal` -- type: `boolean` -- default: `false` -- usage: set to `true` to display the fader horizontally - -### `alignRight` -- type: `boolean` -- default: `false` -- usage: set to `true` to invert the pip's and fader's position - -### `pips` -- type: `boolean` -- default: `true` -- usage: set to `false` to hide the scale - -### `input` -- type: `boolean` -- default: `true` -- usage: set to `false` to hide the built-in input - -### `compact` -- type: `boolean` -- default: `false` -- usage: set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display. - -### `dashed` -- type: `boolean` -- default: `false` -- usage: set to `true` to display a dashed gauge - -### `range` -- type: `object` -- default: `{"min":0,"max":1}` -- usage: `range` defines the breakpoints of the fader's scale - - keys can be percentages and/or `min` / `max` - - values can be `number` or `object` if a custom label is needed -- example: -```js -range: { - "min":0, - "50%":1, - "max": {"inf":10} // "inf" will be used as a custom label on the scale -} -``` - -### `origin` -- type: `number` -- default: `auto` -- usage: `origin` defines the starting point's value of the fader's gauge - -### `logScale` -- type: `boolean` -- default: `false` -- usage: set to `true` use logarithmic scaling between breakpoints (log10) - - -### `unit` -- type: `string` -- default: `empty` -- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages) - - -### `snap` -- type: `boolean` -- default: `false` -- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position. - -### `spring` -- type: `boolean` -- default: `false` -- usage: when set to `true`, the widget will go back to its `default` value when released. - - -### `doubleTap` -- type: `boolean|string` -- default: `false` -- usage: set to `true` to make the fader reset to its `default` value when receiving a double tap. `doubleTap` can also be an osc address, which case the widget will just send an osc message (`/ `), - -### `meter` -- type: `boolean` -- default: `false` -- usage: set to true to display a vu-meter next in the fader - - the meter's `id` will be the same as the widget's with `/meter` appended to it - - the meter's `address `will be the same as the widget's with `/meter` appended to it - -### `meterAddress` -- type: `boolean` -- default: `empty` -- usage: overrides the `meter`'s osc address - -### `css` -```css ---color-gauge:color; ---color-knob:color; ---color-pips:color; ---gauge-opacity:number; /* compact mode only */ -``` - - - -## Knob - -```js -{ - type:'knob', - // etc -} -``` - - -### `pips` -- type: `boolean` -- default: `true` -- usage: set to `false` to hide the scale - -### `input` -- type: `boolean` -- default: `true` -- usage: set to `false` to hide the built-in input - -### `angle` -- type: `number` -- default: `270` -- usage: `angle` defines the angle's width of the knob, in degrees - -### `range` -- type: `object` -- default: `{"min":0,"max":1}` -- usage: `range` defines the breakpoints of the fader's scale - - keys can be percentages and/or `min` / `max` - - values can be `number` or `object` if a custom label is needed -- example: -```js -range: { - "min":0, - "50%":1, - "max": {"inf":10} // "inf" will be used as a custom label on the scale -} -``` - -### `origin` -- type: `number` -- default: `auto` -- usage: `origin` defines the starting point's value of the knob's gauge - -### `logScale` -- type: `boolean` -- default: `false` -- usage: set to `true` use logarithmic scaling between breakpoints - - -### `unit` -- type: `string` -- default: `empty` -- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages) - - -### `snap` -- type: `boolean` -- default: `false` -- usage: by default, dragging the widget *vertically* will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position. - -### `spring` -- type: `boolean` -- default: `false` -- usage: when set to `true`, the widget will go back to its `default` value when released. - -### `doubleTap` -- type: `boolean` -- default: `false` -- usage: set to `true` to make the knob reset to its `default` value when receiving a double tap - -### `css` -``` ---color-gauge:color; ---color-knob:color; ---color-pips:color; -``` - -## Encoder - -An endless knob that only responds to rotative gestures. - -```js -{ - type:'encoder', - // etc -} -``` - -### `ticks` -- type: `number` -- default: `360` -- usage: defines the granularity / verbosity of the encoder (number of step for a 360° arc) - -### `back` -- type: `string|number|object` -- default: `-1` -- usage: defines which value is sent when rotating the encoder anticlockwise - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - -### `forth` -- type: `string|number|object` -- default: `1` -- usage: defines which value is sent when rotating the encoder clockwise - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - -### `release` -- type: `string|number|object` -- default: `empty` -- usage: defines which value is sent when releasing the encoder - - set to `null` to send send no argument in the osc message - - can be an `object` if the type needs to be specified (see [preArgs](./widgets.md#preargs)) - - -### `snap` -- type: `boolean` -- default: `false` -- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position. - -### `doubleTap` -- type: `boolean` -- default: `false` -- usage: set to `true` to make the encoder reset to its initial value when receiving a double tap - -### `css` -``` ---color-knob:color; -``` - - -## Range - -A range is a fader with two handles. To move the range (both handles at once), hold the `shift` key or use two fingers. - -```js -{ - type:'range', - // etc -} -``` - -### `split` -- type: `boolean|object` -- default: `false` -- usage: - - set to `true` to send separate osc messages for `low` and `high` handles. The `address` will be the same as the widget's with `/low` or `/high` appended to it - - can be set as an object to specify a different `address` : `['/osc_address_low', '/osc_address_high']` -- note: the widget will only respond to its original osc address, not to the splitted version - - -### `css` -```css ---color-gauge:color; ---color-knob:color; ---color-pips:color; ---gauge-opacity:number; /* compact mode only */ -``` diff --git a/resources/docs/widgets/switchers.md b/resources/docs/widgets/switchers.md deleted file mode 100644 index 4beda5f9..00000000 --- a/resources/docs/widgets/switchers.md +++ /dev/null @@ -1,38 +0,0 @@ -# Switchers - -Switcher can store and recall the state of other widgets. - - - -## Switcher - -The switcher looks like the [`switch`](buttons/#switch). Each of its possible values represent a bank that stores the values from the widgets listed in its `linkedWidgets` attribute. - - -```js -{ - type:'switcher', - // etc -} -``` - -### `linkedWidgets` -- type: `array|string` -- default: - `empty` -- usage: - - as a `string`: a widget's `id` whose state changes will be stored - - as an `array`: a list of widget `id` `strings` - - -### `values` -- type: `array|object` -- default: `["A", "B"]` -- usage: - - `array` of possible values to switch between : `[1,2,3]` - - `object` of `"label":value` pairs - - -## Crossfader - -The crossfader is a 2-states-only switcher that comes with a slider allowing to fade from one state to the other by interpolating the values. diff --git a/resources/docs/widgets/widgets.md b/resources/docs/widgets/widgets.md deleted file mode 100644 index 7c73b49b..00000000 --- a/resources/docs/widgets/widgets.md +++ /dev/null @@ -1,146 +0,0 @@ -# Widgets properties - -All widgets share a set of generic properties described below. - -## Basics - -### `type` -- type: `string` -- default: `fader` - -### `id` -- type: `string` -- default: generated unique 'widget_n' -- usage: widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages. - -### `linkId` -- type: `string|array` -- default: `empty` -- usage: - - widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages. - - when prefixed with `>>`, the linkId will make the widget act as a master (sending but not receiving) - - when prefixed with `<<`, the linkId will make the widget act as a slave (receiving but not sending) - -## Style - -### `label` -- type: `string|false` -- default: `auto`, which displays `id` -- usage: - - set to `false` to hide completely - - insert icons from [FontAwesome](https://fontawesome.com/icons?d=gallery&s=solid&m=free) using the prefix `^` followed by the icon's name : `made with ^heart`, etc - -### `top` / `left` -- type: `number|percentage` -- default: `auto` -- usage: - - when both `top` and `left` are set to `auto`, the widget is positioned according to the normal flow of the page (from left to right, by order of creation). - - otherwise, the widget will be absolutely positioned - - -### `width` / `height` -- type: `number|percentage` -- default: `auto` - -### `color` -- type: `string` -- default: `auto`, inherited accent color -- usage: any valid `css` color code is valid, this will change the default accent color for the widget and all its children - - -### `css` -- type: `string` -- default: *empty* -- usage: applies CSS rules to widget. See [css tips](../extras/css-tips.md). - -## Value - -### `default` -- type: `*` -- default: `empty` -- usage: if set, the widget will be initialized with this `value` when the session is loaded. Some widgets use this property under specific conditions (see fader's `doubleTap` for example). - - -### `value` -- type: `*` -- default: `empty` -- usage: set `value` to define a widget's value depending on other widget's values / properties using [property inheritance and property maths](../extras/advanced-property-syntax.md). When updated by an osc-sending event (e.g. dragging a slider), the widget will send its own osc message as well. - -!!! note "" - `default` and `value` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc) and restrictions (equal to `on` or `off` for a push/toggle button) - - -## OSC - -### `precision` -- type: `integer|string` -- default: `2` -- usage: the `precision` property defines the number of decimals to display and to send. - - set to `0` to send `integers` only. - - a specific data type can be specified by appending a valid osc type tag to the precision value, for example : `3d` will make the widget send double precision numbers rounded to three decimals - -### `target` -- type: `array|string` -- default: `[]` -- usage: - - this defines the targets of the widget's osc messages - - each element of the `array` must be a string formatted as follows : `"ip:port"` - - multiple targets can be specified : `["ip1:port1","ip2:port2"]` - - a single target can be set : `ip:port` - - if [`midi`](../extras/midi.md) is enabled, targets can be `"midi:device_name"` - - special item `"self"` can be used to refer to the emitting client directly - - if no target is set (empty array `[]`), messages can still be sent if the server has defaults targets (`-s / --send`) - - to disable the default global osc targets (set via the app's `--send` option), set one of the array's item as `null` (unquoted). - -### `address` -- type: `string` -- default: `/widgets_id` -- usage: this is the `address` of the osc messages sent by the widget, it must start with a `/` - -### `touchAddress` -- type: `string` -- default: `empty` -- usage: sliders and pads can send special osc messages to inform weither they are currently touched or not. The osc message will be of the following form : -``` - /touch/address [preArgs] 0/1 -``` - -### `preArgs` -- type: `array|*` -- default: `[]` -- usage: - - each element of the `array` defines a constant value that will be prepended to the osc message - - values can be defined as objects if the osc data type needs to be specified (ie different from the default implied by the `precision` option) - - a single non-array value can be set -- example: -```js -preArgs: [ - "1", // this will always be sent as a string - 0.5, // this will be sent as an integer if precision equals 0 - 1, // this will be sent as float if precision is different from 0 - { - type:"f", - value:0.5 - }, - { - type:"i", - value:1 - }, - { - type:"T", - value:true - }, - { - type:"F", - value:false - } -] -``` - -### `bypass` -- type: `boolean` -- default: `false` -- usage: set to `true` to prevent the widget from sending any osc message - -!!! note "" - Changing OSC properties dynamically using advanced property syntax is likely to break synchronisation between multiple clients. diff --git a/resources/images/logo_discourse.png b/resources/images/logo_discourse.png new file mode 100644 index 00000000..e4fec723 Binary files /dev/null and b/resources/images/logo_discourse.png differ diff --git a/resources/mkdocs.yml b/resources/mkdocs.yml index b4e6ef23..1ce9b210 100644 --- a/resources/mkdocs.yml +++ b/resources/mkdocs.yml @@ -6,49 +6,41 @@ copyright: "Open Stage Control is an AMMD software site_description: "Libre and modular OSC / MIDI controller" theme: - name: 'material' - custom_dir: 'mkdocs-material/material' - feature: - tabs: true + name: null + custom_dir: 'theme/' favicon: 'img/logo-nobadge.png?1' - language: 'en' - logo: 'img/logo-nobadge.svg' - palette: - primary: 'blue grey' - accent: 'light blue' - font: - text: 'Roboto' - code: 'Roboto Mono' + include_search_page: true + static_templates: + - 404.html -extra_css: - - 'css/extra.css' -pages: - - OSC Control Surface: index.md - - Getting started: getting-started.md - - User interface: interface.md - - Editing sessions: editing-sessions.md - - Widgets reference: widgets-reference.md - # - Widget properties: widgets/widgets.md - # - Containers: widgets/containers.md - # - Sliders: widgets/sliders.md - # - Pads: widgets/pads.md - # - Buttons: widgets/buttons.md - # - Switchers: widgets/switchers.md - # - Plots: widgets/plots.md - # - Matrices: widgets/matrices.md - # - Inputs: widgets/inputs.md - # - Maths: widgets/maths.md - - Extras: - - Advanced property syntax: extras/advanced-property-syntax.md - - CSS Tips: extras/css-tips.md - - Theming: extras/theming.md - - URL options: extras/url-options.md - - Remote control: extras/remote-control.md - - Custom module: extras/custom-module.md - - Midi: extras/midi.md - - Examples: examples.md - - Credits: credits.md +extra: + links: + - + title: Download + url: https://github.com/jean-emmanuel/open-stage-control/releases + primary: true + - + title: Demo (requires chromium 50+) + url : http://openstagecontrol.herokuapp.com + +nav: + - Open Stage Control: index.md + - Docs: docs.md + - Docs: + - Getting started: docs/getting-started.md + - User interface: docs/interface.md + - Editing sessions: docs/editing-sessions.md + - Widgets reference: docs/widgets-reference.md + - Advanced property syntax: docs/advanced-property-syntax.md + - CSS Tips: docs/css-tips.md + - Theming: docs/theming.md + - URL options: docs/url-options.md + - Remote control: docs/remote-control.md + - Custom module: docs/custom-module.md + - Midi: docs/midi.md + - Examples: docs/examples.md + - Credits: docs/credits.md markdown_extensions: - markdown.extensions.admonition @@ -68,3 +60,6 @@ markdown_extensions: - pymdownx.superfences - pymdownx.tasklist(custom_checkbox=true) - pymdownx.tilde + +plugins: + - search diff --git a/resources/theme/404.html b/resources/theme/404.html new file mode 100644 index 00000000..8615bbe9 --- /dev/null +++ b/resources/theme/404.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} + +

404

+

Page not found.

+ +{% endblock %} diff --git a/resources/theme/base.html b/resources/theme/base.html new file mode 100644 index 00000000..16ff15e8 --- /dev/null +++ b/resources/theme/base.html @@ -0,0 +1,119 @@ + + + + + + + + + {% if page.title and not page.is_homepage %}{{ page.title }} - {% endif %}{{ config.site_name }} + + + + + + + + {% block extrahead %} + {% endblock %} + + +
+
+
+
+ +
+
+ +
+
+ +
+
+ Home + Docs + Bug Tracker + Community +
+
+
+
+
+ + {% if page.is_homepage %} +
+ +
+

{{ config.site_name }}

+

{{ config.site_description }}

+
+
+ {% for link in config.extra.links %} + {{link.title}} + {% endfor %} +
+
+
+ {% endif %} + +
+ {% if not page.is_homepage %} + {% set ns = namespace(navigation=[]) %} + {% for nav_item in nav %} + {% if nav_item.children %} + {% set ns.navigation = nav_item %} + {% endif %} + {% endfor %} +
+ +
+ {% endif %} + + +
+ {% block content %} + {{ page.content }} + {% endblock %} +
+
+ + + + + + + diff --git a/resources/theme/extensions/admonition.css b/resources/theme/extensions/admonition.css new file mode 100644 index 00000000..f22b7a9b --- /dev/null +++ b/resources/theme/extensions/admonition.css @@ -0,0 +1,57 @@ +div.admonition { + font-size: 0.9em; + border: 1px solid #cccccc; + background-color: #fafafa; + padding: 0; + border-radius: 3px; + margin: 0 0 1.2rem; +} + +div.admonition p { + margin: 0.5em 1em 0.5em 1em; + padding: 0; +} + +div.admonition li p { + margin-left: 0; +} + +div.admonition pre, div.warning pre { + margin: 0; +} + +div.admonition p.admonition-title { + margin: 0; + padding: 0.5em; + color: white; + font-weight: bold; + background-color: #165e83; +} + +div.danger { border: 1px solid #b7282e;} +div.error { border: 1px solid #b7282e;} +div.warning { border: 1px solid #f19072;} +div.caution { border: 1px solid #f19072;} +div.attention { border: 1px solid #f19072;} +div.important { border: 1px solid #f8b862;} +div.note { border: 1px solid #f8b862;} +div.hint { border: 1px solid #7ebea5;} +div.tip { border: 1px solid #7ebea5;} + +div.danger p.admonition-title, div.error p.admonition-title { + background-color: #b7282e; +} + +div.caution p.admonition-title, +div.warning p.admonition-title, +div.attention p.admonition-title { + background-color: #f19072; +} + +div.note p.admonition-title, div.important p.admonition-title { + background-color: #f8b862; +} + +div.hint p.admonition-title, div.tip p.admonition-title { + background-color: #7ebea5; +} diff --git a/resources/theme/extensions/codehilite.css b/resources/theme/extensions/codehilite.css new file mode 100644 index 00000000..d13a18f3 --- /dev/null +++ b/resources/theme/extensions/codehilite.css @@ -0,0 +1,316 @@ +/* https://raw.githubusercontent.com/simonsmith/syntax.css */ + +.codehilite { + background: #ffffff; + border-radius: 3px; +} + +.codehilite .c { + color: #999988; + font-style: italic +} + +/* Comment */ +.codehilite .err { + color: #a61717; + background-color: #e3d2d2 +} + +/* Error */ +.codehilite .k { + font-weight: bold +} + +/* Keyword */ +.codehilite .o { + font-weight: bold +} + +/* Operator */ +.codehilite .cm { + color: #999988; + font-style: italic +} + +/* Comment.Multiline */ +.codehilite .cp { + color: #999999; + font-weight: bold +} + +/* Comment.Preproc */ +.codehilite .c1 { + color: #999988; + font-style: italic +} + +/* Comment.Single */ +.codehilite .cs { + color: #999999; + font-weight: bold; + font-style: italic +} + +/* Comment.Special */ +.codehilite .gd { + color: #000000; + background-color: #ffdddd +} + +/* Generic.Deleted */ +.codehilite .gd .x { + color: #000000; + background-color: #ffaaaa +} + +/* Generic.Deleted.Specific */ +.codehilite .ge { + font-style: italic +} + +/* Generic.Emph */ +.codehilite .gr { + color: #aa0000 +} + +/* Generic.Error */ +.codehilite .gh { + color: #999999 +} + +/* Generic.Heading */ +.codehilite .gi { + color: #000000; + background-color: #ddffdd +} + +/* Generic.Inserted */ +.codehilite .gi .x { + color: #000000; + background-color: #aaffaa +} + +/* Generic.Inserted.Specific */ +.codehilite .go { + color: #888888 +} + +/* Generic.Output */ +.codehilite .gp { + color: #555555 +} + +/* Generic.Prompt */ +.codehilite .gs { + font-weight: bold +} + +/* Generic.Strong */ +.codehilite .gu { + color: #aaaaaa +} + +/* Generic.Subheading */ +.codehilite .gt { + color: #aa0000 +} + +/* Generic.Traceback */ +.codehilite .kc { + font-weight: bold +} + +/* Keyword.Constant */ +.codehilite .kd { + font-weight: bold; + +} + +/* Keyword.Declaration */ +.codehilite .kp { + font-weight: bold +} + +/* Keyword.Pseudo */ +.codehilite .kr { + font-weight: bold +} + +/* Keyword.Reserved */ +.codehilite .kt { + color: #445588; + font-weight: bold +} + +/* Keyword.Type */ +.codehilite .m { + color: #009999 +} + +/* Literal.Number */ +.codehilite .s { + color: #d14 +} + +/* Literal.String */ +.codehilite .na { + color: #008080 +} + +/* Name.Attribute */ +.codehilite .nb { + color: #0086B3 +} + +/* Name.Builtin */ +.codehilite .nc { + color: #445588; + font-weight: bold +} + +/* Name.Class */ +.codehilite .no { + color: #008080 +} + +/* Name.Constant */ +.codehilite .ni { + color: #800080 +} + +/* Name.Entity */ +.codehilite .ne { + color: #990000; + font-weight: bold +} + +/* Name.Exception */ +.codehilite .nf { + color: #990000; + font-weight: bold +} + +/* Name.Function */ +.codehilite .nn { + color: #555555 +} + +/* Name.Namespace */ +.codehilite .nt { + color: #000080 +} + +/* Name.Tag */ +.codehilite .nv { + color: #008080 +} + +/* Name.Variable */ +.codehilite .ow { + font-weight: bold +} + +/* Operator.Word */ +.codehilite .w { + color: #bbbbbb +} + +/* Text.Whitespace */ +.codehilite .mf { + color: #009999 +} + +/* Literal.Number.Float */ +.codehilite .mh { + color: #009999 +} + +/* Literal.Number.Hex */ +.codehilite .mi { + color: #009999 +} + +/* Literal.Number.Integer */ +.codehilite .mo { + color: #009999 +} + +/* Literal.Number.Oct */ +.codehilite .sb { + color: #d14 +} + +/* Literal.String.Backtick */ +.codehilite .sc { + color: #d14 +} + +/* Literal.String.Char */ +.codehilite .sd { + color: #d14 +} + +/* Literal.String.Doc */ +.codehilite .s2 { + color: #d14 +} + +/* Literal.String.Double */ +.codehilite .se { + color: #d14 +} + +/* Literal.String.Escape */ +.codehilite .sh { + color: #d14 +} + +/* Literal.String.Heredoc */ +.codehilite .si { + color: #d14 +} + +/* Literal.String.Interpol */ +.codehilite .sx { + color: #d14 +} + +/* Literal.String.Other */ +.codehilite .sr { + color: #009926 +} + +/* Literal.String.Regex */ +.codehilite .s1 { + color: #d14 +} + +/* Literal.String.Single */ +.codehilite .ss { + color: #990073 +} + +/* Literal.String.Symbol */ +.codehilite .bp { + color: #999999 +} + +/* Name.Builtin.Pseudo */ +.codehilite .vc { + color: #008080 +} + +/* Name.Variable.Class */ +.codehilite .vg { + color: #008080 +} + +/* Name.Variable.Global */ +.codehilite .vi { + color: #008080 +} + +/* Name.Variable.Instance */ +.codehilite .il { + color: #009999 +} diff --git a/resources/theme/icons.min.css b/resources/theme/icons.min.css new file mode 100644 index 00000000..e0681402 --- /dev/null +++ b/resources/theme/icons.min.css @@ -0,0 +1 @@ +/*! Icons.css v0.1.0 | MIT License | github.com/picturepan2/icons.css */.icon{box-sizing:border-box;display:inline-block;font-size:inherit;font-style:normal;height:1em;position:relative;text-indent:-9999px;vertical-align:middle;width:1em}.icon::after,.icon::before{content:"";display:block;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.icon.icon-2x{font-size:32px}.icon.icon-3x{font-size:48px}.icon.icon-4x{font-size:64px}.icon-apps::before{background:currentColor;box-shadow:-.35em -.35em,-.35em 0,-.35em .35em,0 -.35em,0 .35em,.35em -.35em,.35em 0,.35em .35em;height:.15em;width:.15em}.icon-arrow-down::before,.icon-arrow-left::before,.icon-arrow-right::before,.icon-arrow-up::before,.icon-back::before,.icon-downward::before,.icon-forward::before,.icon-upward::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.65em;width:.65em}.icon-arrow-down::before{transform:translate(-50%,-75%) rotate(225deg)}.icon-arrow-left::before{transform:translate(-25%,-50%) rotate(-45deg)}.icon-arrow-right::before{transform:translate(-75%,-50%) rotate(135deg)}.icon-arrow-up::before{transform:translate(-50%,-25%) rotate(45deg)}.icon-back::after,.icon-forward::after{background:currentColor;height:.1rem;width:.8em}.icon-downward::after,.icon-upward::after{background:currentColor;height:.8em;width:.1rem}.icon-back::after{left:55%}.icon-back::before{transform:translate(-50%,-50%) rotate(-45deg)}.icon-downward::after{top:45%}.icon-downward::before{transform:translate(-50%,-50%) rotate(-135deg)}.icon-forward::after{left:45%}.icon-forward::before{transform:translate(-50%,-50%) rotate(135deg)}.icon-upward::after{top:55%}.icon-upward::before{transform:translate(-50%,-50%) rotate(45deg)}.icon-caret::before{border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid currentColor;height:0;transform:translate(-50%,-25%);width:0}.icon-menu::before{background:currentColor;box-shadow:0 -.35em,0 .35em;height:.1rem;width:100%}.icon-more-horiz::before,.icon-more-vert::before{background:currentColor;border-radius:50%;box-shadow:-.4em 0,.4em 0;height:.2em;width:.2em}.icon-more-vert::before{box-shadow:0 -.4em,0 .4em}.icon-bookmark::before{border:.1rem solid currentColor;border-bottom:0;border-top-left-radius:.1rem;border-top-right-radius:.1rem;height:.9em;width:.85em}.icon-bookmark::after{border:.1rem solid currentColor;border-bottom:0;border-left:0;border-radius:.1rem;height:.5em;transform:translate(-50%,.2em) rotate(-45deg) skew(15deg,15deg);width:.5em}.icon-check::before{border:.1rem solid currentColor;border-right:0;border-top:0;height:.5em;transform:translate(-50%,-.375em) rotate(-45deg);width:.9em}.icon-close::before{background:currentColor;height:.1rem;width:100%}.icon-close::after{background:currentColor;height:100%;width:.1rem}.icon-close::after,.icon-close::before{transform:translate(-50%,-50%) rotate(45deg)}.icon-copy::before{border:.1rem solid currentColor;border-bottom-color:transparent;border-radius:.1em;border-right-color:transparent;height:.8em;left:40%;top:40%;width:.7em}.icon-copy::after{border:.1rem solid currentColor;border-radius:.1em;height:.8em;left:60%;top:60%;width:.7em}.icon-delete::before{border:.1rem solid currentColor;border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem;border-top:0;height:.6em;top:70%;width:.75em}.icon-delete::after{background:currentColor;box-shadow:-.2em .2em,.2em .2em;height:.1rem;top:.05rem;width:.5em}.icon-download{border-bottom:.1rem solid currentColor}.icon-download::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.5em;transform:translate(-50%,-.3em) rotate(-135deg);width:.5em}.icon-download::after{background:currentColor;height:.6em;top:40%;width:.1rem}.icon-edit::before{border:.1rem solid currentColor;height:.4em;transform:translate(-.35em,-.25em) rotate(-45deg);width:.85em}.icon-edit::after{border:.15em solid currentColor;border-right-color:transparent;border-top-color:transparent;height:0;left:5%;top:95%;transform:translate(0,-100%);width:0}.icon-flag::before{background:currentColor;height:1em;left:10%;width:.1rem}.icon-flag::after{border:.1rem solid currentColor;border-bottom-right-radius:.1em;border-left:0;border-top-right-radius:.1em;height:.7em;left:52%;top:35%;width:.85em}.icon-minus::before{background:currentColor;height:.1rem;width:100%}.icon-plus::before{background:currentColor;height:.1rem;width:100%}.icon-plus::after{background:currentColor;height:100%;width:.1rem}.icon-refresh::before{border:.1rem solid currentColor;border-radius:50%;border-right-color:transparent;height:1em;width:1em}.icon-refresh::after{border:.2em solid currentColor;border-left-color:transparent;border-top-color:transparent;height:0;left:80%;top:20%;width:0}.icon-resize-horiz::after,.icon-resize-horiz::before,.icon-resize-vert::after,.icon-resize-vert::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.4em;width:.4em}.icon-resize-horiz::before,.icon-resize-vert::before{transform:translate(-50%,-90%) rotate(45deg)}.icon-resize-horiz::after,.icon-resize-vert::after{transform:translate(-50%,-10%) rotate(225deg)}.icon-resize-horiz::before{transform:translate(-90%,-50%) rotate(-45deg)}.icon-resize-horiz::after{transform:translate(-10%,-50%) rotate(135deg)}.icon-search::before{border:.1rem solid currentColor;border-radius:50%;height:.75em;left:5%;top:5%;transform:translate(0,0) rotate(45deg);width:.75em}.icon-search::after{background:currentColor;height:.1rem;left:80%;top:80%;transform:translate(-50%,-50%) rotate(45deg);width:.4em}.icon-share{border:.1rem solid currentColor;border-radius:.1rem;border-right:0;border-top:0}.icon-share::before{border:.1rem solid currentColor;border-left:0;border-top:0;height:.4em;left:100%;top:.25em;transform:translate(-125%,-50%) rotate(-45deg);width:.4em}.icon-share::after{border:.1rem solid currentColor;border-bottom:0;border-radius:75% 15%;border-right:0;height:.6em;top:55%;width:.6em}.icon-shutdown{border:.1rem solid currentColor;border-radius:50%;border-top-color:transparent}.icon-shutdown::before{background:currentColor;content:"";height:.5em;top:.1em;width:.1rem}.icon-stop{border:.1rem solid currentColor;border-radius:50%}.icon-stop::before{background:currentColor;height:.1rem;transform:translate(-50%,-50%) rotate(45deg);width:1em}.icon-upload{border-bottom:.1rem solid currentColor}.icon-upload::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.5em;transform:translate(-50%,-60%) rotate(45deg);width:.5em}.icon-upload::after{background:currentColor;height:.6em;top:50%;width:.1rem}.icon-audio{border:.1rem solid currentColor;border-radius:.4em;height:.6em;margin:-.4em .3em 0 .3em;width:.4em}.icon-audio::before{background:currentColor;height:.15em;transform:translate(-50%,.45em);width:.1rem}.icon-audio::after{border:.1rem solid currentColor;border-bottom-color:transparent;border-radius:50%;border-right-color:transparent;height:.7em;transform:translate(-50%,-35%) rotate(-135deg);width:.7em}.icon-emoji{border:.1rem solid currentColor;border-radius:50%}.icon-emoji::before{border-radius:50%;box-shadow:-.17em -.15em,.17em -.15em;height:.15rem;width:.15rem}.icon-emoji::after{border:.1rem solid currentColor;border-bottom-color:transparent;border-radius:50%;border-right-color:transparent;height:.5em;transform:translate(-50%,-.2em) rotate(-135deg);width:.5em}.icon-link::after,.icon-link::before{border:.1rem solid currentColor;border-radius:5em 0 0 5em;border-right:0;height:.5em;width:.75em}.icon-link::before{transform:translate(-70%,-45%) rotate(-45deg)}.icon-link::after{transform:translate(-30%,-55%) rotate(135deg)}.icon-location::before{border:.1rem solid currentColor;border-radius:50% 50% 50% 0;height:.8em;transform:translate(-50%,-60%) rotate(-45deg);width:.8em}.icon-location::after{border:.1rem solid currentColor;border-radius:50%;height:.3em;transform:translate(-50%,-.25em);width:.3em}.icon-mail::before{border:.1rem solid currentColor;border-radius:.1rem;height:.8em;width:1em}.icon-mail::after{border:.1rem solid currentColor;border-right:0;border-top:0;height:.5em;transform:translate(-50%,-.45em) rotate(-45deg) skew(10deg,10deg);width:.5em}.icon-message{border:.1rem solid currentColor;border-bottom:0;border-radius:.1rem;border-right:0}.icon-message::before{border:.1rem solid currentColor;border-bottom-right-radius:.1rem;border-left:0;border-top:0;height:.8em;left:65%;top:35%;width:.75em}.icon-message::after{background:currentColor;border-radius:.1rem;height:.35em;left:7%;top:100%;transform:translate(0,-.32em) rotate(45deg);width:.1rem}.icon-person::before{border:.1rem solid currentColor;border-radius:50%;height:.45em;top:25%;width:.45em}.icon-person::after{border:.1rem solid currentColor;border-radius:50% 50% 0 0;height:.4em;top:75%;width:.9em}.icon-photo{border:.1rem solid currentColor;border-radius:.1rem}.icon-photo::before{border:.1rem solid currentColor;border-radius:50%;height:.3em;left:35%;top:35%;width:.3em}.icon-photo::after{border:.1rem solid currentColor;border-bottom:0;border-left:0;height:.5em;left:60%;transform:translate(-45%,25%) rotate(-45deg);width:.5em}.icon-time{border:.1rem solid currentColor;border-radius:50%}.icon-time::before{background:currentColor;height:.4em;transform:translate(-50%,-75%);width:.1rem}.icon-time::after{background:currentColor;height:.25em;transform:translate(-50%,-75%) rotate(125deg);transform-origin:50% 100%;width:.1rem} \ No newline at end of file diff --git a/resources/theme/main.html b/resources/theme/main.html new file mode 100644 index 00000000..94d9808c --- /dev/null +++ b/resources/theme/main.html @@ -0,0 +1 @@ +{% extends "base.html" %} diff --git a/resources/theme/normalize.css b/resources/theme/normalize.css new file mode 100644 index 00000000..192eb9ce --- /dev/null +++ b/resources/theme/normalize.css @@ -0,0 +1,349 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/resources/theme/scripts.js b/resources/theme/scripts.js new file mode 100644 index 00000000..4e132596 --- /dev/null +++ b/resources/theme/scripts.js @@ -0,0 +1,9 @@ +var offset = 82 +function offsetScroll(){ + if (document.location.hash) { + var el = document.getElementById(document.location.hash.substring(1)) + if (el) document.body.scrollTop = document.documentElement.scrollTop = el.offsetTop - offset + } +} +window.addEventListener('hashchange', offsetScroll) +setTimeout(offsetScroll, 250) diff --git a/resources/theme/search.html b/resources/theme/search.html new file mode 100644 index 00000000..42d98728 --- /dev/null +++ b/resources/theme/search.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block extrahead %} + +{% endblock %} + +{% block content %} + + + +
+
+ +{% endblock %} diff --git a/resources/theme/styles.css b/resources/theme/styles.css new file mode 100644 index 00000000..cbc30cb1 --- /dev/null +++ b/resources/theme/styles.css @@ -0,0 +1,246 @@ +body { + color: #333; + font-family: Helvetica,Arial,sans-serif; + font-size: 15px; + line-height: 1.4; + background-color: #fff; + overflow-y: scroll; + direction: ltr; +} + + + +.wrap { + max-width: 1110px; +} +@media (max-width: 570px) +.wrap, .full-width { + min-width: 0; +} +.wrap { + margin-right: auto; + margin-left: auto; + padding: 0 8px; +} +.d-header>.wrap { + width: calc(100% - 16px); + height: 100%; + padding: 0; +} + + +.d-header { + left: 0; + height: 4em; + margin-bottom: 15px; +} + +.d-header { + display: flex; + align-items: center; + width: 100%; + position: fixed; + top: 0; + z-index: 1000; + background-color: #333; + box-shadow: 0 2px 4px -1px rgba(0,0,0,0.25); +} + +.d-header>.wrap .contents { + display: flex; + align-items: center; + height: 100%; +} + +.wrap .contents { + position: relative; +} + +.d-header .title { + display: flex; + align-items: center; + height: 100%; +} + +.d-header .title img { + height: 2.57em; + vertical-align: middle; +} + + +.d-header .header-buttons-panel { + position: relative; + display: flex; + flex: 0 0 auto; + margin-left: auto; + align-items: center; +} +.d-header .header-buttons { + display: flex; + align-items: center; + margin-top: 0.2em; +} + +.d-header .header-buttons a { + padding: 6px 10px; + color: #fff; + font-size: 1.1487em; +} + +.d-header .header-buttons a { + opacity: 0.5; + transition: opacity .25s; + text-decoration: none; +} +.d-header .header-buttons a:hover { + opacity: 0.75; +} +.d-header .header-buttons a.active { + opacity: 1; +} + + + +#jumbotron { + text-align: center; + position: relative; + padding: 8em 0 4em; +} +#jumbotron .bg { + position: absolute; + top:0px;left:0px;right:0px;bottom:0px; + background-size: cover; + z-index: -1; + opacity: 0.5; + /* filter: blur(5px); */ + +} + +#jumbotron + #main { + padding-top: 2em; + padding-bottom: 0; +} + + +#main { + padding-top: 5.8572em; + padding-bottom: 4em; + display: flex; + font-size: 14px; +} + +.col-left { + width:240px; +} +.col-left > ul { + top: 5.8572em; + width: 230px; + position: fixed; + overflow-y: auto; + bottom: 0; + padding-left: 2px; +} +.col-left > ul ul { + line-height: 1 +} +.col-right { + flex: 1 +} + +#main img { + max-width: 100%; + border-radius: 3px; + /* box-shadow: 0 2px 8px 0 rgba(0,0,0,0.5); */ +} + +.codehilite { + background-color: #fafafa; + color: #37474f; + line-height: 1em; +} + +.codehilite pre { + padding: 12px; + white-space: pre; + font-feature-settings: "kern"; + /* font-family: "Roboto Mono","Courier New",Courier,monospace; */ + direction: ltr; + line-height: 1.1; +} + +table { + border: 1px solid #eee; + border-collapse: collapse; + border-spacing: 0; + font-size: 100%; + font: inherit; + margin: 0 0 1.2rem; +} + +table tr:nth-child(2n +1) { + background-color: #f8f8f8; +} + +table td { + padding: 10px; +} +table h4 { + margin: 0; + font-size: 14px; + font-weight: bold; +} + +table th { + font-weight: bold; + background-color: #888; + color: #fff; + vertical-align: top; + text-align: left; + padding: 10px; +} + +code, tt { + padding: 0 5px; + white-space: nowrap; + border: 1px solid #eaeaea; + border-radius: 3px; + background-color: #f8f8f8; + color: #333333; } + + +code { + background-color: #fafafa; + padding: 2px; +} + +table code { + white-space: nowrap; +} + +table .thead2 { + background: #ddd!important; + color: #666; + white-space: nowrap; +} + + +.headerlink { + font-size:50%; + opacity: 0.25; + vertical-align: super; + position: relative; +} + +h1:first-child { + margin-top:0; +} + +#mkdocs-search-query { + border: 1px solid #333; + background:rgba(0,0,0,0.25); + border-radius: 15px; + color: #eee; + outline: none; + padding:6px 12px; + margin-right: 10px; +}