04 / Buttons

Button Plugins

3種の GSAP インタラクティブボタンの動作確認ページです。
ボタンにホバーして各種アニメーションを確認してください。

このページは useGsap: true が有効です。GSAP 3.12.5 が CDN から読み込まれます。
block-button-liquid

liquidButton

ホバーすると液体のように形が変形するボタン。
スクイッシュ → バウンス → 安定ホバーの3段階アニメーション。
color / textColor / fontFamily / float / shadow / radius でカスタマイズできます。

パラメーター一覧

パラメーター デフォルト 説明
textstringボタンラベル(必須)
colorstring'#5046e5'ボタン色 hex
textColorstring'#ffffff'テキスト色 hex
fontFamilystring"'Outfit', sans-serif"フォントファミリー
floatbooleantrue浮遊アニメーション
shadowbooleantrueドロップシャドウ
radiusnumber|'auto''auto'角丸 px('auto' で高さから自動計算)
block-button-stagger

staggerButton

ホバーすると文字が1文字ずつ順番にバウンスするタイポグラフィ主役のボタン。
ホバー時に光が走るシマー効果も付きます。
staggerDir で跳ね方向を、bounceY で跳ね上がり量を変えられます。

パラメーター一覧

パラメーター デフォルト 説明
textstringボタンラベル(必須)
colorstring'#111111'ボタン背景色
textColorstring'#ffffff'テキスト色 hex
fontFamilystring"'Syne', sans-serif"フォントファミリー
staggerDirstring'start''start' | 'center' | 'end' | 'random'
bounceYnumber-4跳ね上がり量 px(負の値で上方向)
floatbooleanfalse浮遊アニメーション
shadowbooleanfalseドロップシャドウ
radiusnumber|'auto''auto'角丸 px('auto' で高さから自動計算)
block-button-stroke

strokeButton

ホバーするとSVGのstrokeが上辺中央から両方向に描画されるミニマルなボタン。
テキストも微妙に浮き上がります。マウスアウトで逆方向に消えます。
colortextColor を同色にするとカラーリングが統一されます。

パラメーター一覧

パラメーター デフォルト 説明
textstringボタンラベル(必須)
colorstring'#111111'ホバー時ストローク色 hex
textColorstring'#111111'テキスト色 hex
fontFamilystring"'DM Sans', sans-serif"フォントファミリー
floatbooleanfalse浮遊アニメーション
shadowbooleanfalseドロップシャドウ
radiusnumber3角丸 px
strokeWidthnumber1.2線の太さ px
durationnumber0.55ストローク描画時間(秒)
USAGE

使い方

ページの front-matter に useGsap: true を設定し、
使用するフォントを事前に読み込んでから、マクロを呼び出してください。

---
layout: layouts/base.njk
title: My Page
useGsap: true
---
<!-- フォントの読み込み(使用するフォントのみ) -->
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@500;700&display=swap" rel="stylesheet">

{% from "block-button-liquid/block-button-liquid.njk" import liquidButton %} {% from "block-button-stagger/block-button-stagger.njk" import staggerButton %} {% from "block-button-stroke/block-button-stroke.njk" import strokeButton %}

{{ liquidButton("Get Started", color="#5046e5") }} {{ staggerButton("Learn More", color="#0d9488", staggerDir="center") }} {{ strokeButton("Contact", color="#6366f1", textColor="#6366f1", radius=24) }}