M-013 Animation medium

How to create a prismatic glow card プリズマティックグローカードの作り方

A rotating conic-gradient glow wraps a glassy card with adjustable bloom spread and speed. conic-gradient の虹色グローがカード外周を回転し、発光の広がりと速度を調整できる演出。

ライブデモ Live Demo

Prismatic Glow

Launch a brighter hero moment

Animated spectral light gives your feature card a high-contrast focal point without adding extra assets.

Conic gradient Soft bloom Glass depth
22px
7s

概要・用途・特徴Overview, Usage & Features

何ができるかWhat it does

A rotating conic-gradient glow wraps a glassy card with adjustable bloom spread and speed.

conic-gradient の虹色グローがカード外周を回転し、発光の広がりと速度を調整できる演出。

どこで使うかWhere to use

hero section, micro interaction, visual feedback, brand expression

NFTカード、プレミアム商品カード、ゲームアイテムカード、ポートフォリオ実績

特徴Key features

Card with a dynamic prismatic glow that follows the mouse cursor using CSS custom properties updated in JavaScript. Creates a 3D tilt illusion via perspective and rotateX/Y transforms. GPU-accelerated for smooth performance.

マウスカーソルを追うプリズマティックグロウをJavaScriptで更新するCSSカスタムプロパティで実現。perspectiveとrotateX/Yで3Dチルトイリュージョンを作成。GPUアクセラレーション対応。

調整可能パラメータ Adjustable Parameters

Parameter Default Description

実装コード Implementation Code

<article class="prism-card">
  <h3>Launch a brighter hero moment</h3>
</article>
.prism-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
}

.prism-card::before {
  content: "";
  position: absolute;
  inset: calc(var(--prism-spread, 22px) * -1);
  background: conic-gradient(from 0deg, #ff6b6b, #ffd166, #23f0c7, #4cc9f0, #7b61ff, #ff4d9d, #ff6b6b);
  filter: blur(var(--prism-spread, 22px));
  animation: prism-spin var(--prism-speed, 7s) linear infinite;
}

.prism-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(16, 20, 44, 0.94), rgba(8, 12, 28, 0.98));
}

@keyframes prism-spin {
  to { transform: rotate(360deg); }
}
import "./M-013.css";

export default function PrismaticGlowCard({
  title = "Spectrum Sync",
  description = "Animated conic light wraps a glassy card to spotlight hero content.",
  speed = 7,
  spread = 22,
  items = ["Live gradient", "Soft bloom", "Glass depth"],
}) {
  return (
    <article
      className="prismatic-glow-card"
      style={{
        "--prism-speed": `${speed}s`,
        "--prism-spread": `${spread}px`,
      }}
    >
      <span className="prismatic-glow-card__eyebrow">Prismatic Glow</span>
      <h3>{title}</h3>
      <p>{description}</p>
      <div className="prismatic-glow-card__chips">
        {items.map((item) => (
          <span key={item}>{item}</span>
        ))}
      </div>
    </article>
  );
}
:root {
  --prism-speed: 7s;
  --prism-spread: 22px;
}

.prismatic-glow-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
  padding: clamp(24px, 5vw, 34px);
  color: #f8fbff;
  background:
    linear-gradient(160deg, rgba(18, 22, 48, 0.94), rgba(6, 10, 24, 0.98)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 32%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 60px rgba(5, 8, 24, 0.45);
}

.prismatic-glow-card::before {
  content: "";
  position: absolute;
  inset: calc(var(--prism-spread) * -1);
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    #ff6b6b,
    #ffd166,
    #23f0c7,
    #4cc9f0,
    #7b61ff,
    #ff4d9d,
    #ff6b6b
  );
  filter: blur(var(--prism-spread));
  opacity: 0.9;
  animation: prism-spin var(--prism-speed) linear infinite;
  z-index: -2;
}

.prismatic-glow-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(28px - 1px);
  background:
    linear-gradient(160deg, rgba(16, 20, 44, 0.94), rgba(8, 12, 28, 0.98)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 34%);
  z-index: -1;
}

