Air conditioner "airflow" animation using CSS #259
Replies: 3 comments 3 replies
-
I think maybe use P.S. Please post your final solution as this sounds very cool (pun intended!) |
Beta Was this translation helpful? Give feedback.
-
Hi I'm actually not using the option to generate entity-actions like this. I don't get why I've missed that way of generating class_set-entity code. I guess the There's many examples on the internet, but I'm not sure if that's too advance for you? With that said. You're not really giving me a chance to play around with things, not that no SVG is shared 😄 ... TO BE UPDATED... It's now the next day, and I ended playing around with one of the examples to get a better understand on how to play with You'll need to use SCSS, and generate the CSS - but I think that a way better solution - if you can live without "true randomness". If you're not into advance CSS, i think it's a bit hard to understand the code.. But hey... Fell free to use the codepen, if you're ready for a challenge. It's also possible to control the angle of the movements, but I've not spend time on that part ;) ... |
Beta Was this translation helpful? Give feedback.
-
Hello all!
I finally made an animation of a working air conditioner!
The solution is a little crutch, but it is made on pure css and js.
First you need to perfectly place a lot of "particles" (circles) on the svg (I placed 60 in two rows for better results).
This is the most boring part.
All particles must have the same name with a number (particle1, particle2, particle3, ..., particle60) and be placed in "sensors" group.
The particles must be placed in their "starting" position in a single line (taking into account the perspective).
Use temporary lines to line up the "particles".
After that, on the floorplan card, you need to set the class and style for the "particles".
We set the class and style (with random animation time) for all 60 particles at once with a javascript loop.
Code (YAML):
You also need to add animation to the css file (you need to determine the direction of movement of the particles and the time of their appearance based on your floorplan image).
Code (CSS):
As a result, you should get something like this:
The animation speeds up when the fan speed is high. Also, when the heating mode is set, the particles will be orange.
The source files with the example are in the attached zip archive.
The example code has been slightly modified for demonstration purposes.
In the yaml file, you need to delete lines 38-40:
Uncomment line 54:
// if(entity.state !== undefined && entity.state !== "off" && entity.state !== "unavailable"){
And delete line 55:
if (true){
floorplan_ac_animation.zip
Beta Was this translation helpful? Give feedback.
All reactions