Last active
June 27, 2022 04:30
-
-
Save kobitoDevelopment/67086d985cfcdcf07de485e64107c874 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p class="hoge">transformテスト</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const hoge = document.querySelector(".hoge"); | |
| const hogeStyles = getComputedStyle(hoge); | |
| let matrix = new DOMMatrix(hogeStyles.transform); | |
| console.log("X", matrix.m41, "Y", matrix.m42, "Z", matrix.m43); | |
| // matrixをconsoleに出力してどのkeyにどのvalueが格納されているか確認可能 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .hoge { | |
| transform: translateX(30px) translateY(40px) translateZ(50px); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment