/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
/**
* 玻璃卡片所需的动画与阴影样式(浮动 / 角落脉动 / aurora / 多层阴影)。
* 内置于 GlassCard,任何使用本卡片的页面(登录、注册、企业登录…)都会自动获得,
* 无需各自再注入一份
);
/**
* 登录/注册页通用的玻璃拟态卡片壳
*
* 视觉层(由后到前):
* 1. 外环柔光晕(品牌渐变 + 模糊)
* 2. 左上 / 右下角脉动光晕(可选,withCornerHalos)
* 3. 内层 aurora(缓慢漂移的品牌色径向辉光)
* 4. 卡片主体(高透白 + 强 backdrop-blur + ring/border 双层玻璃边)
* 5. 顶部品牌渐变线 + 1px 白色反光(玻璃顶面反光)
* 6. 用户传入的 children
*
* 交互:
* - 整卡浮动动画(translateY,7s 缓慢呼吸)
* - 角落光晕轻微缩放脉动(6s)
* - 卡片 hover 微抬升(scale 1.008,500ms 缓动)
*
* 性能:
* - 移动端自动降级 backdrop-filter 模糊半径(@media (max-width: 640px))
* - aurora 单层 GPU 合成
* - 全部动画在 prefers-reduced-motion 下关闭
* - 阴影、aurora 颜色均使用 var(--brand-primary-rgb),跟随主题预设
*/
const GlassCard = ({
children,
withCornerHalos = true,
withAurora = true,
className = '',
}) => {
return (
{/* 外环柔光晕 */}
{/* 左上 / 右下脉动光晕 */}
{withCornerHalos && (
<>
>
)}
{/* 卡片主体 */}
{/* 内层 aurora - 缓慢漂移,z-index 负值避免遮挡内容 */}
{withAurora && (
)}
{/* 顶部品牌渐变线 */}
{/* 顶部 1px 白色反光 - 紧贴品牌线下方 */}
{children}
);
};
export default GlassCard;