We developers find every solution to deal with different codes and reached to final solution in the end, I thought previously that this transition effect would be possible using only jQuery. But here we used only pureCSS that will help to complete this task in a very easy and compact way. User can see in the HTML code, I used one main div followed by input check-box and the label with it, The labelclass name should be same with the input id and this label have three children-div. While In CSS code we used "~sign" for making a connection between the input-box, label and the siblings div, as we are checking the checked state and putting the opacity property to the middle of the div and in first and third div will have same transition property that will rotate on different direction making cross sign to it.
Below is the source code that will be expalin each thing in a easy manner.