diff options
author | Jude <julie_wang1@brown.edu> | 2019-03-09 11:28:34 -0500 |
---|---|---|
committer | Jude <julie_wang1@brown.edu> | 2019-03-09 11:28:34 -0500 |
commit | f858a4fc74476c5720cc215c70f12733d757d085 (patch) | |
tree | 3a984187eec283ae056448bbf3d1aa429161aaad /src | |
parent | 2d9c1fd55c4d2c9bf275aeaf6a83703cebba374f (diff) |
improved text node and reduced selection border thickness
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/ContextMenu.scss | 60 | ||||
-rw-r--r-- | src/client/views/DocumentDecorations.scss | 64 | ||||
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 8 | ||||
-rw-r--r-- | src/client/views/Main.scss | 213 | ||||
-rw-r--r-- | src/client/views/_global_variables.scss | 14 | ||||
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.scss | 64 | ||||
-rw-r--r-- | src/client/views/nodes/KeyValueBox.scss | 42 |
7 files changed, 240 insertions, 225 deletions
diff --git a/src/client/views/ContextMenu.scss b/src/client/views/ContextMenu.scss index db79f153a..ecb3cc8c8 100644 --- a/src/client/views/ContextMenu.scss +++ b/src/client/views/ContextMenu.scss @@ -1,41 +1,41 @@ @import "global_variables"; .contextMenu-cont { - position: absolute; - display: flex; - z-index: 1000; - box-shadow: #AAAAAA .2vw .2vw .4vw; - flex-direction: column; + position: absolute; + display: flex; + z-index: 1000; + box-shadow: #aaaaaa 0.2vw 0.2vw 0.4vw; + flex-direction: column; } .contextMenu-item { - width: auto; - height: auto; - background: $light-color-secondary; - display: flex; - justify-content: left; - align-items: center; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - transition: all .1s; - border-width: .11px; - border-style: none; - border-color: #AAAAAA; - border-bottom-style: solid; - padding: 10px; - white-space: nowrap; - font-size: 13px; + width: auto; + height: auto; + background: $light-color-secondary; + display: flex; + justify-content: left; + align-items: center; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + transition: all 0.1s; + border-width: 0.11px; + border-style: none; + border-color: #aaaaaa; + border-bottom-style: solid; + padding: 10px; + white-space: nowrap; + font-size: 13px; } .contextMenu-item:hover { - transition: all .1s; - background: $light-accent; + transition: all 0.1s; + background: $alt-accent; } .contextMenu-description { - text-align: left; - width: 8vw; -}
\ No newline at end of file + text-align: left; + width: 8vw; +} diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss index 8ce9796f1..dc8c3a0cc 100644 --- a/src/client/views/DocumentDecorations.scss +++ b/src/client/views/DocumentDecorations.scss @@ -1,33 +1,33 @@ -@import 'global_variables'; +@import "global_variables"; #documentDecorations-container { - position: absolute; - display: grid; - z-index: 1000; - grid-template-rows: 20px 1fr 20px; - grid-template-columns: 20px 1fr 20px; - pointer-events: none; - #documentDecorations-centerCont { - background: none; - } - .documentDecorations-resizer { - pointer-events: auto; - background: $light-accent; - opacity: 0.4; - } - #documentDecorations-topLeftResizer, - #documentDecorations-bottomRightResizer { - cursor: nwse-resize; - } - #documentDecorations-topRightResizer, - #documentDecorations-bottomLeftResizer { - cursor: nesw-resize; - } - #documentDecorations-topResizer, - #documentDecorations-bottomResizer { - cursor: ns-resize; - } - #documentDecorations-leftResizer, - #documentDecorations-rightResizer { - cursor: ew-resize; - } -}
\ No newline at end of file + position: absolute; + display: grid; + z-index: 1000; + grid-template-rows: 10px 1fr 10px; + grid-template-columns: 10px 1fr 10px; + pointer-events: none; + #documentDecorations-centerCont { + background: none; + } + .documentDecorations-resizer { + pointer-events: auto; + background: $alt-accent; + opacity: 0.4; + } + #documentDecorations-topLeftResizer, + #documentDecorations-bottomRightResizer { + cursor: nwse-resize; + } + #documentDecorations-topRightResizer, + #documentDecorations-bottomLeftResizer { + cursor: nesw-resize; + } + #documentDecorations-topResizer, + #documentDecorations-bottomResizer { + cursor: ns-resize; + } + #documentDecorations-leftResizer, + #documentDecorations-rightResizer { + cursor: ew-resize; + } +} diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 9fd73a33b..36395ed0d 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -149,10 +149,10 @@ export class DocumentDecorations extends React.Component { } return ( <div id="documentDecorations-container" style={{ - width: (bounds.r - bounds.x + 40) + "px", - height: (bounds.b - bounds.y + 40) + "px", - left: bounds.x - 20, - top: bounds.y - 20, + width: (bounds.r - bounds.x + 20) + "px", + height: (bounds.b - bounds.y + 20) + "px", + left: bounds.x - 10, + top: bounds.y - 10, }}> <div id="documentDecorations-topLeftResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> <div id="documentDecorations-topResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div> diff --git a/src/client/views/Main.scss b/src/client/views/Main.scss index e8b522cbb..1c1e08b2f 100644 --- a/src/client/views/Main.scss +++ b/src/client/views/Main.scss @@ -1,162 +1,161 @@ @import "global_variables"; -@import url('https://fonts.googleapis.com/css?family=Work+Sans:300,700'); html, body { - width: 100%; - height: 100%; - overflow: hidden; - font-family: 'Work Sans', sans-serif; - margin: 0; + width: 100%; + height: 100%; + overflow: hidden; + font-family: $sans-serif; + margin: 0; } h1 { - font-size: 50px; - position: fixed; - top: 30px; - left: 50%; - transform: translateX(-50%); - color: $dark-color; - text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; - z-index: 9999; - font-family: 'Work Sans', sans-serif; - font-weight: 700; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + font-size: 50px; + position: fixed; + top: 30px; + left: 50%; + transform: translateX(-50%); + color: $dark-color; + text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; + z-index: 9999; + font-family: $sans-serif; + font-weight: 700; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } p { - margin: 0px; - padding: 0px; + margin: 0px; + padding: 0px; } ::-webkit-scrollbar { - -webkit-appearance: none; - height: 5px; - width: 5px; + -webkit-appearance: none; + height: 5px; + width: 5px; } ::-webkit-scrollbar-thumb { - border-radius: 2px; - background-color: rgba(0, 0, 0, .5); + border-radius: 2px; + background-color: rgba(0, 0, 0, 0.5); } // button stuff button { - background: $dark-color; - outline: none; - border: 0px; - color: $light-color; - text-transform: uppercase; - letter-spacing: 2px; - font-size: 75%; - padding: 10px; - transition: transform 0.2s; + background: $dark-color; + outline: none; + border: 0px; + color: $light-color; + text-transform: uppercase; + letter-spacing: 2px; + font-size: 75%; + padding: 10px; + transition: transform 0.2s; } button:hover { - background: $dark-accent; - transform: scale(1.05); + background: $main-accent; + transform: scale(1.05); } .clear-db-button { - position: absolute; - left: 47%; - bottom: 1em; - font-size: 50%; + position: absolute; + left: 47%; + bottom: 1em; + font-size: 50%; } .add-button { - position: relative; - width: 2em; - height: 2em; - border-radius: 1em; - font-size: 24px; - margin-right: 0.4em; + position: relative; + width: 2em; + height: 2em; + border-radius: 1em; + font-size: 24px; + margin-right: 0.4em; } .add-button:hover { - transform: scale(1.15); + transform: scale(1.15); } .main-undoButtons { - position: absolute; - width: 150px; - right: 0px; + position: absolute; + width: 150px; + right: 0px; } // add nodes menu #add-nodes-menu { - position: absolute; - left: 1em; - bottom: 1em; - label { - background: $dark-color; - color: $light-color; - padding: 10px; - display: inline-block; - border-radius: 1em; - font-size: 24px; - width: 1.09em; - margin-right: 0.4em; - text-align: center; - cursor: pointer; - transition: transform 0.5s; - } - label:hover { - background: $dark-accent; - } - input { - display: none; - } - input:not(:checked)~#add-options-content { - display: none; - } - input:checked~label { - transform: rotate(45deg); - transition: transform 0.5s; - cursor: pointer; - } + position: absolute; + left: 1em; + bottom: 1em; + label { + background: $dark-color; + color: $light-color; + padding: 10px; + display: inline-block; + border-radius: 1em; + font-size: 24px; + width: 1.09em; + margin-right: 0.4em; + text-align: center; + cursor: pointer; + transition: transform 0.5s; + } + label:hover { + background: $main-accent; + } + input { + display: none; + } + input:not(:checked) ~ #add-options-content { + display: none; + } + input:checked ~ label { + transform: rotate(45deg); + transition: transform 0.5s; + cursor: pointer; + } } #add-options-content { - display: table; - opacity: 1; - margin: 0; - padding: 0; - position: relative; - float: right; - bottom: 0.3em; - margin-bottom: -1.68em; + display: table; + opacity: 1; + margin: 0; + padding: 0; + position: relative; + float: right; + bottom: 0.3em; + margin-bottom: -1.68em; } ul#add-options-list { - list-style: none; + list-style: none; + padding: 0; + li { + display: inline-block; padding: 0; - li { - display: inline-block; - padding: 0; - } + } } // goldenlayout stuff div .lm_header { - background: $dark-color; - min-height: 2em; + background: $dark-color; + min-height: 2em; } .lm_tab { - margin-top: 0.7em !important; - padding-top: 0.5em !important; - min-height: 1.4em; - padding-bottom: 0px; - border-radius: 5px; - font-family: 'Work Sans', sans-serif !important; + margin-top: 0.7em !important; + padding-top: 0.5em !important; + min-height: 1.4em; + padding-bottom: 0px; + border-radius: 5px; + font-family: $sans-serif !important; } .lm_header .lm_controls { - right: 1em !important; -}
\ No newline at end of file + right: 1em !important; +} diff --git a/src/client/views/_global_variables.scss b/src/client/views/_global_variables.scss index 5ccb76320..5fbf798cb 100644 --- a/src/client/views/_global_variables.scss +++ b/src/client/views/_global_variables.scss @@ -1,5 +1,13 @@ -$light-color: #FCFBF7; +@import url("https://fonts.googleapis.com/css?family=Roboto+Slab:300,700|Crimson+Text:400,400i,700"); + +// colors +$light-color: #fcfbf7; $light-color-secondary: rgb(241, 239, 235); +$main-accent: #61aaa3; +$alt-accent: #afcbff; +$intermediate-color: #9c9396; $dark-color: #121721; -$dark-accent: #61AAA3; -$light-accent: #AFCBFF;
\ No newline at end of file + +// fonts +$sans-serif: "Roboto Slab", sans-serif; +$serif: "Crimson Text", serif; diff --git a/src/client/views/nodes/FormattedTextBox.scss b/src/client/views/nodes/FormattedTextBox.scss index ab5849f09..42e5320d3 100644 --- a/src/client/views/nodes/FormattedTextBox.scss +++ b/src/client/views/nodes/FormattedTextBox.scss @@ -1,38 +1,46 @@ +@import "../global_variables"; .ProseMirror { - width: 100%; - height: auto; - min-height: 100% + width: 100%; + height: auto; + min-height: 100%; + font-family: $serif; } .ProseMirror:focus { - outline: none !important + outline: none !important; } .formattedTextBox-cont { - background: white; - padding: 1; - border-width: 1px; - border-radius: 2px; - border-color:black; - box-sizing: border-box; - background: white; - border-style:solid; - overflow-y: scroll; - overflow-x: hidden; - color: initial; - height: 100%; + background: $light-color-secondary; + padding: 0.7em; + border-width: 1px; + border-radius: 0.3em; + border-color: $intermediate-color; + box-sizing: border-box; + border-style: solid; + overflow-y: scroll; + overflow-x: hidden; + color: initial; + height: 100%; } .menuicon { - display: inline-block; - border-right: 1px solid rgba(0, 0, 0, 0.2); - color: #888; - line-height: 1; - padding: 0 7px; - margin: 1px; - cursor: pointer; - text-align: center; - min-width: 1.4em; - } - .strong, .heading { font-weight: bold; } - .em { font-style: italic; }
\ No newline at end of file + display: inline-block; + border-right: 1px solid rgba(0, 0, 0, 0.2); + color: #888; + line-height: 1; + padding: 0 7px; + margin: 1px; + cursor: pointer; + text-align: center; + min-width: 1.4em; +} + +.strong, +.heading { + font-weight: bold; +} + +.em { + font-style: italic; +} diff --git a/src/client/views/nodes/KeyValueBox.scss b/src/client/views/nodes/KeyValueBox.scss index 1295266e5..e946275fa 100644 --- a/src/client/views/nodes/KeyValueBox.scss +++ b/src/client/views/nodes/KeyValueBox.scss @@ -1,31 +1,31 @@ .keyValueBox-cont { - overflow-y:scroll; - height: 100%; - border: black; - border-width: 1px; - border-style: solid; - box-sizing: border-box; - display: inline-block; - .imageBox-cont img { - max-height:45px; - height: auto; - } + overflow-y: scroll; + height: 100%; + border: black; + border-width: 1px; + border-style: solid; + box-sizing: border-box; + display: inline-block; + .imageBox-cont img { + max-height: 45px; + height: auto; + } } .keyValueBox-table { - position: relative; + position: relative; } .keyValueBox-header { - background:gray; + background: gray; } .keyValueBox-evenRow { + background: white; + .formattedTextBox-cont { background: white; - .formattedTextBox-cont { - background: white; - } + } } .keyValueBox-oddRow { - background: lightGray; - .formattedTextBox-cont { - background: lightgray; - } -}
\ No newline at end of file + background: lightGray; + .formattedTextBox-cont { + background: lightgray; + } +} |