File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ font-size: 2.2rem;
3434margin : 40px 40px ;
3535position : relative;
3636text-align : center;
37- animation : slide 0.5 s ease-out ;
37+ left : -1000 px ;
3838}
3939
40- @keyframes slide {
41- 0 % { margin-left : -600 px ;}
42- 100 % { margin-left : 40 px ;}
40+ . transition {
41+ transform : translate ( 1000 px );
42+ transition : transform 1000 ms ;
4343}
4444
4545
Original file line number Diff line number Diff line change 1515< body >
1616 < div class ="container ">
1717 < div class ="quote ">
18- < blockquote id ="quote "> Wisely, and slow. They stumble that run fast</ blockquote >
18+ < blockquote class =" transition " id ="quote "> Wisely, and slow. They stumble that run fast</ blockquote >
1919 < h2 id ="author "> William Shakespeare</ h2 >
2020 < div class ="clearFix "> </ div >
2121 </ div >
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ let quoteNum = 0;
5050button . addEventListener ( 'click' , changeQuote ) ;
5151
5252function changeQuote ( ) {
53+ quote . classList . remove ( 'transition' ) ;
54+ setTimeout ( ( ) => {
55+ quote . classList . add ( 'transition' ) ;
56+ } , 5 )
5357 quote . textContent = quotes [ quoteNum ] . quote ;
5458 author . textContent = quotes [ quoteNum ] . author ;
5559 quoteNum ++ ;
You can’t perform that action at this time.
0 commit comments