diff --git a/ui/dist/themes/dark.css b/ui/dist/themes/dark.css index e95cf2143..f5d9d4736 100644 --- a/ui/dist/themes/dark.css +++ b/ui/dist/themes/dark.css @@ -10,15 +10,27 @@ --color-money: var(--color-primary); --color-meta-light: #757575; --color-dark-overlay: rgba(15, 21, 23, 0.85); + --color-download: rgba(255, 255, 255, 0.75); + /* Text */ --text-color: #FFF; --text-selection-bg: rgba(0,150,136, 0.95); + /* Form */ + --form-label-color: rgba(255, 255, 255, 0.70); + /* Input */ --input-bg: transparent; - --input-active-bg: rgba(0,0,0, 0.5); - --input-border-color: rgba(255,255,255, 0.25); + --input-border-color: rgba(255,255,255, 0.70); + --input-hover-border-color: rgba(255, 255, 255, 1); + + /* input:placeholder */ + --input-placeholder-color: rgba(255,255,255, 0.5); + + /* input:disabled */ + --input-disabled-color: rgba(255, 255, 255, 0.50); + --input-disabled-border-color: rgba(255, 255, 255, 0.70); /* Search */ --search-bg: rgba(0,0,0, 0.45); diff --git a/ui/js/component/channelTile/view.jsx b/ui/js/component/channelTile/view.jsx index 6082ec58a..512389f0c 100644 --- a/ui/js/component/channelTile/view.jsx +++ b/ui/js/component/channelTile/view.jsx @@ -1,4 +1,5 @@ import React from "react"; +import CardMedia from "component/cardMedia"; import { TruncatedText, BusyMessage } from "component/common.js"; class ChannelTile extends React.PureComponent { @@ -18,29 +19,38 @@ class ChannelTile extends React.PureComponent { render() { const { claim, navigate, isResolvingUri, totalItems, uri } = this.props; + let channelName, channelId; + + if (claim) { + channelName = claim.name; + channelId = claim.claim_id; + } let onClick = () => navigate("/show", { uri }); return (
-
-
-

- {uri} -

-
-
- {isResolvingUri && - } - {totalItems > 0 && - - This is a channel with {totalItems}{" "} - {totalItems === 1 ? " item" : " items"} inside of it. - } - {!isResolvingUri && - !totalItems && - This is an empty channel.} +
+ {channelName && } +
+
+

+ {channelName || uri} +

