Skip to content

Commit

Permalink
Flux - 26 - Adding an Image Stats Overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jul 5, 2015
1 parent 77ef623 commit 7c86a66
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions imgur-client/sass/image-preview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
display: inline-block;
position: relative;

.inset {
position: absolute;
bottom: 5px;
left: 0px;
width: 100%;
background-color: white;
text-align: center;
opacity: .7;
}

.glyphicon {
position: absolute;
top: 50%;
Expand Down
8 changes: 8 additions & 0 deletions imgur-client/src/components/image-preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ module.exports = React.createClass({
>
{this.props.animated && this.state.hovering ? this.video() : this.image()}
{this.props.animated && !this.state.hovering ? this.icon() : null }
{this.state.hovering ? this.inset() : null}
</div>
},
inset: function() {
return <div className="inset">
Views: {this.props.views}
<br />
Upvotes: {this.props.ups}
</div>
},
image: function() {
Expand Down

0 comments on commit 7c86a66

Please sign in to comment.