@LilaRest
#neumorphism#skeuomorphism#animation#minimalist#social#button#like#heart#realistic#favorite
#e8e8e8183 views
CSSAdd prefixes
1button { 2 display: flex; 3 justify-content: center; 4 align-items: center; 5 padding: 20px 22px 20px 22px; 6 box-shadow: rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset; 7 background-color: #e8e8e8; 8 border-color: #ffe2e2; 9 border-style: solid; 10 border-width: 9px; 11 border-radius: 35px; 12 transition: transform 400ms cubic-bezier(.68,-0.55,.27,2.5), 13 border-color 400ms ease-in-out, 14 background-color 400ms ease-in-out; 15 word-spacing: -2px; 16} 17 18@keyframes movingBorders { 19 0% { 20 border-color: #fce4e4; 21 } 22 23 50% { 24 border-color: #ffd8d8; 25 } 26 27 90% { 28 border-color: #fce4e4; 29 } 30} 31 32button:hover { 33 background-color: #eee; 34 transform: scale(105%); 35 animation: movingBorders 3s infinite; 36} 37 38.filled, 39.empty { 40 fill: rgb(255, 110, 110); 41 transition: opacity 100ms ease-in-out; 42} 43 44.filled { 45 position: absolute; 46 opacity: 0; 47} 48 49@keyframes beatingHeart { 50 0% { 51 transform: scale(1); 52 } 53 54 15% { 55 transform: scale(1.15); 56 } 57 58 30% { 59 transform: scale(1); 60 } 61 62 45% { 63 transform: scale(1.15); 64 } 65 66 60% { 67 transform: scale(1); 68 } 69} 70 71button:hover .empty { 72 opacity: 0; 73} 74 75button:hover .filled { 76 opacity: 1; 77 animation: beatingHeart 1.2s infinite; 78}
HTML
1<button> 2 <svg class="empty" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="32" height="32"><path fill="none" d="M0 0H24V24H0z"></path><path d="M16.5 3C19.538 3 22 5.5 22 9c0 7-7.5 11-10 12.5C9.5 20 2 16 2 9c0-3.5 2.5-6 5.5-6C9.36 3 11 4 12 5c1-1 2.64-2 4.5-2zm-3.566 15.604c.881-.556 1.676-1.109 2.42-1.701C18.335 14.533 20 11.943 20 9c0-2.36-1.537-4-3.5-4-1.076 0-2.24.57-3.086 1.414L12 7.828l-1.414-1.414C9.74 5.57 8.576 5 7.5 5 5.56 5 4 6.656 4 9c0 2.944 1.666 5.533 4.645 7.903.745.592 1.54 1.145 2.421 1.7.299.189.595.37.934.572.339-.202.635-.383.934-.571z"></path></svg> 3 <svg class="filled" height="32" width="32" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0H24V24H0z" fill="none"></path><path d="M16.5 3C19.538 3 22 5.5 22 9c0 7-7.5 11-10 12.5C9.5 20 2 16 2 9c0-3.5 2.5-6 5.5-6C9.36 3 11 4 12 5c1-1 2.64-2 4.5-2z"></path></svg> 4</button> 5