Skip to content

Commit

Permalink
Merge pull request #436 from statonlab/add-overlay-expand
Browse files Browse the repository at this point in the history
Expand observation details when clicking on image
  • Loading branch information
almasaeed2010 authored Mar 13, 2019
2 parents d13fc82 + c788977 commit 2a63162
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion public/css/app.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/js/0.825a5c484855705e19a3.js

This file was deleted.

1 change: 1 addition & 0 deletions public/js/0.99d5c823070e6284ffaa.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/1.a266fdc902bcbfb78c0d.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/js/1.fdf7ae7a5834c3106b49.js

This file was deleted.

1 change: 0 additions & 1 deletion public/js/10.13b19ddc3e10d7b970e6.js

This file was deleted.

1 change: 1 addition & 0 deletions public/js/10.eb3fefb19e1aec5b6a34.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/js/5.0fcb379126c6dff92351.js

This file was deleted.

1 change: 1 addition & 0 deletions public/js/5.7ff1c5eaa7fec20ea9ae.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/7.31711383b283780003ff.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/js/7.628127b85601a2003538.js

This file was deleted.

1 change: 0 additions & 1 deletion public/js/8.86ef8961eaaf3c5048fd.js

This file was deleted.

1 change: 1 addition & 0 deletions public/js/8.e3c466dcae3156837f34.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/js/vendor.js": "/js/vendor.js?id=da80df012039296cf353",
"/js/app.js": "/js/app.js?id=77c4fd7378b4f0f4e511",
"/css/app.css": "/css/app.css?id=e14a98d124f4aef3659d",
"/css/app.css": "/css/app.css?id=076495e51d1dc3726549",
"/js/admin.js": "/js/admin.js?id=75c7242ae22087a5578f",
"/js/manifest.js": "/js/manifest.js?id=68e6367db4de00aa60cc"
"/js/manifest.js": "/js/manifest.js?id=9eee0aada8d13e2cf483"
}
31 changes: 19 additions & 12 deletions resources/assets/js/components/ObservationCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export default class ObservationCard extends Component {
this.slowCloseSlideContent()

return
}
else if (slide) {
} else if (slide) {
this.setState({
slideContent: label
})
Expand Down Expand Up @@ -304,8 +303,7 @@ export default class ObservationCard extends Component {
this.setState({
correctMarks: this.state.correctMarks - 1
})
}
else {
} else {
this.setState({
incorrectMarks: this.state.incorrectMarks - 1
})
Expand All @@ -323,8 +321,7 @@ export default class ObservationCard extends Component {
if (this.state.confirmation.id !== -1) {
if (this.state.confirmation.correct) {
this.setState({correctMarks: this.state.correctMarks - 1})
}
else {
} else {
this.setState({incorrectMarks: this.state.incorrectMarks - 1})
}
}
Expand All @@ -341,8 +338,7 @@ export default class ObservationCard extends Component {
this.setState({
correctMarks: this.state.correctMarks + 1
})
}
else {
} else {
this.setState({
incorrectMarks: this.state.incorrectMarks + 1
})
Expand Down Expand Up @@ -473,11 +469,22 @@ export default class ObservationCard extends Component {
</header>
<div className="relative-block">
<Spinner visible={this.state.loading}/>
<div className="has-bg-image relative-block">
<div className="card-image"
style={{
backgroundImage: `url(${observation.thumbnail || '/images/placeholder.png'})`
<div className="has-bg-image relative-block is-positioned-relatively">
<div
className="card-image img-bg-zoom"
style={{
backgroundImage: `url(${observation.thumbnail || '/images/placeholder.png'})`
}}>
<a href="javascript:;"
className="sidebar-img-overlay flexbox flex-v-center flex-h-center flex-column z-10"
onClick={() => {
this.setState({showDetailsModal: true})
}}>
<i className="fa fa-photo"></i>
<div className="has-text-centered">
Click for More Details
</div>
</a>
</div>
</div>

Expand Down
11 changes: 11 additions & 0 deletions resources/assets/sass/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,14 @@ a.card-header-title {
margin-top: auto;
}
}

.img-bg-zoom {
transition: background-size 250ms linear;
&:hover {
background-size: 110%;
}
}

.z-10 {
z-index: 10!important;
}
4 changes: 4 additions & 0 deletions resources/assets/sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,7 @@ a.box {
.has-no-shadow {
box-shadow: none !important;
}

.cursor-pointer {
cursor: pointer;
}

0 comments on commit 2a63162

Please sign in to comment.