用达子上的k2.5试了下天气卡片效果感觉还行吧

站里大佬的prompt:

你是一位就职于苹果公司的顶级前端工程师。请创建一个包含CSS和JavaScript的HTML文件,用于生成动画天气卡片。卡片需要以不同动画效果直观展示以下天气状况:

风力(如:飘动的云朵、摇曳的树木或风线)
降雨(如:下落的雨滴、形成的水洼)
晴天(如:闪耀的光线、明亮的背景)
下雪(如:飘落的雪花、积雪效果)

所有天气卡片需要并排显示,背景采用深色设计。所有HTML、CSS和JavaScript代码都需包含在这个单一文件中。JavaScript部分需包含切换不同天气状态的功能(例如通过函数或按钮组),以演示每种天气的动画效果。

将前端显示效果优化得更精致流畅,打造出价值20元/月的精品天气应用既视感。

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>精品天气卡片 - Premium Weather Cards</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            min-height: 100vh;
            background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            padding: 20px;
            overflow-x: auto;
        }

        .title {
            color: #fff;
            font-size: 2.5rem;
            font-weight: 300;
            margin-bottom: 10px;
            text-align: center;
            letter-spacing: 3px;
            text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
        }

        .subtitle {
            color: rgba(255, 255, 255, 0.5);
            font-size: 0.9rem;
            margin-bottom: 40px;
            letter-spacing: 2px;
        }

        .cards-container {
            display: flex;
            gap: 30px;
            flex-wrap: wrap;
            justify-content: center;
            max-width: 1400px;
        }

        .weather-card {
            width: 280px;
            height: 400px;
            border-radius: 30px;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        }

        .weather-card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
        }

        .weather-card.active {
            box-shadow: 0 0 40px rgba(255, 255, 255, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
        }

        /* 晴天卡片 */
        .sunny-card {
            background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
        }

        .sun {
            width: 100px;
            height: 100px;
            background: radial-gradient(circle, #ffd700 0%, #ff8c00 70%);
            border-radius: 50%;
            position: absolute;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            box-shadow: 0 0 60px #ffd700, 0 0 100px #ff8c00;
            animation: sunPulse 3s ease-in-out infinite;
        }

        @keyframes sunPulse {
            0%, 100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 60px #ffd700, 0 0 100px #ff8c00; }
            50% { transform: translateX(-50%) scale(1.1); box-shadow: 0 0 80px #ffd700, 0 0 120px #ff8c00; }
        }

        .sun-ray {
            position: absolute;
            width: 4px;
            height: 30px;
            background: linear-gradient(to bottom, rgba(255, 215, 0, 0.8), transparent);
            top: 50%;
            left: 50%;
            transform-origin: center bottom;
            animation: sunRayRotate 10s linear infinite;
        }

        .sun-ray:nth-child(1) { transform: translate(-50%, -100%) rotate(0deg); }
        .sun-ray:nth-child(2) { transform: translate(-50%, -100%) rotate(45deg); }
        .sun-ray:nth-child(3) { transform: translate(-50%, -100%) rotate(90deg); }
        .sun-ray:nth-child(4) { transform: translate(-50%, -100%) rotate(135deg); }
        .sun-ray:nth-child(5) { transform: translate(-50%, -100%) rotate(180deg); }
        .sun-ray:nth-child(6) { transform: translate(-50%, -100%) rotate(225deg); }
        .sun-ray:nth-child(7) { transform: translate(-50%, -100%) rotate(270deg); }
        .sun-ray:nth-child(8) { transform: translate(-50%, -100%) rotate(315deg); }

        @keyframes sunRayRotate {
            from { transform: translate(-50%, -100%) rotate(0deg); }
            to { transform: translate(-50%, -100%) rotate(360deg); }
        }

        .cloud {
            position: absolute;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 100px;
            opacity: 0.8;
        }

        .cloud::before,
        .cloud::after {
            content: '';
            position: absolute;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 100px;
        }

        .cloud1 {
            width: 80px;
            height: 30px;
            top: 180px;
            left: -80px;
            animation: cloudFloat1 15s linear infinite;
        }

        .cloud1::before {
            width: 40px;
            height: 40px;
            top: -20px;
            left: 10px;
        }

        .cloud1::after {
            width: 50px;
            height: 35px;
            top: -15px;
            right: 10px;
        }

        @keyframes cloudFloat1 {
            0% { left: -80px; }
            100% { left: 100%; }
        }

        .cloud2 {
            width: 60px;
            height: 25px;
            top: 220px;
            left: -60px;
            animation: cloudFloat2 20s linear infinite;
            animation-delay: 5s;
        }

        .cloud2::before {
            width: 35px;
            height: 35px;
            top: -18px;
            left: 8px;
        }

        .cloud2::after {
            width: 40px;
            height: 30px;
            top: -12px;
            right: 8px;
        }

        @keyframes cloudFloat2 {
            0% { left: -60px; }
            100% { left: 100%; }
        }

        /* 雨天卡片 */
        .rainy-card {
            background: linear-gradient(180deg, #2c3e50 0%, #4a5568 50%, #2d3748 100%);
        }

        .dark-cloud {
            position: absolute;
            background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
            border-radius: 100px;
            top: 40px;
            left: 50%;
            transform: translateX(-50%);
            width: 150px;
            height: 50px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        .dark-cloud::before,
        .dark-cloud::after {
            content: '';
            position: absolute;
            background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
            border-radius: 100px;
        }

        .dark-cloud::before {
            width: 70px;
            height: 70px;
            top: -35px;
            left: 20px;
        }

        .dark-cloud::after {
            width: 80px;
            height: 60px;
            top: -25px;
            right: 20px;
        }

        .rain-container {
            position: absolute;
            top: 100px;
            left: 0;
            right: 0;
            bottom: 0;
            overflow: hidden;
        }

        .raindrop {
            position: absolute;
            width: 2px;
            height: 15px;
            background: linear-gradient(to bottom, transparent, rgba(174, 194, 224, 0.8));
            border-radius: 2px;
            animation: rainFall linear infinite;
        }

        @keyframes rainFall {
            0% { transform: translateY(-20px); opacity: 0; }
            10% { opacity: 1; }
            90% { opacity: 1; }
            100% { transform: translateY(300px); opacity: 0; }
        }

        .puddle {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            width: 120px;
            height: 20px;
            background: rgba(174, 194, 224, 0.3);
            border-radius: 50%;
            animation: puddleRipple 2s ease-in-out infinite;
        }

        @keyframes puddleRipple {
            0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.3; }
            50% { transform: translateX(-50%) scale(1.1); opacity: 0.5; }
        }

        .lightning {
            position: absolute;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            width: 4px;
            height: 100px;
            background: linear-gradient(to bottom, #fff, #ffd700);
            clip-path: polygon(40% 0, 100% 0, 60% 40%, 80% 40%, 20% 100%, 40% 100%, 0 60%, 20% 60%);
            opacity: 0;
            animation: lightningFlash 4s ease-in-out infinite;
        }

        @keyframes lightningFlash {
            0%, 90%, 100% { opacity: 0; }
            92%, 96% { opacity: 1; }
            94% { opacity: 0.3; }
        }

        /* 雪天卡片 */
        .snowy-card {
            background: linear-gradient(180deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);
        }

        .snow-container {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            overflow: hidden;
        }

        .snowflake {
            position: absolute;
            color: #fff;
            font-size: 1em;
            opacity: 0.8;
            animation: snowFall linear infinite;
            text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
        }

        @keyframes snowFall {
            0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
            10% { opacity: 0.8; }
            90% { opacity: 0.8; }
            100% { transform: translateY(420px) rotate(360deg); opacity: 0; }
        }

        .snow-ground {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: linear-gradient(to top, rgba(255, 255, 255, 0.3), transparent);
            border-radius: 50% 50% 0 0 / 20px 20px 0 0;
        }

        .snow-hill {
            position: absolute;
            bottom: 0;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
            border-radius: 50% 50% 0 0;
        }

        .snow-hill1 {
            width: 200px;
            height: 80px;
            left: -50px;
        }

        .snow-hill2 {
            width: 180px;
            height: 60px;
            right: -30px;
        }

        /* 风天卡片 */
        .windy-card {
            background: linear-gradient(180deg, #2d3748 0%, #4a5568 50%, #718096 100%);
        }

        .wind-lines {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            overflow: hidden;
        }

        .wind-line {
            position: absolute;
            height: 2px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
            border-radius: 2px;
            animation: windBlow linear infinite;
        }

        @keyframes windBlow {
            0% { transform: translateX(-100%); opacity: 0; }
            10% { opacity: 1; }
            90% { opacity: 1; }
            100% { transform: translateX(300px); opacity: 0; }
        }

        .tree {
            position: absolute;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
        }

        .tree-trunk {
            width: 20px;
            height: 80px;
            background: linear-gradient(90deg, #4a3728, #6b4e3d);
            margin: 0 auto;
            border-radius: 0 0 5px 5px;
        }

        .tree-leaves {
            width: 120px;
            height: 100px;
            background: linear-gradient(180deg, #48bb78 0%, #2f855a 100%);
            border-radius: 50% 50% 45% 45%;
            position: relative;
            top: -20px;
            animation: treeSway 2s ease-in-out infinite;
            transform-origin: center bottom;
        }

        @keyframes treeSway {
            0%, 100% { transform: rotate(-3deg); }
            50% { transform: rotate(3deg); }
        }

        .tree-leaves::before,
        .tree-leaves::after {
            content: '';
            position: absolute;
            background: linear-gradient(180deg, #48bb78 0%, #2f855a 100%);
            border-radius: 50%;
        }

        .tree-leaves::before {
            width: 80px;
            height: 80px;
            top: -30px;
            left: -20px;
        }

        .tree-leaves::after {
            width: 80px;
            height: 80px;
            top: -30px;
            right: -20px;
        }

        .floating-cloud {
            position: absolute;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 100px;
            animation: cloudFloatFast 8s linear infinite;
        }

        .floating-cloud::before,
        .floating-cloud::after {
            content: '';
            position: absolute;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 100px;
        }

        .floating-cloud1 {
            width: 60px;
            height: 25px;
            top: 60px;
            left: -60px;
        }

        .floating-cloud1::before {
            width: 35px;
            height: 35px;
            top: -18px;
            left: 8px;
        }

        .floating-cloud1::after {
            width: 40px;
            height: 30px;
            top: -12px;
            right: 8px;
        }

        @keyframes cloudFloatFast {
            0% { left: -80px; }
            100% { left: 100%; }
        }

        /* 卡片信息 */
        .card-info {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 25px;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
            color: #fff;
        }

        .weather-type {
            font-size: 1.5rem;
            font-weight: 600;
            margin-bottom: 5px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .temperature {
            font-size: 3rem;
            font-weight: 300;
            margin-bottom: 5px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .description {
            font-size: 0.9rem;
            opacity: 0.8;
            text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
        }

        /* 控制按钮 */
        .controls {
            margin-top: 40px;
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .control-btn {
            padding: 12px 30px;
            border: none;
            border-radius: 25px;
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            letter-spacing: 1px;
        }

        .control-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        .control-btn.active {
            background: rgba(255, 255, 255, 0.3);
            box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
        }

        /* 粒子效果 */
        .particle {
            position: absolute;
            pointer-events: none;
            opacity: 0;
        }

        /* 响应式 */
        @media (max-width: 1200px) {
            .cards-container {
                gap: 20px;
            }
            .weather-card {
                width: 240px;
                height: 350px;
            }
        }

        @media (max-width: 768px) {
            .title {
                font-size: 1.8rem;
            }
            .weather-card {
                width: 100%;
                max-width: 300px;
                height: 380px;
            }
        }
    </style>
</head>
<body>
    <h1 class="title">Weather Cards</h1>
    <p class="subtitle">PREMIUM ANIMATED WEATHER EXPERIENCE</p>

    <div class="cards-container">
        <!-- 晴天卡片 -->
        <div class="weather-card sunny-card" data-weather="sunny" onclick="selectWeather('sunny')">
            <div class="sun">
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
                <div class="sun-ray"></div>
            </div>
            <div class="cloud cloud1"></div>
            <div class="cloud cloud2"></div>
            <div class="card-info">
                <div class="weather-type">晴天</div>
                <div class="temperature">28°</div>
                <div class="description">阳光明媚 · 微风</div>
            </div>
        </div>

        <!-- 雨天卡片 -->
        <div class="weather-card rainy-card" data-weather="rainy" onclick="selectWeather('rainy')">
            <div class="dark-cloud"></div>
            <div class="lightning"></div>
            <div class="rain-container" id="rainContainer"></div>
            <div class="puddle"></div>
            <div class="card-info">
                <div class="weather-type">降雨</div>
                <div class="temperature">18°</div>
                <div class="description">中雨 · 湿度 85%</div>
            </div>
        </div>

        <!-- 雪天卡片 -->
        <div class="weather-card snowy-card" data-weather="snowy" onclick="selectWeather('snowy')">
            <div class="snow-container" id="snowContainer"></div>
            <div class="snow-hill snow-hill1"></div>
            <div class="snow-hill snow-hill2"></div>
            <div class="snow-ground"></div>
            <div class="card-info">
                <div class="weather-type">下雪</div>
                <div class="temperature">-3°</div>
                <div class="description">大雪 · 积雪 5cm</div>
            </div>
        </div>

        <!-- 风天卡片 -->
        <div class="weather-card windy-card" data-weather="windy" onclick="selectWeather('windy')">
            <div class="wind-lines" id="windContainer"></div>
            <div class="floating-cloud floating-cloud1"></div>
            <div class="tree">
                <div class="tree-leaves"></div>
                <div class="tree-trunk"></div>
            </div>
            <div class="card-info">
                <div class="weather-type">大风</div>
                <div class="temperature">15°</div>
                <div class="description">西北风 · 6级</div>
            </div>
        </div>
    </div>

    <div class="controls">
        <button class="control-btn active" onclick="selectWeather('sunny')">☀️ 晴天</button>
        <button class="control-btn" onclick="selectWeather('rainy')">🌧️ 降雨</button>
        <button class="control-btn" onclick="selectWeather('snowy')">❄️ 下雪</button>
        <button class="control-btn" onclick="selectWeather('windy')">💨 大风</button>
        <button class="control-btn" onclick="toggleAnimation()">⏸️ 暂停/播放</button>
    </div>

    <script>
        // 全局动画状态
        let animationPaused = false;
        let currentWeather = 'sunny';

        // 初始化雨滴
        function createRaindrops() {
            const container = document.getElementById('rainContainer');
            container.innerHTML = '';
            for (let i = 0; i < 40; i++) {
                const drop = document.createElement('div');
                drop.className = 'raindrop';
                drop.style.left = Math.random() * 100 + '%';
                drop.style.animationDuration = (Math.random() * 0.5 + 0.5) + 's';
                drop.style.animationDelay = Math.random() * 2 + 's';
                drop.style.opacity = Math.random() * 0.5 + 0.5;
                container.appendChild(drop);
            }
        }

        // 初始化雪花
        function createSnowflakes() {
            const container = document.getElementById('snowContainer');
            container.innerHTML = '';
            const snowflakeSymbols = ['❄', '❅', '❆'];
            for (let i = 0; i < 50; i++) {
                const flake = document.createElement('div');
                flake.className = 'snowflake';
                flake.innerHTML = snowflakeSymbols[Math.floor(Math.random() * snowflakeSymbols.length)];
                flake.style.left = Math.random() * 100 + '%';
                flake.style.fontSize = (Math.random() * 10 + 10) + 'px';
                flake.style.animationDuration = (Math.random() * 3 + 2) + 's';
                flake.style.animationDelay = Math.random() * 5 + 's';
                flake.style.opacity = Math.random() * 0.6 + 0.4;
                container.appendChild(flake);
            }
        }

        // 初始化风线
        function createWindLines() {
            const container = document.getElementById('windContainer');
            container.innerHTML = '';
            for (let i = 0; i < 15; i++) {
                const line = document.createElement('div');
                line.className = 'wind-line';
                line.style.top = (Math.random() * 250 + 50) + 'px';
                line.style.width = (Math.random() * 100 + 50) + 'px';
                line.style.animationDuration = (Math.random() * 1 + 0.5) + 's';
                line.style.animationDelay = Math.random() * 2 + 's';
                container.appendChild(line);
            }
        }

        // 选择天气
        function selectWeather(weather) {
            currentWeather = weather;
            
            // 更新卡片状态
            document.querySelectorAll('.weather-card').forEach(card => {
                card.classList.remove('active');
                if (card.dataset.weather === weather) {
                    card.classList.add('active');
                }
            });

            // 更新按钮状态
            document.querySelectorAll('.control-btn').forEach((btn, index) => {
                btn.classList.remove('active');
                if (index < 4 && btn.textContent.includes(getWeatherEmoji(weather))) {
                    btn.classList.add('active');
                }
            });

            // 触发粒子效果
            createParticles(weather);
        }

        // 获取天气emoji
        function getWeatherEmoji(weather) {
            const emojis = {
                'sunny': '☀️',
                'rainy': '🌧️',
                'snowy': '❄️',
                'windy': '💨'
            };
            return emojis[weather] || '☀️';
        }

        // 创建粒子效果
        function createParticles(weather) {
            const colors = {
                'sunny': '#ffd700',
                'rainy': '#aec2e0',
                'snowy': '#ffffff',
                'windy': '#ffffff'
            };

            const card = document.querySelector(`[data-weather="${weather}"]`);
            const rect = card.getBoundingClientRect();

            for (let i = 0; i < 20; i++) {
                setTimeout(() => {
                    const particle = document.createElement('div');
                    particle.className = 'particle';
                    particle.style.width = '6px';
                    particle.style.height = '6px';
                    particle.style.background = colors[weather];
                    particle.style.borderRadius = '50%';
                    particle.style.left = (rect.width / 2) + 'px';
                    particle.style.top = (rect.height / 2) + 'px';
                    particle.style.boxShadow = `0 0 10px ${colors[weather]}`;
                    
                    const angle = (Math.PI * 2 * i) / 20;
                    const velocity = 100 + Math.random() * 100;
                    const tx = Math.cos(angle) * velocity;
                    const ty = Math.sin(angle) * velocity;
                    
                    particle.style.transition = 'all 0.8s ease-out';
                    card.appendChild(particle);
                    
                    requestAnimationFrame(() => {
                        particle.style.opacity = '1';
                        particle.style.transform = `translate(${tx}px, ${ty}px) scale(0)`;
                    });

                    setTimeout(() => particle.remove(), 800);
                }, i * 30);
            }
        }

        // 切换动画
        function toggleAnimation() {
            animationPaused = !animationPaused;
            document.querySelectorAll('.weather-card *').forEach(el => {
                el.style.animationPlayState = animationPaused ? 'paused' : 'running';
            });
        }

        // 鼠标跟随效果
        document.querySelectorAll('.weather-card').forEach(card => {
            card.addEventListener('mousemove', (e) => {
                const rect = card.getBoundingClientRect();
                const x = e.clientX - rect.left;
                const y = e.clientY - rect.top;
                
                const centerX = rect.width / 2;
                const centerY = rect.height / 2;
                
                const rotateX = (y - centerY) / 20;
                const rotateY = (centerX - x) / 20;
                
                card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) translateY(-10px) scale(1.02)`;
            });

            card.addEventListener('mouseleave', () => {
                card.style.transform = '';
            });
        });

        // 初始化
        document.addEventListener('DOMContentLoaded', () => {
            createRaindrops();
            createSnowflakes();
            createWindLines();
            selectWeather('sunny');
        });

        // 窗口大小改变时重新初始化
        window.addEventListener('resize', () => {
            createRaindrops();
            createSnowflakes();
            createWindLines();
        });
    </script>
</body>
</html>

3 个赞

色泽比glm4.7差点意思。就是多了个暂停播放 :distorted_face:

感觉一般诶

1 个赞


用老黄的k2.5 + cherrystudio 生成的

总结
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>iOS 18 Weather Cards</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        /* 引入 San Francisco 风格的系统字体栈 */
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
            background: #000;
            overflow-x: hidden;
        }

        /* iOS 18 液态玻璃材质基础 */
        .glass-card {
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(25px) saturate(180%);
            -webkit-backdrop-filter: blur(25px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.15);
            box-shadow: 
                0 25px 50px -12px rgba(0, 0, 0, 0.5),
                inset 0 0 0 1px rgba(255, 255, 255, 0.1);
            transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
            transform-style: preserve-3d;
            perspective: 1000px;
        }

        .glass-card:hover {
            transform: translateY(-8px) scale(1.02);
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.25);
            box-shadow: 
                0 35px 60px -15px rgba(0, 0, 0, 0.6),
                inset 0 0 0 1px rgba(255, 255, 255, 0.2);
        }

        /* 动态渐变背景动画 */
        .gradient-bg-sunny {
            background: linear-gradient(135deg, #FF8C42 0%, #FF6B6B 50%, #FFE66D 100%);
            background-size: 400% 400%;
            animation: gradientShift 8s ease infinite;
        }

        .gradient-bg-windy {
            background: linear-gradient(135deg, #4ECDC4 0%, #556270 50%, #8B9A9C 100%);
            background-size: 400% 400%;
            animation: gradientShift 10s ease infinite;
        }

        .gradient-bg-rain {
            background: linear-gradient(135deg, #203A43 0%, #2C5364 50%, #0F2027 100%);
            background-size: 400% 400%;
            animation: gradientShift 12s ease infinite;
        }

        .gradient-bg-snow {
            background: linear-gradient(135deg, #E6DADA 0%, #274046 50%, #5D6D7E 100%);
            background-size: 400% 400%;
            animation: gradientShift 15s ease infinite;
        }

        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* 太阳动画 - iOS 风格的光晕脉动 */
        .sun-core {
            background: radial-gradient(circle, #FFD700 0%, #FF8C00 70%);
            box-shadow: 
                0 0 40px rgba(255, 215, 0, 0.6),
                0 0 80px rgba(255, 140, 0, 0.4),
                inset -5px -5px 15px rgba(0,0,0,0.1);
            animation: sunPulse 4s ease-in-out infinite, rotate 20s linear infinite;
        }

        @keyframes sunPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.05); opacity: 0.9; }
        }

        @keyframes rotate {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* 云朵与风动画 */
        .cloud {
            background: rgba(255, 255, 255, 0.8);
            border-radius: 50px;
            filter: blur(1px);
            animation: float 6s ease-in-out infinite;
        }

        .wind-line {
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
            animation: windMove 2s linear infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px) translateX(0px); }
            50% { transform: translateY(-10px) translateX(5px); }
        }

        @keyframes windMove {
            0% { transform: translateX(-100%); opacity: 0; }
            50% { opacity: 1; }
            100% { transform: translateX(200%); opacity: 0; }
        }

        /* 雨滴动画系统 */
        .rain-container {
            overflow: hidden;
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            pointer-events: none;
        }

        .raindrop {
            position: absolute;
            width: 2px;
            height: 15px;
            background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.8));
            border-radius: 2px;
            animation: fall linear infinite;
        }

        @keyframes fall {
            to { transform: translateY(300px); }
        }

        /* 闪电效果 */
        .lightning {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.3);
            opacity: 0;
            animation: flash 5s infinite;
            pointer-events: none;
        }

        @keyframes flash {
            0%, 90%, 100% { opacity: 0; }
            92%, 96% { opacity: 0.3; }
            94% { opacity: 0; }
        }

        /* 雪花动画 */
        .snowflake {
            position: absolute;
            color: rgba(255, 255, 255, 0.9);
            font-size: 1em;
            animation: snowFall linear infinite;
            text-shadow: 0 0 5px rgba(255,255,255,0.8);
        }

        @keyframes snowFall {
            to { 
                transform: translateY(300px) rotate(360deg); 
            }
        }

        /* 温度数字滚动动画 */
        .temp-number {
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.05em;
        }

        /* 3D 倾斜效果容器 */
        .tilt-wrapper {
            transform-style: preserve-3d;
            transition: transform 0.1s ease-out;
        }

        /* 玻璃拟态文字效果 */
        .glass-text {
            text-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        /* 响应式优化 */
        @media (max-width: 1024px) {
            .weather-grid {
                overflow-x: auto;
                scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch;
                padding: 20px;
                gap: 20px;
            }
            .weather-card {
                scroll-snap-align: center;
                min-width: 280px;
            }
        }

        /* 动态模糊背景球体 */
        .ambient-orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.6;
            animation: orbFloat 10s ease-in-out infinite;
            z-index: -1;
        }

        @keyframes orbFloat {
            0%, 100% { transform: translate(0, 0) scale(1); }
            50% { transform: translate(20px, -20px) scale(1.1); }
        }

        /* 微交互动画类 */
        .interactive-element {
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .interactive-element:active {
            transform: scale(0.95);
        }
    </style>
</head>
<body class="bg-black min-h-screen flex items-center justify-center p-4 relative overflow-hidden">

    <!-- 环境光效背景 -->
    <div class="ambient-orb w-96 h-96 bg-orange-500 top-0 left-0"></div>
    <div class="ambient-orb w-80 h-80 bg-blue-500 bottom-0 right-0 animation-delay-2000"></div>
    <div class="ambient-orb w-64 h-64 bg-purple-500 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 animation-delay-4000"></div>

    <!-- 主容器 -->
    <div class="w-full max-w-7xl mx-auto">
        
        <!-- 标题区域 -->
        <div class="mb-8 text-center">
            <h1 class="text-4xl md:text-5xl font-bold text-white mb-2 tracking-tight glass-text">天气</h1>
            <p class="text-white/60 text-lg font-light">Weather</p>
        </div>

        <!-- 卡片网格 - 横向排列 -->
        <div class="weather-grid flex flex-col lg:flex-row gap-6 justify-center items-stretch">

            <!-- 卡片 1: 晴天 (Sunny) -->
            <article class="weather-card glass-card gradient-bg-sunny relative w-full lg:w-72 h-96 rounded-3xl overflow-hidden cursor-pointer group" data-tilt>
                <div class="absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black/20"></div>
                
                <div class="relative h-full p-6 flex flex-col justify-between z-10">
                    <!-- 顶部信息 -->
                    <div class="flex justify-between items-start">
                        <div>
                            <h2 class="text-white/90 text-2xl font-semibold tracking-tight">Cupertino</h2>
                            <p class="text-white/70 text-sm font-medium mt-1">加利福尼亚</p>
                        </div>
                        <div class="text-white/80 text-sm font-medium bg-white/10 px-3 py-1 rounded-full backdrop-blur-md border border-white/20">
                            现在
                        </div>
                    </div>

                    <!-- 天气图标区域 -->
                    <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-32 h-32 interactive-element">
                        <div class="sun-core w-full h-full rounded-full relative">
                            <div class="absolute inset-0 bg-gradient-to-tr from-yellow-300 to-transparent opacity-50 rounded-full blur-xl animate-pulse"></div>
                        </div>
                        <!-- 光芒射线 -->
                        <div class="absolute inset-0 animate-spin" style="animation-duration: 12s;">
                            <div class="absolute top-0 left-1/2 w-1 h-4 bg-yellow-200/80 rounded-full transform -translate-x-1/2 -translate-y-2 blur-sm"></div>
                            <div class="absolute bottom-0 left-1/2 w-1 h-4 bg-yellow-200/80 rounded-full transform -translate-x-1/2 translate-y-2 blur-sm"></div>
                            <div class="absolute left-0 top-1/2 w-4 h-1 bg-yellow-200/80 rounded-full transform -translate-x-2 -translate-y-1/2 blur-sm"></div>
                            <div class="absolute right-0 top-1/2 w-4 h-1 bg-yellow-200/80 rounded-full transform translate-x-2 -translate-y-1/2 blur-sm"></div>
                        </div>
                    </div>

                    <!-- 温度信息 -->
                    <div class="mt-auto">
                        <div class="flex items-end gap-2 mb-2">
                            <span class="temp-number text-6xl font-bold text-white tracking-tighter counter" data-target="28">0</span>
                            <span class="text-3xl font-light text-white/80 mb-2">°</span>
                        </div>
                        <p class="text-white/90 text-lg font-medium">晴朗</p>
                        <div class="flex gap-3 mt-3 text-white/70 text-sm font-medium">
                            <span>最高: 31°</span>
                            <span>最低: 22°</span>
                        </div>
                    </div>
                </div>
            </article>

            <!-- 卡片 2: 大风 (Windy) -->
            <article class="weather-card glass-card gradient-bg-windy relative w-full lg:w-72 h-96 rounded-3xl overflow-hidden cursor-pointer group" data-tilt>
                <div class="absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black/30"></div>
                
                <div class="relative h-full p-6 flex flex-col justify-between z-10">
                    <div class="flex justify-between items-start">
                        <div>
                            <h2 class="text-white/90 text-2xl font-semibold tracking-tight">芝加哥</h2>
                            <p class="text-white/70 text-sm font-medium mt-1">伊利诺伊州</p>
                        </div>
                        <div class="text-white/80 text-sm font-medium bg-white/10 px-3 py-1 rounded-full backdrop-blur-md border border-white/20">
                            阵风
                        </div>
                    </div>

                    <!-- 风与云动画 -->
                    <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-full h-32 interactive-element">
                        <!-- 云朵 -->
                        <div class="cloud absolute w-20 h-8 top-4 left-8 opacity-80" style="animation-delay: 0s;"></div>
                        <div class="cloud absolute w-16 h-6 top-12 right-8 opacity-60" style="animation-delay: 1s; animation-duration: 8s;"></div>
                        
                        <!-- 风线 -->
                        <div class="wind-line absolute w-24 h-0.5 top-8 left-0 rounded-full" style="animation-delay: 0s;"></div>
                        <div class="wind-line absolute w-32 h-0.5 top-16 left-4 rounded-full" style="animation-delay: 0.5s;"></div>
                        <div class="wind-line absolute w-20 h-0.5 top-24 left-12 rounded-full" style="animation-delay: 1s;"></div>
                    </div>

                    <div class="mt-auto">
                        <div class="flex items-end gap-2 mb-2">
                            <span class="temp-number text-6xl font-bold text-white tracking-tighter counter" data-target="18">0</span>
                            <span class="text-3xl font-light text-white/80 mb-2">°</span>
                        </div>
                        <p class="text-white/90 text-lg font-medium">大风</p>
                        <div class="flex items-center gap-2 mt-3 text-white/70 text-sm font-medium">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                            <span>风速 35 km/h</span>
                        </div>
                    </div>
                </div>
            </article>

            <!-- 卡片 3: 暴雨 (Heavy Rain) -->
            <article class="weather-card glass-card gradient-bg-rain relative w-full lg:w-72 h-96 rounded-3xl overflow-hidden cursor-pointer group" data-tilt>
                <div class="lightning"></div>
                <div class="absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black/40"></div>
                
                <div class="relative h-full p-6 flex flex-col justify-between z-10">
                    <div class="flex justify-between items-start">
                        <div>
                            <h2 class="text-white/90 text-2xl font-semibold tracking-tight">伦敦</h2>
                            <p class="text-white/70 text-sm font-medium mt-1">英格兰</p>
                        </div>
                        <div class="text-white/80 text-sm font-medium bg-white/10 px-3 py-1 rounded-full backdrop-blur-md border border-white/20">
                            预警
                        </div>
                    </div>

                    <!-- 雨滴容器 -->
                    <div class="rain-container" id="rainContainer"></div>

                    <!-- 云图标 -->
                    <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 interactive-element">
                        <div class="relative w-28 h-16">
                            <div class="absolute inset-0 bg-gray-700 rounded-full blur-md opacity-80"></div>
                            <div class="absolute inset-0 bg-gradient-to-b from-gray-400 to-gray-600 rounded-full shadow-2xl"></div>
                            <div class="absolute -top-4 left-4 w-12 h-12 bg-gray-400 rounded-full"></div>
                            <div class="absolute -top-2 right-6 w-10 h-10 bg-gray-500 rounded-full"></div>
                        </div>
                    </div>

                    <div class="mt-auto relative z-20">
                        <div class="flex items-end gap-2 mb-2">
                            <span class="temp-number text-6xl font-bold text-white tracking-tighter counter" data-target="12">0</span>
                            <span class="text-3xl font-light text-white/80 mb-2">°</span>
                        </div>
                        <p class="text-white/90 text-lg font-medium">暴雨</p>
                        <div class="flex items-center gap-2 mt-3 text-white/70 text-sm font-medium">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
                            </svg>
                            <span>降雨量 24mm</span>
                        </div>
                    </div>
                </div>
            </article>

            <!-- 卡片 4: 暴雪 (Heavy Snow) -->
            <article class="weather-card glass-card gradient-bg-snow relative w-full lg:w-72 h-96 rounded-3xl overflow-hidden cursor-pointer group" data-tilt>
                <div class="absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black/30"></div>
                
                <div class="relative h-full p-6 flex flex-col justify-between z-10">
                    <div class="flex justify-between items-start">
                        <div>
                            <h2 class="text-white/90 text-2xl font-semibold tracking-tight">札幌</h2>
                            <p class="text-white/70 text-sm font-medium mt-1">北海道</p>
                        </div>
                        <div class="text-white/80 text-sm font-medium bg-white/10 px-3 py-1 rounded-full backdrop-blur-md border border-white/20">
                            严寒
                        </div>
                    </div>

                    <!-- 雪花容器 -->
                    <div class="snow-container absolute inset-0 overflow-hidden pointer-events-none" id="snowContainer"></div>

                    <!-- 雪云 -->
                    <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 interactive-element">
                        <div class="relative w-32 h-20">
                            <div class="absolute inset-0 bg-gradient-to-b from-white/90 to-white/60 rounded-full blur-sm"></div>
                            <div class="absolute top-2 left-2 w-10 h-10 bg-white rounded-full opacity-80"></div>
                            <div class="absolute top-0 right-4 w-12 h-12 bg-white rounded-full opacity-90"></div>
                            <div class="absolute bottom-0 left-1/2 transform -translate-x-1/2 w-24 h-12 bg-white rounded-full"></div>
                        </div>
                    </div>

                    <div class="mt-auto">
                        <div class="flex items-end gap-2 mb-2">
                            <span class="temp-number text-6xl font-bold text-white tracking-tighter counter" data-target="-5">0</span>
                            <span class="text-3xl font-light text-white/80 mb-2">°</span>
                        </div>
                        <p class="text-white/90 text-lg font-medium">暴雪</p>
                        <div class="flex items-center gap-2 mt-3 text-white/70 text-sm font-medium">
                            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
                            </svg>
                            <span>风寒 -12°</span>
                        </div>
                    </div>
                </div>
            </article>

        </div>

        <!-- 底部状态栏 -->
        <div class="mt-8 text-center text-white/40 text-sm font-light tracking-wide">
            <p>基于 iOS 18 Liquid Glass 设计语言构建</p>
        </div>
    </div>

    <script>
        // 3D 倾斜效果(Tilt Effect)- 模拟 iOS 的触觉反馈
        const cards = document.querySelectorAll('[data-tilt]');
        
        cards.forEach(card => {
            card.addEventListener('mousemove', (e) => {
                const rect = card.getBoundingClientRect();
                const x = e.clientX - rect.left;
                const y = e.clientY - rect.top;
                
                const centerX = rect.width / 2;
                const centerY = rect.height / 2;
                
                const rotateX = (y - centerY) / 10;
                const rotateY = (centerX - x) / 10;
                
                card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) translateZ(10px) scale(1.02)`;
            });
            
            card.addEventListener('mouseleave', () => {
                card.style.transform = 'perspective(1000px) rotateX(0) rotateY(0) translateZ(0) scale(1)';
            });
            
            card.addEventListener('mouseenter', () => {
                // 触觉反馈(如果设备支持)
                if (navigator.vibrate) {
                    navigator.vibrate(5);
                }
            });
        });

        // 数字递增动画 - 温度显示
        const counters = document.querySelectorAll('.counter');
        counters.forEach(counter => {
            const target = parseInt(counter.getAttribute('data-target'));
            const duration = 1500; // 1.5秒
            const start = 0;
            const increment = target / (duration / 16); // 60fps
            
            let current = start;
            const updateCounter = () => {
                current += increment;
                if ((increment > 0 && current < target) || (increment < 0 && current > target)) {
                    counter.innerText = Math.round(current);
                    requestAnimationFrame(updateCounter);
                } else {
                    counter.innerText = target;
                }
            };
            
            updateCounter();
        });

        // 生成雨滴
        const rainContainer = document.getElementById('rainContainer');
        for (let i = 0; i < 40; i++) {
            const drop = document.createElement('div');
            drop.className = 'raindrop';
            drop.style.left = Math.random() * 100 + '%';
            drop.style.animationDuration = (Math.random() * 0.5 + 0.5) + 's';
            drop.style.animationDelay = Math.random() * 2 + 's';
            drop.style.opacity = Math.random() * 0.5 + 0.3;
            rainContainer.appendChild(drop);
        }

        // 生成雪花
        const snowContainer = document.getElementById('snowContainer');
        const snowflakes = ['❄', '❅', '❆'];
        for (let i = 0; i < 30; i++) {
            const flake = document.createElement('div');
            flake.className = 'snowflake';
            flake.innerHTML = snowflakes[Math.floor(Math.random() * snowflakes.length)];
            flake.style.left = Math.random() * 100 + '%';
            flake.style.animationDuration = (Math.random() * 3 + 2) + 's';
            flake.style.animationDelay = Math.random() * 5 + 's';
            flake.style.fontSize = (Math.random() * 10 + 10) + 'px';
            flake.style.opacity = Math.random() * 0.7 + 0.3;
            snowContainer.appendChild(flake);
        }

        // 点击卡片的涟漪效果(Ripple Effect)
        cards.forEach(card => {
            card.addEventListener('click', function(e) {
                const rect = card.getBoundingClientRect();
                const x = e.clientX - rect.left;
                const y = e.clientY - rect.top;
                
                const ripple = document.createElement('div');
                ripple.style.position = 'absolute';
                ripple.style.width = '0';
                ripple.style.height = '0';
                ripple.style.borderRadius = '50%';
                ripple.style.background = 'rgba(255, 255, 255, 0.4)';
                ripple.style.transform = 'translate(-50%, -50%)';
                ripple.style.left = x + 'px';
                ripple.style.top = y + 'px';
                ripple.style.animation = 'ripple 0.6s ease-out';
                ripple.style.pointerEvents = 'none';
                
                card.appendChild(ripple);
                
                setTimeout(() => ripple.remove(), 600);
            });
        });

        // 添加涟漪动画样式
        const style = document.createElement('style');
        style.textContent = `
            @keyframes ripple {
                to {
                    width: 200px;
                    height: 200px;
                    opacity: 0;
                }
            }
        `;
        document.head.appendChild(style);

        // 环境光效跟随鼠标
        document.addEventListener('mousemove', (e) => {
            const orbs = document.querySelectorAll('.ambient-orb');
            const x = e.clientX / window.innerWidth;
            const y = e.clientY / window.innerHeight;
            
            orbs.forEach((orb, index) => {
                const speed = (index + 1) * 20;
                const xOffset = (0.5 - x) * speed;
                const yOffset = (0.5 - y) * speed;
                orb.style.transform = `translate(${xOffset}px, ${yOffset}px)`;
            });
        });
    </script>
</body>
</html>```
1 个赞

确实 回去翻了下glm4.7的 就感觉k2.5的一般了 :distorted_face:

色泽搭配感觉有点小怪 :distorted_face:

换成安卓工程师呢 :distorted_face:

UI一般,差点意思