From 5f2b4a481f090368ff86fa5ae047c367c095d863 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Tue, 19 Sep 2017 02:39:06 +0100 Subject: [PATCH 01/25] Cleanup browser-solidity.css, minor things left --- assets/css/browser-solidity.css | 231 +----------------------------- src/app.js | 15 +- src/app/files/file-explorer.js | 3 + src/app/panels/editor-panel.js | 41 +++++- src/app/panels/righthand-panel.js | 88 +++++++++--- src/app/tabs/analysis-tab.js | 3 + src/app/tabs/compile-tab.js | 4 +- src/app/tabs/run-tab.js | 2 +- src/app/tabs/settings-tab.js | 8 +- src/universal-dapp.js | 6 +- 10 files changed, 150 insertions(+), 251 deletions(-) diff --git a/assets/css/browser-solidity.css b/assets/css/browser-solidity.css index d72db57491..5685170271 100644 --- a/assets/css/browser-solidity.css +++ b/assets/css/browser-solidity.css @@ -1,223 +1,33 @@ -#files .file { - padding: 0 0.6em; - box-sizing: border-box; - background-color: hsla(229, 100%, 97%, 1); /* backgroundBlue in style-guide.js */ - cursor: pointer; - border-right: 0.5em solid white; - position: relative; - display: table-cell; - text-align: center; - vertical-align: middle; - color: hsla(0, 0%, 40%, 1); /* grey in style-guide.js */ -} - -#files .file.active { - color: black; - font-weight: bold; - border-bottom: 0 none; - padding-right: 2em; -} -#files .file .remove { - position: absolute; - right: 0; - top: 0; - height: 1.25em; - width: 1.25em; - line-height: 1em; - color: hsla(0, 82%, 82%, 1); /* red in style-guide.js */ - display: none; - margin: 0.4em; - text-align: center; -} - -#files .file input { - background-color: transparent; - border: 0 none; - border-bottom: 1px dotted black; - line-height: 1em; - margin: 0.5em 0; -} - -#files .file.active .remove { - display: inline-block; -} - -#righthand-panel { - top: 0; - right: 0; - bottom: 0; - box-sizing: border-box; - overflow: hidden; -} - -#righthand-panel { - display: flex; - flex-direction: column; -} - -#righthand-panel #solIcon { - float: right; - height: 90%; - background-color: white; - padding-right: 5%; - padding-left: 5%; -} - -#righthand-panel #menu { - border-bottom: 3px solid hsla(229, 100%, 97%, 1); /* backgroundBlue in style-guide.js*/ - height: 2em; - font-size: 1em; - margin-top: 0.5em; - box-sizing: content-box; - display: flex; -} - -#righthand-panel #options { - list-style: none; - margin: 0; - padding: 0; - display: flex; - justify-content: space-between; -} - -#righthand-panel #options li.active { - background-color: hsla(229, 100%, 97%, 1); /* backgroundBlue in style-guide.js*/; -} - -#righthand-panel #options li a { - color: inherit; -} - -#righthand-panel #optionViews { - background-color: hsla(229, 100%, 97%, 1); /* backgroundBlue in style-guide.js*/; - overflow: scroll; - height: 100%; -} - -#righthand-panel #optionViews > div { - display: none; -} - -#righthand-panel #optionViews.txView #txView { +#optionViews.settingsView #settingsView { display: block; } -#righthand-panel #optionViews.settingsView #settingsView { +#optionViews.compileView #compileTabView { display: block; } -#righthand-panel #optionViews.publishView #publishView { +#optionViews.runView #runTabView { display: block; } -#righthand-panel #optionViews.compileView #compileTabView { +#optionViews.debugView #debugView { display: block; } -#righthand-panel #optionViews.runView #runTabView { - display: block; -} - -#righthand-panel #optionViews.debugView #debugView { - display: block; -} - -#righthand-panel #optionViews.verificationView #verificationView { - display: block; -} -#righthand-panel #optionViews.staticanalysisView #staticanalysisView { +#optionViews.staticanalysisView #staticanalysisView { display: block; } -#header #optionViews.supportView #supportView { +#optionViews.supportView #supportView { display: block; } -#header #optionViews.txView input, -#header #optionViews.txView select { - max-width: 13em; - padding: 0.3em; - box-sizing: border-box; - border: 1px solid hsl(0, 0%, 0%); /* black in style-guide.js */ - border-radius: 3px; -} - -#righthand-panel #optionViews .pre { - word-wrap: break-word; - background-color: hsl(0, 0%, 100%); /* white in style-guide.js */ - border-radius: 3px; - display: inline-block; - padding: 0 0.6em; -} - -#righthand-panel #optionViews .hide { - display: none; -} -#righthand-panel .info { - min-height: 6em; - padding: 0.25em 0; - padding-left: 6em; -} -#settingsView button { - background-color: hsla(229, 75%, 87%, .5); /* lightBlue in style-guide.js*/ - font-size: 12px; - padding: 0.25em; - margin: 3em 1em .5em 0; - color: black; - border:0 none; - border-radius: 3px; - width: 8em; - cursor: pointer; -} -#header .origin { - display: block; - word-wrap: break-word; - padding: 1.5em; - font-weight: bold; -} - -#output .udapp { - border: 0 none; - box-shadow: none; - border-bottom: 3px solid hsla(229, 100%, 97%, 1); /* backgroundBlue in style-guide.js*/; -} - -.crow { - overflow: auto; - display: block; - clear: both; - margin: .5em .5em 0 .5em; - padding: .5em; - font-weight: bold; -} -.crow #txorigin { - margin-left: 0.5em; - text-decoration: none; - background-color: hsla(229, 75%, 87%, .5); /* lightBlue in style-guide.js*/ - cursor: pointer; - font-size: 12px; - color: black; - border-radius: 3px; - border: 0 none; -} -.contractDetails button { - background-color: transparent; - border: 0 none; - padding: 0; - display: inline-block; - text-decoration: underline; - color: blue; - cursor: pointer; - width: auto; - min-width: 4em; - margin-bottom: 1em; -} .sol.success, .sol.error, @@ -268,28 +78,6 @@ border: .2em dotted hsla(141, 40%, 48%, 1); } -#ghostbar { - width: 1px; - background-color: hsla(0, 82%, 82%, 1); /* orange in style-guide.js */ - opacity: 0.5; - position: absolute; - cursor: col-resize; - z-index: 9999; - top: 0; - bottom: 0; -} - -input[readonly] { - display: block; - width: 100%; - height: 7px; - padding: .8em; -} - -input[type="file"] { - display: none; -} - .highlightreference { position:absolute; z-index:20; @@ -310,13 +98,6 @@ input[type="file"] { background-color:hsla(0, 82%, 82%, 1); /* red in style-guide.js */ } -.highlightcode_fullLine { - position:absolute; - z-index:20; - background-color: hsla(0, 82%, 82%, .5); /* lightRed in style-guide.js */ - opacity: 0.5; -} - .ace_gutter-cell.ace_breakpoint{ background-color: hsla(0, 82%, 82%, 1); /* red in style-guide.js */ } diff --git a/src/app.js b/src/app.js index f888d9d52a..e249285617 100644 --- a/src/app.js +++ b/src/app.js @@ -82,6 +82,17 @@ var css = csjs` bottom : 0; overflow : hidden; } + .highlightcode { + position:absolute; + z-index:20; + background-color: ${styles.colors.lightOrange}; + } + .highlightcode_fullLine { + position:absolute; + z-index:20; + background-color: ${styles.colors.lightOrange}; + opacity: 0.5; + } ` class App { @@ -576,7 +587,7 @@ function run () { if (config.get('currentFile') !== this.source) { fileManager.switchFile(this.source) } - this.statementMarker = editor.addMarker(lineColumnPos, this.source, 'highlightcode') + this.statementMarker = editor.addMarker(lineColumnPos, this.source, css.highlightcode) editor.scrollToLine(lineColumnPos.start.line, true, true, function () {}) if (lineColumnPos.start.line === lineColumnPos.end.line) { this.fullLineMarker = editor.addMarker({ @@ -588,7 +599,7 @@ function run () { line: lineColumnPos.start.line + 1, column: 0 } - }, this.source, 'highlightcode_fullLine') + }, this.source, css.highlightcode_fullLine) } } }, diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 28da9ceca8..b2c5941d62 100755 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -15,6 +15,9 @@ var css = csjs` .fileexplorer { box-sizing : border-box; } + input[type="file"] { + display: none; + } .folder, .file { font-size : 14px; diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index fc66620965..ecb73a82a2 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -114,7 +114,6 @@ var css = csjs` pointer-events : none; transition : .3s opacity ease-in; } - .content { position : relative; display : flex; @@ -133,6 +132,46 @@ var css = csjs` right : 20px; top : 10px; width : 20em; + + #files .file { + padding: 0 0.6em; + box-sizing: border-box; + background-color: hsla(229, 100%, 97%, 1); /* backgroundBlue in style-guide.js */ + cursor: pointer; + border-right: 0.5em solid white; + position: relative; + display: table-cell; + text-align: center; + vertical-align: middle; + color: hsla(0, 0%, 40%, 1); /* grey in style-guide.js */ + } + #files .file.active { + color: black; + font-weight: bold; + border-bottom: 0 none; + padding-right: 2em; + } + #files .file .remove { + position: absolute; + right: 0; + top: 0; + height: 1.25em; + width: 1.25em; + line-height: 1em; + color: hsla(0, 82%, 82%, 1); /* red in style-guide.js */ + display: none; + margin: 0.4em; + text-align: center; + } + #files .file input { + background-color: transparent; + border: 0 none; + border-bottom: 1px dotted black; + line-height: 1em; + margin: 0.5em 0; + } + #files .file.active .remove { + display: inline-block; } ` diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index b3d37e7f4c..8a448e877b 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -15,15 +15,60 @@ var styleGuide = remix.ui.styleGuide var styles = styleGuide() var css = csjs` + #righthand-panel { + display: flex; + flex-direction: column; + top: 0; + right: 0; + bottom: 0; + box-sizing: border-box; + overflow: hidden; + } + #optionViews { + background-color: ${styles.colors.backgroundBlue}; + overflow: scroll; + height: 100%; + } + #optionViews > div { + display: none; + } + #optionViews .pre { + word-wrap: break-word; + background-color: hsl(0, 0%, 100%); /* white in style-guide.js */ + border-radius: 3px; + display: inline-block; + padding: 0 0.6em; + } + #optionViews .hide { + display: none; + } + .menu { + display: flex; + } .options { - float: left; - padding-top: 0.7em; - min-width: 60px; - font-size: 0.9em; - cursor: pointer; - background-color: ${styles.colors.transparent}; - font-size: 1em; - text-align: center; + float: left; + padding-top: 0.7em; + min-width: 60px; + font-size: 0.9em; + cursor: pointer; + background-color: ${styles.colors.transparent}; + font-size: 1em; + text-align: center; + } + .opts { + display: flex; + list-style: none; + margin: 0; + padding: 0; + } + .opts_li:active { + background-color: ${styles.colors.backgroundBlue}; + } + .opts_li a { + color: inherit; + } + .opts_li { + display: block; } .dragbar { position : absolute; @@ -50,6 +95,15 @@ var css = csjs` .header { height : 100%; } + .solIcon { + margin-left: 10px; + margin-right: 30px; + display: flex; + align-self: center; + height: 20px; + width: 20px; + background-color: white; + } ` // ------------------------------------------------------------------ @@ -64,13 +118,13 @@ function RighthandPanel (appAPI, events, opts) { var optionViews = yo`
` var options = yo` -