Skip to content
This repository was archived by the owner on Aug 27, 2018. It is now read-only.

Commit 6cbcda7

Browse files
committed
Change picture selection animation
1 parent 79960ee commit 6cbcda7

File tree

2 files changed

+29
-31
lines changed
  • 3-panel/src/views/Pages/Gallery/components/PicturesDialog

2 files changed

+29
-31
lines changed

3-panel/src/views/Pages/Gallery/components/PicturesDialog/components/Picture/index.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,26 @@ export default class Picture extends Component {
3636
}
3737

3838
select (flag) {
39-
const picturesDialog = this.props.getPicturesDialog()
40-
4139
const selectContainer = this.elements.selectContainer
4240
const img = this.elements.img
43-
const icon = this.elements.icon
44-
45-
const size = (flag) ? (picturesDialog.elements.container.classList.contains('vertical') ? img.clientHeight : img.clientWidth) : 0
4641

47-
selectContainer.style.borderRadius = (flag) ? '0%' : '100%'
48-
49-
setTimeout(function () {
50-
selectContainer.style.width = size + 'px'
51-
selectContainer.style.height = size + 'px'
52-
}, 10)
42+
selectContainer.style.width = img.clientWidth + 1 + 'px'
43+
selectContainer.style.height = img.clientHeight + 'px'
5344

54-
icon.style[(flag) ? 'display' : 'opacity'] = (flag) ? 'block' : '0'
45+
selectContainer.style[(flag) ? 'display' : 'opacity'] = (flag) ? 'block' : '0'
5546

5647
setTimeout(function () {
57-
icon.style[(flag) ? 'opacity' : 'display'] = (flag) ? '1' : 'none'
58-
}, (flag) ? 10 : 150)
48+
selectContainer.style[(flag) ? 'opacity' : 'display'] = (flag) ? '1' : 'none'
49+
}, (flag) ? 20 : 150)
5950
}
6051

6152
render () {
6253
return (
6354
<div className='picture' ref='root' onClick={this.onClick}>
6455
<img ref='img' />
65-
<div className='select-container' ref='selectContainer' />
66-
<div className='icon' ref='icon' />
56+
<div className='select-container' ref='selectContainer'>
57+
<div className='icon' />
58+
</div>
6759
</div>
6860
)
6961
}

3-panel/src/views/Pages/Gallery/components/PicturesDialog/style.scss

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
margin-right: auto;
77

88
& .picture {
9+
width: auto;
10+
height: auto;
911
position: relative;
1012
cursor: pointer;
1113
opacity: 0;
@@ -15,30 +17,34 @@
1517
& img {
1618
width: 100%;
1719
height: auto;
20+
position: relative;
21+
z-index: 0;
22+
min-height: 0;
1823
}
1924

2025
& .select-container {
21-
width: 0px;
22-
height: 0px;
23-
position: absolute;
24-
@include center;
25-
background-color: rgba(63, 81, 181, 0.5);
26-
border-radius: 100%;
27-
transition: 1s border-radius, 0.3s width ease, 0.3s height ease;
28-
}
29-
30-
& .icon {
3126
width: 100%;
3227
height: 100%;
3328
position: absolute;
3429
top: 0;
3530
left: 0;
36-
background-image: url(images/Toolbar/exit.png);
37-
opacity: 0;
38-
display: none;
31+
right: 0;
32+
margin: 0 auto;
33+
background-color: rgba(63, 81, 181, 0.5);
3934
transition: 0.3s opacity;
40-
@include image-center(32px, auto);
41-
@include invert-colors;
35+
display: none;
36+
opacity: 0;
37+
38+
& .icon {
39+
width: 100%;
40+
height: 100%;
41+
position: absolute;
42+
top: 0;
43+
left: 0;
44+
background-image: url(images/Toolbar/exit.png);
45+
@include image-center(32px, auto);
46+
@include invert-colors;
47+
}
4248
}
4349
}
4450

0 commit comments

Comments
 (0)