css-animations

CSS animation triggered through JS only plays every other click

Deadly 提交于 2021-01-18 12:32:33
问题 I want to make a simple JavaScript onclick animation. My problem is that when I click onto the button, the animation is executed, but when I click again onto the button, nothing happens. On the third clicks the animation plays again. I want to make that, the animation plays at the second click. Heres my code" var anim = document.getElementById("anim"); anim.onclick = function highA() { var willCheck = document.getElementById("contactId"); if (!willCheck.classList.contains("highAnim")) {

Adding Animation while switching to dark mode HTML

梦想的初衷 提交于 2020-12-31 14:57:56
问题 I created a dark mode for my webpage by following the link https://dev.to/ananyaneogi/create-a-dark-light-mode-switch-with-css-variables-34l8 I want to add an animation effect so that when the dark mode is applied, the transition is smooth. How do I do it? I know CSS keyframes are used to add animations or alternatively jQuery can be used, but I can't seem to get how to use them. 回答1: You could use a css transition. Here follows a simple example, click in the snippet to transition the

Is it possible to use transform: scaleX() without affecting the border-radius?

别说谁变了你拦得住时间么 提交于 2020-12-30 02:30:26
问题 I am trying to generate a simple expanding bar animation. Everything works find and I control it to my liking, except for the changing border-radius which is affected by the scaleX() transformation. Is there a way to avoid this effect? I assumed using an absolute unit for border-radius would suffice but it doesn't. scaleX() still affects it. Important note: I want to use scaleX() rather than working with the width property because the elements i am working on come with various changing widths

Can CSS animate or transition be used on the flex-direction property?

穿精又带淫゛_ 提交于 2020-12-08 05:58:18
问题 If an ordered list uses flex-direction: column on small screens and flex-direction: row on larger screens, can CSS3 animations or transitions animate the flex-direction property between media queries? Initial page set up html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body { font-size: 100%; } ol { display: flex; flex-direction: column; margin: 0; padding: 1rem 2rem; } ol a { display: block; padding: 1rem; text-decoration: none; border-bottom: 1px solid blue; }

Can CSS animate or transition be used on the flex-direction property?

假如想象 提交于 2020-12-08 05:56:32
问题 If an ordered list uses flex-direction: column on small screens and flex-direction: row on larger screens, can CSS3 animations or transitions animate the flex-direction property between media queries? Initial page set up html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body { font-size: 100%; } ol { display: flex; flex-direction: column; margin: 0; padding: 1rem 2rem; } ol a { display: block; padding: 1rem; text-decoration: none; border-bottom: 1px solid blue; }

Can CSS animate or transition be used on the flex-direction property?

耗尽温柔 提交于 2020-12-08 05:56:15
问题 If an ordered list uses flex-direction: column on small screens and flex-direction: row on larger screens, can CSS3 animations or transitions animate the flex-direction property between media queries? Initial page set up html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body { font-size: 100%; } ol { display: flex; flex-direction: column; margin: 0; padding: 1rem 2rem; } ol a { display: block; padding: 1rem; text-decoration: none; border-bottom: 1px solid blue; }

Animating a svg, with a mask, I am having trouble clipping outside of the svg

百般思念 提交于 2020-12-06 15:50:12
问题 I have a simple svg with two grouped paths that is a shape of a tshirt. I have created a mask with a circle with the fill color red, I am animating that mask into from the bottom of one path to the top. You can see it running on codepen. The part where I am stuck is how do I clip everything outside the tshirt with a stroke so you can only see the masked path animate inside. thanks ahead of time here is the code pen https://codepen.io/wispyco/pen/abvweMp #svg { width: 100px; margin: 0 auto;

Animating a svg, with a mask, I am having trouble clipping outside of the svg

爱⌒轻易说出口 提交于 2020-12-06 15:48:31
问题 I have a simple svg with two grouped paths that is a shape of a tshirt. I have created a mask with a circle with the fill color red, I am animating that mask into from the bottom of one path to the top. You can see it running on codepen. The part where I am stuck is how do I clip everything outside the tshirt with a stroke so you can only see the masked path animate inside. thanks ahead of time here is the code pen https://codepen.io/wispyco/pen/abvweMp #svg { width: 100px; margin: 0 auto;

Animating a svg, with a mask, I am having trouble clipping outside of the svg

独自空忆成欢 提交于 2020-12-06 15:47:04
问题 I have a simple svg with two grouped paths that is a shape of a tshirt. I have created a mask with a circle with the fill color red, I am animating that mask into from the bottom of one path to the top. You can see it running on codepen. The part where I am stuck is how do I clip everything outside the tshirt with a stroke so you can only see the masked path animate inside. thanks ahead of time here is the code pen https://codepen.io/wispyco/pen/abvweMp #svg { width: 100px; margin: 0 auto;