From d427d8358674a8007bd9988c5b780e6c3ef7438a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 18 Sep 2015 10:12:27 +0200 Subject: [PATCH] - not much to say... prepare for mergiiiiing --- README.md | 2 +- app/browser/css/style.css | 2 +- app/browser/js/app/parser.js | 10 +++++++--- app/browser/js/app/utils.js | 9 ++++++--- app/browser/js/app/widgets.js | 19 ++++++++++--------- app/browser/scss/style.scss | 10 +++++----- sessions/demo.js | 5 ++--- 7 files changed, 32 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3ef43160..b84adacc 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A valid session file is a javascript file that returns, when eval'd, an array of ``` [ { - id:"my_tab_id", // [string] optional, default unique tab id + id:"my_tab_id", // [string] optional, default to unique 'tab_n' label:"My tab", // [string] default to id stack:false, // [bool] set to true to stack widgets vertically widgets: [], // [array] of widget objects diff --git a/app/browser/css/style.css b/app/browser/css/style.css index 7dae06fe..cf90d902 100644 --- a/app/browser/css/style.css +++ b/app/browser/css/style.css @@ -1 +1 @@ -* { margin: 0; padding: 0; box-sizing: border-box; text-decoration: none; outline: 0; font: inherit; cursor: inherit; }a { cursor: pointer; display: block; }::-webkit-scrollbar { width: 10px; height: 10px; opacity: 1; }::-webkit-scrollbar-track-piece { background: rgba(0, 0, 0, 0.2); }::-webkit-scrollbar-track-piece:vertical { border-left: 2px solid #282c34; }::-webkit-scrollbar-track-piece:horizontal { border-top: 2px solid #282c34; }::-webkit-scrollbar-corner { background: none; }::-webkit-scrollbar-thumb { background: linear-gradient(#2d3139, #2b2f37 15rem); }::-webkit-scrollbar-thumb:vertical { border-left: 2px solid #282c34; }::-webkit-scrollbar-thumb:horizontal { border-top: 2px solid #282c34; }* { -webkit-user-select: none; }.inspector * { -webkit-user-select: initial; }.inspector *::selection { background: #528bff !important; }input:focus::selection { background: #528bff; }input { cursor: text; }html, body { height: 100%; overflow: hidden; position: relative; }html { font-size: 1px; }body { font-size: 14rem; line-height: 16rem; font-family: sans; color: #cccccc; white-space: nowrap; opacity: 1; cursor: default; }.btn { background: linear-gradient(#2d3139, #2b2f37 15rem); display: block; border: 1px solid #1a1d22; padding: 15rem; }a.btn:hover { background: linear-gradient(#32363d, #2d3139); }#lobby { background: #22252c; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; border: 1px solid #1a1d22; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 20rem; }#lobby .main { width: 600rem; max-height: 100%; }#lobby .header { background: linear-gradient(#2d3139, #2b2f37 15rem); padding: 20rem; font-weight: bold; box-shadow: 0 0 0 1px #1a1d22 inset; white-space: nowrap; text-overflow: ellipsis; }#lobby a { padding-right: 35rem; overflow: hidden; margin-top: 10rem; position: relative; white-space: nowrap; text-overflow: ellipsis; }#lobby a span { position: absolute; right: 0rem; top: 0rem; padding: 15rem; color: #999999; }#lobby a span:hover { color: #cccccc; }#container { background: #22252c; position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; transition: right 0.2s; }#container.sidepanel-open { right: 300rem; }#container #open-toggle { position: absolute; right: 0; top: 2rem; width: 60rem; height: 60rem; padding: 0 10rem; line-height: 60rem; font-size: 24rem; text-align: center; color: #999999; z-index: 2; }#container #open-toggle.sidepanel-open { color: #cccccc; }#sidepanel { position: absolute; z-index: 999999; width: 300rem; top: 0; right: 0; bottom: 0; margin-right: -300rem; background: #282c34; border-left: 1px solid #1a1d22; transition: right 0.2s; overflow-y: auto; overflow-x: visible; }#sidepanel.sidepanel-open { right: 300rem; }#sidepanel #options { position: absolute; left: 0; top: 2rem; right: 0; bottom: 0; padding: 5rem; list-style: none; background: #282c34; }#sidepanel #options li { display: block; margin-bottom: 5rem; background: linear-gradient(#2d3139, #2b2f37 15rem); }#sidepanel #options .inspector { padding: 10rem; }#sidepanel #options .inspector .result { background: #1a1d22; border-radius: 3rem; margin-top: 10rem; padding: 10rem; color: #999999; white-space: pre; word-wrap: break-word; width: 100%; max-height: 300rem; overflow-y: auto; }#sidepanel #options .inspector .result::-webkit-scrollbar-track-piece, #sidepanel #options .inspector .result::-webkit-scrollbar-thumb { border-color: #1a1d22 !important; }#sidepanel #options .inspector .result::-webkit-scrollbar-thumb { background: #22252c !important; opacity: 0.6 !important; }.nicescroll-rails-hr { margin-top: 3rem; }.nicescroll-rails-vr { display: none !important; }a { color: inherit; }.navigation { position: absolute; top: 0; left: 0; right: 0; z-index: 1; font-size: 14rem; background: #22252c; border-bottom: 1px solid #1a1d22; border-top: 1px solid #282c34; height: 60rem; }.navigation ::first-letter { text-transform: uppercase; }.navigation.main { padding-right: 55rem; right: 0; }.navigation ul { list-style: none; display: flex; padding: 7rem 5rem; }.navigation ul li.on + li { border-image: none; border-left: 1px solid transparent; }.navigation ul li { display: block; max-width: 250rem; flex: 1; border-width: 0 0 0 1px; border-image: linear-gradient(rgba(26, 29, 34, 0), #1a1d22, rgba(26, 29, 34, 0)) 0 0 0 1 stretch; }.navigation ul li:first-child, .navigation ul li.on { border-image: none; border-left: 1px solid transparent; }.navigation ul li:first-child { border-left: 0; }.navigation ul li a { display: block; padding: 5rem 10rem; line-height: 34rem; border-radius: 3rem; overflow: hidden; text-align: center; border: 1px solid transparent; position: relative; color: #999999; }.navigation ul li a span { display: block; width: 100%; -webkit-mask: linear-gradient(to left, transparent, #000000 10rem) no-repeat; }.navigation ul li a.on { background: #282c34; border: 1px solid #1a1d22; color: #cccccc; }.navigation ul li a.on:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06); background: linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)); }.navigation ul li a.on:after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4rem; }.content { position: absolute; left: 0; top: 60rem; right: 0; bottom: 0; background: #282c34; }.content .tab { font-size: 0; overflow: auto; }.content .content { top: 60rem; }.tab { display: none; }.tab.on { display: block; height: 100%; width: auto; }#loading { position: absolute; top: 50%; left: 50%; margin-top: -15rem; text-align: center; }#loading .spinner { display: block; margin: 0 auto; height: 30rem; width: 30rem; border-radius: 50%; border: 2rem solid rgba(0, 0, 0, 0.2); border-top-color: #528bff; animation: spin 0.5s linear infinite; }#loading #status { margin-top: 10rem; display: inline-block; }@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }.popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; padding: 10%; background: rgba(0, 0, 0, 0.5); z-index: 1000000; }.popup .popup-title { position: relative; padding: 15rem; background: linear-gradient(#2d3139, #2b2f37 15rem); }.popup .popup-title .closer { position: absolute; right: 0rem; top: 0; padding: 15rem; color: #999999; cursor: pointer; }.popup .popup-title .closer:hover { color: #cccccc; }.popup .popup-wrapper { background: #282c34; height: 100%; width: 100%; max-width: 600rem; margin: 0 auto; position: relative; overflow: hidden; border: 1px solid #1a1d22; }.popup .popup-wrapper .popup-content { height: 100%; width: 100%; padding: 10rem; overflow-y: scroll; white-space: normal; }form label { display: block; padding-top: 10rem; margin-bottom: 10rem; }form .info { color: #999999; margin-bottom: 10rem; }form input { display: block; margin-bottom: 10rem; background: #22252c; font: inherit; color: #cccccc; border: 1px solid #1a1d22; width: 100%; padding: 10rem; }form input.invalid { box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.3) !important; }form input:focus { box-shadow: 0 0 0 1px #528bff; }form .submit { margin-top: 30rem; }.widget { display: inline-block; height: auto; overflow: hidden; position: relative; font-size: 13rem; padding: 35rem 1px 0; vertical-align: top; border: 6rem solid #282c34; border-width: 6rem 3rem; box-shadow: 0 0 0 1px #22252c inset; background: linear-gradient(#2d3139, #2b2f37 15rem); }.widget:first-child { border-left-width: 6rem; }.widget:last-child { border-right-width: 6rem; }.widget .label { z-index: 1; padding: 10rem 10rem; position: absolute; top: 0rem; left: 0; right: 0; text-overflow: ellipsis; overflow: hidden; height: 35rem; }.widget .label.accent { color: #528bff; }.widget input { width: 100%; height: 35rem; border: 0; background: #22252c; color: inherit; display: block; padding: 10rem; }.widget input:focus { box-shadow: 0 0 0 1px #528bff inset !important; }.widget input[disabled] { color: #999999; }.tab.stack { display: flex; flex-direction: column; }.tab.stack > .widget { height: auto; flex-shrink: 0; border-left-width: 6rem; }/* STRIP (contains any widgets) */.strip-container { height: 100%; overflow: visible; border-bottom: 0; background: none; box-shadow: none; padding-top: 35rem; }.strip-container > .label { background: linear-gradient(#2d3139, #2b2f37 15rem); box-shadow: 0 0 0 1px #22252c inset; }.strip-container.no-stretch { height: auto; min-height: 100%; }.strip-container.no-stretch .strip .widget { height: auto; }.strip-container .strip { height: 100%; display: flex; flex-direction: column; }.strip-container .strip.horizontal { flex-direction: row; }.strip-container .strip.horizontal > .widget { border-bottom-width: 0; border-right-width: 6rem; }.strip-container .strip > .widget { display: block; border-left-width: 0; border-right-width: 0; }.strip-container .strip > .widget:not(:last-child) { border-bottom-width: 0; }/* BUTTONS */.toggle-container { width: 100rem; flex-shrink: 0; padding: 0 !important; cursor: pointer; }.toggle-container .label { position: relative; padding: 29rem 10rem 26rem; line-height: 1rem; background: none !important; text-align: center; }.toggle-container:hover { background: linear-gradient(#32363d, #2d3139); }.toggle { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }.toggle .light { position: absolute; left: 4rem; right: 4rem; top: 4rem; height: 4rem; background: #1a1d22; border-radius: 3rem; }.toggle.on .light { background: #528bff; }.switch-container { width: 100rem; flex-shrink: 0; }.switch-container .switch { height: 100%; width: 100%; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; padding-bottom: 1px; }.switch-container .switch .value { background: linear-gradient(#2d3139, #2b2f37 15rem); color: #999999; width: 100%; position: relative; border-top: 1px solid #282c34; padding: 12rem 12rem 12rem 24rem; white-space: normal; text-align: left; word-break: break-all; overflow: hidden; }.switch-container .switch .value:hover { background: linear-gradient(#32363d, #2d3139); }.switch-container .switch .value:last-child { margin-bottom: 0; }.switch-container .switch .value:after { content: ""; position: absolute; left: 8rem; top: 50%; width: 8rem; height: 8rem; margin-top: -4rem; background: #1a1d22; border-radius: 8rem; }.switch-container .switch .value.on:after { background: #528bff; }/* XY */.xy-container, .rgb-container { width: 300rem; flex-shrink: 0; }.xy-wrapper { overflow: hidden; }.xy-wrapper .value { width: 100%; }.xy-wrapper input { width: 50%; float: left; padding-left: 20rem; position: relative; left: 0rem; right: 0rem; box-shadow: 0 0 1px 0 #1a1d22 inset; }.xy { position: relative; width: 100%; padding-bottom: 90%; overflow: hidden; }.xy .handle { position: absolute; height: 0rem; width: 0rem; bottom: 0; left: 0; max-height: 100%; max-width: 100%; z-index: 2; cursor: -webkit-grab; }.xy .handle:active { cursor: -webkit-grabbing; }.xy .handle:active:after { transform: scale(1.5); }.xy .handle:after { content: ""; position: absolute; top: -.5rem; right: -1px; border-radius: 100% !important; width: 20rem; height: 20rem; margin: -10rem -10rem 0 0; box-shadow: 0 0 0 1000rem rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2); }.xy .handle::before { content: ""; position: absolute; top: -.5rem; left: -1px; width: 2000rem; height: 2000rem; margin: -1000rem 0 0 -1000rem; }.rgb-wrapper input { width: 33.33%; }.rgb { background-color: red; }.rgb:before, .rgb:after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; }.rgb:before { background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%); }.rgb:after { background: linear-gradient(to bottom, transparent 0%, black 100%); /* W3C */ }.hue { width: 100%; height: 30rem; background: transparent linear-gradient(to left, #F00, #FF0080, #F0F, #8000FF, #00F, #0080FF, #0FF, #00FF80, #0F0, #80FF00, #FF0, #FF8000, #F00) repeat scroll 0% 0%; overflow: hidden; position: relative; }.hue .handle { position: absolute; height: 100%; max-width: 100%; width: 0; z-index: 2; left: 0; bottom: 0; cursor: -webkit-grab; }.hue .handle:active { cursor: -webkit-grabbing; }.hue .handle:active:after { transform: scale(1.5); }.hue .handle:after { content: ""; position: absolute; top: 50%; right: -1px; box-shadow: 0 0 0 1000rem rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2); border-radius: 100% !important; width: 11rem; height: 11rem; margin: -5rem -4rem 0 0; }.hue .handle:before { content: ""; position: absolute; top: 0; left: 0; width: 2000rem; height: 100%; margin-left: -1000rem; }.fader-container { width: 100rem; height: 100%; min-height: 300rem; }.fader-container .fader-wrapper-outer { padding-bottom: 30rem; position: absolute; top: 30rem; bottom: 0; left: 1px; right: 1px; }.fader-container .fader-wrapper-outer input { position: absolute; bottom: 0; }.fader-container .fader-wrapper { padding: 20rem; overflow: hidden; height: 100%; position: relative; }.fader-container .fader-wrapper .fader { height: 100%; width: 4rem; background: #1a1d22; position: relative; }.fader-container .fader-wrapper .fader .handle { position: absolute; bottom: 0 !important; top: auto !important; width: 100%; height: 0rem; max-height: 100%; max-width: 100%; cursor: -webkit-grab; background: #528bff; z-index: 1; }.fader-container .fader-wrapper .fader .handle:active { cursor: -webkit-grabbing; }.fader-container .fader-wrapper .fader .handle:after { content: ""; position: absolute; height: 2000rem; width: 2000rem; margin: -1000rem 0 0 -1000rem; }.fader-container .fader-wrapper .pips { position: absolute; top: -1%; bottom: 1%; left: 14rem; }.fader-container .fader-wrapper .pips .pip { height: 1%; width: 4rem; border-bottom: 1px solid #cccccc; }.fader-container .fader-wrapper .pips .pip.val { width: 10rem; position: relative; }.fader-container .fader-wrapper .pips .pip.val span { position: relative; width: 30rem; display: block; text-align: center; font-size: 11rem; line-height: 12rem; left: 15rem; top: -2rem; color: #cccccc; }.fader-container.horizontal { min-height: 80rem; height: auto; width: 300rem; flex-shrink: 0; }.fader-container.horizontal .fader-wrapper-outer { position: relative; top: auto; padding-bottom: 35rem; }.fader-container.horizontal .fader-wrapper-outer .fader-wrapper { padding: 20rem 20rem 50rem; }.fader-container.horizontal .fader-wrapper-outer .fader { width: 100%; height: 4rem; }.fader-container.horizontal .fader-wrapper-outer .fader .handle { height: 100% !important; width: 0; }.fader-container.horizontal .fader-wrapper-outer .pips { top: 14rem; left: 0; right: 0; display: flex; flex-direction: row; align-items: stretch; }.fader-container.horizontal .fader-wrapper-outer .pip { width: 100%; display: block; height: 4rem; border-bottom: 0; border-right: 1px solid #999999; }.fader-container.horizontal .fader-wrapper-outer .pip.val { width: 1%; float: left; height: 10rem; }.fader-container.horizontal .fader-wrapper-outer .pip.val span { top: 15rem; left: -15rem; }.knob-container { width: 100rem; flex-shrink: 0; }.knob-container .knob-wrapper-outer { width: 100%; top: 0; bottom: 0; }.knob-container .knob-wrapper-outer input { bottom: 0; }.knob-container .knob-wrapper-outer .knob-wrapper { padding: 10rem 20rem 20rem 20rem; margin: 0 auto; overflow: hidden; width: 95rem; position: relative; }.knob-container .knob-wrapper-outer .knob-wrapper .knob-mask { width: 100%; padding-bottom: 100%; border-radius: 100%; position: relative; }.knob-container .knob-wrapper-outer .knob-wrapper .knob-mask:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 100%; border: 4rem solid #1a1d22; border-bottom-color: transparent; pointer-events: none; z-index: 0; }.knob-container .knob-wrapper-outer .knob-wrapper .knob-mask:after { content: ""; position: absolute; top: 0rem; left: -3rem; right: -3rem; bottom: -2rem; border-radius: 100%; border: 12rem solid transparent; border-bottom-color: #2b2f37; pointer-events: none; }.knob-container .knob-wrapper-outer .knob-wrapper .knob { position: absolute; top: 0; left: 0; right: 0; bottom: 0; cursor: -webkit-grab; }.knob-container .knob-wrapper-outer .knob-wrapper .knob:active { cursor: -webkit-grabbing; }.knob-container .knob-wrapper-outer .knob-wrapper .knob:before { content: ""; position: absolute; top: 20rem; left: 20rem; right: 20rem; bottom: 20rem; border-radius: 100%; background: rgba(204, 204, 204, 0.2); box-shadow: 0 0 0 4rem #22252c; z-index: 100; }.knob-container .knob-wrapper-outer .knob-wrapper .knob:after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 100%; border: 4rem solid transparent; border-bottom-color: #528bff; }.knob-container .knob-wrapper-outer .knob-wrapper .knob.d2:after { border-right-color: #528bff; }.knob-container .knob-wrapper-outer .knob-wrapper .knob.d3:after { border-top-color: #528bff; border-right-color: #528bff; }.knob-container .knob-wrapper-outer .knob-wrapper .knob span { position: absolute; height: 3rem; width: 3rem; background: rgba(204, 204, 204, 0.2); margin: 7rem 0 0 -3rem; left: 50%; top: 50%; transform-origin: center -6rem; transform: rotate(45deg); z-index: 100; }.knob-container .knob-wrapper-outer .knob-wrapper .knob.dot:after { content: ""; position: absolute; bottom: 11rem; left: 12rem; height: 4rem; width: 4rem; transform: rotate(45deg); background: #528bff; border: 0 !important; }.knob-container .knob-wrapper-outer .knob-wrapper .pip { position: absolute; font-size: 11rem; color: #cccccc; }.knob-container .knob-wrapper-outer .knob-wrapper .pip.min { bottom: 10rem; left: 0; right: 50%; width: 50%; text-align: center; }.knob-container .knob-wrapper-outer .knob-wrapper .pip.max { bottom: 10rem; left: 50%; width: 50%; right: 0; text-align: center; }.led-container { width: 100rem; flex-shrink: 0; }.led-container .led { padding: 10rem 1px 5rem; }.led-container .led div { border-radius: 100%; width: 60%; margin: 0 auto; overflow: hidden; background: #1a1d22; }.led-container .led div span { padding-bottom: 100%; display: block; background-color: #528bff; } \ No newline at end of file +* { margin: 0; padding: 0; box-sizing: border-box; text-decoration: none; outline: 0; font: inherit; cursor: inherit; }a { cursor: pointer; display: block; }::-webkit-scrollbar { width: 10px; height: 10px; opacity: 1; }::-webkit-scrollbar-track-piece { background: rgba(0, 0, 0, 0.2); }::-webkit-scrollbar-track-piece:vertical { border-left: 2px solid #282c34; }::-webkit-scrollbar-track-piece:horizontal { border-top: 2px solid #282c34; }::-webkit-scrollbar-corner { background: none; }::-webkit-scrollbar-thumb { background: linear-gradient(#2d3139, #2b2f37 15rem); }::-webkit-scrollbar-thumb:vertical { border-left: 2px solid #282c34; }::-webkit-scrollbar-thumb:horizontal { border-top: 2px solid #282c34; }* { -webkit-user-select: none; }.inspector * { -webkit-user-select: initial; }.inspector *::selection { background: #528bff !important; }input:focus::selection { background: #528bff; }input { cursor: text; }html, body { height: 100%; overflow: hidden; position: relative; }html { font-size: 1px; }body { font-size: 14rem; line-height: 16rem; font-family: sans; color: #cccccc; white-space: nowrap; opacity: 1; cursor: default; }.btn { background: linear-gradient(#2d3139, #2b2f37 15rem); display: block; border: 1px solid #1a1d22; padding: 15rem; }a.btn:hover { background: linear-gradient(#32363d, #2d3139); }#lobby { background: #22252c; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; border: 1px solid #1a1d22; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 20rem; }#lobby .main { width: 600rem; max-height: 100%; }#lobby .header { background: linear-gradient(#2d3139, #2b2f37 15rem); padding: 20rem; font-weight: bold; box-shadow: 0 0 0 1px #1a1d22 inset; white-space: nowrap; text-overflow: ellipsis; }#lobby a { padding-right: 35rem; overflow: hidden; margin-top: 10rem; position: relative; white-space: nowrap; text-overflow: ellipsis; }#lobby a span { position: absolute; right: 0rem; top: 0rem; padding: 15rem; color: #999999; }#lobby a span:hover { color: #cccccc; }#container { background: #22252c; position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; transition: right 0.2s; }#container.sidepanel-open { right: 300rem; }#container #open-toggle { position: absolute; right: 0; top: 2rem; width: 60rem; height: 60rem; padding: 0 10rem; line-height: 60rem; font-size: 24rem; text-align: center; color: #999999; z-index: 2; }#container #open-toggle.sidepanel-open { color: #cccccc; }#sidepanel { position: absolute; z-index: 999999; width: 300rem; top: 0; right: 0; bottom: 0; margin-right: -300rem; background: #282c34; border-left: 1px solid #1a1d22; transition: right 0.2s; overflow-y: auto; overflow-x: visible; }#sidepanel.sidepanel-open { right: 300rem; }#sidepanel #options { position: absolute; left: 0; top: 2rem; right: 0; bottom: 0; padding: 5rem; list-style: none; background: #282c34; }#sidepanel #options li { display: block; margin-bottom: 5rem; background: linear-gradient(#2d3139, #2b2f37 15rem); }#sidepanel #options .inspector { padding: 10rem; }#sidepanel #options .inspector .result { background: #1a1d22; border-radius: 3rem; margin-top: 10rem; padding: 10rem; color: #999999; white-space: pre; word-wrap: break-word; width: 100%; max-height: 300rem; overflow-y: auto; }#sidepanel #options .inspector .result::-webkit-scrollbar-track-piece, #sidepanel #options .inspector .result::-webkit-scrollbar-thumb { border-color: #1a1d22 !important; }#sidepanel #options .inspector .result::-webkit-scrollbar-thumb { background: #22252c !important; opacity: 0.6 !important; }.nicescroll-rails-hr { margin-top: 3rem; }.nicescroll-rails-vr { display: none !important; }a { color: inherit; }.navigation { position: absolute; top: 0; left: 0; right: 0; z-index: 1; font-size: 14rem; background: #22252c; border-bottom: 1px solid #1a1d22; border-top: 1px solid #282c34; height: 60rem; }.navigation ::first-letter { text-transform: uppercase; }.navigation.main { padding-right: 55rem; right: 0; }.navigation ul { list-style: none; display: flex; padding: 7rem 5rem; }.navigation ul li.on + li { border-image: none; border-left: 1px solid transparent; }.navigation ul li { display: block; max-width: 250rem; flex: 1; border-width: 0 0 0 1px; border-image: linear-gradient(rgba(26, 29, 34, 0), #1a1d22, rgba(26, 29, 34, 0)) 0 0 0 1 stretch; }.navigation ul li:first-child, .navigation ul li.on { border-image: none; border-left: 1px solid transparent; }.navigation ul li:first-child { border-left: 0; }.navigation ul li a { display: block; padding: 5rem 10rem; line-height: 34rem; border-radius: 3rem; overflow: hidden; text-align: center; border: 1px solid transparent; position: relative; color: #999999; }.navigation ul li a span { display: block; width: 100%; -webkit-mask: linear-gradient(to left, transparent, #000000 10rem) no-repeat; }.navigation ul li a.on { background: #282c34; border: 1px solid #1a1d22; color: #cccccc; }.navigation ul li a.on:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06); background: linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)); }.navigation ul li a.on:after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4rem; }.content { position: absolute; left: 0; top: 60rem; right: 0; bottom: 0; background: #282c34; }.content .tab { font-size: 0; overflow: auto; }.content .content { top: 60rem; }.tab { display: none; }.tab.on { display: block; height: 100%; width: auto; }#loading { position: absolute; top: 50%; left: 50%; margin-top: -15rem; text-align: center; }#loading .spinner { display: block; margin: 0 auto; height: 30rem; width: 30rem; border-radius: 50%; border: 2rem solid rgba(0, 0, 0, 0.2); border-top-color: #528bff; animation: spin 0.5s linear infinite; }#loading #status { margin-top: 10rem; display: inline-block; }@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }.popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; padding: 10%; background: rgba(0, 0, 0, 0.5); z-index: 1000000; }.popup .popup-title { position: relative; padding: 15rem; background: linear-gradient(#2d3139, #2b2f37 15rem); }.popup .popup-title .closer { position: absolute; right: 0rem; top: 0; padding: 15rem; color: #999999; cursor: pointer; }.popup .popup-title .closer:hover { color: #cccccc; }.popup .popup-wrapper { background: #282c34; height: 100%; width: 100%; max-width: 600rem; margin: 0 auto; position: relative; overflow: hidden; border: 1px solid #1a1d22; }.popup .popup-wrapper .popup-content { height: 100%; width: 100%; padding: 10rem; overflow-y: scroll; white-space: normal; }form label { display: block; padding-top: 10rem; margin-bottom: 10rem; }form .info { color: #999999; margin-bottom: 10rem; }form input { display: block; margin-bottom: 10rem; background: #22252c; font: inherit; color: #cccccc; border: 1px solid #1a1d22; width: 100%; padding: 10rem; }form input.invalid { box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.3) !important; }form input:focus { box-shadow: 0 0 0 1px #528bff; }form .submit { margin-top: 30rem; }.widget { display: inline-block; height: auto; overflow: hidden; position: relative; font-size: 13rem; padding: 35rem 1px 0; vertical-align: top; border: 6rem solid #282c34; border-width: 6rem 0; margin: 0 3rem; box-shadow: 0 0 0 1px #22252c inset; background: linear-gradient(#2d3139, #2b2f37 15rem); }.widget:first-child { margin-left: 6rem; }.widget:last-child { margin-right: 6rem; }.widget .label { z-index: 1; padding: 10rem 10rem; position: absolute; top: 0rem; left: 0; right: 0; text-overflow: ellipsis; overflow: hidden; height: 35rem; }.widget .label.accent { color: #528bff; }.widget input { width: 100%; height: 35rem; border: 0; background: #22252c; color: inherit; display: block; padding: 10rem; }.widget input:focus { box-shadow: 0 0 0 1px #528bff inset !important; }.widget input[disabled] { color: #999999; }.tab.stack { display: flex; flex-direction: column; }.tab.stack > .widget { height: auto; flex-shrink: 0; border-left-width: 6rem; }/* STRIP (contains any widgets) */.strip-container { height: 100%; overflow: visible; border-bottom: 0; background: none; box-shadow: none; padding-top: 35rem; }.strip-container > .label { background: linear-gradient(#2d3139, #2b2f37 15rem); box-shadow: 0 0 0 1px #22252c inset; }.strip-container.no-stretch { height: auto; min-height: 100%; }.strip-container.no-stretch .strip .widget { height: auto; }.strip-container .strip { height: 100%; display: flex; flex-direction: column; }.strip-container .strip.horizontal { flex-direction: row; }.strip-container .strip.horizontal > .widget { border-bottom-width: 0; border-right-width: 6rem; }.strip-container .strip > .widget { display: block; margin: 0; }.strip-container .strip > .widget:not(:last-child) { border-bottom-width: 0; }/* BUTTONS */.toggle-container { width: 100rem; flex-shrink: 0; padding: 0 !important; cursor: pointer; }.toggle-container .label { position: relative; padding: 29rem 10rem 26rem; line-height: 1rem; background: none !important; text-align: center; }.toggle-container:hover { background: linear-gradient(#32363d, #2d3139); }.toggle { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }.toggle .light { position: absolute; left: 4rem; right: 4rem; top: 4rem; height: 4rem; background: #1a1d22; border-radius: 3rem; }.toggle.on .light { background: #528bff; }.switch-container { width: 100rem; flex-shrink: 0; }.switch-container .switch { height: 100%; width: 100%; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; padding-bottom: 1px; }.switch-container .switch .value { background: linear-gradient(#2d3139, #2b2f37 15rem); color: #999999; width: 100%; position: relative; border-top: 1px solid #282c34; padding: 12rem 12rem 12rem 24rem; white-space: normal; text-align: left; word-break: break-all; overflow: hidden; }.switch-container .switch .value:hover { background: linear-gradient(#32363d, #2d3139); }.switch-container .switch .value:last-child { margin-bottom: 0; }.switch-container .switch .value:after { content: ""; position: absolute; left: 8rem; top: 50%; width: 8rem; height: 8rem; margin-top: -4rem; background: #1a1d22; border-radius: 8rem; }.switch-container .switch .value.on:after { background: #528bff; }/* XY */.xy-container, .rgb-container { width: 300rem; flex-shrink: 0; }.xy-wrapper { overflow: hidden; }.xy-wrapper .value { width: 100%; }.xy-wrapper input { width: 50%; float: left; padding-left: 20rem; position: relative; left: 0rem; right: 0rem; box-shadow: 0 0 1px 0 #1a1d22 inset; }.xy { position: relative; width: 100%; padding-bottom: 90%; overflow: hidden; }.xy .handle { position: absolute; height: 0rem; width: 0rem; bottom: 0; left: 0; max-height: 100%; max-width: 100%; z-index: 2; cursor: -webkit-grab; }.xy .handle:active { cursor: -webkit-grabbing; }.xy .handle:active:after { transform: scale(1.5); }.xy .handle:after { content: ""; position: absolute; top: -.5rem; right: -1px; border-radius: 100% !important; width: 20rem; height: 20rem; margin: -10rem -10rem 0 0; box-shadow: 0 0 0 1000rem rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2); }.xy .handle::before { content: ""; position: absolute; top: -.5rem; left: -1px; width: 2000rem; height: 2000rem; margin: -1000rem 0 0 -1000rem; }.rgb-wrapper input { width: 33.33%; }.rgb { background-color: red; }.rgb:before, .rgb:after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; }.rgb:before { background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%); }.rgb:after { background: linear-gradient(to bottom, transparent 0%, black 100%); /* W3C */ }.hue { width: 100%; height: 30rem; background: transparent linear-gradient(to left, #F00, #FF0080, #F0F, #8000FF, #00F, #0080FF, #0FF, #00FF80, #0F0, #80FF00, #FF0, #FF8000, #F00) repeat scroll 0% 0%; overflow: hidden; position: relative; }.hue .handle { position: absolute; height: 100%; max-width: 100%; width: 0; z-index: 2; left: 0; bottom: 0; cursor: -webkit-grab; }.hue .handle:active { cursor: -webkit-grabbing; }.hue .handle:active:after { transform: scale(1.5); }.hue .handle:after { content: ""; position: absolute; top: 50%; right: -1px; box-shadow: 0 0 0 1000rem rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2); border-radius: 100% !important; width: 11rem; height: 11rem; margin: -5rem -4rem 0 0; }.hue .handle:before { content: ""; position: absolute; top: 0; left: 0; width: 2000rem; height: 100%; margin-left: -1000rem; }.fader-container { width: 100rem; height: 100%; min-height: 300rem; }.fader-container .fader-wrapper-outer { padding-bottom: 30rem; position: absolute; top: 30rem; bottom: 0; left: 1px; right: 1px; }.fader-container .fader-wrapper-outer input { position: absolute; bottom: 0; }.fader-container .fader-wrapper { padding: 20rem; overflow: hidden; height: 100%; position: relative; }.fader-container .fader-wrapper .fader { height: 100%; width: 4rem; background: #1a1d22; position: relative; }.fader-container .fader-wrapper .fader .handle { position: absolute; bottom: 0 !important; top: auto !important; width: 100%; height: 0rem; max-height: 100%; max-width: 100%; cursor: -webkit-grab; background: #528bff; z-index: 1; }.fader-container .fader-wrapper .fader .handle:active { cursor: -webkit-grabbing; }.fader-container .fader-wrapper .fader .handle:after { content: ""; position: absolute; height: 2000rem; width: 2000rem; margin: -1000rem 0 0 -1000rem; }.fader-container .fader-wrapper .pips { position: absolute; top: -1%; bottom: 1%; left: 14rem; }.fader-container .fader-wrapper .pips .pip { height: 1%; width: 4rem; border-bottom: 1px solid #cccccc; }.fader-container .fader-wrapper .pips .pip.val { width: 10rem; position: relative; }.fader-container .fader-wrapper .pips .pip.val span { position: relative; width: 30rem; display: block; text-align: center; font-size: 11rem; line-height: 12rem; left: 15rem; top: -2rem; color: #cccccc; }.fader-container.horizontal { min-height: 80rem; height: auto; width: 300rem; flex-shrink: 0; }.fader-container.horizontal .fader-wrapper-outer { position: relative; top: auto; padding-bottom: 35rem; }.fader-container.horizontal .fader-wrapper-outer .fader-wrapper { padding: 20rem 20rem 50rem; }.fader-container.horizontal .fader-wrapper-outer .fader { width: 100%; height: 4rem; }.fader-container.horizontal .fader-wrapper-outer .fader .handle { height: 100% !important; width: 0; }.fader-container.horizontal .fader-wrapper-outer .pips { top: 14rem; left: 0; right: 0; display: flex; flex-direction: row; align-items: stretch; }.fader-container.horizontal .fader-wrapper-outer .pip { width: 100%; display: block; height: 4rem; border-bottom: 0; border-right: 1px solid #999999; }.fader-container.horizontal .fader-wrapper-outer .pip.val { width: 1%; float: left; height: 10rem; }.fader-container.horizontal .fader-wrapper-outer .pip.val span { top: 15rem; left: -15rem; }.knob-container { width: 100rem; flex-shrink: 0; }.knob-container .knob-wrapper-outer { width: 100%; top: 0; bottom: 0; }.knob-container .knob-wrapper-outer input { bottom: 0; }.knob-container .knob-wrapper-outer .knob-wrapper { padding: 10rem 20rem 20rem 20rem; margin: 0 auto; overflow: hidden; width: 95rem; position: relative; }.knob-container .knob-wrapper-outer .knob-wrapper .knob-mask { width: 100%; padding-bottom: 100%; border-radius: 100%; position: relative; }.knob-container .knob-wrapper-outer .knob-wrapper .knob-mask:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 100%; border: 4rem solid #1a1d22; border-bottom-color: transparent; pointer-events: none; z-index: 0; }.knob-container .knob-wrapper-outer .knob-wrapper .knob-mask:after { content: ""; position: absolute; top: 0rem; left: -3rem; right: -3rem; bottom: -2rem; border-radius: 100%; border: 12rem solid transparent; border-bottom-color: #2b2f37; pointer-events: none; }.knob-container .knob-wrapper-outer .knob-wrapper .knob { position: absolute; top: 0; left: 0; right: 0; bottom: 0; cursor: -webkit-grab; }.knob-container .knob-wrapper-outer .knob-wrapper .knob:active { cursor: -webkit-grabbing; }.knob-container .knob-wrapper-outer .knob-wrapper .knob:before { content: ""; position: absolute; top: 20rem; left: 20rem; right: 20rem; bottom: 20rem; border-radius: 100%; background: rgba(204, 204, 204, 0.2); box-shadow: 0 0 0 4rem #22252c; z-index: 100; }.knob-container .knob-wrapper-outer .knob-wrapper .knob:after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 100%; border: 4rem solid transparent; border-bottom-color: #528bff; }.knob-container .knob-wrapper-outer .knob-wrapper .knob.d2:after { border-right-color: #528bff; }.knob-container .knob-wrapper-outer .knob-wrapper .knob.d3:after { border-top-color: #528bff; border-right-color: #528bff; }.knob-container .knob-wrapper-outer .knob-wrapper .knob span { position: absolute; height: 3rem; width: 3rem; background: rgba(204, 204, 204, 0.2); margin: 7rem 0 0 -3rem; left: 50%; top: 50%; transform-origin: center -6rem; transform: rotate(45deg); z-index: 100; }.knob-container .knob-wrapper-outer .knob-wrapper .knob.dot:after { content: ""; position: absolute; bottom: 11rem; left: 12rem; height: 4rem; width: 4rem; transform: rotate(45deg); background: #528bff; border: 0 !important; }.knob-container .knob-wrapper-outer .knob-wrapper .pip { position: absolute; font-size: 11rem; color: #cccccc; }.knob-container .knob-wrapper-outer .knob-wrapper .pip.min { bottom: 10rem; left: 0; right: 50%; width: 50%; text-align: center; }.knob-container .knob-wrapper-outer .knob-wrapper .pip.max { bottom: 10rem; left: 50%; width: 50%; right: 0; text-align: center; }.led-container { width: 100rem; flex-shrink: 0; }.led-container .led { padding: 10rem 1px 5rem; }.led-container .led div { border-radius: 100%; width: 60%; margin: 0 auto; overflow: hidden; background: #1a1d22; }.led-container .led div span { padding-bottom: 100%; display: block; background-color: #528bff; } \ No newline at end of file diff --git a/app/browser/js/app/parser.js b/app/browser/js/app/parser.js index bdee88a9..663466fa 100644 --- a/app/browser/js/app/parser.js +++ b/app/browser/js/app/parser.js @@ -30,10 +30,12 @@ parsetabs = function(tabs,parent,sub){ for (i in tabs) { var tabData = tabs[i] + tabData.id = tabData.id?tabData.id.replace(' ','_'):'tab_'+getIterator('tab') - var id = tabData.id, - label= tabData.label||id + var id = 'tab_'+getIterator('tab') + label= tabData.label||tabData.id + navtabs.append('
  • '+label+'
  • '); @@ -81,13 +83,15 @@ parsewidgets = function(widgets,parent) { widgetInner.type = type widgetContainer.find('.label').data('papers',widgetData) - // store widget reference for cross widget sync widgetContainer.append(widgetInner) + + // store widget reference for cross widget sync if (__widgets__[id]==undefined) { __widgets__[id] = [] } __widgets__[id].push(widgetInner) + // store path vs widget id for faster cross-app sync __widgetsIds__[widgetData.path ] = id diff --git a/app/browser/js/app/utils.js b/app/browser/js/app/utils.js index 72e11423..317646ce 100644 --- a/app/browser/js/app/utils.js +++ b/app/browser/js/app/utils.js @@ -12,7 +12,8 @@ saveState = function () { getState = function (){ var data = [] $.each(__widgets__,function(i,widget) { - data.push(widget[0].type+':'+i+':'+widget[0].getValue()) + var v = widget[0].getValue() + if (v!=undefined) data.push(i+' '+widget[0].getValue()) }) return data } @@ -32,7 +33,8 @@ setState = function(preset){ setTimeout(function(){ if (__widgets__[data[1]]!=undefined) { - __widgets__[data[1]][0].setValue(data[2].split(','),true,true) + __widgets__[data[1]][0].setValue(data[ + console.log(value)].split(','),true,true) } },i) }) @@ -43,11 +45,12 @@ setState = function(preset){ openSession = function(path){ var fs = require('fs'), data = fs.readFileSync(path,'utf8'), + vm = require('vm'), session, error try { - session = eval(data) + session = vm.runInNewContext(data) } catch(err) { error = err } diff --git a/app/browser/js/app/widgets.js b/app/browser/js/app/widgets.js index 6c7ecdfd..3cda2f7f 100644 --- a/app/browser/js/app/widgets.js +++ b/app/browser/js/app/widgets.js @@ -141,10 +141,11 @@ createWidget.xy = function(widgetData) { '), handle = widget.find('.handle'), pad = widget.find('.xy'), - value = {x:widget.find('.x'),y:widget.find('.y')} + value = {x:widget.find('.x'),y:widget.find('.y')}, + range = widgetData.range || {x:{min:0,max:1},y:{min:0,max:1}} - widgetData.range = widgetData.range || {x:{min:0,max:1},y:{min:0,max:1}} + widgetData.range = range pad.width = pad.innerWidth() @@ -179,15 +180,15 @@ createWidget.xy = function(widgetData) { widget.getValue = function() { - var x = mapToScale(handle.width,[0,100],[widgetData.range.x.min,widgetData.range.x.max]), - y = mapToScale(handle.height,[0,100],[widgetData.range.y.min,widgetData.range.y.max]) + var x = mapToScale(handle.width,[0,100],[range.x.min,range.x.max]), + y = mapToScale(handle.height,[0,100],[range.y.min,range.y.max]) return [x,y] } widget.setValue = function(v,send,sync) { if (v[1]==undefined) var v = [v,v] - var w = mapToScale(v[0],[widgetData.range.x.min,widgetData.range.x.max],[0,100]) - h = mapToScale(v[1],[widgetData.range.y.min,widgetData.range.y.max],[0,100]), + var w = mapToScale(v[0],[range.x.min,range.x.max],[0,100]) + h = mapToScale(v[1],[range.y.min,range.y.max],[0,100]), handle[0].setAttribute('style','height:'+h+'%;width:'+w+'%') handle.height = h @@ -210,16 +211,16 @@ createWidget.xy = function(widgetData) { value.x.change(function(){ var v = widget.getValue(); - v[0] = clip(value.x.val(),[widgetData.range.x.min,widgetData.range.x.max]) + v[0] = clip(value.x.val(),[range.x.min,range.x.max]) widget.setValue(v,true,true) }) value.y.change(function(){ var v = widget.getValue(); - v[1] = clip(value.y.val(),[widgetData.range.y.min,widgetData.range.y.max]) + v[1] = clip(value.y.val(),[range.y.min,range.y.max]) widget.setValue(v,true,true) }) - widget.setValue(widgetData.range.x.min,widgetData.range.y.min) + widget.setValue(range.x.min,range.y.min) return widget; } diff --git a/app/browser/scss/style.scss b/app/browser/scss/style.scss index a2d7fd24..b8321e6e 100644 --- a/app/browser/scss/style.scss +++ b/app/browser/scss/style.scss @@ -559,16 +559,17 @@ form { padding:35rem 1px 0; vertical-align:top; border: 6rem solid $color-fg; - border-width:6rem 3rem; + border-width:6rem 0; + margin:0 3rem; box-shadow: 0 0 0 1px $color-bg inset; background:$bg-3d; &:first-child { - border-left-width:6rem; + margin-left:6rem; } &:last-child { - border-right-width:6rem; + margin-right:6rem; } .label { @@ -653,8 +654,7 @@ form { > .widget { display: block; - border-left-width:0; - border-right-width:0; + margin: 0; &:not(:last-child) { border-bottom-width:0; } diff --git a/sessions/demo.js b/sessions/demo.js index dc875127..dbeffbdb 100644 --- a/sessions/demo.js +++ b/sessions/demo.js @@ -11,7 +11,7 @@ type:'strip', widgets: [ { - "type":"knob", + type:"knob", target:target }, { @@ -21,8 +21,8 @@ }, { type:"fader", + range:db, target:target, - range:db }, { type:"toggle", @@ -38,7 +38,6 @@ return tab }()) - tabs.push({id:'test'}) return tabs })()