html - Spinning Effect Anchor tag CSS3 -



html - Spinning Effect Anchor tag CSS3 -

helo guys!

i trying create spinning hover effect css3.

just made circle spinning effect. check jsfiddle here: http://jsfiddle.net/63yyeezn/26/

however want create tthat spins time box type

just image:

so want similar effect jsfiddle shown above time must box.

really having hard time figuring out. here's css:

body { background: #292929; padding-left: 30px; font-size: 12px; } .twist { display: inline-block; font-size: 45px; line-height: 90px; cursor: pointer; margin: 20px; width: 90px; height: 90px; border-radius: 50%; text-align: center; position: relative; text-decoration: none; z-index: 1; color: #fff; } .twist:after { pointer-events: none; position: absolute; width: 100%; height: 100%; border-radius: 50%; content:''; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } .twist:before { speak: none; font-size: 48px; line-height: 90px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; display: block; -webkit-font-smoothing: antialiased; } .twist.demo-4 { width: 92px; height: 92px; box-shadow: 0 0 0 4px rgba(255, 255, 255, 1); } .twist.demo-4:before { line-height: 92px; } .twist.demo-4:after { top: -4px; left: -4px; padding: 0; z-index: 10; border: 4px dashed #fff; } .twist.demo-4:hover { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); color: #fff; } .twist.demo-4:hover { color: #fff; } .twist.demo-4.spin:hover { -webkit-transition: box-shadow 0.2s; -moz-transition: box-shadow 0.2s; transition: box-shadow 0.2s; } .twist.demo-4.spin:hover:after { -webkit-animation: spinaround 9s linear infinite; -moz-animation: spinaround 9s linear infinite; animation: spinaround 9s linear infinite; } @-webkit-keyframes spinaround { { -webkit-transform: rotate(0deg) } { -webkit-transform: rotate(360deg); } } @-moz-keyframes spinaround { { -moz-transform: rotate(0deg) } { -moz-transform: rotate(360deg); } } @keyframes spinaround { { transform: rotate(0deg) } { transform: rotate(360deg); } }

hope can help me jsfiddle file.

thanks!

my reply won't fit example, may involvement it's full-css3 solution, without html markup change. animation won't rotation, translation.

webkit version

class="snippet-code-css lang-css prettyprint-override">.bordered { overflow: hidden; } .bordered:before { content: ''; position: absolute; top: 5px; /* 5px: border width */ left: 5px; right: 5px; bottom: 5px; background: white; z-index: -1; } .bordered:after { content: ''; position: absolute; top: -50%; left: -50%; right: -50%; bottom: -50%; background: black; z-index: -2; } .bordered:hover:after { background: -webkit-linear-gradient(left, white 50%, black 50%); /* black: border color*/ background-size: 20px 100%; /* 20px: dash width */ -webkit-animation: borderanimated 1s linear infinite; } @-webkit-keyframes borderanimated { { transform: rotate(45deg) translate(0, 0); } { transform: rotate(45deg) translate(20px, 0); } } /* --- style only--- */ .bordered { width: 150px; height: 150px; line-height: 150px; text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } class="snippet-code-html lang-html prettyprint-override"><div class="bordered">lorem ipsum</div>

the trick have stripped background in :after pseudo-element, , false empty background in :before element, work mask. when hovering element, have animate :after pseudo-element nice.

html css css3

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -