パーツ番号 08-04-04 ・ JavaScript使用
円形ワイプ遷移
メニューリンク押下時に円形ワイプで次のページを表示する演出。コーポレートサイトのトップメニュー遷移に。
プレビュー
ソースコード
HTML
<div class="d08-04-04-stage">
<div class="d08-04-04-page d08-04-04-a">
<strong>ホーム</strong>
<p>サイトのトップ</p>
</div>
<div class="d08-04-04-page d08-04-04-b">
<strong>お問い合わせ</strong>
<p>フォームへ移動</p>
</div>
<button type="button" class="d08-04-04-btn">切り替える</button>
</div>CSS
.prev.d08-04-04{padding:0;}
.d08-04-04-stage{position:absolute;inset:0;overflow:hidden;font-family:sans-serif;}
.d08-04-04-page{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#fff;}
.d08-04-04-a{background:linear-gradient(135deg,#1e293b,#334155);}
.d08-04-04-b{background:linear-gradient(135deg,#06b6d4,#0891b2);clip-path:circle(0% at 50% 50%);transition:clip-path .7s ease;z-index:2;}
.d08-04-04-stage.is-b .d08-04-04-b{clip-path:circle(150% at 50% 50%);}
.d08-04-04-page strong{font-size:18px;}
.d08-04-04-page p{font-size:12px;margin:0;opacity:.85;}
.d08-04-04-btn{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:3;border:none;border-radius:999px;padding:6px 16px;font-size:12px;background:#fff;color:#333;cursor:pointer;}JavaScript
(function(){
var box=document.currentScript.closest('.item').querySelector('.d08-04-04');
var stage=box.querySelector('.d08-04-04-stage');
var btn=box.querySelector('.d08-04-04-btn');
var on=false;
btn.addEventListener('click',function(){
on=!on;
stage.classList.toggle('is-b',on);
btn.textContent=on?'ホームへ戻る':'切り替える';
});
})();クラス名 .d08-04-04 は本ライブラリ内での識別用です。複数のパーツを同じページで使う場合は、重複しないよう名前を変更してください。