Skip to content

Commit 7c86a66

Browse files
committed
Flux - 26 - Adding an Image Stats Overlay
1 parent 77ef623 commit 7c86a66

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

imgur-client/sass/image-preview.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
display: inline-block;
33
position: relative;
44

5+
.inset {
6+
position: absolute;
7+
bottom: 5px;
8+
left: 0px;
9+
width: 100%;
10+
background-color: white;
11+
text-align: center;
12+
opacity: .7;
13+
}
14+
515
.glyphicon {
616
position: absolute;
717
top: 50%;

imgur-client/src/components/image-preview.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ module.exports = React.createClass({
1414
>
1515
{this.props.animated && this.state.hovering ? this.video() : this.image()}
1616
{this.props.animated && !this.state.hovering ? this.icon() : null }
17+
{this.state.hovering ? this.inset() : null}
18+
</div>
19+
},
20+
inset: function() {
21+
return <div className="inset">
22+
Views: {this.props.views}
23+
<br />
24+
Upvotes: {this.props.ups}
1725
</div>
1826
},
1927
image: function() {

0 commit comments

Comments
 (0)