.prismatic-glow-card__eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #eef4ff;
  background: rgba(255, 255, 255, 0.08);
}

.prismatic-glow-card h3 {
  margin: 18px 0 10px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.05;
}

.prismatic-glow-card p {
  margin: 0;
  max-width: 36ch;
  color: rgba(240, 245, 255, 0.78);
  line-height: 1.6;
}

.prismatic-glow-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.prismatic-glow-card__chips span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(244, 248, 255, 0.92);
  font-size: 13px;
}

@keyframes prism-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .prismatic-glow-card::before {
    animation: none;
  }
}

仕組みとカスタマイズHow It Works & Customization

仕組みHow it works

A mousemove event listener on the card calculates the cursor position relative to the card center (x, y from -1 to 1). These values drive CSS custom properties (--rx, --ry) that control rotateX and rotateY in a 3D perspective transform. A radial gradient overlay also shifts position to simulate a light reflection moving with the cursor.

カード上のmousemoveイベントリスナーがカード中心に対するカーソル位置(-1から1のx, y)を計算。これらの値がCSSカスタムプロパティ(--rx、--ry)を駆動し、3DパースペクティブトランスフォームのrotateXとrotateYを制御。ラジアルグラデーションオーバーレイも位置をシフトしてカーソルに合わせて動く光の反射をシミュレート。

カスタマイズ方法Customization

Increase the rotation magnitude divisor to reduce the tilt intensity for a subtler effect. Swap the gradient colors in the glow overlay to match your brand. Add a CSS filter: brightness() transition on mouseenter/leave for a card "lighting up" effect.

回転量の除数を増やしてチルト強度を下げより繊細なエフェクトに。グロウオーバーレイのグラデーション色をブランドカラーに変更。mouseenter/leaveのCSS filter:brightness()トランジションを追加してカードが「点灯」するエフェクトに。

注意点Caveats

Mouse tracking via JavaScript adds CPU overhead on elements with complex gradients. Throttle the mousemove handler with requestAnimationFrame to maintain 60 fps. Disable the tilt and glow for touch devices where mouse tracking is unavailable.

JavaScriptによるマウストラッキングは複雑なグラデーションを持つ要素でCPU負荷を増やします。requestAnimationFrameでmousemoveハンドラをスロットリングして60fpsを維持。マウストラッキングが利用できないタッチデバイスではチルトとグロウを無効化してください。

よくある質問 Frequently Asked Questions

How to customize the prismatic glow card? Prismatic Glow Cardをカスタマイズするには?

Modify the CSS custom properties and class styles defined in the code section. Key adjustable values include colors, sizes, durations, and spacing. See the Adjustable Parameters section for specific variables.

コードセクションで定義されているCSSカスタムプロパティとクラススタイルを変更してください。色、サイズ、時間、間隔が主な調整可能値です。具体的な変数は調整可能パラメータセクションを参照してください。

How to use the prismatic glow card in React? ReactでPrismatic Glow Cardを使うには?

Import the provided React component and its CSS file. The component accepts props for customization. Check the React code section for the full implementation and available props.

提供されているReactコンポーネントとCSSファイルをインポートしてください。コンポーネントのpropsでカスタマイズできます。完全な実装と利用可能なpropsはReactコードセクションを参照してください。

What are the performance implications of prismatic glow card? Prismatic Glow Cardのパフォーマンスへの影響は?

This implementation uses CSS transforms and opacity for animations, which are GPU-accelerated. It's lightweight and doesn't cause layout thrashing. Consider using prefers-reduced-motion for accessibility.

この実装はCSSのtransformとopacityを使用しており、GPUアクセラレーションされます。軽量でレイアウトスラッシングを引き起こしません。アクセシビリティのためにprefers-reduced-motionの使用を検討してください。

AIへの指示テンプレート AI Prompt Template

以下をAIに貼り付けると実装を依頼できます。 Paste the following into your AI assistant to request implementation.