Skip to content

Commit 1d7841c

Browse files
committed
Styled image tile with progress bar
1 parent ca043b0 commit 1d7841c

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

client/app/components/progress-bar.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default Ember.Component.extend({
2+
classNames: ['progress-bar'],
3+
attributeBindings: ['style'],
4+
style: function() {
5+
return 'width: ' + this.get('progress') + '%;';
6+
}.property('progress')
7+
});

client/app/components/ui-spinner.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ var SPINNER_PROPS = [
1919

2020
export default Ember.Component.extend({
2121
lines: 13, // The number of lines to draw
22-
length: 20, // The length of each line
23-
width: 10, // The line thickness
24-
radius: 30, // The radius of the inner circle
22+
length: 5, // The length of each line
23+
width: 5, // The line thickness
24+
radius: 10, // The radius of the inner circle
2525
corners: 1, // Corner roundness (0..1)
2626
rotate: 0, // The rotation offset
2727
direction: 1, // 1: clockwise, -1: counterclockwise
28-
color: '#000', // #rgb or #rrggbb or array of colors
28+
color: '#999', // #rgb or #rrggbb or array of colors
2929
speed: 1, // Rounds per second
3030
trail: 60, // Afterglow percentage
3131
shadow: false, // Whether to render a shadow

client/app/styles/views/images.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,23 @@ section.images {
3232
left: 0;
3333
right: 0;
3434
bottom: 0;
35-
background: #ddd;
35+
background: #eee;
3636
color: #666;
3737
font-size: 1em;
3838
font-weight: 400;
3939
margin: 0;
40+
white-space: nowrap;
41+
overflow: hidden;
42+
text-overflow: ellipsis;
43+
padding: 5px;
44+
}
45+
46+
.progress-bar {
47+
position: absolute;
48+
left: 0;
49+
bottom: 0;
50+
height: 2px;
51+
background: $green;
4052
}
4153
}
4254
}

client/app/templates/components/image-item.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{{error}}
99
{{else}}
1010
{{ui-spinner}}
11-
[{{image.wholeProgress}}%]
1211
<h2>{{image.file.name}}</h2>
12+
{{progress-bar progress=image.wholeProgress}}
1313
{{/if}}
1414
{{/if}}

0 commit comments

Comments
 (0)