Alright, I'm trying to emulate the CSS effect on this chart:
http://bl.ocks.org/bobmonteverde/2070069
When you hover over a point, it creates a bigger circle around the point.
For the life of me, I can't figure out what I'm missing in my own CSS :)
my Fiddle: https://jsfiddle.net/y3LpjLph/3/
CSS:
/* Line Chart CSS */
.axis path,
.axis line {
fill: none;
stroke: #000;
stroke-width: 3px;
shape-rendering: crispEdges;
}
#pipeline-1,
#pipeline-2 {
fill: none;
stroke-width: 1.5px;
stroke-linecap: round;
transition: stroke-width 250ms linear;
-moz-transition: stroke-width 250ms linear;
-webkit-transition: stroke-width 250ms linear;
transition-delay: 250ms
-moz-transition-delay: 250ms;
-webkit-transition-delay: 250ms;
}
.x.axis path {
/* Uncomment below if I want to remove x-axis line */
/* display: none;*/
}
stroke-opacity: 0;
fill-opacity: 0;
#pipeline-chart-render {
padding-left: -50px;
}
.area {
fill: gray;
opacity: 0.2;
}
.legend-items text {
fill: steelblue;
}
.legend {
fill: white;
text-decoration-color: blue;
}
/* Simple tooltip CSS */
div.tooltip {
position: absolute;
background-color: rgba(255,255,255,1);
padding: 10px;
border: 1px solid #ddd;
font-family: Arial;
font-size: 13px;
font-weight: bold;
color: #7c795d;
transition: opacity 500ms linear;
-moz-transition: opacity 500ms linear;
-webkit-transition: opacity 500ms linear;
transition-delay: 500ms
-moz-transition-delay: 500ms;
-webkit-transition-delay: 500ms;
-moz-box-shadow: 4px 4px 12px rgba(0,0,0,.5);
-webkit-box-shadow: 4px 4px 12px rgba(0,0,0,.5);
box-shadow: 4px 4px 12px rgba(0,0,0,.5);
-moz-border-radius: 15px;
border-radius: 15px;
}
.noPointers{
pointer-events:none;
}
.pipelinePoint .circlePoint.active {
fill: orangered;
fill-opacity: 1;
stroke-width: 25px;
stroke-opacity: .5;
}
.pipelinePoint {
stroke-opacity: 1;
fill-opacity: 0.5;
}
.pipelinePoint .circlePoint {
transition: stroke-width 250ms linear;
-moz-transition: stroke-width 250ms linear;
-webkit-transition: stroke-width 250ms linear;
}
/*.pipelinePoint .circlePoint.hover {
fill: blue;
}*/
.circlePoint {
fill-opacity: 0.5;
transition: stroke-width 250ms linear;
-moz-transition: stroke-width 250ms linear;
-webkit-transition: stroke-width 250ms linear;
}
.point-paths path {
/*
fill: #eee;
stroke: #aaa;
*/
stroke-opacity: 0;
fill-opacity: 0;
}
You've filled your circles, but they have do not have a stroke color. So, your css animation is running, there's just nothing to see:
.pipelinePoint .circlePoint.active {
fill: orangered;
stroke: orangered;
fill-opacity: 1;
stroke-width: 25px;
stroke-opacity: .5;
}
Updated fiddle.
Related
.btn.btn-decor {
min-width: 12.375rem;
color: #fff;
padding: .625rem;
background: #000;
border: none;
outline: none;
}
.btn {
-webkit-transition: color .3s linear,border-color .3s linear,background .3s linear;
transition: color .3s linear,border-color .3s linear,background .3s linear;
min-width: 11.1875rem;
font-family: sans-serif;
font-size: .6875rem;
font-weight: 600;
letter-spacing: 3px;
text-transform: uppercase;
white-space: normal;
padding: 1.25rem .9375rem;
position: relative;
}
.btn {
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid transparent;
padding: .375rem .75rem;
font-size: .730rem;
line-height: 1.5;
border-radius: 0;
-webkit-transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.btn.btn-decor span {
-webkit-transition: border-color .3s linear;
transition: border-color .3s linear;
display: block;
padding: 1.25rem .9375rem;
border-top: 2px solid #272726;
border-bottom: 2px solid #272726;
position: relative;
}
.btn.btn-decor span:before {
bottom: 0;
}
.btn.btn-decor span:after, .btn.btn-decor span:before {
-webkit-transition: border-color .3s linear;
transition: border-color .3s linear;
content: "";
position: absolute;
left: 0;
right: 0;
height: 1.375rem;
border-width: 0 2px;
border-style: solid;
border-color: #272726;
color: #272726;
}
.btn.btn-decor .icon-star:first-child {
left: -.25rem;
}
.btn.btn-decor .icon-star {
-webkit-transition: color .4s linear,-webkit-transform .4s linear;
transition: color .4s linear,-webkit-transform .4s linear;
transition: color .4s linear,transform .4s linear;
transition: color .4s linear,transform .4s linear,-webkit-transform .4s linear;
width: .625rem;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%) rotate(0);
-ms-transform: translateY(-50%) rotate(0);
transform: translateY(-50%) rotate(0);
font-size: .625rem;
color: #272726;
}
[class*=" icon-"], [class^=icon-] {
font-family: icomoon!important;
speak: none;
font-style: normal;
font-weight: 400;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.btn.btn-decor .icon-star:nth-child(2) {
right: -.25rem;
}
.btn.btn-decor .icon-star {
-webkit-transition: color .4s linear,-webkit-transform .4s linear;
transition: color .4s linear,-webkit-transform .4s linear;
transition: color .4s linear,transform .4s linear;
transition: color .4s linear,transform .4s linear,-webkit-transform .4s linear;
width: .625rem;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%) rotate(0);
-ms-transform: translateY(-50%) rotate(0);
transform: translateY(-50%) rotate(0);
font-size: .625rem;
color: #272726;
}
[class*=" icon-"], [class^=icon-] {
font-family: icomoon!important;
speak: none;
font-style: normal;
font-weight: 400;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.btn.btn-decor span:after {
top: 0;
}
.btn.btn-decor span:after, .btn.btn-decor span:before {
-webkit-transition: border-color .3s linear;
transition: border-color .3s linear;
content: "";
position: absolute;
left: 0;
right: 0;
height: 1.375rem;
border-width: 0 2px;
border-style: solid;
border-color: #272726;
color: #272726;
}
.icon-star:before {
content: url("");
}
.btn:not(:disabled):not(.disabled) {
cursor: pointer;
}
.btn.btn-decor.btn-decor-white:hover .icon-star,.btn.btn-decor:hover .icon-star {
-webkit-transform: translateY(-50%) rotate(360deg);
-ms-transform: translateY(-50%) rotate(360deg);
transform: translateY(-50%) rotate(360deg);
color: #4f4f4d
}
.offer-section .stars-bg .icon-star:first-child {
top: 0;
left: 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%)
}
.btn.btn-decor.btn-decor-white:hover span,.btn.btn-decor:hover span {
border-color: #4f4f4d
}
.btn.btn-decor.btn-decor-white:hover span:after,.btn.btn-decor.btn-decor-white:hover span:before,.btn.btn-decor:hover span:after,.btn.btn-decor:hover span:before {
border-color: #4f4f4d
}
<div>
<a -label="Link more" href="#" gv-link="link_3" class="btn btn-decor js-check-text sticky-link">
<span><i class="icon-star"></i>submit<i class="icon-star"></i></span>
</a>
</div>
enter image description here
When adding my button classes to the shortcode, it picks them up, but not correctly. Maybe because I have two classes "btn btn-decor" and "icon-star". What other options can there be, well, besides creating your own form, so that the button works in the created Contact Form 7?
I have a checkmark SVG animation that works in Safari, Chrome, Firefox, etc but does not work in Edge and IE (surprise surprise).
It seems as if the SVG is there but the strokes are not displaying.
As far as I can tell both Edge and IE11 support what I am trying to do and I've used every prefix I can think of.
CSS/HTML:
.checkmark {
position: relative;
left: 50px;
z-index: 1;
opacity: 1;
width: 22px;
border-radius: 50%;
display: inline;
stroke-width: 6;
stroke: #fff;
stroke-miterlimit: 10;
margin: -4px -15px;
-webkit-box-shadow: inset 0px 0px 0px #fff;
box-shadow: inset 0px 0px 0px #fff;
-webkit-animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__circle {
stroke-dasharray: 166;
stroke-dashoffset: 166;
stroke-width: 3;
stroke-miterlimit: 10;
stroke: #fff;
fill: none;
-webkit-animation: stroke .6s cubic-bezier(0.650, 0.000, 0.450, 1.000) forwards;
animation: stroke .6s cubic-bezier(0.650, 0.000, 0.450, 1.000) forwards;
}
.checkmark__check {
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
stroke-dasharray: 48;
stroke-dashoffset: 48;
-webkit-animation: stroke .3s cubic-bezier(0.650, 0.000, 0.450, 1.000) .8s forwards;
animation: stroke .3s cubic-bezier(0.650, 0.000, 0.450, 1.000) .8s forwards;
}
#-webkit-keyframes stroke {
100% {
stroke-dashoffset: 0;
}
}
#keyframes stroke {
100% {
stroke-dashoffset: 0;
}
}
#-webkit-keyframes scale {
0%, 100% {
-webkit-transform: none;
transform: none;
}
50% {
-webkit-transform: scale3d(1.1, 1.1, 1);
transform: scale3d(1.1, 1.1, 1);
}
}
#keyframes scale {
0%, 100% {
-webkit-transform: none;
transform: none;
}
50% {
-webkit-transform: scale3d(1.1, 1.1, 1);
transform: scale3d(1.1, 1.1, 1);
}
}
#-webkit-keyframes fill {
100% {
-webkit-box-shadow: inset 0px 0px 0px 30px #B0D056;
box-shadow: inset 0px 0px 0px 30px #B0D056;
}
}
#keyframes fill {
100% {
-webkit-box-shadow: inset 0px 0px 0px 30px #B0D056;
box-shadow: inset 0px 0px 0px 30px #B0D056;
}
}
<svg class="checkmark"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 52 52">
<circle class="checkmark__circle"
cx="26"
cy="26"
r="25"
fill="none"/>
<path class="checkmark__check"
fill="none"
d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
</svg>
Any ideas?
Any help is appreciated.
So after some research I found that in Edge, you have to be more specific when dealing with stroke-dashoffset and stroke-dasharray so instead of '0' you have to put '0px';
#keyframes stroke {
100% {
stroke-dashoffset: 0px; /* instead of stroke-dashoffset: 0; */
}
}
IE does not support CSS animations of SVGs and never will
Please, how can I get an effect like the one in the upper right menu, with just CSS3? (mouse over -> circle shrinks and fades in, mouse out -> circle expands and fades out)
http://wpkuzen.com/html/architex/
I tried to look at the code and it's messy, nand couldn' find a tutorial that explain this...
Thanks in advance!
Take a look at this article and demo. They have very similar transitions/animations to the one which you need.
Here's an example:
FIDDLE
Markup:
CSS
.hi-icon {
display: inline-block;
font-size: 0px;
cursor: pointer;
margin: 15px 30px;
width: 90px;
height: 90px;
border-radius: 50%;
text-align: center;
position: relative;
z-index: 1;
color: green;
box-shadow: 0 0 0 4px #FFF;
-webkit-transition: color 0.3s;
-moz-transition: color 0.3s;
transition: color 0.3s;
}
.hi-icon:before {
content: "X"; /* place image here */
font-size: 48px;
line-height: 90px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
display: block;
-webkit-font-smoothing: antialiased;
}
.hi-icon:hover:after {
-webkit-transform: scale(1.3);
-moz-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3);
opacity: 0;
}
.hi-icon:after {
content: '';
pointer-events: none;
position: absolute;
top: -2px;
left: -2px;
width: 100%;
height: 100%;
border-radius: 50%;
padding: 2px;
z-index: -1;
background: #FFF;
-webkit-transition: -webkit-transform 0.2s, opacity 0.3s;
-moz-transition: -moz-transform 0.2s, opacity 0.3s;
transition: transform 0.2s, opacity 0.3s;
}
This effect is done by using the CSS transition. You have one property and instead of change that property instantly (on hover or fadeout) you change that property over time.
Here you have a nice link helping you to hopefully achive your goals. :)
link to transition
I really don't understand your comment "I tried to look at the code and it's messy".
You have a fully indented CSS with comments !
directly copy-pasted from your link:
/* Positioning the icons and preparing for the animation*/
.nav i {
position: relative;
display: inline-block;
margin: 0 auto;
padding: 0.4em;
border-radius: 50%;
font-size: 2.2em;
box-shadow: 0 0 0 30px transparent;
background: rgba(255,255,255,0.1);
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition: box-shadow .6s ease-in-out;
-moz-transition: box-shadow .6s ease-in-out;
-o-transition: box-shadow .6s ease-in-out;
-ms-transition: box-shadow .6s ease-in-out;
transition: box-shadow .6s ease-in-out;
width:1.1em !important;
}
/* Animate the box-shadow to create the effect */
.navbar .nav a:hover i,
.navbar .nav a:active i,
.navbar .nav a:focus i {
box-shadow: 0 0 0 0 rgba(255,255,255,0.2);
-webkit-transition: box-shadow .4s ease-in-out;
-moz-transition: box-shadow .4s ease-in-out;
-o-transition: box-shadow .4s ease-in-out;
-ms-transition: box-shadow .4s ease-in-out;
transition: box-shadow .4s ease-in-out;
}
I've got a div styled to be a circle with an image and some text centered inside of it.
Without hovering, the circle and image are shown while the text is transparent.
When hovering, the circle border starts flashes (webkit animation), the image's opacity is lowered, and the text becomes visible.
When writing/testing this code in Firefox, everything works as desired, but on Chrome, the changes from the hover effect persist and I don't want them to (namely, the image opacity stays lowered, and the text remains visible. Continuing to hover on the div, however, makes the border flash as intended.
I've got all the correct webkit/moz/ms/o transitions and animations, but I can't seem to figure out what's going wrong (or if this is just one of the deficiencies that comes from using Chrome).
My code for the div and all its elements is:
<div class='players'>
<div class='row'>
<div class='span6'>
<div class='matchup'>
<p class='team'>SOMETEAMNAME</p>
<p class='name'>SOMENAME</p>
<img src='SOMEIMAGE'>
</div>
</div>
</div>
</div>
My CSS code:
.matchup {
width: 250px;
height: 250px;
background: transparent;
border: 1px solid #ff6600;
border-radius: 125px;
display: block;
margin-left: auto;
margin-right: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: 0.5s ease;
-moz-transition: 0.5s ease;
-ms-transition: 0.5s ease;
-o-transition: 0.5s ease;
transition: 0.5s ease;
}
.matchup img {
position: static;
margin-top: -22%;
opacity: 1;
-webkit-transition: 0.5s ease;
-moz-transition: 0.5s ease;
-ms-transition: 0.5s ease;
-o-transition: 0.5s ease;
transition: 0.5s ease;
}
.matchup p {
font-family: 'Lobster', cursive;
position: relative;
text-align: center;
top: 50%;
color: transparent;
-webkit-transition: 0.5s ease;
-moz-transition: 0.5s ease;
-ms-transition: 0.5s ease;
-o-transition: 0.5s ease;
transition: 0.5s ease;
}
.team {
font-size: 25px;
}
.name {
font-size: 45px;
}
.map {
font-size: 15px;
margin-top: -70%;
}
.matchup:hover {
-webkit-animation: matchup-active 1s infinite;
-moz-animation: matchup-active 1s infinite;
-ms-animation: matchup-active 1s infinite;
-o-animation: matchup-active 1s infinite;
animation: matchup-active 1s infinite;
p {
color: #ff6600;
}
img {
opacity: 0.2;
}
}
#-webkit-keyframes matchup-active {
0% {
border: 1px solid #ff6600;
}
50% {
border: 1px solid transparent;
}
100% {
border: 1px solid #ff6600;
}
}
#-moz-keyframes matchup-active {
0% {
border: 1px solid #ff6600;
}
50% {
border: 1px solid transparent;
}
100% {
border: 1px solid #ff6600;
}
}
#-o-keyframes matchup-active {
0% {
border: 1px solid #ff6600;
}
50% {
border: 1px solid transparent;
}
100% {
border: 1px solid #ff6600;
}
}
#keyframes matchup-active {
0% {
border: 1px solid #ff6600;
}
50% {
border: 1px solid transparent;
}
100% {
border: 1px solid #ff6600;
}
}
EDIT:
Updated with a jsfiddle: http://jsfiddle.net/sicophrenic/qvJ94/
It's not styled perfectly (i.e. images and stuff aren't centered), but the problem I'm having shows up (in Chrome and works fine in Firefox).
on .matchup add color:transparent;
on .matchup:hover add color: #ff6600;
on .matchup p add color: inherit;
because .matchup:hover p is not a valid selector.
here is a fiddle
I want to animate borders of an element using CSS3, whether it's in hover state or normal state. Can someone provide me a code snippet for this or can guide?
I can do this using jQuery but looking for some pure CSS3 solution.
You can use a CSS3 transition for this. Have a look at this example:
http://jsfiddle.net/ujDkf/1/
Here is the main code:
#box {
position : relative;
width : 100px;
height : 100px;
background-color : gray;
border : 5px solid black;
-webkit-transition : border 500ms ease-out;
-moz-transition : border 500ms ease-out;
-o-transition : border 500ms ease-out;
transition : border 500ms ease-out;
}
#box:hover {
border : 10px solid red;
}
You can try this also...
button {
background: none;
border: 0;
box-sizing: border-box;
margin: 1em;
padding: 1em 2em;
box-shadow: inset 0 0 0 2px #f45e61;
color: #f45e61;
font-size: inherit;
font-weight: 700;
vertical-align: middle;
position: relative;
}
button::before, button::after {
box-sizing: inherit;
content: '';
position: absolute;
width: 100%;
height: 100%;
}
.draw {
-webkit-transition: color 0.25s;
transition: color 0.25s;
}
.draw::before, .draw::after {
border: 2px solid transparent;
width: 0;
height: 0;
}
.draw::before {
top: 0;
left: 0;
}
.draw::after {
bottom: 0;
right: 0;
}
.draw:hover {
color: #60daaa;
}
.draw:hover::before, .draw:hover::after {
width: 100%;
height: 100%;
}
.draw:hover::before {
border-top-color: #60daaa;
border-right-color: #60daaa;
-webkit-transition: width 0.25s ease-out, height 0.25s ease-out 0.25s;
transition: width 0.25s ease-out, height 0.25s ease-out 0.25s;
}
.draw:hover::after {
border-bottom-color: #60daaa;
border-left-color: #60daaa;
-webkit-transition: border-color 0s ease-out 0.5s, width 0.25s ease-out 0.5s, height 0.25s ease-out 0.75s;
transition: border-color 0s ease-out 0.5s, width 0.25s ease-out 0.5s, height 0.25s ease-out 0.75s;
}
<section class="buttons">
<button class="draw">Draw</button>
</section>
If you need the transition to run infinitely, try the below example:
#box {
position: relative;
width: 100px;
height: 100px;
background-color: gray;
border: 5px solid black;
display: block;
}
#box:hover {
border-color: red;
animation-name: flash_border;
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
-webkit-animation-name: flash_border;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-moz-animation-name: flash_border;
-moz-animation-duration: 2s;
-moz-animation-timing-function: linear;
-moz-animation-iteration-count: infinite;
}
#keyframes flash_border {
0% {
border-color: red;
}
50% {
border-color: black;
}
100% {
border-color: red;
}
}
#-webkit-keyframes flash_border {
0% {
border-color: red;
}
50% {
border-color: black;
}
100% {
border-color: red;
}
}
#-moz-keyframes flash_border {
0% {
border-color: red;
}
50% {
border-color: black;
}
100% {
border-color: red;
}
}
<div id="box">roll over me</div>
A bit late to this one but...
This is what I do:
.class {
color: tomato;
border: 10px solid currentColor;
transition: color 250ms linear;
// not part of solution just layout
width: 100px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
font-size: 2rem;
text-transform: uppercase;
}
.class:hover {
color: rebeccapurple;
}
<div class='class' >color way</div>