how is that transition of the icons when choosing dark/light/auto mode? #51
-
Initially I would like to congratulate you for the work that was very well done and for the recent integration to the Laravel framework. I'd also like to congratulate you on the most beautiful transition I've ever seen for switching the light/dark/auto mode icons. So, without any kind of shame, I would like to ask you to explain (if possible with many words - or maybe in a video coff coff) how the transition was made with the rotations that simulate, beautifully, the sun hiding and rising. Note: I'm asking because I wasn't able to fully understand it by looking at the source code. thx :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I created a small codepen: https://codepen.io/walterwoshid/pen/yLpNxjW I used Vue 2 and Tailwind CSS 2, I hope you are a little bit familiar with it. Explanation - Vue:Vue has a virtual dom, that means, every variable in the Explanation - HTML:
Explanation - Animation:
The animation is a little bit buggy if you click the button often, not like in Ignition, but with these principles, it is possible to perfect it :) |
Beta Was this translation helpful? Give feedback.
-
Hey @WalterWoshid Thx for your full explanation with a codepen. I'm not familiar with Vue, but Im with Tailwind and Alpinejs. I think I can replicate it. :) |
Beta Was this translation helpful? Give feedback.
@fcno
I created a small codepen: https://codepen.io/walterwoshid/pen/yLpNxjW
I used Vue 2 and Tailwind CSS 2, I hope you are a little bit familiar with it.
Explanation - Vue:
Vue has a virtual dom, that means, every variable in the
data
object of thenew Vue({})
object is synced with the html. I change a number, it automatically changes in the html. I can include it with{{ variable }}
or:class="variable"
Explanation - HTML:
:class="{ class: condition }
- This is a list with conditional classes. If the condition is true, the class is added to theclass attribute
, seebg-gray-800
&bg-gray-100
@click="method"
- This executes a method in themethods
object of thenew Vue({})
object