@@ -14,120 +14,106 @@ const Wrapper = styled('a', {
1414 cursor : 'pointer' ,
1515 overflow : 'hidden' ,
1616 diplay : 'block' ,
17+ position : 'relative' ,
1718
1819 '.main-text' : {
19- diplay : 'block' ,
20- transform : translateY ( 0 ) ,
20+ display : 'block' ,
2121 transition : 'transform 500ms'
2222 } ,
2323
24- '&:before' : {
25- content : '' ,
24+ '.hover-text' : {
25+ diplay : 'block' ,
26+ transform : 'translateY(100%)' ,
27+ transition : 'transform 500ms' ,
2628 position : 'absolute' ,
27- top : '50%' ,
28- left : '50%' ,
29- width : '140px' ,
30- height : '140px' ,
31- borderRadius : '50%' ,
32- transform : 'translate3d(-50%,-50%,0) scale3d(0,0,0)' ,
33- transition : 'opacity .4s cubic-bezier(.19,1,.22,1),transform .75s cubic-bezier(.19,1,.22,1)' ,
34- backgroundColor : 'hsl(244, 63%, 69%)' ,
35- opacity : 0
29+ top : 0 ,
30+ left : 0 ,
31+ width : '100%' ,
32+ height : '100%'
3633 } ,
3734
3835 '&:hover' : {
39- '&:before' : {
40- opacity : 1 ,
41- transitionDuration : '.85s' ,
42- transform : 'translate3d(-50%,-50%,0) scale3d(1.2,1.2,1.2)'
36+ '.main-text' : {
37+ transition : 'transform 250ms' ,
38+ transform : 'translateY(-100%)'
4339 } ,
4440
45- span : {
46- color : '$white'
41+ '.hover-text' : {
42+ transition : 'transform 250ms' ,
43+ transform : 'translateY(0%)'
4744 }
4845 }
4946} ) ;
5047
5148const cssStyling = `
5249.exampleBtn {
53- padding: 12px 24px;
54- background-color: hsl(222, 100%, 95%);
55- color: hsl(243, 80%, 62%);
56- position: relative;
57- border-radius: 6px;
58- overflow: hidden;
59- z-index: 1;
50+ color: 'white';
51+ cursor: 'pointer';
52+ overflow: 'hidden';
53+ diplay: 'block';
54+ position: 'relative';
6055}
6156
62- .exampleBtn span {
63- z-index: 1 ;
64- position: relative ;
57+ .main-text {
58+ display: block ;
59+ transition: transform 500ms ;
6560}
6661
67- .exampleBtn::before {
68- content: '';
69- position: absolute;
70- top: 50%;
71- left: 50%;
72- width: 140px;
73- height: 140px;
74- border-radius: 50%;
75- transform: translate3d(-50%,-50%,0) scale3d(0,0,0);
76- transition: opacity .4s cubic-bezier(.19,1,.22,1),transform .75s cubic-bezier(.19,1,.22,1);
77- background-color: hsl(243, 80%, 62%);
78- opacity: 0;
62+ .hover-text {
63+ transition: transform 250ms;
64+ transform: translateY(0%);
65+ position: absolute;
66+ top: 0;
67+ left: 0;
68+ width: 100%;
69+ height: 100%;
7970}
8071
81- .exampleBtn:hover span {
82- color: hsl(222, 100%, 95%);
72+ .exampleBtn:hover .main-text {
73+ transition: transform 250ms;
74+ transform: translateY(-100%);
8375}
8476
85- .exampleBtn:hover::before {
86- opacity: 1;
87- transition-duration: .85s;
88- transform: translate3d(-50%,-50%,0) scale3d(1.2,1.2,1.2);
77+ .exampleBtn:hover .hover-text {
78+ transition: transform 250ms;
79+ transform: translateY(0%);
8980}
81+
9082` ;
9183
9284const scssStyling = `
9385.exampleBtn {
94- padding: 12px 24px;
95- background-color: hsl(222, 100%, 95%);
96- color: hsl(243, 80%, 62%);
97- position: relative;
98- border-radius: 6px;
99- overflow: hidden;
100- z-index: 1;
101-
102- span {
103- z-index: 1;
104- position: relative;
86+ color: 'white';
87+ cursor: 'pointer';
88+ overflow: 'hidden';
89+ diplay: 'block';
90+ position: 'relative';
91+
92+ .main-text {
93+ display: block;
94+ transition: transform 500ms;
10595 }
10696
107- &:before {
108- content: '';
97+ .hover-text {
98+ transition: transform 250ms;
99+ transform: translateY(0%);
109100 position: absolute;
110- top: 50%;
111- left: 50%;
112- width: 140px;
113- height: 140px;
114- border-radius: 50%;
115- transform: translate3d(-50%,-50%,0) scale3d(0,0,0);
116- transition: opacity .4s cubic-bezier(.19,1,.22,1),transform .75s cubic-bezier(.19,1,.22,1);
117- background-color: hsl(243, 80%, 62%);
118- opacity: 0;
101+ top: 0;
102+ left: 0;
103+ width: 100%;
104+ height: 100%;
119105 }
120106
121107 &:hover {
122- span {
123- color: hsl(222, 100%, 95%) ;
124- }
125-
126- &:before {
127- opacity: 1;
128- transition-duration: .85s ;
129- transform: translate3d(-50%,-50%,0) scale3d(1.2,1.2,1.2 );
130- }
108+ .main-text {
109+ transition: transform 250ms ;
110+ transform: translateY(-100%);
111+ }
112+
113+ .hover-text {
114+ transition: transform 250ms ;
115+ transform: translateY(0% );
116+ }
131117 }
132118}
133119` ;
0 commit comments