+
+
+ {isResolvingUri && + } + {totalItems > 0 && + + This is a channel with {totalItems}{" "} + {totalItems === 1 ? " item" : " items"} inside of it. + } + {!isResolvingUri && + !totalItems && + This is an empty channel.} +
diff --git a/ui/js/component/fileTile/view.jsx b/ui/js/component/fileTile/view.jsx index 566985084..b712ae048 100644 --- a/ui/js/component/fileTile/view.jsx +++ b/ui/js/component/fileTile/view.jsx @@ -84,6 +84,11 @@ class FileTile extends React.PureComponent { let onClick = () => navigate("/show", { uri }); + let name = ""; + if (claim) { + name = claim.name; + } + let description = ""; if (isClaimed) { description = metadata && metadata.description; @@ -114,7 +119,7 @@ class FileTile extends React.PureComponent { >
- +
@@ -125,9 +130,8 @@ class FileTile extends React.PureComponent { {showLocal && fileInfo && }

- {title} + {title || name}

- {uri}
{description &&
diff --git a/ui/js/component/form.js b/ui/js/component/form.js index 7eaac87e4..ec34734bf 100644 --- a/ui/js/component/form.js +++ b/ui/js/component/form.js @@ -46,6 +46,10 @@ export class FormRow extends React.PureComponent { // helper: React.PropTypes.html, }; + static defaultProps = { + isFocus: false, + }; + constructor(props) { super(props); @@ -101,8 +105,12 @@ export class FormRow extends React.PureComponent { return this._field.getOptions(); } - focus() { - this._field.focus(); + onFocus() { + this.setState({ isFocus: true }); + } + + onBlur() { + this.setState({ isFocus: false }); } render() { @@ -117,6 +125,7 @@ export class FormRow extends React.PureComponent { } delete fieldProps.helper; delete fieldProps.errorMessage; + delete fieldProps.isFocus; return (
@@ -124,14 +133,16 @@ export class FormRow extends React.PureComponent { ?
+
+
+

{__("License")}

+
+
{ @@ -687,7 +691,7 @@ class PublishForm extends React.PureComponent { this.handleLicenseTypeChange(event); }} > -
} diff --git a/ui/js/constants/icons.js b/ui/js/constants/icons.js index d9c36fc32..ce2f54e22 100644 --- a/ui/js/constants/icons.js +++ b/ui/js/constants/icons.js @@ -1,3 +1,4 @@ export const FEATURED = "rocket"; export const LOCAL = "folder"; export const FILE = "file"; +export const HISTORY = "history"; diff --git a/ui/js/modal/modalRemoveFile/view.jsx b/ui/js/modal/modalRemoveFile/view.jsx index c18acb6f2..5b0c36f86 100644 --- a/ui/js/modal/modalRemoveFile/view.jsx +++ b/ui/js/modal/modalRemoveFile/view.jsx @@ -50,25 +50,21 @@ class ModalRemoveFile extends React.PureComponent {

- +
{claimIsMine &&
- +
} ); diff --git a/ui/js/page/settings/view.jsx b/ui/js/page/settings/view.jsx index 1a5f900b5..e11a2443f 100644 --- a/ui/js/page/settings/view.jsx +++ b/ui/js/page/settings/view.jsx @@ -148,7 +148,7 @@ class SettingsPage extends React.PureComponent { {/*
-

{__("Language")}

+

{__("Language")}

@@ -170,7 +170,7 @@ class SettingsPage extends React.PureComponent {
*/}
-

{__("Download Directory")}

+

{__("Download Directory")}

-

{__("Purchase Settings")}

+

{__("Max Purchase Price")}

-
- -
+
+ +
+
+

{__("Purchase Confirmations")}

+
-
- -
-

{__("Content")}

+

{__("Content")}

-
-
-

{__("Share Diagnostic Data")}

+

{__("Share Diagnostic Data")}

-

{__("Theme")}

+

{__("Theme")}

-

{__("Application Cache")}

+

{__("Application Cache")}

diff --git a/ui/scss/_gui.scss b/ui/scss/_gui.scss index 580862b54..64a69ea28 100644 --- a/ui/scss/_gui.scss +++ b/ui/scss/_gui.scss @@ -9,6 +9,7 @@ body color: var(--text-color); font-family: 'Roboto', sans-serif; line-height: var(--font-line-height); + user-select: none; } /* Custom text selection */ diff --git a/ui/scss/_vars.scss b/ui/scss/_vars.scss index fe7deb6c7..ec6f5e439 100644 --- a/ui/scss/_vars.scss +++ b/ui/scss/_vars.scss @@ -13,13 +13,13 @@ $text-color: #000; --color-primary-light: saturate(lighten(#155B4A, 50%), 20%); --color-light-alt: hsl(hue(#155B4A), 15, 85); --color-dark-overlay: rgba(32,32,32,0.9); - --color-help: rgba(0,0,0,.6); + --color-help: rgba(0, 0, 0, 0.54); --color-notice: #8a6d3b; --color-error: #a94442; --color-load-screen-text: #c3c3c3; --color-meta-light: #505050; --color-money: #216C2A; - --color-download: #444; + --color-download: rgba(0, 0, 0, 0.75); --color-canvas: #f5f5f5; --color-bg: #ffffff; --color-bg-alt: #D9D9D9; @@ -53,13 +53,27 @@ $text-color: #000; /* Window */ --window-bg: var(--color-canvas); + /* Form */ + --form-label-color: rgba(0, 0, 0, 0.54); + /* Input */ --input-bg: transparent; - --input-active-bg: transparent; --input-width: 330px; --input-color: var(--text-color); --input-border-size: 2px; - --input-border-color: rgba(0,0,0,.25); + --input-border-color: rgba(0, 0, 0, 0.42); + /* input:active */ + --input-active-bg: transparent; + + /* input:disabled */ + --input-disabled-border-color: rgba(0, 0, 0, 0.42); + --input-disabled-color: rgba(0, 0, 0, 0.54); + + /* input:hover */ + --input-hover-border-color: rgba(0, 0, 0, 0.87); + /* input:placeholder */ + --input-placeholder-color: rgba(0, 0, 0, 0.42); + --input-placeholder-opacity: 1; /* Select */ --select-bg: var(--color-bg-alt); diff --git a/ui/scss/all.scss b/ui/scss/all.scss index 3b4dc401e..7ef0e0c88 100644 --- a/ui/scss/all.scss +++ b/ui/scss/all.scss @@ -25,4 +25,6 @@ @import "component/_tabs.scss"; @import "component/_media.scss"; @import "component/_divider.scss"; +@import "component/_checkbox.scss"; +@import "component/_radio.scss"; @import "page/_show.scss"; diff --git a/ui/scss/component/_button.scss b/ui/scss/component/_button.scss index 7ba181c78..642e3de92 100644 --- a/ui/scss/component/_button.scss +++ b/ui/scss/component/_button.scss @@ -45,6 +45,7 @@ $button-focus-shift: 12%; cursor: pointer; font-weight: 500; font-size: 14px; + user-select: none; transition: background var(--animation-duration) var(--animation-style); } diff --git a/ui/scss/component/_card.scss b/ui/scss/component/_card.scss index 1de1e4494..44575951c 100644 --- a/ui/scss/component/_card.scss +++ b/ui/scss/component/_card.scss @@ -7,6 +7,7 @@ border-radius: var(--card-radius); margin-bottom: var(--card-margin); overflow: auto; + user-select: text; //below added to prevent scrollbar on long titles when show page loads, would prefer a cleaner CSS solution overflow-x: hidden; @@ -49,6 +50,8 @@ .card__actions { margin-top: var(--card-margin); margin-bottom: var(--card-margin); + user-select: none; + } .card__actions--bottom { margin-top: $spacing-vertical * 1/3; diff --git a/ui/scss/component/_checkbox.scss b/ui/scss/component/_checkbox.scss new file mode 100644 index 000000000..92b7599cb --- /dev/null +++ b/ui/scss/component/_checkbox.scss @@ -0,0 +1,69 @@ +*, *:before, *:after { + box-sizing: border-box; +} + +$md-checkbox-checked-color: var(--color-primary); +$md-checkbox-border-color: var(--input-border-color); +$md-checkbox-size: 20px; +$md-checkbox-padding: 4px; +$md-checkmark-width: 2px; +$md-checkmark-color: #FFF; + +.form-field--checkbox { + position: relative; + + label { + cursor: pointer; + &:before, &:after { + content: ""; + position: absolute; + left:0; + top: 0; + } + + &:before { + // box + width: $md-checkbox-size; + height: $md-checkbox-size; + background: transparent; + border: 2px solid $md-checkbox-border-color; + border-radius: 2px; + cursor: pointer; + transition: background .3s; + } + + &:after { + // checkmark + } + } + + input[type="checkbox"] { + outline: 0; + visibility: hidden; + margin-right: 16px; + + &:checked { + + + label:before{ + background: $md-checkbox-checked-color; + border:none; + } + + label:after { + + $md-checkmark-size: $md-checkbox-size - 2*$md-checkbox-padding; + + transform: rotate(-45deg); + + top: ($md-checkbox-size / 2) - ($md-checkmark-size / 4) - $md-checkbox-size/10; + left: $md-checkbox-padding; + width: $md-checkmark-size; + height: $md-checkmark-size / 2; + + border: $md-checkmark-width solid $md-checkmark-color; + border-top-style: none; + border-right-style: none; + } + } + } + +} diff --git a/ui/scss/component/_file-download.scss b/ui/scss/component/_file-download.scss index 485e2ea9d..dcde4b31b 100644 --- a/ui/scss/component/_file-download.scss +++ b/ui/scss/component/_file-download.scss @@ -12,7 +12,7 @@ .file-download__overlay { background: var(--color-download); - color: white; + color: var(--color-bg); position: absolute; white-space: nowrap; overflow: hidden; diff --git a/ui/scss/component/_file-selector.scss b/ui/scss/component/_file-selector.scss index 31dc20d81..8172da203 100644 --- a/ui/scss/component/_file-selector.scss +++ b/ui/scss/component/_file-selector.scss @@ -1,3 +1,8 @@ +.form-field--file, +.form-field--directory { + width: 100%; +} + .file-selector { display: flex; } @@ -11,4 +16,8 @@ .file-selector__path { font-size: 14px; + flex-grow: 2; + .input-copyable { + width: 100%; + } } diff --git a/ui/scss/component/_form-field.scss b/ui/scss/component/_form-field.scss index 4e9620a0a..d4b9e1256 100644 --- a/ui/scss/component/_form-field.scss +++ b/ui/scss/component/_form-field.scss @@ -1,10 +1,3 @@ - -@mixin placeholder { - &::-webkit-input-placeholder {@content} - &:-moz-placeholder {@content} - &:-ms-input-placeholder {@content} -} - .form-row-submit { margin-top: $spacing-vertical; @@ -16,7 +9,7 @@ .form-row__label-row { margin-top: $spacing-vertical * 5/6; - margin-bottom: $spacing-vertical * 1/6; + margin-bottom: 0px; line-height: 1; font-size:calc( 0.9 * var(--font-size)); } @@ -25,25 +18,9 @@ margin-right: 5px; } -input[type="text"].input-copyable { - background: var(--input-bg); - border-bottom: var(--input-border-size) solid var(--input-border-color); - color: var(--input-color); - line-height: 1; - padding-top: $spacing-vertical * 1/3; - padding-bottom: $spacing-vertical * 1/3; - width: var(--input-width); - padding-left: 5px; - padding-right: 5px; - width: 100%; - &:focus { - border-color: var(--color-primary); - background: none !important; - } -} - .form-field { display: inline-block; + margin: 8px 0; input[type="checkbox"], input[type="radio"] { @@ -63,61 +40,71 @@ input[type="text"].input-copyable { } } + input[type="text"].input-copyable { + background: var(--input-bg); + color: var(--input-disabled-color); + line-height: 1; + padding-top: $spacing-vertical * 1/3; + padding-bottom: $spacing-vertical * 1/3; + padding-left: 5px; + padding-right: 5px; + width: 100%; + } + + input[readonly] { + color: var(--input-disabled-color) !important; + border-bottom: 1px dashed var(--input-disabled-border-color) !important; + } + + input[readonly]:focus { + background: var(--input-bg) !important; + border-bottom: 1px dashed var(--input-disabled-border-color) !important; + } + textarea, input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"], - input[type="date"] { - @include placeholder { - color: lighten($text-color, 60%); - } - transition: all var(--transition-duration) var(--transition-type); + input[type="date"]{ + background: var(--input-bg); + border-bottom: var(--input-border-size) solid var(--input-border-color); + caret-color: var(--color-primary); + color: var(--input-color); cursor: pointer; - padding-left: 1px; - padding-right: 1px; + line-height: 1; + padding:0 1px 8px 1px; box-sizing: border-box; -webkit-appearance: none; - background: var(--input-bg); - color: var(--input-color); - &[readonly] { - background-color: var(--input-bg); - } - } + transition: all var(--transition-duration) var(--transition-type); - input[type="text"], - input[type="password"], - input[type="email"], - input[type="number"], - input[type="search"], - input[type="date"] { - border-bottom: var(--input-border-size) solid var(--input-border-color); - line-height: 1; - padding-top: $spacing-vertical * 1/3; - padding-bottom: $spacing-vertical * 1/3; + &::-webkit-input-placeholder { + color: var(--input-placeholder-color); + opacity: var(--input-placeholder-opacity) !important; + } + + &:focus { + border-color: var(--color-primary); + background: var(--input-active-bg); + } + + &:hover:not(:focus){ + border-color: var(--input-hover-border-color); + } &.form-field__input--error { border-color: var(--color-error); } + &.form-field__input--inline { padding-top: 0; padding-bottom: 0; - border-bottom-width: 1px; + border-bottom-width: var(--input-border-size); margin-left: 8px; margin-right: 8px; } - } - textarea:focus, - input[type="text"]:focus, - input[type="password"]:focus, - input[type="email"]:focus, - input[type="number"]:focus, - input[type="search"]:focus, - input[type="date"]:focus { - border-color: var(--color-primary); - background: var(--input-active-bg); } textarea { @@ -129,12 +116,22 @@ input[type="text"].input-copyable { display: block; } + .form-field__label, .form-row__label { - color: var(--color-help); + color: var(--form-label-color); &[for] { cursor: pointer; } > input[type="checkbox"], input[type="radio"] { margin-right: 6px; } + + &.focus { + color: var(--color-primary) !important; + } + + &.checked { + color: var(--text-color) !important; + } + } .form-row__label-row .form-field__label--error { diff --git a/ui/scss/component/_markdown-editor.scss b/ui/scss/component/_markdown-editor.scss index a2b311f5b..5a1786b48 100644 --- a/ui/scss/component/_markdown-editor.scss +++ b/ui/scss/component/_markdown-editor.scss @@ -1,20 +1,22 @@ .CodeMirror { - background: var(--input-active-bg) !important; - border: 1px solid var(--input-border-color) !important; + background: var(--color-canvas) !important; + border: 0px !important; + border-radius: 0px !important; color: var(--text-color) !important; -} - -.CodeMirror-fullscreen { - background: var(--input-bg); + box-shadow: var(--box-shadow-layer); } .editor-toolbar { - border: 1px solid var(--input-border-color) !important; - border-bottom: 0 !important; + opacity: 1 !important; + border: 0 !important; + background: var(--color-bg-alt); + border-radius: 0 !important; + box-shadow: var(--box-shadow-layer); } .editor-toolbar i.separator { - border-color: var(--input-border-color) !important; + border: 0 !important; + border-right: var(--divider) !important; } .editor-toolbar.fullscreen { @@ -22,26 +24,29 @@ } div.editor-toolbar a { + opacity: 0.64; color: var(--text-color) !important; } .editor-toolbar a.active, .editor-toolbar a:hover { + opacity: 1; background: var(--button-bg) !important; border-color: transparent !important; } .editor-toolbar.disabled-for-preview a:not(.no-disable) { - background: transparent !important; + background: var(--color-bg-alt) !important; border-color: transparent !important; } .editor-statusbar { - color: #959694; + color: var(--form-label-color) !important; } .editor-preview { background: var(--card-bg) !important; + border: 0 !important; } .editor-preview-side { @@ -79,7 +84,7 @@ div.editor-toolbar a { } .CodeMirror .CodeMirror-cursor{ - border-color: var(--text-color) !important; + border-color: var(--color-primary) !important; } .CodeMirror .CodeMirror-code .cm-comment { diff --git a/ui/scss/component/_radio.scss b/ui/scss/component/_radio.scss new file mode 100644 index 000000000..3e54da009 --- /dev/null +++ b/ui/scss/component/_radio.scss @@ -0,0 +1,54 @@ +$md-radio-checked-color: var(--color-primary); +$md-radio-border-color: var(--input-border-color); +$md-radio-size: 20px; +$md-radio-checked-size: 10px; +$md-radio-ripple-size: 15px; + +.form-field--radio { + position: relative; + + label { + cursor: pointer; + + &:before, &:after { + content: ""; + position: absolute; + left:0; + top: 0; + border-radius: 50%; + transition: all .3s ease; + transition-property: transform, border-color; + } + + &:before { + width: $md-radio-size; + height: $md-radio-size; + background: transparent; + border: 2px solid $md-radio-border-color; + cursor: pointer; + } + + &:after { + top: $md-radio-size / 2 - $md-radio-checked-size / 2; + left: $md-radio-size / 2 - $md-radio-checked-size / 2; + width:$md-radio-checked-size; + height:$md-radio-checked-size; + transform: scale(0); + background:$md-radio-checked-color; + } + + } + + input[type="radio"] { + visibility: hidden; + margin-right: 16px; + + &:checked + label:before { + border-color: $md-radio-checked-color; + } + + &:checked + label:after { + transform: scale(1); + } + } +} diff --git a/ui/scss/component/_scrollbar.scss b/ui/scss/component/_scrollbar.scss index b95a5f899..048428132 100644 --- a/ui/scss/component/_scrollbar.scss +++ b/ui/scss/component/_scrollbar.scss @@ -1,12 +1,12 @@ ::-webkit-scrollbar { - width: 7px; + width: 8px; overflow: auto; } ::-webkit-scrollbar-track { background: var(--scrollbar-track-bg); border-radius: var(--scrollbar-radius); - margin: 4px 0; + margin: 4px; } ::-webkit-scrollbar-thumb {