From 2f307e2803658a6406e260c3a3b938eadf6cfdaa Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 6 Jun 2018 10:15:39 +0300 Subject: [PATCH] making file upload widget more consistent visually --- css/base.css | 43 +++++++++++++++++-------------------------- index.html | 24 +++++------------------- 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/css/base.css b/css/base.css index e8df2bc8..045b0526 100644 --- a/css/base.css +++ b/css/base.css @@ -1703,33 +1703,24 @@ ul.tabbar li.active > a:after { } /* File upload styles */ -.upload-container { - width: 2rem; - height: 2rem; - padding: 0; - margin: 0; +.uploader { + display: flex; +} +/* Gray uploader bar of fixed length (background) */ +.uploader > div { position: relative; - background-color: #CCF; - border-radius: 50%; + height: 0.6rem; + padding: 0.15rem; + margin: 0.3rem; + width: 6rem; + border-radius: 0.1rem; + background-color: silver; } -.upload-container .half { +/* Colored uploader progress bar of variable length */ +.uploader > div > span { position: absolute; - top: 0; left: 0; width: 1rem; height: 2rem; - border-radius: 1rem 0 0 1rem; - transform-origin: 1rem 1rem; -} -.upload-container .half.active { - background-color: #66F; -} -.upload-container .half.clip { - background-color: #CCF; -} -.upload-container .inner { - font-size: 80%; - position: absolute; - top: 0.25rem; left: 0.25rem; right: 0.25rem; bottom: 0.25rem; - text-align: center; - line-height: 1.5rem; - border-radius: 50%; - background-color: white; + display: inline-block; + height: 0.3rem; + background-color: #1e88e5; + border-radius: 0.08rem; } diff --git a/index.html b/index.html index 31e7e333..a8c12b44 100644 --- a/index.html +++ b/index.html @@ -703,30 +703,15 @@ super(props); this.state = { - progress: 0 + progress: 0.33 }; } render() { - var halfclip, progress1, progress2; - if (this.state.progress < 0.5) { - halfclip = {display: "block"}; - progress1 = {transform: "rotate(" + (this.state.progress*360) + "deg)"}; - progress2 = {display: "none"}; - } else { - halfclip = {display: "none"}; - progress1 = {transform: "rotate(180deg)"}; - progress2 = {display: "block", transform: "rotate(" + (180 + (this.state.progress-0.5)*360) + "deg)"}; - } return ( -
-
-
-
-
{this.props.onCancel ? - : - null} -
+
+
+ close cancel
); } @@ -1576,6 +1561,7 @@ onError={this.props.onError} /> : null} +
); }