Last active
April 8, 2022 07:13
-
-
Save kobitoDevelopment/774a818423ed2a8d30d29d45dba82171 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
| <div class="clip-wrap"> | |
| <div class="clip-top"></div> | |
| <div class="clip-bottom"></div> | |
| </div> |
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 clipWrap = document.querySelector(".clip-wrap"); | |
| clipWrap.classList.add("is-active"); |
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
| $(".clip-wrap").addClass("is-active"); //デバッグ用 |
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
| .clip-wrap { | |
| position: relative; | |
| width: 500px; //希望のコンテンツ横幅 | |
| .clip-top { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| z-index: 2; | |
| background: red; //デバッグ用カラー | |
| transition: 0.6s; | |
| clip-path: polygon(0 0, 0 0, 0 0); | |
| } | |
| .clip-bottom { | |
| position: relative; | |
| top: 0; | |
| left: 0; | |
| height: 300px; //デバッグ用高さ設定 | |
| z-index: 1; | |
| background: blue; //デバッグ用カラー | |
| } | |
| &.is-active { | |
| .clip-top { | |
| transition: 0.6s; | |
| clip-path: polygon(0 0, 100% 100%, 100% 0); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment