File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ const ExpandImage = ( { children } ) => {
4
+
5
+ const StyledChildren = ( ) =>
6
+ React . Children . map ( children , child => {
7
+ return (
8
+ < div className = 'image-container-175mw' >
9
+ { child }
10
+ </ div >
11
+ )
12
+ }
13
+ ) ;
14
+
15
+ return < StyledChildren /> ;
16
+ }
17
+
18
+ export default ExpandImage
Original file line number Diff line number Diff line change 17
17
--ifm-footer-background-color : # 0c2c40
18
18
}
19
19
20
+ .image-container-175mw {
21
+ position : relative;
22
+ max-width : 175px ;
23
+ margin-left : auto;
24
+ margin-right : auto;
25
+ }
26
+
27
+ /* from https: //stackoverflow.com/questions/19104018/how-to-expand-an-image-in-html-by-clicking-on-it */
28
+ .image-container-175mw ::after {
29
+ color : white;
30
+ display : flex;
31
+ justify-content : center;
32
+ align-items : center;
33
+ font-size : 30px ;
34
+ font-weight : 600 ;
35
+ position : absolute;
36
+ height : 100% ;
37
+ width : 100% ;
38
+ top : 0 ;
39
+ text-align : center;
40
+ text-shadow : 0 0 30px # 000 ;
41
+ transition : .5s ease;
42
+ background-color : rgba (0 , 0 , 0 , 0.4 );
43
+ content : "Hover to expand" ;
44
+ }
45
+
46
+ .image-container-175mw : hover ::after {
47
+ opacity : 0 ;
48
+ }
49
+
50
+ .image-container-175mw > svg {
51
+ max-width : 175px ;
52
+ height : auto;
53
+ margin-left : auto;
54
+ margin-right : auto;
55
+ display : block;
56
+ opacity : 0.8 ;
57
+ }
58
+
59
+ .image-container-175mw : hover > svg {
60
+ color : # 424242 ;
61
+ -webkit-transition : all .3s ease-in;
62
+ -moz-transition : all .3s ease-in;
63
+ -ms-transition : all .3s ease-in;
64
+ -o-transition : all .3s ease-in;
65
+ transition : all .3s ease-in;
66
+ opacity : 1 ;
67
+ transform : scale (1.55 );
68
+ -ms-transform : scale (1.55 ); /* IE 9 */
69
+ -webkit-transform : scale (1.55 ); /* Safari and Chrome */
70
+ }
71
+
20
72
html footer {
21
73
--ifm-footer-title-color : rgb (255 , 255 , 255 );
22
74
--ifm-footer-link-color : # dadde1 ;
You can’t perform that action at this time.
0 commit comments