Skip to content

Instantly share code, notes, and snippets.

@marcusig
Created January 4, 2022 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusig/dcaaa1623339e6e5cb73b7da029bed3a to your computer and use it in GitHub Desktop.
Save marcusig/dcaaa1623339e6e5cb73b7da029bed3a to your computer and use it in GitHub Desktop.
Animate a layer in and out when changing a selection.
/*
The Layer must have a specific class to target the images.
In this example, we use the class "bezel"
See it working on http://demos.mklacroix.com/configurable-watch/
*/
.mkl_pc .mkl_pc_container .mkl_pc_viewer .mkl_pc_layers img.bezel:not(.active) {
transform: translateX(calc(-50% - 300px)) translateY(-50%);
}
.mkl_pc .mkl_pc_container .mkl_pc_viewer .mkl_pc_layers img.bezel.active ~ img.bezel:not(.active) {
transform: translateX(calc(-50% + 300px)) translateY(-50%);
}
@marcusig
Copy link
Author

This will move the angle selector to the bottom corner on the Float or WSB theme.

.mkl_pc .mkl_pc_container .mkl_pc_viewer .angles-select {
    top: auto;
    bottom: 5em;
    left: 2em;
}

You can adjust the exact position by changing the bottom and left values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment