import { notification } from 'antd';
const darkGlassStyle = {
background: 'rgba(30, 32, 40, 0.95)',
backdropFilter: 'blur(10px)',
WebkitBackdropFilter: 'blur(10px)',
border: '1px solid rgba(255, 255, 255, 0.08)',
borderRadius: '8px',
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.4)',
padding: '12px 16px',
};
/** 胶片容器样式 */
const filmStripContainerStyle = {
position: 'relative' as const,
width: '100%',
height: '80px',
marginBottom: '16px',
overflow: 'hidden',
};
/** 胶片样式 */
const filmStripStyle = {
display: 'flex',
alignItems: 'center',
animation: 'filmScroll 20s linear infinite',
};
/** 文字样式 */
const textStyle = {
fontSize: '13px',
color: 'rgba(255, 255, 255, 0.9)',
marginBottom: '12px',
};
/** 胶片帧组件 */
const FilmFrame = () => (
);
/** 放映机音效组件 */
const ProjectorSound = () => (
);
/**
* 显示队列等待通知
* @param position - 当前队列位置
* @param estimatedMinutes - 预计等待分钟数
*/
export const showQueueNotification = (position: number, estimatedMinutes: number) => {
notification.open({
message: null,
description: (
{/* 胶片动画区域 */}
{[...Array(6)].map((_, i) => (
))}
{[...Array(6)].map((_, i) => (
))}
{/* 队列信息 */}
🎬
您的作品正在第 {position} 位等待制作
{/* 预计等待时间 */}
预计等待时间:约 {estimatedMinutes} 分钟
{/* 取消按钮 */}
{/* 放映机音效 */}
),
duration: 0,
placement: 'topRight',
style: {
...darkGlassStyle,
border: '1px solid rgba(246, 178, 102, 0.2)',
},
className: 'movie-queue-notification',
closeIcon: (
),
});
};
// 添加必要的CSS动画
const styles = `
@keyframes filmScroll {
0% { transform: translateX(0); }
100% { transform: translateX(-360px); }
}
.film-strip-2 {
position: absolute;
top: 0;
left: 360px;
}
.movie-queue-notification {
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
`;
// 将样式注入到页面
if (typeof document !== 'undefined') {
const styleSheet = document.createElement('style');
styleSheet.textContent = styles;
document.head.appendChild(styleSheet);
}
// 配置通知
notification.config({
maxCount: 3,
});