Coins have been an integral part of human history, serving as both currency and cultural artifacts. From ancient civilizations to modern economies, they offer a fascinating glimpse into the evolution of trade and society.
This article explores ten notable examples of coins, each with its own unique story and significance. Whether you're a numismatist or simply curious, these coins provide a window into different eras and regions.
CODE1
Here's the code:
CODETEXT1
CODE2
Here's the code:
CODETEXT2
CODE3
Here's the code:
CODETEXT3
CODE4
Here's the code:
CODETEXT4
CODE5
Here's the code:
CODETEXT5
Designing your own coin has never been easier with Subframe. Its drag-and-drop interface and intuitive, responsive canvas ensure pixel-perfect UI every time. Loved by designers and developers alike, Subframe makes the design process seamless and efficient.
Start for free and bring your coin designs to life today!
CODE6
Here's the code:
CODETEXT6
CODE7
Here's the code:
CODETEXT7
CODE8
Here's the code:
CODETEXT8
CODE9
Here's the code:
CODETEXT9
CODE10
Here's the code:
CODETEXT10
Ready to elevate your UI designs? With Subframe, you can create stunning, pixel-perfect interfaces in minutes. Its drag-and-drop editor and beautifully crafted components make the design process efficient and enjoyable.
Don't wait—start for free and bring your creative visions to life immediately!
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Crypto Dashboard</title> <style> :root { --bg-primary: #0d1117; --bg-secondary: #161b22; --text-primary: #f0f6fc; --text-secondary: #8b949e; --accent-blue: #58a6ff; --accent-green: #3fb950; --accent-red: #f85149; --accent-purple: #bc8cff; --accent-yellow: #f0883e; --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3); --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --transition-fast: 0.2s ease; --transition-base: 0.3s ease; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } body { background-color: var(--bg-primary); color: var(--text-primary); display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow-x: hidden; } .dashboard { width: 100%; max-width: 700px; height: 700px; background-color: var(--bg-secondary); border-radius: var(--radius-md); padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; box-shadow: var(--shadow-md); position: relative; } .header { display: flex; justify-content: space-between; align-items: center; } .header h1 { font-size: 24px; font-weight: 700; } .toggle-view { background: none; border: none; color: var(--accent-blue); font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: var(--transition-fast); } .toggle-view:hover { opacity: 0.8; } .portfolio-summary { background: linear-gradient(145deg, #1a1f29, #1f2632); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); } .portfolio-total { font-size: 32px; font-weight: 700; margin-bottom: 8px; } .portfolio-change { font-size: 14px; color: var(--accent-green); display: flex; align-items: center; gap: 4px; } .crypto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; } .crypto-coin { background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)); border-radius: var(--radius-md); padding: 16px; position: relative; transition: transform var(--transition-base), box-shadow var(--transition-base); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center; height: 180px; justify-content: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .crypto-coin:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); } .crypto-coin::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius-md); padding: 2px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; } .coin-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 24px; font-weight: 700; margin-bottom: 12px; position: relative; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); background-position: center; background-size: 70%; background-repeat: no-repeat; transition: transform var(--transition-base); } .crypto-coin:hover .coin-icon { transform: rotate(15deg); } .coin-icon::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; box-shadow: inset 0 4px 8px rgba(255, 255, 255, 0.1); pointer-events: none; } .btc .coin-icon { background: linear-gradient(135deg, #F7931A, #F7931A); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M23.638 14.904c-1.602 6.43-8.113 10.34-14.542 8.736C2.67 22.05-1.244 15.525.362 9.105 1.962 2.67 8.475-1.243 14.9.358c6.43 1.605 10.342 8.115 8.738 14.548v-.002zm-6.35-4.613c.24-1.59-.974-2.45-2.64-3.03l.54-2.153-1.315-.33-.525 2.107c-.345-.087-.705-.167-1.064-.25l.526-2.127-1.32-.33-.54 2.165c-.285-.067-.565-.132-.84-.2l-1.815-.45-.35 1.4s.975.225.955.236c.535.136.63.486.615.766l-1.477 5.92c-.075.166-.24.406-.614.314.015.02-.96-.24-.96-.24l-.66 1.51 1.71.426.93.242-.54 2.19 1.32.327.54-2.17c.36.1.705.19 1.05.273l-.51 2.154 1.32.33.545-2.19c2.24.427 3.93.257 4.64-1.774.57-1.637-.03-2.58-1.217-3.196.854-.193 1.5-.76 1.68-1.93h.01zm-3.01 4.22c-.404 1.64-3.157.75-4.05.53l.72-2.9c.896.23 3.757.67 3.33 2.37zm.41-4.24c-.37 1.49-2.662.735-3.405.55l.654-2.64c.744.18 3.137.524 2.75 2.084v.006z'/%3E%3C/svg%3E"); } .eth .coin-icon { background: linear-gradient(135deg, #627EEA, #3C3C3D); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z'/%3E%3C/svg%3E"); } .sol .coin-icon { background: linear-gradient(135deg, #9945FF, #14F195); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 397.7 311.7' fill='%23ffffff'%3E%3Cpath d='M64.6 237.9c2.4-2.4 5.7-3.8 9.2-3.8h317.4c5.8 0 8.7 7 4.6 11.1l-62.7 62.7c-2.4 2.4-5.7 3.8-9.2 3.8H6.5c-5.8 0-8.7-7-4.6-11.1l62.7-62.7zM64.6 3.8C67.1 1.4 70.4 0 73.8 0h317.4c5.8 0 8.7 7 4.6 11.1l-62.7 62.7c-2.4 2.4-5.7 3.8-9.2 3.8H6.5c-5.8 0-8.7-7-4.6-11.1L64.6 3.8zM333.1 120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8 0-8.7 7-4.6 11.1l62.7 62.7c2.4 2.4 5.7 3.8 9.2 3.8h317.4c5.8 0 8.7-7 4.6-11.1l-62.7-62.7z'/%3E%3C/svg%3E"); } .ada .coin-icon { background: linear-gradient(135deg, #0033AD, #0033AD); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 0c-.73 0-1.755.428-2.412 1.472L4.265 9.97c-.93 1.523-.54 3.494.764 4.798l.69.69a1.497 1.497 0 0 1 0 2.119l-.69.69a1.496 1.496 0 0 1-2.118 0l-.345-.344a1.497 1.497 0 0 1 0-2.119l.345-.345a.499.499 0 0 0 0-.707l-.345-.345a.499.499 0 0 0-.707 0l-.345.345a2.493 2.493 0 0 0 0 3.534l.345.344a2.493 2.493 0 0 0 3.533 0l.69-.69a2.474 2.474 0 0 0 .604-2.5 3.486 3.486 0 0 0 3.9.286l.689-.4a3.486 3.486 0 0 0 1.524-2.399 3.486 3.486 0 0 0 2.822 1.131 3.487 3.487 0 0 0 2.822-1.131 3.486 3.486 0 0 0 1.524 2.398l.69.4a3.486 3.486 0 0 0 3.9-.285 2.493 2.493 0 0 0 .603 2.5l.69.689a2.493 2.493 0 0 0 3.534 0l.344-.344a2.494 2.494 0 0 0 0-3.534l-.344-.345a.499.499 0 0 0-.708 0l-.345.345a.499.499 0 0 0 0 .707l-.344.344a1.497 1.497 0 0 1-2.12 0l-.689-.69a1.496 1.496 0 0 1 0-2.118l.69-.69c1.304-1.305 1.693-3.276.764-4.799l-5.323-8.496C13.754.428 12.73 0 12 0zm0 12c-.828 0-1.5.672-1.5 1.5S11.172 15 12 15s1.5-.672 1.5-1.5S12.828 12 12 12z'/%3E%3C/svg%3E"); } .dot .coin-icon { background: linear-gradient(135deg, #E6007A, #E6007A); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z'/%3E%3Ccircle cx='12' cy='12' r='5' fill='%23ffffff'/%3E%3C/svg%3E"); } .link .coin-icon { background: linear-gradient(135deg, #2A5ADA, #2A5ADA); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='%23ffffff'%3E%3Cpath d='M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0zm0 6l-1.799 1.055L9.3 9.945 7.5 11v10l1.799 1.055 4.947 2.89L16.045 26l1.799-1.055 4.857-2.89L24.5 21V11l-1.799-1.055-4.902-2.89L16 6zm0 2.22l.846.495 3.91 2.33.844.505v7.9l-.844.505-3.955 2.34-.801.475-.846-.495-3.91-2.33-.844-.505v-7.9l.844-.505 3.955-2.34.801-.475zm-4.292 6.62v2.725l2.336 1.405 2.335-1.405v-2.725l-2.335-1.405-2.336 1.405z'/%3E%3C/svg%3E"); } .coin-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; } .coin-price { font-size: 18px; font-weight: 600; margin-bottom: 2px; } .coin-change { font-size: 12px; padding: 2px 8px; border-radius: 12px; margin-top: 4px; } .change-up { background-color: rgba(63, 185, 80, 0.15); color: var(--accent-green); } .change-down { background-color: rgba(248, 81, 73, 0.15); color: var(--accent-red); } .coin-details { display: none; position: absolute; bottom: -90px; left: 0; right: 0; background: rgba(22, 27, 34, 0.95); backdrop-filter: blur(6px); padding: 16px; border-radius: 0 0 var(--radius-md) var(--radius-md); transition: transform var(--transition-base); transform: translateY(0); z-index: 10; box-shadow: var(--shadow-md); border-top: 1px solid rgba(255, 255, 255, 0.1); } .crypto-coin:hover .coin-details { display: block; transform: translateY(-90px); } .detail-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; } .detail-label { color: var(--text-secondary); } .detail-value { font-weight: 600; } .market-trends { border-radius: var(--radius-md); background: linear-gradient(145deg, #1a1f29, #1f2632); padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; } .market-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .market-title { font-size: 16px; font-weight: 700; } .market-timeframe { display: flex; gap: 4px; } .timeframe-btn { background: rgba(255, 255, 255, 0.05); border: none; color: var(--text-secondary); font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer; transition: var(--transition-fast); } .timeframe-btn.active { background: var(--accent-blue); color: var(--text-primary); } .chart-container { height: 180px; position: relative; margin-top: 10px; } .chart-canvas { width: 100%; height: 100%; } .add-to-watchlist { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: var(--transition-fast); opacity: 0; z-index: 5; } .crypto-coin:hover .add-to-watchlist { opacity: 1; } .add-to-watchlist:hover { background: rgba(255, 255, 255, 0.2); } .star-icon { width: 14px; height: 14px; fill: var(--text-secondary); transition: var(--transition-fast); } .add-to-watchlist:hover .star-icon { fill: var(--accent-yellow); } .tabbed-view { display: flex; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 16px; } .tab { padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; position: relative; transition: var(--transition-fast); } .tab.active { color: var(--text-primary); } .tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background-color: var(--accent-blue); border-radius: 2px 2px 0 0; } .tab:hover:not(.active) { color: var(--text-primary); background-color: rgba(255, 255, 255, 0.03); } .footer { display: flex; justify-content: center; color: var(--text-secondary); font-size: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.05); } .pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: var(--accent-green); margin-right: 6px; position: relative; } .pulse::after { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; background-color: var(--accent-green); animation: pulse 2s infinite; opacity: 0.6; } @keyframes pulse { 0% { transform: scale(1); opacity: 0.6; } 70% { transform: scale(2); opacity: 0; } 100% { transform: scale(2.5); opacity: 0; } } /* Loading animation */ .loading { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; background-color: var(--bg-secondary); z-index: 100; transition: opacity 0.5s ease, visibility 0.5s ease; } .loading.hidden { opacity: 0; visibility: hidden; } .coin-loader { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(145deg, var(--accent-blue), var(--accent-purple)); display: flex; justify-content: center; align-items: center; position: relative; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); animation: rotate 2s infinite linear; } .coin-loader::before { content: "$"; color: white; font-size: 30px; font-weight: bold; position: relative; z-index: 2; } .coin-loader::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg-secondary); } .loading-text { font-size: 16px; font-weight: 600; margin-top: 10px; color: var(--text-primary); } @keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Mobile responsiveness */ @media (max-width: 480px) { .dashboard { padding: 16px; } .header h1 { font-size: 20px; } .portfolio-total { font-size: 24px; } .crypto-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; } .crypto-coin { height: 150px; padding: 12px 8px; } .coin-icon { width: 50px; height: 50px; font-size: 20px; } .coin-name { font-size: 14px; } .coin-price { font-size: 16px; } .market-trends { padding: 14px; } .chart-container { height: 140px; } } /* Custom scrollbar */ .dashboard::-webkit-scrollbar { width: 6px; } .dashboard::-webkit-scrollbar-track { background: var(--bg-secondary); } .dashboard::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.1); border-radius: 6px; } .dashboard::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.2); } </style> </head> <body> <div class="dashboard"> <div class="loading" id="loadingScreen"> <div class="coin-loader"></div> <div class="loading-text">Loading your crypto assets...</div> </div> <div class="header"> <h1>Crypto Dashboard</h1> <button class="toggle-view"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <line x1="4" y1="21" x2="4" y2="14"></line> <line x1="4" y1="10" x2="4" y2="3"></line> <line x1="12" y1="21" x2="12" y2="12"></line> <line x1="12" y1="8" x2="12" y2="3"></line> <line x1="20" y1="21" x2="20" y2="16"></line> <line x1="20" y1="12" x2="20" y2="3"></line> <line x1="1" y1="14" x2="7" y2="14"></line> <line x1="9" y1="8" x2="15" y2="8"></line> <line x1="17" y1="16" x2="23" y2="16"></line> </svg> Customize </button> </div> <div class="portfolio-summary"> <div class="portfolio-total">$24,892.51</div> <div class="portfolio-change"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <polyline points="18 15 12 9 6 15"></polyline> </svg> +3.42% ($826.91) today </div> </div> <div class="tabbed-view"> <div class="tab active">Portfolio</div> <div class="tab">Watchlist</div> <div class="tab">Trends</div> </div> <div class="crypto-grid"> <div class="crypto-coin btc"> <div class="add-to-watchlist"> <svg class="star-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path> </svg> </div> <div class="coin-icon"></div> <div class="coin-name">Bitcoin</div> <div class="coin-price">$37,429.52</div> <div class="coin-change change-up">+2.8%</div> <div class="coin-details"> <div class="detail-row"> <span class="detail-label">Market Cap</span> <span class="detail-value">$732.6B</span> </div> <div class="detail-row"> <span class="detail-label">24h Volume</span> <span class="detail-value">$28.7B</span> </div> <div class="detail-row"> <span class="detail-label">Your Holdings</span> <span class="detail-value">0.421 BTC</span> </div> </div> </div> <div class="crypto-coin eth"> <div class="add-to-watchlist"> <svg class="star-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path> </svg> </div> <div class="coin-icon"></div> <div class="coin-name">Ethereum</div> <div class="coin-price">$2,018.74</div> <div class="coin-change change-up">+5.2%</div> <div class="coin-details"> <div class="detail-row"> <span class="detail-label">Market Cap</span> <span class="detail-value">$243.2B</span> </div> <div class="detail-row"> <span class="detail-label">24h Volume</span> <span class="detail-value">$15.4B</span> </div> <div class="detail-row"> <span class="detail-label">Your Holdings</span> <span class="detail-value">3.87 ETH</span> </div> </div> </div> <div class="crypto-coin sol"> <div class="add-to-watchlist"> <svg class="star-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path> </svg> </div> <div class="coin-icon"></div> <div class="coin-name">Solana</div> <div class="coin-price">$71.23</div> <div class="coin-change change-up">+8.7%</div> <div class="coin-details"> <div class="detail-row"> <span class="detail-label">Market Cap</span> <span class="detail-value">$31.7B</span> </div> <div class="detail-row"> <span class="detail-label">24h Volume</span> <span class="detail-value">$2.9B</span> </div> <div class="detail-row"> <span class="detail-label">Your Holdings</span> <span class="detail-value">45.2 SOL</span> </div> </div> </div> <div class="crypto-coin ada"> <div class="add-to-watchlist"> <svg class="star-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path> </svg> </div> <div class="coin-icon"></div> <div class="coin-name">Cardano</div> <div class="coin-price">$0.386</div> <div class="coin-change change-down">-1.2%</div> <div class="coin-details"> <div class="detail-row"> <span class="detail-label">Market Cap</span> <span class="detail-value">$13.6B</span> </div> <div class="detail-row"> <span class="detail-label">24h Volume</span> <span class="detail-value">$376.2M</span> </div> <div class="detail-row"> <span class="detail-label">Your Holdings</span> <span class="detail-value">1,250 ADA</span> </div> </div> </div> <div class="crypto-coin dot"> <div class="add-to-watchlist"> <svg class="star-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path> </svg> </div> <div class="coin-icon"></div> <div class="coin-name">Polkadot</div> <div class="coin-price">$5.93</div> <div class="coin-change change-up">+0.8%</div> <div class="coin-details"> <div class="detail-row"> <span class="detail-label">Market Cap</span> <span class="detail-value">$7.9B</span> </div> <div class="detail-row"> <span class="detail-label">24h Volume</span> <span class="detail-value">$192.4M</span> </div> <div class="detail-row"> <span class="detail-label">Your Holdings</span> <span class="detail-value">82.6 DOT</span> </div> </div> </div> <div class="crypto-coin link"> <div class="add-to-watchlist"> <svg class="star-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path> </svg> </div> <div class="coin-icon"></div> <div class="coin-name">Chainlink</div> <div class="coin-price">$14.72</div> <div class="coin-change change-up">+3.4%</div> <div class="coin-details"> <div class="detail-row"> <span class="detail-label">Market Cap</span> <span class="detail-value">$8.7B</span> </div> <div class="detail-row"> <span class="detail-label">24h Volume</span> <span class="detail-value">$424.8M</span> </div> <div class="detail-row"> <span class="detail-label">Your Holdings</span> <span class="detail-value">36.4 LINK</span> </div> </div> </div> </div> <div class="market-trends"> <div class="market-header"> <div class="market-title">Bitcoin Price Chart</div> <div class="market-timeframe"> <button class="timeframe-btn">1D</button> <button class="timeframe-btn active">1W</button> <button class="timeframe-btn">1M</button> <button class="timeframe-btn">1Y</button> </div> </div> <div class="chart-container"> <canvas id="priceChart" class="chart-canvas"></canvas> </div> </div> <div class="footer"> <div class="pulse"></div> Live data syncing • Last updated: Just now
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Gaming Rewards Interface</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #121212; overflow: hidden; position: relative; } .container { width: 650px; height: 650px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; position: relative; padding: 20px; } .header { text-align: center; color: #fff; z-index: 10; margin-bottom: 10px; } .header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 10px; color: #FFD700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.7); } .header p { font-size: 1rem; color: #ccc; margin-bottom: 20px; } .coins-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; max-width: 600px; z-index: 10; } .coin-card { background: rgba(25, 25, 35, 0.8); border-radius: 15px; padding: 20px; display: flex; flex-direction: column; align-items: center; position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; overflow: hidden; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1); } .coin-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4); } .coin-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient( to bottom right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100% ); transform: rotate(45deg); z-index: 1; transition: all 0.6s ease; opacity: 0; } .coin-card:hover::before { animation: shine 1s; opacity: 1; } .coin { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; font-weight: bold; position: relative; z-index: 2; transition: all 0.3s ease; } .coin svg { width: 100%; height: 100%; } .coin-card:hover .coin { transform: rotateY(180deg) scale(1.1); } .coin-info { text-align: center; color: #fff; z-index: 2; } .coin-info h3 { font-size: 1.2rem; margin-bottom: 5px; font-weight: 600; } .coin-info p { font-size: 0.85rem; color: #aaa; margin-bottom: 10px; } .collect-btn { background: linear-gradient(45deg, #FF4500, #FF8C00); border: none; color: white; padding: 8px 16px; border-radius: 20px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; z-index: 2; font-size: 0.85rem; box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3); } .collect-btn:hover { transform: scale(1.05); box-shadow: 0 7px 20px rgba(255, 69, 0, 0.5); } .coin-gold { background: linear-gradient(45deg, #FFD700, #FFA500); box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); } .coin-silver { background: linear-gradient(45deg, #C0C0C0, #A9A9A9); box-shadow: 0 0 20px rgba(192, 192, 192, 0.6); } .coin-bronze { background: linear-gradient(45deg, #CD7F32, #8B4513); box-shadow: 0 0 20px rgba(205, 127, 50, 0.6); } .coin-emerald { background: linear-gradient(45deg, #50C878, #046307); box-shadow: 0 0 20px rgba(80, 200, 120, 0.6); } .coin-ruby { background: linear-gradient(45deg, #E0115F, #8B0000); box-shadow: 0 0 20px rgba(224, 17, 95, 0.6); } .coin-sapphire { background: linear-gradient(45deg, #0F52BA, #000080); box-shadow: 0 0 20px rgba(15, 82, 186, 0.6); } .achievement-bar { width: 100%; max-width: 600px; background: rgba(25, 25, 35, 0.5); height: 15px; border-radius: 10px; margin-top: 25px; position: relative; overflow: hidden; z-index: 10; } .achievement-progress { height: 100%; width: 65%; background: linear-gradient(90deg, #FF4500, #FFA500); border-radius: 10px; position: relative; transition: width 1s ease; } .achievement-progress::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient( 90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100% ); animation: shine-progress 2s infinite; } .achievement-label { color: #fff; font-size: 0.9rem; margin-top: 5px; display: flex; justify-content: space-between; width: 100%; max-width: 600px; z-index: 10; } .particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; } .particle { position: absolute; width: 10px; height: 10px; border-radius: 50%; background-color: rgba(255, 215, 0, 0.3); pointer-events: none; } @keyframes shine { 0% { left: -100%; opacity: 0; } 20% { opacity: 1; } 100% { left: 100%; opacity: 0; } } @keyframes shine-progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } } @keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } } .coin-collect-animation { animation: collect 0.8s ease-in-out; } @keyframes collect { 0% { transform: scale(1); } 50% { transform: scale(1.5) rotate(180deg); } 70% { transform: scale(0.8) rotate(270deg); } 100% { transform: scale(1) rotate(360deg); } } .pulse { animation: pulse 1.5s infinite; } @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); } } .tooltip { position: absolute; background: rgba(0, 0, 0, 0.8); color: white; padding: 5px 10px; border-radius: 5px; font-size: 0.8rem; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; z-index: 100; white-space: nowrap; } .coin-count { position: absolute; top: 20px; right: 20px; background: rgba(25, 25, 35, 0.8); padding: 10px 15px; border-radius: 30px; color: #FFD700; font-weight: bold; display: flex; align-items: center; z-index: 100; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 215, 0, 0.3); } .coin-count i { margin-right: 8px; font-size: 1.2rem; color: #FFD700; } .notification { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(25, 25, 35, 0.9); padding: 10px 20px; border-radius: 30px; color: white; font-weight: bold; z-index: 100; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1); } .notification.show { opacity: 1; transform: translateX(-50%) translateY(-10px); } /* Responsive adjustments */ @media (max-width: 700px) { .coins-container { grid-template-columns: repeat(2, 1fr); max-width: 90%; } .header h1 { font-size: 2rem; } .coin-card { padding: 15px; } .coin { width: 70px; height: 70px; } .achievement-bar, .achievement-label { max-width: 90%; } .container { width: 100%; padding: 15px; } } @media (max-width: 400px) { .coins-container { grid-template-columns: 1fr; } .coin-card { max-width: 80%; margin: 0 auto; } } </style> </head> <body> <div class="container"> <div class="header"> <h1>Treasure Trove</h1> <p>Collect rare coins to unlock epic rewards and power-ups!</p> </div> <div class="coins-container"> <!-- Gold Coin --> <div class="coin-card" data-value="100"> <div class="coin coin-gold"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="45" fill="url(#goldGradient)" stroke="#B8860B" stroke-width="2"/> <text x="50" y="55" text-anchor="middle" fill="#5C4033" font-size="14" font-weight="bold">100</text> <path d="M45,30 L55,30 L55,70 L45,70 Z" fill="#5C4033"/> <path d="M35,40 L65,40 L65,50 L35,50 Z" fill="#5C4033"/> <defs> <linearGradient id="goldGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" stop-color="#FFD700"/> <stop offset="100%" stop-color="#FFA500"/> </linearGradient> </defs> </svg> </div> <div class="coin-info"> <h3>Victory Gold</h3> <p>Win 3 matches in a row</p> <button class="collect-btn">Collect +100</button> </div> </div> <!-- Silver Coin --> <div class="coin-card" data-value="50"> <div class="coin coin-silver"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="45" fill="url(#silverGradient)" stroke="#A9A9A9" stroke-width="2"/> <text x="50" y="55" text-anchor="middle" fill="#555" font-size="14" font-weight="bold">50</text> <path d="M40,35 C40,35 50,25 60,35 C70,45 60,65 50,65 C40,65 30,55 40,35" fill="#555"/> <defs> <linearGradient id="silverGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" stop-color="#E0E0E0"/> <stop offset="100%" stop-color="#A9A9A9"/> </linearGradient> </defs> </svg> </div> <div class="coin-info"> <h3>Combo Crusher</h3> <p>10+ combo streak</p> <button class="collect-btn">Collect +50</button> </div> </div> <!-- Bronze Coin --> <div class="coin-card" data-value="25"> <div class="coin coin-bronze"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="45" fill="url(#bronzeGradient)" stroke="#8B4513" stroke-width="2"/> <text x="50" y="55" text-anchor="middle" fill="#5D2E0C" font-size="14" font-weight="bold">25</text> <path d="M50,30 L60,45 L50,60 L40,45 Z" fill="#5D2E0C"/> <defs> <linearGradient id="bronzeGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" stop-color="#CD7F32"/> <stop offset="100%" stop-color="#8B4513"/> </linearGradient> </defs> </svg> </div> <div class="coin-info"> <h3>Speed Demon</h3> <p>Complete level under 2min</p> <button class="collect-btn">Collect +25</button> </div> </div> <!-- Emerald Coin --> <div class="coin-card" data-value="200"> <div class="coin coin-emerald pulse"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <polygon points="50,15 85,40 70,80 30,80 15,40" fill="url(#emeraldGradient)" stroke="#046307" stroke-width="2"/> <text x="50" y="55" text-anchor="middle" fill="#033E04" font-size="14" font-weight="bold">200</text> <defs> <linearGradient id="emeraldGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" stop-color="#50C878"/> <stop offset="100%" stop-color="#046307"/> </linearGradient> </defs> </svg> </div> <div class="coin-info"> <h3>Pixel Perfect</h3> <p>Zero damage boss defeat</p> <button class="collect-btn">Collect +200</button> </div> </div> <!-- Ruby Coin --> <div class="coin-card" data-value="150"> <div class="coin coin-ruby"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <polygon points="50,15 70,35 70,65 50,85 30,65 30,35" fill="url(#rubyGradient)" stroke="#8B0000" stroke-width="2"/> <text x="50" y="55" text-anchor="middle" fill="#5A0000" font-size="14" font-weight="bold">150</text> <defs> <linearGradient id="rubyGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" stop-color="#E0115F"/> <stop offset="100%" stop-color="#8B0000"/> </linearGradient> </defs> </svg> </div> <div class="coin-info"> <h3>Treasure Hunter</h3> <p>Find all hidden chests</p> <button class="collect-btn">Collect +150</button> </div> </div> <!-- Sapphire Coin --> <div class="coin-card" data-value="175"> <div class="coin coin-sapphire"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="40" fill="url(#sapphireGradient)" stroke="#000080" stroke-width="2"/> <path d="M30,45 L50,25 L70,45 L50,75 Z" fill="#000080" fill-opacity="0.3"/> <text x="50" y="55" text-anchor="middle" fill="#00052E" font-size="14" font-weight="bold">175</text> <defs> <linearGradient id="sapphireGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" stop-color="#0F52BA"/> <stop offset="100%" stop-color="#000080"/> </linearGradient> </defs> </svg> </div> <div class="coin-info"> <h3>Perfect Streak</h3> <p>7 day login streak</p> <button class="collect-btn">Collect +175</button> </div> </div> </div> <div class="achievement-bar"> <div class="achievement-progress"></div> </div> <div class="achievement-label"> <span>Level Progress</span> <span>65%</span> </div> </div> <div class="particles"></div> <div class="coin-count"> <i>🪙</i> <span id="total-coins">0</span> </div> <div class="notification" id="notification"></div> <div class="tooltip" id="tooltip"></div> <script> document.addEventListener('DOMContentLoaded', () => { // Initialize particles createParticles(); // Initialize coin collection const totalCoinsElement = document.getElementById('total-coins'); const notification = document.getElementById('notification'); const tooltip = document.getElementById('tooltip'); let totalCoins = 0; // Create floating particles function createParticles() { const particlesContainer = document.querySelector('.particles'); const numberOfParticles = 30; for (let i = 0; i < numberOfParticles; i++) { const particle = document.createElement('div'); particle.classList.add('particle'); // Random position const posX = Math.random() * 100; const posY = Math.random() * 100; // Random size const size = Math.random() * 8 + 2; // Random color const colors = ['rgba(255, 215, 0, 0.2)', 'rgba(192, 192, 192, 0.2)', 'rgba(205, 127, 50, 0.2)', 'rgba(80, 200, 120, 0.2)', 'rgba(224, 17, 95, 0.2)', 'rgba(15, 82, 186, 0.2)']; const color = colors[Math.floor(Math.random() * colors.length)]; // Random animation duration const duration = Math.random() * 20 + 10; particle.style.left = `${posX}%`; particle.style.top = `${posY}%`; particle.style.width = `${size}px`; particle.style.height = `${size}px`; particle.style.backgroundColor = color; particle.style.animation = `float ${duration}s infinite ease-in-out`; particle.style.animationDelay = `${Math.random() * 5}s`; particlesContainer.appendChild(particle); } } // Handle coin collection document.querySelectorAll('.collect-btn').forEach(button => { button.addEventListener('click', (e) => { e.stopPropagation(); const coinCard = button.closest('.coin-card'); const coinValue = parseInt(coinCard.dataset.value); const coinElement = coinCard.querySelector('.coin'); // Add animation class coinElement.classList.add('coin-collect-animation'); // Add coins to total totalCoins += coinValue; totalCoinsElement.textContent = totalCoins; // Show notification const coinName = coinCard.querySelector('h3').textContent; showNotification(`+${coinValue} ${coinName} collected!`); // Create flying coin animation createFlyingCoin(coinElement, coinValue); // Remove animation class after animation ends setTimeout(() => { coinElement.classList.remove('coin-collect-animation'); }, 800); // Disable button temporarily button.disabled = true; button.textContent = 'Collected!'; button.style.background = 'linear-gradient(45deg, #555, #888)'; setTimeout(() => { button.disabled = false; button.textContent = `Collect +${coinValue}`; button.style.background = 'linear-gradient(45deg, #FF4500, #FF8C00)'; }, 3000); }); }); // Handle coin card hover for tooltip document.querySelectorAll('.coin-card').forEach(card => { card.addEventListener('mouseenter', (e) => { const coinValue = card.dataset.value; const coinName = card.querySelector('h3').textContent; const coinDesc = card.querySelector('p').textContent; tooltip.textContent = `${coinName}: ${coinDesc} (${coinValue} coins)`; tooltip.style.opacity = '1'; tooltip.style.top = `${e.clientY - 30}px`; tooltip.style.left = `${e.clientX + 10}px`; }); card.addEventListener('mousemove', (e) => { tooltip.style.top = `${e.clientY - 30}px`; tooltip.style.left = `${e.clientX + 10}px`; }); card.addEventListener('mouseleave', () => { tooltip.style.opacity = '0'; }); }); // Create flying coin animation function createFlyingCoin(coinElement, value) { const flyingCoin = document.createElement('div'); flyingCoin.style.position = 'absolute'; flyingCoin.style.width = '40px'; flyingCoin.style.height = '40px'; flyingCoin.style.borderRadius = '50%'; flyingCoin.style.background = 'radial-gradient(#FFD700, #FFA500)'; flyingCoin.style.boxShadow = '0 0 10px rgba(255, 215, 0, 0.8)'; flyingCoin.style.display = 'flex'; flyingCoin.style.justifyContent = 'center'; flyingCoin.style.alignItems = 'center'; flyingCoin.style.fontWeight = 'bold'; flyingCoin.style.color = '#5C4033'; flyingCoin.style.zIndex = '1000'; flyingCoin.textContent = `+${value}`; // Get position of coin element const rect = coinElement.getBoundingClientRect(); flyingCoin.style.top = `${rect.top}px`; flyingCoin.style.left = `${rect.left}px`; document.body.appendChild(flyingCoin); // Get position of total coins counter const targetRect = document.querySelector('.coin-count').getBoundingClientRect(); // Animate flying coin const keyframes = [ { top: `${rect.top}px`, left: `${rect.left}px`, transform: 'scale(1)' }, { top: `${rect.top - 50}px`, left: `${rect.left + 50}px`, transform: 'scale(1.2) rotate(45deg)' }, { top: `${targetRect.top}px`, left: `${targetRect.left}px`, transform: 'scale(0.5) rotate(90deg)' } ]; const animation = flyingCoin.animate(keyframes, { duration: 1000, easing: 'cubic-bezier(0.2, 0.8, 0.2, 1)' }); animation.onfinish = () => { flyingCoin.remove(); // Add pulse effect to counter const counter = document.querySelector('.coin-count'); counter.style.animation = 'pulse 0.5s'; setTimeout(() => { counter.style.animation = ''; }, 500); }; } // Show notification function showNotification(message) { notification.textContent = message; notification.classList.add('show'); setTimeout(() => { notification.classList.remove('show'); }, 2000); } // Animate achievement progress bar on load setTimeout(() => { const progressBar = document.querySelector('.achievement-progress'); progressBar.style.width = '65%'; }, 500); }); </script> </body> </html>
<html> <head> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; } body { background-color: #f7f5f2; height: 700px; width: 700px; overflow: hidden; display: flex; flex-direction: column; } .container { max-width: 700px; height: 700px; padding: 20px; margin: 0 auto; position: relative; overflow: hidden; } header { text-align: center; padding: 10px 0 20px; } h1 { color: #5a6163; font-size: 26px; margin-bottom: 10px; font-weight: 700; } .tagline { color: #8b9192; font-size: 14px; font-weight: 400; } .simulator { display: flex; flex-direction: column; gap: 20px; height: calc(100% - 100px); } .coin-container { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 15px; background-color: #fff; border-radius: 16px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); } .coin { width: 85px; height: 85px; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08); transition: transform 0.3s ease, box-shadow 0.3s ease; } .coin:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); } .coin.active { animation: pulse 0.6s ease-in-out; } .coin::after { content: ''; position: absolute; width: 92%; height: 92%; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.8); } .coin-value { color: white; font-weight: 700; font-size: 20px; z-index: 2; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); } .penny { background: linear-gradient(145deg, #c08a59, #a17243); } .nickel { background: linear-gradient(145deg, #9fa0a3, #b4b5b8); } .dime { background: linear-gradient(145deg, #c0c2c4, #d5d7d9); } .quarter { background: linear-gradient(145deg, #b4b5b8, #c0c2c4); } .loonie { background: linear-gradient(145deg, #fcd868, #e9b92a); } .scenarios { flex: 1; background-color: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column; } .scenario-title { color: #5a6163; font-size: 18px; margin-bottom: 15px; font-weight: 600; } .scenario-description { color: #8b9192; font-size: 14px; line-height: 1.5; margin-bottom: 20px; } .wallet { display: flex; align-items: center; gap: 15px; padding: 15px; background-color: #f0ede9; border-radius: 12px; margin-bottom: 15px; } .wallet-icon { width: 40px; height: 40px; background-color: #5a6163; border-radius: 8px; display: flex; align-items: center; justify-content: center; } .wallet-icon svg { width: 24px; height: 24px; fill: white; } .wallet-amount { font-size: 20px; font-weight: 600; color: #5a6163; } .transaction-list { flex: 1; overflow-y: auto; padding-right: 5px; } .transaction { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0ede9; } .transaction-label { color: #5a6163; font-size: 14px; font-weight: 500; } .transaction-amount { font-weight: 600; font-size: 14px; } .transaction-amount.positive { color: #5db075; } .transaction-amount.negative { color: #e97171; } .transaction-coin { display: flex; align-items: center; gap: 5px; } .mini-coin { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; color: white; font-weight: 700; } .challenges { background-color: #5a6163; border-radius: 12px; padding: 15px; margin-top: auto; } .challenge-title { color: white; font-size: 16px; font-weight: 600; margin-bottom: 10px; } .challenge-options { display: flex; gap: 10px; } .challenge-option { background-color: rgba(255, 255, 255, 0.15); border-radius: 8px; padding: 10px; flex: 1; cursor: pointer; transition: background-color 0.3s ease; } .challenge-option:hover { background-color: rgba(255, 255, 255, 0.25); } .challenge-option-label { color: white; font-size: 12px; font-weight: 500; margin-bottom: 5px; } .challenge-option-value { color: white; font-size: 14px; font-weight: 700; } .floating-coin { position: absolute; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 14px; z-index: 10; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); opacity: 0; } @keyframes float-to-wallet { 0% { opacity: 1; transform: scale(1) translateY(0); } 70% { opacity: 1; transform: scale(0.8) translateY(-20px); } 100% { opacity: 0; transform: scale(0.5) translateY(0); } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } } /* Responsive adjustments */ @media (max-width: 500px) { h1 { font-size: 22px; } .coin { width: 70px; height: 70px; } .coin-value { font-size: 16px; } .scenario-title { font-size: 16px; } } /* Custom scrollbar */ .transaction-list::-webkit-scrollbar { width: 6px; } .transaction-list::-webkit-scrollbar-track { background: #f0ede9; border-radius: 3px; } .transaction-list::-webkit-scrollbar-thumb { background: #c0c2c4; border-radius: 3px; } .transaction-list::-webkit-scrollbar-thumb:hover { background: #8b9192; } </style> </head> <body> <div class="container"> <header> <h1>Financial Education Simulator</h1> <p class="tagline">Make smart financial decisions with real-world currency practice</p> </header> <div class="simulator"> <div class="coin-container"> <div class="coin penny" data-value="0.01"> <span class="coin-value">1¢</span> </div> <div class="coin nickel" data-value="0.05"> <span class="coin-value">5¢</span> </div> <div class="coin dime" data-value="0.10"> <span class="coin-value">10¢</span> </div> <div class="coin quarter" data-value="0.25"> <span class="coin-value">25¢</span> </div> <div class="coin loonie" data-value="1.00"> <span class="coin-value">$1</span> </div> </div> <div class="scenarios"> <h3 class="scenario-title">Weekly Allowance Budgeting</h3> <p class="scenario-description">You receive a $5 weekly allowance. Click on coins to make deposits or handle expenses. Can you save $3 by the end of the week?</p> <div class="wallet"> <div class="wallet-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M20 7V5c0-1.1-.9-2-2-2H5C3.9 3 3 3.9 3 5v14c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-2h2c.6 0 1-.4 1-1V8c0-.6-.4-1-1-1h-2zm-2 12H5V5h13v2h-3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h3v2zm2-3h-5V9h5v7z"/> <circle cx="16" cy="12.5" r="1.5"/> </svg> </div> <div class="wallet-amount">$<span id="balance">0.00</span></div> </div> <div class="transaction-list" id="transactions"> <!-- Transactions will be added here --> </div> <div class="challenges"> <h4 class="challenge-title">Today's Financial Challenges</h4> <div class="challenge-options"> <div class="challenge-option" data-value="-0.75"> <div class="challenge-option-label">Ice Cream</div> <div class="challenge-option-value">-75¢</div> </div> <div class="challenge-option" data-value="-1.25"> <div class="challenge-option-label">Toy Purchase</div> <div class="challenge-option-value">-$1.25</div> </div> <div class="challenge-option" data-value="2.00"> <div class="challenge-option-label">Chores</div> <div class="challenge-option-value">+$2.00</div> </div> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { let balance = 0; const balanceElement = document.getElementById('balance'); const transactionsElement = document.getElementById('transactions'); const coins = document.querySelectorAll('.coin'); const challengeOptions = document.querySelectorAll('.challenge-option'); // Function to format amount with 2 decimal places function formatAmount(amount) { return amount.toFixed(2); } // Function to update the balance function updateBalance(amount) { balance += amount; balanceElement.textContent = formatAmount(balance); } // Function to add a transaction function addTransaction(label, amount, coinClass = null) { const transaction = document.createElement('div'); transaction.className = 'transaction'; const transactionLabel = document.createElement('div'); transactionLabel.className = 'transaction-label'; transactionLabel.textContent = label; const transactionAmount = document.createElement('div'); transactionAmount.className = `transaction-amount ${amount >= 0 ? 'positive' : 'negative'}`; if (coinClass) { const transactionCoin = document.createElement('div'); transactionCoin.className = 'transaction-coin'; const miniCoin = document.createElement('div'); miniCoin.className = `mini-coin ${coinClass}`; const value = document.createElement('span'); if (amount === 0.01) value.textContent = '1¢'; else if (amount === 0.05) value.textContent = '5¢'; else if (amount === 0.10) value.textContent = '10¢'; else if (amount === 0.25) value.textContent = '25¢'; else value.textContent = '$1'; miniCoin.appendChild(value); transactionCoin.appendChild(miniCoin); const amountText = document.createElement('span'); amountText.textContent = `$${formatAmount(Math.abs(amount))}`; transactionCoin.appendChild(amountText); transactionAmount.appendChild(transactionCoin); } else { transactionAmount.textContent = `${amount >= 0 ? '+' : '-'}$${formatAmount(Math.abs(amount))}`; } transaction.appendChild(transactionLabel); transaction.appendChild(transactionAmount); transactionsElement.prepend(transaction); // Remove oldest transaction if there are more than 5 if (transactionsElement.children.length > 5) { transactionsElement.removeChild(transactionsElement.lastChild); } } // Function to animate a coin from its position to the wallet function animateCoin(coinElement, amount) { const coin = coinElement.getBoundingClientRect(); const wallet = document.querySelector('.wallet').getBoundingClientRect(); const floatingCoin = document.createElement('div'); floatingCoin.className = `floating-coin ${coinElement.classList[1]}`; const value = document.createElement('span'); if (amount === 0.01) value.textContent = '1¢'; else if (amount === 0.05) value.textContent = '5¢'; else if (amount === 0.10) value.textContent = '10¢'; else if (amount === 0.25) value.textContent = '25¢'; else value.textContent = '$1'; floatingCoin.appendChild(value); floatingCoin.style.left = `${coin.left + coin.width/2 - 20}px`; floatingCoin.style.top = `${coin.top + coin.height/2 - 20}px`; document.body.appendChild(floatingCoin); // Calculate the destination point (wallet) const destX = wallet.left + wallet.width/2 - coin.left - coin.width/2 + 20; const destY = wallet.top + wallet.height/2 - coin.top - coin.height/2 + 20; floatingCoin.style.animation = 'float-to-wallet 0.8s forwards'; setTimeout(() => { floatingCoin.remove(); }, 800); } // Add click event to coins coins.forEach(coin => { coin.addEventListener('click', function() { const value = parseFloat(this.dataset.value); updateBalance(value); addTransaction('Deposit', value, this.classList[1]); animateCoin(this, value); this.classList.add('active'); setTimeout(() => { this.classList.remove('active'); }, 600); }); }); // Add click event to challenge options challengeOptions.forEach(option => { option.addEventListener('click', function() { const value = parseFloat(this.dataset.value); updateBalance(value); let label; if (value === -0.75) label = 'Ice Cream Purchase'; else if (value === -1.25) label = 'Toy Purchase'; else label = 'Completed Chores'; addTransaction(label, value); // Visual feedback for selection this.style.backgroundColor = 'rgba(255, 255, 255, 0.3)'; setTimeout(() => { this.style.backgroundColor = ''; }, 300); }); }); // Add initial transaction addTransaction('Weekly Allowance', 5.00); updateBalance(5.00); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; } body { display: flex; justify-content: center; align-items: center; min-height: 700px; background: linear-gradient(135deg, #121212, #1e1e1e); color: #ffffff; overflow-x: hidden; } .container { width: 100%; max-width: 700px; padding: 2rem; position: relative; } .loyalty-header { text-align: center; margin-bottom: 3rem; position: relative; } .loyalty-header h1 { font-weight: 700; font-size: 2.5rem; background: linear-gradient(to right, #e0c3a6, #f8e4cc); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 0.5rem; letter-spacing: 1px; } .loyalty-header p { color: #c0c0c0; font-size: 1rem; max-width: 500px; margin: 0 auto; line-height: 1.6; } .coins-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem; margin-top: 2rem; } .coin { position: relative; cursor: pointer; transition: transform 0.4s ease; transform-style: preserve-3d; perspective: 1000px; text-align: center; } .coin:hover { transform: translateY(-10px) rotateY(20deg); } .coin-wrapper { position: relative; width: 120px; height: 120px; margin: 0 auto; } .coin-face { width: 100%; height: 100%; border-radius: 50%; position: absolute; display: flex; align-items: center; justify-content: center; font-weight: 700; background: linear-gradient(145deg, #333, #222); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); transition: all 0.3s ease; transform: translateZ(0); backface-visibility: hidden; } .coin.bronze .coin-face { background: linear-gradient(145deg, #cd7f32, #a05a2c); border: 3px solid #8b4513; } .coin.silver .coin-face { background: linear-gradient(145deg, #c0c0c0, #a9a9a9); border: 3px solid #808080; } .coin.gold .coin-face { background: linear-gradient(145deg, #ffd700, #daa520); border: 3px solid #b8860b; } .coin.platinum .coin-face { background: linear-gradient(145deg, #e5e4e2, #b9b8b6); border: 3px solid #85754e; } .coin:hover .coin-face { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.3); } .coin-value { font-size: 1.8rem; z-index: 2; color: #f8f8f8; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4); } .coin-title { margin-top: 1rem; font-weight: 600; font-size: 1.2rem; color: #f8f8f8; } .coin-points { color: #b0b0b0; margin-top: 0.2rem; font-size: 0.9rem; } .coin-edge { position: absolute; height: 100%; width: 8px; background: #333; left: 50%; top: 0; transform: translateX(-50%) rotateY(90deg); transform-origin: center; border-radius: 4px; } .coin.bronze .coin-edge { background: #8b4513; } .coin.silver .coin-edge { background: #808080; } .coin.gold .coin-edge { background: #b8860b; } .coin.platinum .coin-edge { background: #85754e; } .coin-shine { position: absolute; width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(135deg, transparent 20%, rgba(255, 255, 255, 0.2) 40%, transparent 80%); transform: rotate(-45deg); pointer-events: none; } .coin-symbol { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; opacity: 0.15; color: rgba(255, 255, 255, 0.7); } .progress-container { margin-top: 3rem; background: rgba(30, 30, 30, 0.6); border-radius: 15px; padding: 1.5rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); position: relative; overflow: hidden; } .progress-container::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%); pointer-events: none; } .progress-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; } .progress-title h3 { font-weight: 600; font-size: 1.2rem; color: #f8f8f8; } .progress-points { font-size: 0.9rem; color: #b0b0b0; } .progress-bar { height: 12px; background: rgba(20, 20, 20, 0.8); border-radius: 10px; overflow: hidden; position: relative; } .progress-fill { height: 100%; width: 65%; background: linear-gradient(to right, #cd7f32, #ffd700); border-radius: 10px; position: relative; transition: width 1s ease; } .next-reward { margin-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; } .next-reward-text { flex: 1; } .next-reward-text p { font-size: 0.9rem; color: #c0c0c0; margin-bottom: 0.3rem; } .next-reward-text h4 { font-size: 1.1rem; color: #e0c3a6; } .redeem-button { background: linear-gradient(135deg, #e0c3a6, #c69c6d); border: none; padding: 0.8rem 1.5rem; border-radius: 50px; font-weight: 600; color: #1a1a1a; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(198, 156, 109, 0.3); position: relative; overflow: hidden; } .redeem-button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(198, 156, 109, 0.4); } .redeem-button::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: rgba(255, 255, 255, 0.1); transform: rotate(45deg); opacity: 0; transition: opacity 0.3s; } .redeem-button:hover::after { opacity: 1; transition: opacity 0.3s; } .floating-particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; } .particle { position: absolute; width: 5px; height: 5px; background: rgba(255, 215, 0, 0.3); border-radius: 50%; animation: float 10s linear infinite; } @keyframes float { 0% { transform: translateY(0) rotate(0deg); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-500px) rotate(360deg); opacity: 0; } } .coin-animation { animation: coinPulse 2s infinite alternate; } @keyframes coinPulse { 0% { transform: scale(1); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); } 100% { transform: scale(1.05); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.3); } } .redemption-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .redemption-modal.active { opacity: 1; pointer-events: all; } .modal-content { background: linear-gradient(135deg, #1e1e1e, #2a2a2a); padding: 2rem; border-radius: 10px; width: 90%; max-width: 500px; text-align: center; position: relative; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5); transform: translateY(30px); transition: transform 0.4s ease; } .redemption-modal.active .modal-content { transform: translateY(0); } .modal-close { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; color: #888; cursor: pointer; transition: color 0.2s ease; } .modal-close:hover { color: #e0c3a6; } .modal-title { margin-bottom: 1.5rem; color: #e0c3a6; font-size: 1.8rem; } .modal-rewards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin: 2rem 0; } .modal-reward { padding: 1rem; background: rgba(30, 30, 30, 0.6); border-radius: 8px; cursor: pointer; transition: all 0.3s ease; } .modal-reward:hover { background: rgba(50, 50, 50, 0.6); transform: translateY(-5px); } .reward-icon { font-size: 1.8rem; margin-bottom: 0.5rem; color: #e0c3a6; } .reward-name { font-size: 0.9rem; color: #f8f8f8; margin-bottom: 0.3rem; } .reward-cost { font-size: 0.8rem; color: #b0b0b0; } .confirm-button { background: linear-gradient(135deg, #e0c3a6, #c69c6d); border: none; padding: 0.8rem 1.5rem; border-radius: 50px; font-weight: 600; color: #1a1a1a; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(198, 156, 109, 0.3); margin-top: 1.5rem; } .confirm-button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(198, 156, 109, 0.4); } @media (max-width: 600px) { .loyalty-header h1 { font-size: 2rem; } .coins-container { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } .coin-wrapper { width: 100px; height: 100px; } .coin-value { font-size: 1.5rem; } .coin-title { font-size: 1rem; } .modal-rewards { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 400px) { .coins-container { grid-template-columns: repeat(2, 1fr); gap: 1rem; } .coin-wrapper { width: 90px; height: 90px; } .loyalty-header h1 { font-size: 1.8rem; } .next-reward { flex-direction: column; align-items: flex-start; } .redeem-button { margin-top: 1rem; width: 100%; } } .shine-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent); opacity: 0; transform: translateX(-100%); transition: transform 0.5s; pointer-events: none; } .coin:hover .shine-effect { opacity: 1; transform: translateX(100%); transition: transform 0.8s; } </style> </head> <body> <div class="container"> <div class="loyalty-header"> <h1>LUXE REWARDS</h1> <p>Collect and redeem our exclusive virtual coins as you shop. Each purchase builds your collection and unlocks premium benefits tailored to your preferences.</p> </div> <div class="coins-container"> <div class="coin bronze"> <div class="coin-wrapper"> <div class="coin-face"> <div class="coin-value">25</div> <div class="coin-symbol">⋆</div> <div class="coin-shine"></div> </div> <div class="coin-edge"></div> <div class="shine-effect"></div> </div> <div class="coin-title">Bronze</div> <div class="coin-points">500 points</div> </div> <div class="coin silver"> <div class="coin-wrapper"> <div class="coin-face"> <div class="coin-value">50</div> <div class="coin-symbol">⋆</div> <div class="coin-shine"></div> </div> <div class="coin-edge"></div> <div class="shine-effect"></div> </div> <div class="coin-title">Silver</div> <div class="coin-points">1,000 points</div> </div> <div class="coin gold"> <div class="coin-wrapper"> <div class="coin-face"> <div class="coin-value">75</div> <div class="coin-symbol">⋆</div> <div class="coin-shine"></div> </div> <div class="coin-edge"></div> <div class="shine-effect"></div> </div> <div class="coin-title">Gold</div> <div class="coin-points">2,500 points</div> </div> <div class="coin platinum"> <div class="coin-wrapper"> <div class="coin-face"> <div class="coin-value">100</div> <div class="coin-symbol">⋆</div> <div class="coin-shine"></div> </div> <div class="coin-edge"></div> <div class="shine-effect"></div> </div> <div class="coin-title">Platinum</div> <div class="coin-points">5,000 points</div> </div> </div> <div class="progress-container"> <div class="progress-title"> <h3>Your Progress</h3> <div class="progress-points">1,625 / 2,500 points</div> </div> <div class="progress-bar"> <div class="progress-fill"></div> </div> <div class="next-reward"> <div class="next-reward-text"> <p>Next tier reward</p> <h4>Gold Coin (875 points away)</h4> </div> <button class="redeem-button" id="redeemButton">Redeem Rewards</button> </div> </div> <div class="floating-particles" id="particles"></div> <div class="redemption-modal" id="redemptionModal"> <div class="modal-content"> <div class="modal-close" id="modalClose">×</div> <h2 class="modal-title">Redeem Your Rewards</h2> <p>You have accumulated 75 reward coins. Choose a premium reward below:</p> <div class="modal-rewards"> <div class="modal-reward"> <div class="reward-icon">🛍️</div> <div class="reward-name">15% Off Next Order</div> <div class="reward-cost">50 coins</div> </div> <div class="modal-reward"> <div class="reward-icon">🚚</div> <div class="reward-name">Free Express Shipping</div> <div class="reward-cost">25 coins</div> </div> <div class="modal-reward"> <div class="reward-icon">🎁</div> <div class="reward-name">Mystery Gift Box</div> <div class="reward-cost">75 coins</div> </div> <div class="modal-reward"> <div class="reward-icon">✨</div> <div class="reward-name">Early Access Sale</div> <div class="reward-cost">40 coins</div> </div> </div> <button class="confirm-button" id="confirmButton">Confirm Selection</button> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { // Create floating particles const particlesContainer = document.getElementById('particles'); const particleCount = 20; for (let i = 0; i < particleCount; i++) { const particle = document.createElement('div'); particle.classList.add('particle'); // Random positioning const randomX = Math.floor(Math.random() * 100); const randomY = Math.floor(Math.random() * 100); const randomSize = Math.floor(Math.random() * 3) + 2; const randomOpacity = Math.random() * 0.5 + 0.1; const randomDuration = Math.floor(Math.random() * 20) + 10; const randomDelay = Math.floor(Math.random() * 10); particle.style.left = `${randomX}%`; particle.style.top = `${randomY}%`; particle.style.width = `${randomSize}px`; particle.style.height = `${randomSize}px`; particle.style.opacity = randomOpacity; particle.style.animationDuration = `${randomDuration}s`; particle.style.animationDelay = `${randomDelay}s`; particlesContainer.appendChild(particle); } // Coin 3D effect on mouse move const coins = document.querySelectorAll('.coin'); coins.forEach(coin => { coin.addEventListener('mouseenter', function() { this.querySelector('.coin-face').classList.add('coin-animation'); }); coin.addEventListener('mouseleave', function() { this.querySelector('.coin-face').classList.remove('coin-animation'); }); }); // Modal functionality const modal = document.getElementById('redemptionModal'); const redeemBtn = document.getElementById('redeemButton'); const closeBtn = document.getElementById('modalClose'); const confirmBtn = document.getElementById('confirmButton'); const modalRewards = document.querySelectorAll('.modal-reward'); redeemBtn.addEventListener('click', function() { modal.classList.add('active'); }); closeBtn.addEventListener('click', function() { modal.classList.remove('active'); }); confirmBtn.addEventListener('click', function() { // Add a little animation on the modal this.innerHTML = 'Reward Confirmed!'; this.style.background = 'linear-gradient(135deg, #5cb85c, #3e8f3e)'; setTimeout(() => { modal.classList.remove('active'); // Reset button after closing setTimeout(() => { this.innerHTML = 'Confirm Selection'; this.style.background = 'linear-gradient(135deg, #e0c3a6, #c69c6d)'; }, 500); }, 1500); }); // Handle reward selection modalRewards.forEach(reward => { reward.addEventListener('click', function() { modalRewards.forEach(r => r.style.border = 'none'); this.style.border = '2px solid #e0c3a6'; }); }); // Progressive counter animation for progress bar const progressFill = document.querySelector('.progress-fill'); // Simulate progress increase let currentWidth = 0; const targetWidth = 65; // 65% filled function animateProgress() { if (currentWidth < targetWidth) { currentWidth++; progressFill.style.width = `${currentWidth}%`; requestAnimationFrame(animateProgress); } } // Start the animation setTimeout(animateProgress, 500); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Coin Crew: Treasure Learning</title> <style> :root { --primary: #FFD700; --secondary: #FF9933; --accent1: #7BC950; --accent2: #4E9AF1; --accent3: #E55B88; --dark: #333333; --light: #FFFFFF; --background: #F7F9FC; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Comic Sans MS', 'Bubblegum Sans', cursive; } body { background-color: var(--background); height: 100vh; width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; } .game-container { width: 100%; max-width: 680px; height: 680px; background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); border-radius: 24px; padding: 20px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); position: relative; overflow: hidden; } .game-header { text-align: center; margin-bottom: 15px; } .game-title { font-size: 2.2rem; color: var(--dark); text-shadow: 2px 2px 0px var(--light); margin-bottom: 5px; } .game-subtitle { font-size: 1rem; color: var(--dark); margin-bottom: 10px; } .score-container { display: flex; justify-content: center; align-items: center; gap: 10px; background-color: var(--light); border-radius: 50px; padding: 8px 15px; width: fit-content; margin: 0 auto; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .coin-icon { width: 30px; height: 30px; background-color: var(--primary); border-radius: 50%; border: 3px solid #E5A800; display: flex; justify-content: center; align-items: center; font-weight: bold; color: var(--dark); } .score { font-size: 1.3rem; font-weight: bold; color: var(--dark); } .game-board { background-color: var(--light); height: 400px; border-radius: 20px; margin: 15px 0; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; position: relative; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08); } .math-problem { text-align: center; font-size: 2.5rem; color: var(--dark); margin: 20px 0; height: 120px; display: flex; justify-content: center; align-items: center; } .options-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; padding: 10px; } .option { background-color: var(--light); border: 3px solid var(--accent2); border-radius: 15px; padding: 15px; font-size: 1.8rem; color: var(--dark); text-align: center; cursor: pointer; transition: all 0.3s ease; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 0 rgba(78, 154, 241, 0.5); } .option:hover { transform: translateY(-3px); box-shadow: 0 7px 0 rgba(78, 154, 241, 0.5); } .option:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(78, 154, 241, 0.5); } .feedback { height: 50px; text-align: center; font-size: 1.5rem; font-weight: bold; margin-top: 10px; color: var(--accent1); display: flex; justify-content: center; align-items: center; } .coin-collection { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 15px; } .coin { width: 60px; height: 60px; border-radius: 50%; position: relative; transform-style: preserve-3d; animation: rotate 3s infinite linear; cursor: pointer; transition: transform 0.3s ease; } .coin:hover { transform: scale(1.1) rotate(20deg); } .coin-front, .coin-edge, .coin-back { position: absolute; width: 100%; height: 100%; border-radius: 50%; backface-visibility: hidden; } .coin-front { background: radial-gradient(circle at 30% 30%, var(--primary), #E5A800); display: flex; justify-content: center; align-items: center; font-size: 1.5rem; color: var(--dark); font-weight: bold; border: 3px solid #E5A800; transform: translateZ(2px); } .coin-edge { background: #E5A800; transform: rotateY(90deg); width: 5px; left: 27.5px; } .coin-back { background: radial-gradient(circle at 30% 30%, #E5A800, var(--primary)); transform: rotateY(180deg) translateZ(2px); border: 3px solid #E5A800; } @keyframes rotate { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } } .sparkle { position: absolute; width: 20px; height: 20px; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M12 0L15 9H24L17 14.5L20 24L12 18L4 24L7 14.5L0 9H9L12 0Z"/></svg>'); background-size: contain; animation: sparkle 0.8s linear forwards; pointer-events: none; z-index: 100; } @keyframes sparkle { 0% { transform: scale(0) rotate(0deg); opacity: 1; } 50% { transform: scale(1.2) rotate(45deg); opacity: 1; } 100% { transform: scale(0) rotate(90deg); opacity: 0; } } .coin-pouch { width: 120px; height: 100px; background-color: #A52A2A; border-radius: 20px 20px 60px 60px; margin: 0 auto; position: relative; box-shadow: 0 8px 0 #7B1818; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; } .pouch-opening { width: 90px; height: 30px; background-color: #7B1818; border-radius: 40px 40px 0 0; position: absolute; top: 10px; } .pouch-string { width: 70px; height: 10px; background-color: #7B1818; position: absolute; top: 30px; border-radius: 10px; } .pouch-coin { width: 20px; height: 20px; background-color: var(--primary); border-radius: 50%; border: 2px solid #E5A800; position: absolute; bottom: 10px; } .pouch-coin:nth-child(1) { left: 40px; bottom: 15px; } .pouch-coin:nth-child(2) { left: 55px; bottom: 25px; } .pouch-coin:nth-child(3) { left: 30px; bottom: 30px; } .level-indicator { display: flex; justify-content: space-between; margin-bottom: 10px; } .level-text { background-color: var(--light); padding: 5px 15px; border-radius: 20px; font-weight: bold; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1); } .progress-bar { background-color: var(--light); height: 10px; border-radius: 5px; overflow: hidden; width: 100%; margin: 5px 0; } .progress-fill { background-color: var(--accent1); height: 100%; width: 30%; border-radius: 5px; transition: width 0.5s ease; } .celebrations { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; display: none; } .confetti { position: absolute; width: 10px; height: 10px; background-color: var(--accent3); opacity: 0.8; animation: confetti-fall 3s linear forwards; } @keyframes confetti-fall { 0% { transform: translateY(-10px) rotate(0deg); opacity: 1; } 100% { transform: translateY(700px) rotate(360deg); opacity: 0; } } .reset-btn { background-color: var(--accent2); color: var(--light); border: none; border-radius: 50px; padding: 8px 20px; font-size: 1rem; cursor: pointer; margin-top: 10px; transition: all 0.3s ease; box-shadow: 0 4px 0 #3A78B5; } .reset-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #3A78B5; } .reset-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #3A78B5; } /* Character */ .character { position: absolute; width: 70px; height: 70px; bottom: 20px; right: 20px; transition: all 0.5s ease; } .character-body { width: 50px; height: 50px; background-color: #FFB6C1; border-radius: 50%; position: relative; z-index: 1; } .character-eye { width: 10px; height: 10px; background-color: var(--dark); border-radius: 50%; position: absolute; top: 15px; } .character-eye.left { left: 10px; } .character-eye.right { right: 10px; } .character-mouth { width: 20px; height: 10px; background-color: #FF6B6B; border-radius: 0 0 10px 10px; position: absolute; bottom: 10px; left: 15px; } .character-ears { position: absolute; width: 15px; height: 20px; background-color: #FFB6C1; border-radius: 50%; top: -10px; } .character-ears.left { left: 5px; transform: rotate(-30deg); } .character-ears.right { right: 5px; transform: rotate(30deg); } .speech-bubble { position: absolute; width: 100px; padding: 8px; background-color: white; border-radius: 10px; font-size: 0.8rem; text-align: center; top: -50px; right: 0; opacity: 0; transition: opacity 0.3s ease; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); } .speech-bubble:after { content: ''; position: absolute; bottom: -10px; right: 20px; border-width: 10px 10px 0; border-style: solid; border-color: white transparent; } .character:hover .speech-bubble { opacity: 1; } /* Responsive adjustments */ @media (max-width: 680px) { .game-container { height: 100%; } .game-title { font-size: 1.8rem; } .game-subtitle { font-size: 0.9rem; } .math-problem { font-size: 2rem; height: 80px; } .options-container { grid-template-columns: 1fr 1fr; } .option { font-size: 1.5rem; padding: 10px; } .coin { width: 50px; height: 50px; } .game-board { height: 350px; } } </style> </head> <body> <div class="game-container"> <div class="game-header"> <h1 class="game-title">Coin Crew: Math Treasures</h1> <p class="game-subtitle">Solve the math problems to earn shiny coins!</p> <div class="level-indicator"> <div class="level-text">Level: <span id="level">1</span></div> <div class="level-text">Stars: <span id="stars">0</span>⭐</div> </div> <div class="progress-bar"> <div class="progress-fill" id="progress"></div> </div> </div> <div class="score-container"> <div class="coin-icon">$</div> <div class="score" id="score">0</div> </div> <div class="game-board"> <div class="math-problem" id="problem">2 + 3 = ?</div> <div class="options-container" id="options"> <div class="option" data-value="4">4</div> <div class="option" data-value="5">5</div> <div class="option" data-value="6">6</div> <div class="option" data-value="7">7</div> </div> <div class="feedback" id="feedback"></div> </div> <div class="coin-collection" id="coin-collection"> <div class="coin-pouch"> <div class="pouch-opening"></div> <div class="pouch-string"></div> <div class="pouch-coin"></div> <div class="pouch-coin"></div> <div class="pouch-coin"></div> </div> </div> <button class="reset-btn" id="reset-btn">New Game</button> <div class="character" id="helper"> <div class="speech-bubble">Need help? Just click on the right answer!</div> <div class="character-ears left"></div> <div class="character-ears right"></div> <div class="character-body"> <div class="character-eye left"></div> <div class="character-eye right"></div> <div class="character-mouth"></div> </div> </div> <div class="celebrations" id="celebrations"></div> </div> <script> document.addEventListener('DOMContentLoaded', () => { // Game state const gameState = { score: 0, level: 1, stars: 0, questionsAnswered: 0, correctAnswers: 0, maxQuestions: 5, currentAnswer: null }; // DOM elements const problemEl = document.getElementById('problem'); const optionsEl = document.getElementById('options'); const scoreEl = document.getElementById('score'); const feedbackEl = document.getElementById('feedback'); const coinCollectionEl = document.getElementById('coin-collection'); const levelEl = document.getElementById('level'); const starsEl = document.getElementById('stars'); const progressEl = document.getElementById('progress'); const resetBtn = document.getElementById('reset-btn'); const celebrationsEl = document.getElementById('celebrations'); const helperEl = document.getElementById('helper'); // Coin colors based on value const coinColors = { 1: { bg: '#C0C0C0', border: '#A8A8A8' }, // Silver 5: { bg: '#FFD700', border: '#E5A800' }, // Gold 10: { bg: '#4E9AF1', border: '#3A78B5' }, // Blue 25: { bg: '#7BC950', border: '#5A9A38' }, // Green 50: { bg: '#E55B88', border: '#C03A64' } // Pink }; // Initialize game generateProblem(); updateUI(); // Event listener for options optionsEl.addEventListener('click', (e) => { if (e.target.classList.contains('option')) { const selectedValue = parseInt(e.target.dataset.value); checkAnswer(selectedValue); } }); // Reset button resetBtn.addEventListener('click', () => { resetGame(); }); // Helper character movement setInterval(() => { const randomMove = Math.floor(Math.random() * 20) - 10; helperEl.style.transform = `translateY(${randomMove}px)`; }, 2000); // Generate math problem based on current level function generateProblem() { let num1, num2, operator, problem, answer, options; // Adjust difficulty based on level switch(gameState.level) { case 1: // Simple addition (1-10) num1 = Math.floor(Math.random() * 5) + 1; num2 = Math.floor(Math.random() * 5) + 1; problem = `${num1} + ${num2} = ?`; answer = num1 + num2; break; case 2: // Addition and subtraction (1-15) num1 = Math.floor(Math.random() * 10) + 5; num2 = Math.floor(Math.random() * 5) + 1; operator = Math.random() > 0.5 ? '+' : '-'; if (operator === '-') { // Ensure positive result [num1, num2] = [Math.max(num1, num2), Math.min(num1, num2)]; } problem = `${num1} ${operator} ${num2} = ?`; answer = operator === '+' ? num1 + num2 : num1 - num2; break; case 3: // Addition, subtraction, simple multiplication num1 = Math.floor(Math.random() * 10) + 1; num2 = Math.floor(Math.random() * 5) + 1; const opIndex = Math.floor(Math.random() * 3); operator = ['+', '-', '×'][opIndex]; if (operator === '-') { // Ensure positive result [num1, num2] = [Math.max(num1, num2), Math.min(num1, num2)]; } problem = `${num1} ${operator} ${num2} = ?`; answer = operator === '+' ? num1 + num2 : (operator === '-' ? num1 - num2 : num1 * num2); break; default: // More complex operations for higher levels num1 = Math.floor(Math.random() * 12) + 3; num2 = Math.floor(Math.random() * 12) + 3; operator = ['+', '-', '×'][Math.floor(Math.random() * 3)]; if (operator === '-') { // Ensure positive result [num1, num2] = [Math.max(num1, num2), Math.min(num1, num2)]; } problem = `${num1} ${operator} ${num2} = ?`; answer = operator === '+' ? num1 + num2 : (operator === '-' ? num1 - num2 : num1 * num2); } // Generate options (including the correct answer) options = [answer]; while (options.length < 4) { // Generate reasonable wrong answers (closer to correct answer for higher challenge) const offset = Math.floor(Math.random() * 5) + 1; const wrongAnswer = Math.random() > 0.5 ? answer + offset : Math.max(0, answer - offset); if (!options.includes(wrongAnswer)) { options.push(wrongAnswer); } } // Shuffle options options.sort(() => Math.random() - 0.5); // Update the DOM problemEl.textContent = problem; let optionsHTML = ''; options.forEach(value => { optionsHTML += `<div class="option" data-value="${value}">${value}</div>`; }); optionsEl.innerHTML = optionsHTML; // Store current answer gameState.currentAnswer = answer; } // Check if the selected answer is correct function checkAnswer(selectedValue) { gameState.questionsAnswered++; if (selectedValue === gameState.currentAnswer) { // Correct answer gameState.correctAnswers++; feedbackEl.textContent = "Correct! 🎉"; feedbackEl.style.color = "var(--accent1)"; // Award coins based on level const coinValue = gameState.level * 5; gameState.score += coinValue; // Create sparkle effects createSparkles(); // Add animated coin addCoin(coinValue); // Update progress const progress = (gameState.correctAnswers / gameState.maxQuestions) * 100; progressEl.style.width = `${progress}%`; // Check if level complete if (gameState.correctAnswers >= gameState.maxQuestions) { levelUp(); } } else { // Incorrect answer feedbackEl.textContent = "Try again! 🔄"; feedbackEl.style.color = "var(--accent3)"; } updateUI(); // Generate new problem after a short delay setTimeout(() => { generateProblem(); feedbackEl.textContent = ""; }, 1500); } // Level up and celebrate function levelUp() { gameState.level++; gameState.correctAnswers = 0; gameState.stars++; // Reset progress bar progressEl.style.width = "0%"; // Celebration animation celebrationsEl.style.display = 'block'; createConfetti(); setTimeout(() => { celebrationsEl.style.display = 'none'; }, 3000); } // Create sparkle effects function createSparkles() { for (let i = 0; i < 10; i++) { const sparkle = document.createElement('div'); sparkle.classList.add('sparkle'); // Random position const x = Math.random() * 600; const y = Math.random() * 600; sparkle.style.left = `${x}px`; sparkle.style.top = `${y}px`; document.querySelector('.game-container').appendChild(sparkle); // Remove sparkle after animation completes setTimeout(() => { sparkle.remove(); }, 800); } } // Create confetti celebration function createConfetti() { for (let i = 0; i < 50; i++) { const confetti = document.createElement('div'); confetti.classList.add('confetti'); // Random position, color and shape const x = Math.random() * 680; confetti.style.left = `${x}px`; // Random color const colors = ['#FFD700', '#4E9AF1', '#7BC950', '#E55B88', '#FF9933']; const color = colors[Math.floor(Math.random() * colors.length)]; confetti.style.backgroundColor = color; // Random shape const shapes = ['circle', 'square', 'triangle']; const shape = shapes[Math.floor(Math.random() * shapes.length)]; if (shape === 'circle') { confetti.style.borderRadius = '50%'; } else if (shape === 'triangle') { confetti.style.width = '0'; confetti.style.height = '0'; confetti.style.backgroundColor = 'transparent'; confetti.style.borderLeft = '5px solid transparent'; confetti.style.borderRight = '5px solid transparent'; confetti.style.borderBottom = `10px solid ${color}`; } // Random rotation and delay const delay = Math.random() * 2; confetti.style.animationDelay = `${delay}s`; celebrationsEl.appendChild(confetti); // Remove confetti after animation setTimeout(() => { confetti.remove(); }, 3000); } } // Add animated coin to collection function addCoin(value) { // Determine coin type based on value let coinType; if (value <= 5) coinType = 1; else if (value <= 10) coinType = 5; else if (value <= 20) coinType = 10; else if (value <= 30) coinType = 25; else coinType = 50; const color = coinColors[coinType]; const coin = document.createElement('div'); coin.classList.add('coin'); coin.innerHTML = ` <div class="coin-front" style="background: radial-gradient(circle at 30% 30%, ${color.bg}, ${color.border});">${coinType}</div> <div class="coin-edge" style="background: ${color.border};"></div> <div class="coin-back" style="background: radial-gradient(circle at 30% 30%, ${color.border}, ${color.bg});"></div> `; // Fly in animation coin.style.transform = 'scale(0) rotateY(0)'; coinCollectionEl.appendChild(coin); setTimeout(() => { coin.style.transform = 'scale(1) rotateY(0)'; }, 100); // Make coins clickable for fun coin.addEventListener('click', () => { createSparkles(); coin.style.animation = 'none'; coin.style.transform = 'scale(1.2) rotateY(0)'; setTimeout(() => { coin.style.animation = 'rotate 3s infinite linear'; }, 300); }); } // Update UI with current game state function updateUI() { scoreEl.textContent = gameState.score; levelEl.textContent = gameState.level; starsEl.textContent = gameState.stars; } // Reset game function resetGame() { gameState.score = 0; gameState.level = 1; gameState.stars = 0; gameState.questionsAnswered = 0; gameState.correctAnswers = 0; // Clear coin collection except for the pouch const pouch = coinCollectionEl.querySelector('.coin-pouch'); coinCollectionEl.innerHTML = ''; coinCollectionEl.appendChild(pouch); // Reset progress progressEl.style.width = "0%"; // Update UI updateUI(); // Generate new problem generateProblem(); // Clear feedback feedbackEl.textContent = ""; } }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>AR Treasure Hunt Collectibles</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background: #121212; color: #f0f0f0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 700px; width: 700px; margin: 0 auto; overflow: hidden; position: relative; } .bg-pattern { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: radial-gradient(circle at 10% 20%, rgba(50, 50, 50, 0.1) 0%, transparent 20%), radial-gradient(circle at 90% 80%, rgba(50, 50, 50, 0.1) 0%, transparent 20%); z-index: -1; } .app-container { width: 100%; max-width: 700px; padding: 20px; display: flex; flex-direction: column; gap: 25px; } header { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .logo { font-size: 24px; font-weight: bold; background: linear-gradient(45deg, #FFD700, #FFA500); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; } .logo::after { content: ''; position: absolute; width: 100%; height: 3px; bottom: -5px; left: 0; background: linear-gradient(45deg, #FFD700, #FFA500); border-radius: 10px; } .stats { display: flex; gap: 20px; } .stat { display: flex; flex-direction: column; align-items: center; } .stat-value { font-size: 20px; font-weight: bold; color: #FFD700; } .stat-label { font-size: 12px; color: #888; } .scan-area { display: flex; flex-direction: column; align-items: center; margin-top: 10px; position: relative; } .scan-border { width: 280px; height: 280px; border: 2px dashed rgba(255, 215, 0, 0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; transition: all 0.3s ease; } .scan-border::before { content: ''; position: absolute; width: 290px; height: 290px; border: 1px solid rgba(255, 215, 0, 0.2); border-radius: 50%; } .scan-border::after { content: ''; position: absolute; width: 310px; height: 310px; border: 1px solid rgba(255, 215, 0, 0.1); border-radius: 50%; } .scan-text { position: absolute; top: -40px; background: rgba(0, 0, 0, 0.7); padding: 8px 16px; border-radius: 20px; font-size: 14px; color: #FFD700; border: 1px solid rgba(255, 215, 0, 0.3); } .scan-icon { font-size: 24px; color: rgba(255, 215, 0, 0.7); animation: pulse 2s infinite; } @keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 0.7; } } .coins-showcase { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 10px; margin-top: 20px; } .coin-wrapper { position: relative; width: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; perspective: 1000px; cursor: pointer; } .coin { width: 80%; height: 80%; position: relative; transition: transform 0.6s; transform-style: preserve-3d; border-radius: 50%; } .coin-front, .coin-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 0 10px rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.1); } .coin-front { background: linear-gradient(45deg, #d4af37, #ffd700, #d4af37); } .coin-back { background: linear-gradient(45deg, #d4af37, #ffd700, #d4af37); transform: rotateY(180deg); } .coin-symbol { font-size: 30px; color: rgba(0, 0, 0, 0.7); text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); } .coin.gold { background: linear-gradient(45deg, #d4af37, #ffd700, #d4af37); } .coin.silver { background: linear-gradient(45deg, #c0c0c0, #e8e8e8, #c0c0c0); } .coin.bronze { background: linear-gradient(45deg, #cd7f32, #e3a46f, #cd7f32); } .coin-detail { position: absolute; width: 95%; height: 95%; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.1); top: 2.5%; left: 2.5%; } .coin-detail-inner { position: absolute; width: 75%; height: 75%; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.1); top: 12.5%; left: 12.5%; } .coin-reflections { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; background: linear-gradient( 45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70% ); transform: rotate(45deg); pointer-events: none; } .coin-name { position: absolute; bottom: -25px; left: 0; right: 0; text-align: center; font-size: 12px; color: #FFD700; opacity: 0; transition: opacity 0.3s ease; } .coin-wrapper:hover .coin-name { opacity: 1; } .coin-details { font-size: 8px; position: absolute; width: 100%; text-align: center; color: rgba(0, 0, 0, 0.7); } .coin-wrapper:hover .coin { transform: rotateY(180deg); } .collection-panel { width: 100%; padding: 15px; background: rgba(30, 30, 30, 0.5); border-radius: 10px; margin-top: 10px; } .collection-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; } .collection-title { font-size: 18px; font-weight: bold; color: #FFD700; } .collection-progress { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; margin-bottom: 15px; } .progress-bar { height: 100%; background: linear-gradient(90deg, #FFD700, #FFA500); border-radius: 3px; width: 40%; transition: width 0.5s ease; } .collection-stats { display: flex; justify-content: space-between; font-size: 12px; color: #888; } .cta-button { padding: 12px 25px; background: linear-gradient(45deg, #FFD700, #FFA500); color: #000; border: none; border-radius: 25px; font-weight: bold; cursor: pointer; transition: all 0.3s ease; margin-top: 15px; align-self: center; position: relative; overflow: hidden; } .cta-button::before { content: ''; position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px; background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700); z-index: -1; filter: blur(10px); opacity: 0; transition: opacity 0.3s ease; } .cta-button:hover::before { opacity: 0.7; } .cta-button:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); } .cta-button:active { transform: scale(0.95); } .scan-animation { position: absolute; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; opacity: 0; } .loading-line { position: absolute; height: 2px; width: 100%; background: linear-gradient(90deg, transparent, #FFD700, transparent); top: 50%; animation: scanning 2s infinite ease-in-out; } @keyframes scanning { 0% { transform: translateY(-100px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(100px); opacity: 0; } } .found-coin { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(45deg, #d4af37, #ffd700, #d4af37); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3); opacity: 0; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10; } .found-coin.show { transform: translate(-50%, -50%) scale(1); opacity: 1; animation: coinPulse 0.5s ease-in-out; } @keyframes coinPulse { 0% { transform: translate(-50%, -50%) scale(0.5); } 50% { transform: translate(-50%, -50%) scale(1.1); } 100% { transform: translate(-50%, -50%) scale(1); } } .tactile-feedback { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 215, 0, 0.1); z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; } .haptic-ring { position: absolute; border-radius: 50%; border: 2px solid #FFD700; width: 50px; height: 50px; transform: translate(-50%, -50%) scale(0); pointer-events: none; opacity: 0; } @keyframes hapticPulse { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(2); opacity: 0; } } .ar-instructions { background: rgba(30, 30, 30, 0.7); padding: 12px; border-radius: 8px; margin-top: 20px; border-left: 3px solid #FFD700; font-size: 14px; line-height: 1.4; } .ar-instructions h3 { color: #FFD700; margin-bottom: 8px; font-size: 16px; } .ar-tip { margin-top: 8px; color: #aaa; font-style: italic; font-size: 12px; } @media (max-width: 500px) { .coins-showcase { grid-template-columns: repeat(2, 1fr); } .scan-border { width: 220px; height: 220px; } .scan-border::before { width: 230px; height: 230px; } .scan-border::after { width: 250px; height: 250px; } } </style> </head> <body> <div class="bg-pattern"></div> <div class="app-container"> <header> <div class="logo">AR Treasure</div> <div class="stats"> <div class="stat"> <div class="stat-value">14</div> <div class="stat-label">FOUND</div> </div> <div class="stat"> <div class="stat-value">35</div> <div class="stat-label">TOTAL</div> </div> </div> </header> <div class="scan-area"> <div class="scan-text">Point camera at flat surfaces</div> <div class="scan-border"> <div class="scan-icon"> <i class="fas">⊕</i> </div> <div class="scan-animation"> <div class="loading-line"></div> </div> <div class="found-coin"> <div class="coin-symbol">₭</div> <div class="coin-reflections"></div> </div> </div> </div> <div class="collection-panel"> <div class="collection-header"> <div class="collection-title">Mythic Metals Collection</div> <div>14/35</div> </div> <div class="collection-progress"> <div class="progress-bar"></div> </div> <div class="collection-stats"> <div>Rare: 4/10</div> <div>Epic: 2/15</div> <div>Legendary: 0/5</div> </div> </div> <div class="coins-showcase"> <div class="coin-wrapper"> <div class="coin"> <div class="coin-front"> <div class="coin-symbol">₳</div> <div class="coin-detail"></div> <div class="coin-detail-inner"></div> </div> <div class="coin-back"> <div class="coin-details">ANCIENT ATHENS · 500 BCE</div> </div> <div class="coin-reflections"></div> </div> <div class="coin-name">Athenian Drachma</div> </div> <div class="coin-wrapper"> <div class="coin"> <div class="coin-front"> <div class="coin-symbol">₮</div> <div class="coin-detail"></div> <div class="coin-detail-inner"></div> </div> <div class="coin-back"> <div class="coin-details">ROMAN EMPIRE · 117 CE</div> </div> <div class="coin-reflections"></div> </div> <div class="coin-name">Trajan Denarius</div> </div> <div class="coin-wrapper"> <div class="coin"> <div class="coin-front"> <div class="coin-symbol">₵</div> <div class="coin-detail"></div> <div class="coin-detail-inner"></div> </div> <div class="coin-back"> <div class="coin-details">CONSTANTINOPLE · 330 CE</div> </div> <div class="coin-reflections"></div> </div> <div class="coin-name">Byzantine Solidus</div> </div> <div class="coin-wrapper"> <div class="coin"> <div class="coin-front"> <div class="coin-symbol">𐆂</div> <div class="coin-detail"></div> <div class="coin-detail-inner"></div> </div> <div class="coin-back"> <div class="coin-details">MAYA CIVILIZATION · 800 CE</div> </div> <div class="coin-reflections"></div> </div> <div class="coin-name">Maya Cacao Token</div> </div> <div class="coin-wrapper"> <div class="coin"> <div class="coin-front"> <div class="coin-symbol">₢</div> <div class="coin-detail"></div> <div class="coin-detail-inner"></div> </div> <div class="coin-back"> <div class="coin-details">IMPERIAL CHINA · 1100 CE</div> </div> <div class="coin-reflections"></div> </div> <div class="coin-name">Song Dynasty Coin</div> </div> <div class="coin-wrapper"> <div class="coin"> <div class="coin-front"> <div class="coin-symbol">?</div> <div class="coin-detail"></div> <div class="coin-detail-inner"></div> </div> <div class="coin-back"> <div class="coin-details">UNDISCOVERED</div> </div> <div class="coin-reflections"></div> </div> <div class="coin-name">???</div> </div> </div> <div class="ar-instructions"> <h3>Hunting Tips</h3> <p>Move your device slowly to detect surfaces where coins may be hidden. Digital coins respond to real-world lighting conditions.</p> <p class="ar-tip">When a coin is found, your device will vibrate with a unique pattern based on the coin's rarity.</p> </div> <button class="cta-button" id="scan-button">ACTIVATE AR SCANNER</button> </div> <div class="tactile-feedback" id="tactileFeedback"></div> <div class="haptic-ring" id="hapticRing"></div> <script> document.addEventListener('DOMContentLoaded', () => { // Elements const scanButton = document.getElementById('scan-button'); const scanBorder = document.querySelector('.scan-border'); const scanAnimation = document.querySelector('.scan-animation'); const foundCoin = document.querySelector('.found-coin'); const tactileFeedback = document.getElementById('tactileFeedback'); const hapticRing = document.getElementById('hapticRing'); const coinWrappers = document.querySelectorAll('.coin-wrapper'); const progressBar = document.querySelector('.progress-bar'); // Track mouse position for dynamic lighting effects document.addEventListener('mousemove', (e) => { const x = e.clientX / window.innerWidth; const y = e.clientY / window.innerHeight; // Update coin reflections based on mouse position document.querySelectorAll('.coin-reflections').forEach(reflection => { reflection.style.background = `linear-gradient( ${x * 360}deg, transparent ${30 + y * 20}%, rgba(255, 255, 255, ${0.1 + y * 0.2}) ${50 + x * 10}%, transparent ${70 + y * 10}% )`; }); }); // Scanning functionality let isScanning = false; scanButton.addEventListener('click', () => { if (isScanning) { stopScanning(); } else { startScanning(); } }); function startScanning() { isScanning = true; scanButton.textContent = 'STOP SCANNING'; scanBorder.style.borderColor = 'rgba(255, 215, 0, 0.8)'; scanAnimation.style.opacity = '1'; // Simulate finding a coin after a random delay setTimeout(() => { if (isScanning) { coinFound(); } }, 2000 + Math.random() * 3000); } function stopScanning() { isScanning = false; scanButton.textContent = 'ACTIVATE AR SCANNER'; scanBorder.style.borderColor = 'rgba(255, 215, 0, 0.5)'; scanAnimation.style.opacity = '0'; foundCoin.classList.remove('show'); } function coinFound() { scanAnimation.style.opacity = '0'; foundCoin.classList.add('show'); // Trigger tactile feedback triggerTactileFeedback(); // Update progress to simulate collection setTimeout(() => { progressBar.style.width = '45%'; // Create a new revealed coin in the collection if (document.querySelectorAll('.coin-wrapper').length >= 6) { const lastCoin = document.querySelector('.coin-wrapper:last-child'); lastCoin.querySelector('.coin-symbol').textContent = '₭'; lastCoin.querySelector('.coin-name').textContent = 'Kingsfoil Token'; lastCoin.querySelector('.coin-details').textContent = 'LOST CITY · 1453 CE'; } // Reset scan after a delay setTimeout(() => { if (isScanning) { foundCoin.classList.remove('show'); scanAnimation.style.opacity = '1'; // Maybe find another coin setTimeout(() => { if (isScanning) { coinFound(); } }, 5000 + Math.random() * 5000); } }, 2000); }, 1000); } function triggerTactileFeedback() { // Visual feedback to simulate device vibration tactileFeedback.style.opacity = '0.5'; setTimeout(() => { tactileFeedback.style.opacity = '0'; }, 100); setTimeout(() => { tactileFeedback.style.opacity = '0.3'; setTimeout(() => { tactileFeedback.style.opacity = '0'; }, 80); }, 200); setTimeout(() => { tactileFeedback.style.opacity = '0.7'; setTimeout(() => { tactileFeedback.style.opacity = '0'; }, 120); }, 350); // Create haptic rings at coin position createHapticRing(); } function createHapticRing() { const ring = document.createElement('div'); ring.className = 'haptic-ring'; ring.style.left = '50%'; ring.style.top = '50%'; document.body.appendChild(ring); // Start animation ring.style.animation = 'hapticPulse 1s ease-out forwards'; // Remove after animation completes setTimeout(() => { ring.remove(); }, 1000); } // Apply dynamic lighting to coins on hover coinWrappers.forEach(wrapper => { wrapper.addEventListener('mousemove', (e) => { const coin = wrapper.querySelector('.coin'); const rect = wrapper.getBoundingClientRect(); const x = (e.clientX - rect.left) / rect.width - 0.5; const y = (e.clientY - rect.top) / rect.height - 0.5; // Tilt effect coin.style.transform = `rotateY(${x * 20}deg) rotateX(${-y * 20}deg)`; // Dynamic reflections const reflection = wrapper.querySelector('.coin-reflections'); reflection.style.background = `linear-gradient( ${(x + 0.5) * 360}deg, transparent ${30 + (y + 0.5) * 20}%, rgba(255, 255, 255, 0.3) 50%, transparent ${70 - (y + 0.5) * 20}% )`; }); wrapper.addEventListener('mouseleave', () => { const coin = wrapper.querySelector('.coin'); coin.style.transform = 'rotateY(0) rotateX(0)'; }); // Simulate collection on click wrapper.addEventListener('click', () => { createHapticRing(); tactileFeedback.style.opacity = '0.5'; setTimeout(() => { tactileFeedback.style.opacity = '0'; }, 100); }); }); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Luxury Casino Coins</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Playfair Display', serif; } body { width: 100%; height: 100%; background-color: #0E0E10; color: #FFF; display: flex; justify-content: center; align-items: center; overflow: hidden; perspective: 1000px; } #casino-container { width: 700px; height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; background: radial-gradient(circle at center, #1A1A1E, #0A0A0C); overflow: hidden; padding: 20px; } h1 { font-size: 2.5rem; margin-bottom: 10px; text-align: center; background: linear-gradient(45deg, #FFD700, #FFA500); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); font-weight: 700; letter-spacing: 1px; position: relative; z-index: 2; } .subtitle { font-size: 1.2rem; color: #CCCCCC; margin-bottom: 30px; text-align: center; font-style: italic; position: relative; z-index: 2; } .coin-collection { display: flex; justify-content: center; flex-wrap: wrap; width: 100%; margin: 20px 0; position: relative; z-index: 2; } .coin { width: 150px; height: 150px; margin: 10px; position: relative; transform-style: preserve-3d; cursor: pointer; transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55); } .coin:hover { transform: rotateY(180deg) scale(1.05); } .coin-face { position: absolute; width: 100%; height: 100%; border-radius: 50%; backface-visibility: hidden; display: flex; justify-content: center; align-items: center; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); } .coin-front { background: linear-gradient(45deg, #FFD700, #FFCC00); transform: rotateY(0deg); } .coin-back { background: linear-gradient(45deg, #E8C568, #D4AF37); transform: rotateY(180deg); } .coin-border { position: absolute; width: 94%; height: 94%; border-radius: 50%; border: 3px dashed #7D5C0F; opacity: 0.7; } .coin-inner { position: absolute; width: 80%; height: 80%; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-direction: column; padding: 10px; text-align: center; } .coin-value { font-size: 1.8rem; font-weight: bold; color: #000; text-shadow: 0 0 2px rgba(255, 255, 255, 0.5); } .coin-icon { font-size: 1.5rem; margin-bottom: 5px; color: #000; } .coin-text { font-size: 0.7rem; text-transform: uppercase; font-weight: bold; color: #000; letter-spacing: 1px; } .pattern { position: absolute; width: 100%; height: 100%; border-radius: 50%; opacity: 0.15; background-image: radial-gradient(circle at 25% 25%, #FFF 1px, transparent 1px), radial-gradient(circle at 75% 75%, #FFF 1px, transparent 1px); background-size: 20px 20px; } .control-panel { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 30px; position: relative; z-index: 2; width: 100%; } .bet-btn { padding: 12px 25px; margin: 0 10px; background: linear-gradient(45deg, #D4AF37, #FFD700); border: none; border-radius: 5px; color: #000; font-weight: bold; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); position: relative; overflow: hidden; } .bet-btn:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); } .bet-btn:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); } .bet-btn::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient( rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) ); transform: rotate(30deg); transition: all 0.5s ease; } .bet-btn:hover::after { transform: rotate(30deg) translate(10%, 10%); } .balance-display { background: rgba(0, 0, 0, 0.6); padding: 15px 25px; border-radius: 10px; margin-top: 20px; border: 1px solid #D4AF37; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); } .balance-value { color: #FFD700; font-size: 1.5rem; font-weight: bold; margin-left: 10px; } .coins-rain { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; } .rain-coin { position: absolute; background: radial-gradient(circle at center, #FFD700, #D4AF37); border-radius: 50%; opacity: 0; width: 20px; height: 20px; transform: translateY(-50px); animation: rainFall 3s linear forwards; } @keyframes rainFall { 0% { transform: translateY(-50px) rotate(0deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(800px) rotate(720deg); opacity: 0; } } .casino-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23000" opacity="0.05"/><path d="M20 10H80L50 40z" fill="%23D4AF37" opacity="0.05"/><path d="M20 90H80L50 60z" fill="%23D4AF37" opacity="0.05"/></svg>'); background-size: 100px 100px; opacity: 0.2; pointer-events: none; z-index: 0; } @keyframes spin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } } .spinning { animation: spin 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); } @media (max-width: 700px) { h1 { font-size: 2rem; } .subtitle { font-size: 1rem; } .coin { width: 120px; height: 120px; } .coin-value { font-size: 1.5rem; } .bet-btn { padding: 10px 20px; margin: 5px; } } @media (max-width: 480px) { .coin { width: 100px; height: 100px; } .control-panel { flex-direction: column; } .bet-btn { margin: 5px 0; } } </style> </head> <body> <div id="casino-container"> <div class="casino-bg"></div> <h1>ROYAL FORTUNE</h1> <p class="subtitle">Where Luxury Meets Fortune</p> <div class="coin-collection"> <div class="coin" data-value="100"> <div class="coin-face coin-front"> <div class="coin-border"></div> <div class="coin-inner"> <div class="coin-icon">♦</div> <div class="coin-value">100</div> <div class="coin-text">High Roller</div> </div> <div class="pattern"></div> </div> <div class="coin-face coin-back"> <div class="coin-border"></div> <div class="coin-inner"> <div class="coin-icon">♠</div> <div class="coin-text">Royal Fortune</div> </div> <div class="pattern"></div> </div> </div> <div class="coin" data-value="50"> <div class="coin-face coin-front"> <div class="coin-border"></div> <div class="coin-inner"> <div class="coin-icon">♥</div> <div class="coin-value">50</div> <div class="coin-text">Flush Fund</div> </div> <div class="pattern"></div> </div> <div class="coin-face coin-back"> <div class="coin-border"></div> <div class="coin-inner"> <div class="coin-icon">♣</div> <div class="coin-text">Royal Fortune</div> </div> <div class="pattern"></div> </div> </div> <div class="coin" data-value="25"> <div class="coin-face coin-front"> <div class="coin-border"></div> <div class="coin-inner"> <div class="coin-icon">♠</div> <div class="coin-value">25</div> <div class="coin-text">Straight Play</div> </div> <div class="pattern"></div> </div> <div class="coin-face coin-back"> <div class="coin-border"></div> <div class="coin-inner"> <div class="coin-icon">♦</div> <div class="coin-text">Royal Fortune</div> </div> <div class="pattern"></div> </div> </div> </div> <div class="control-panel"> <button class="bet-btn" id="bet-max">BET MAX</button> <button class="bet-btn" id="bet-spin">SPIN & WIN</button> <button class="bet-btn" id="cashout">CASH OUT</button> </div> <div class="balance-display"> YOUR BALANCE: <span class="balance-value">1,000</span> </div> <div class="coins-rain" id="coins-rain"></div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const coins = document.querySelectorAll('.coin'); const betMax = document.getElementById('bet-max'); const betSpin = document.getElementById('bet-spin'); const cashout = document.getElementById('cashout'); const balanceValue = document.querySelector('.balance-value'); const coinsRain = document.getElementById('coins-rain'); let balance = 1000; let selectedCoin = null; // Make coins interactive coins.forEach(coin => { coin.addEventListener('click', function() { // Deselect previously selected coin if (selectedCoin) { selectedCoin.style.boxShadow = ''; } // Select this coin selectedCoin = this; this.style.boxShadow = '0 0 20px 5px rgba(255, 215, 0, 0.7)'; // Trigger spin animation this.classList.add('spinning'); setTimeout(() => { this.classList.remove('spinning'); }, 1500); }); }); // Bet Max button functionality betMax.addEventListener('click', function() { const maxValue = Math.max(...Array.from(coins).map(coin => parseInt(coin.dataset.value))); const maxCoin = Array.from(coins).find(coin => parseInt(coin.dataset.value) === maxValue); // Trigger click on max value coin if (maxCoin) { maxCoin.click(); } // Visual feedback this.classList.add('active'); setTimeout(() => { this.classList.remove('active'); }, 200); }); // Spin & Win button functionality betSpin.addEventListener('click', function() { if (!selectedCoin) { shakeCoinCollection(); return; } const betAmount = parseInt(selectedCoin.dataset.value); if (balance >= betAmount) { balance -= betAmount; updateBalance(); // Animate all coins coins.forEach(coin => { coin.classList.add('spinning'); setTimeout(() => { coin.classList.remove('spinning'); }, 1500); }); // Determine win (random for demo) setTimeout(() => { const win = Math.random() > 0.5; if (win) { const winAmount = betAmount * (Math.floor(Math.random() * 5) + 2); balance += winAmount; updateBalance(); createCoinsRain(); } }, 1600); } else { // Not enough balance - shake the balance display const balanceDisplay = document.querySelector('.balance-display'); balanceDisplay.style.animation = 'none'; void balanceDisplay.offsetWidth; balanceDisplay.style.animation = 'shake 0.5s'; } // Visual feedback this.classList.add('active'); setTimeout(() => { this.classList.remove('active'); }, 200); }); // Cash Out button functionality cashout.addEventListener('click', function() { const oldBalance = balance; if (oldBalance > 0) { // Visual celebration createCoinsRain(); // Flash the balance green before zeroing balanceValue.style.color = '#50C878'; setTimeout(() => { balance = 0; updateBalance(); balanceValue.style.color = '#FFD700'; }, 1000); } // Visual feedback this.classList.add('active'); setTimeout(() => { this.classList.remove('active'); }, 200); }); // Update balance display function updateBalance() { balanceValue.textContent = balance.toLocaleString(); } // Create raining coins effect function createCoinsRain() { coinsRain.innerHTML = ''; for (let i = 0; i < 30; i++) { setTimeout(() => { const coin = document.createElement('div'); coin.classList.add('rain-coin'); coin.style.left = `${Math.random() * 100}%`; coin.style.width = `${Math.random() * 15 + 10}px`; coin.style.height = coin.style.width; coin.style.animationDuration = `${Math.random() * 2 + 2}s`; coinsRain.appendChild(coin); // Remove after animation setTimeout(() => { coin.remove(); }, 3000); }, i * 100); } } // Shake effect when no coin selected function shakeCoinCollection() { const coinCollection = document.querySelector('.coin-collection'); coinCollection.style.animation = 'none'; void coinCollection.offsetWidth; coinCollection.style.animation = 'shake 0.5s'; } // Add shake animation const style = document.createElement('style'); style.textContent = ` @keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } 20%, 40%, 60%, 80% { transform: translateX(5px); } } `; document.head.appendChild(style); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Premium Subscription Coins</title> <style> :root { --primary-gold: #d4af37; --secondary-gold: #ffdf5e; --dark-gold: #a07e1c; --silver: #c0c0c0; --platinum: #e5e4e2; --background: #f8f9fa; --text-dark: #2d2d2d; --text-light: #6b6b6b; --shadow-subtle: rgba(0, 0, 0, 0.08); --shadow-medium: rgba(0, 0, 0, 0.12); --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px; --transition-slow: 0.5s cubic-bezier(0.25, 1, 0.5, 1); --transition-normal: 0.3s cubic-bezier(0.25, 1, 0.5, 1); --transition-fast: 0.15s cubic-bezier(0.25, 1, 0.5, 1); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; } body { background-color: var(--background); color: var(--text-dark); height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-x: hidden; padding: 20px; } .container { max-width: 650px; width: 100%; height: 650px; display: flex; flex-direction: column; align-items: center; overflow: hidden; } header { text-align: center; margin-bottom: 30px; width: 100%; } h1 { font-size: 28px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; color: var(--text-dark); } p.tagline { font-size: 16px; color: var(--text-light); max-width: 450px; margin: 0 auto 10px; font-weight: 400; line-height: 1.6; } .coins-container { display: flex; justify-content: center; align-items: stretch; gap: 20px; width: 100%; flex-wrap: wrap; margin-bottom: 30px; } .coin-wrapper { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 180px; max-width: 200px; perspective: 1000px; } .coin { position: relative; width: 140px; height: 140px; border-radius: 50%; margin-bottom: 16px; cursor: pointer; transform-style: preserve-3d; transition: transform var(--transition-slow); } .coin:hover { transform: rotateY(180deg); } .coin-face { position: absolute; width: 100%; height: 100%; border-radius: 50%; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px var(--shadow-subtle), 0 8px 30px var(--shadow-medium); overflow: hidden; } .coin-front { background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold)); } .coin-front.silver { background: linear-gradient(135deg, var(--silver), #f5f5f5); } .coin-front.platinum { background: linear-gradient(135deg, var(--platinum), #ffffff); } .coin-back { transform: rotateY(180deg); background: linear-gradient(135deg, var(--dark-gold), var(--primary-gold)); } .coin-back.silver { background: linear-gradient(135deg, #8c8c8c, var(--silver)); } .coin-back.platinum { background: linear-gradient(135deg, #b3b3b3, var(--platinum)); } .coin-detail { position: absolute; width: 85%; height: 85%; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: rgba(0, 0, 0, 0.7); } .coin-detail-back { color: rgba(255, 255, 255, 0.9); } .coin-tier { font-size: 22px; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; } .coin-symbol { font-size: 32px; margin-bottom: 4px; } .coin-value { font-size: 15px; font-weight: 500; } .coin-info { text-align: center; width: 100%; } .coin-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; color: var(--text-dark); } .coin-description { font-size: 14px; font-weight: 400; color: var(--text-light); line-height: 1.4; margin-bottom: 12px; } .coin-extra { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; color: var(--text-light); font-weight: 500; } .coin-pulse { position: absolute; width: 100%; height: 100%; border-radius: 50%; background: transparent; z-index: -1; } .plan-benefits { background: white; border-radius: var(--radius-md); padding: 24px; width: 100%; box-shadow: 0 4px 20px var(--shadow-subtle); text-align: center; } .benefits-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: var(--text-dark); } .benefits-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; } .benefit-item { display: flex; align-items: flex-start; text-align: left; padding: 6px 0; } .benefit-icon { color: var(--primary-gold); margin-right: 10px; font-size: 18px; } .benefit-text { font-size: 14px; line-height: 1.5; color: var(--text-dark); } .selected-coin { animation: selectedPulse 2s infinite; box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3); } @keyframes coinPulse { 0% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.1); opacity: 0.2; } 100% { transform: scale(1); opacity: 0.6; } } @keyframes selectedPulse { 0% { box-shadow: 0 0 0 0px rgba(212, 175, 55, 0.3); } 70% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); } 100% { box-shadow: 0 0 0 0px rgba(212, 175, 55, 0); } } @media (max-width: 640px) { h1 { font-size: 24px; } .coins-container { gap: 10px; } .coin-wrapper { min-width: 120px; } .coin { width: 100px; height: 100px; } .coin-tier { font-size: 18px; } .coin-symbol { font-size: 26px; } .benefits-list { grid-template-columns: 1fr; } } </style> </head> <body> <div class="container"> <header> <h1>Membership Benefits</h1> <p class="tagline">Explore our premium subscription tiers, each represented by a unique coin that unlocks exclusive services and benefits.</p> </header> <div class="coins-container"> <div class="coin-wrapper"> <div class="coin" data-tier="silver"> <div class="coin-pulse"></div> <div class="coin-face coin-front silver"> <div class="coin-detail"> <div class="coin-tier">Silver</div> <div class="coin-symbol">Ag</div> <div class="coin-value">15 Credits</div> </div> </div> <div class="coin-face coin-back silver"> <div class="coin-detail coin-detail-back"> <div class="coin-tier">Silver</div> <div class="coin-value">Est. 2023</div> </div> </div> </div> <div class="coin-info"> <div class="coin-title">Essentials</div> <div class="coin-description">Core features with basic support and monthly updates</div> <div class="coin-extra">$9.99/month</div> </div> </div> <div class="coin-wrapper"> <div class="coin" data-tier="gold"> <div class="coin-pulse"></div> <div class="coin-face coin-front"> <div class="coin-detail"> <div class="coin-tier">Gold</div> <div class="coin-symbol">Au</div> <div class="coin-value">50 Credits</div> </div> </div> <div class="coin-face coin-back"> <div class="coin-detail coin-detail-back"> <div class="coin-tier">Gold</div> <div class="coin-value">Est. 2023</div> </div> </div> </div> <div class="coin-info"> <div class="coin-title">Professional</div> <div class="coin-description">Advanced features with priority support</div> <div class="coin-extra">$24.99/month</div> </div> </div> <div class="coin-wrapper"> <div class="coin" data-tier="platinum"> <div class="coin-pulse"></div> <div class="coin-face coin-front platinum"> <div class="coin-detail"> <div class="coin-tier">Platinum</div> <div class="coin-symbol">Pt</div> <div class="coin-value">100 Credits</div> </div> </div> <div class="coin-face coin-back platinum"> <div class="coin-detail coin-detail-back"> <div class="coin-tier">Platinum</div> <div class="coin-value">Est. 2023</div> </div> </div> </div> <div class="coin-info"> <div class="coin-title">Enterprise</div> <div class="coin-description">Unlimited usage with dedicated account manager</div> <div class="coin-extra">$49.99/month</div> </div> </div> </div> <div class="plan-benefits"> <div class="benefits-title">Selected Plan Benefits</div> <div class="benefits-list" id="benefits-container"> <div class="benefit-item"> <span class="benefit-icon">✦</span> <span class="benefit-text">Select a coin above to see included benefits</span> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded', function() { const coins = document.querySelectorAll('.coin'); const benefitsContainer = document.getElementById('benefits-container'); let selectedCoin = null; const benefits = { silver: [ "15 monthly service credits", "Basic access to all platform tools", "Standard response time customer service", "Weekly content updates" ], gold: [ "50 monthly service credits", "Priority access to new features", "24-hour customer support response", "Advanced analytics dashboard", "Customizable workspace options" ], platinum: [ "100 monthly service credits", "Unlimited access to all premium features", "Dedicated account manager", "White-glove onboarding service", "Custom API integration support", "Exclusive early access to beta features" ] }; // Add pulse animation to coins coins.forEach(coin => { const pulse = coin.querySelector('.coin-pulse'); pulse.style.animation = 'coinPulse 4s infinite'; // Offset the animations const random = Math.random() * 2; pulse.style.animationDelay = `${random}s`; coin.addEventListener('click', function() { // Remove selected class from previous selection if (selectedCoin) { selectedCoin.classList.remove('selected-coin'); } // Add selected class to current coin this.classList.add('selected-coin'); selectedCoin = this; const tier = this.getAttribute('data-tier'); updateBenefits(tier); }); }); function updateBenefits(tier) { // Clear existing benefits benefitsContainer.innerHTML = ''; // Add new benefits const tierBenefits = benefits[tier]; tierBenefits.forEach(benefit => { const benefitItem = document.createElement('div'); benefitItem.className = 'benefit-item'; benefitItem.innerHTML = ` <span class="benefit-icon">✦</span> <span class="benefit-text">${benefit}</span> `; benefitsContainer.appendChild(benefitItem); // Add entrance animation setTimeout(() => { benefitItem.style.opacity = '0'; benefitItem.style.transform = 'translateY(10px)'; benefitItem.style.transition = 'opacity 0.3s ease, transform 0.3s ease'; setTimeout(() => { benefitItem.style.opacity = '1'; benefitItem.style.transform = 'translateY(0)'; }, 10); }, 0); }); } // Set default to gold tier setTimeout(() => { const goldCoin = document.querySelector('[data-tier="gold"]'); goldCoin.click(); }, 500); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3D Interactive Coin Experience</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; } body { background: #0f0f1e; color: #fff; overflow-x: hidden; height: 700px; width: 700px; max-width: 100%; max-height: 100%; position: relative; } .container { width: 100%; height: 100%; overflow-y: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; perspective: 1000px; scrollbar-width: thin; scrollbar-color: #2a2a40 #0f0f1e; } .container::-webkit-scrollbar { width: 5px; } .container::-webkit-scrollbar-track { background: #0f0f1e; } .container::-webkit-scrollbar-thumb { background-color: #2a2a40; border-radius: 20px; } section { height: 100%; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; min-height: 700px; } h1 { font-size: 2.5rem; margin-bottom: 1rem; background: linear-gradient(to right, #f5d77b, #e6b325); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; text-align: center; } p { font-size: 1rem; line-height: 1.6; max-width: 500px; margin-bottom: 1.5rem; text-align: center; opacity: 0.85; } .coins-container { position: relative; width: 100%; height: 300px; display: flex; justify-content: center; align-items: center; margin: 2rem 0; } .coin { position: absolute; width: 150px; height: 150px; transform-style: preserve-3d; transform: rotateY(0deg) rotateX(15deg); transition: transform 0.3s ease-out; cursor: pointer; } .coin-face { position: absolute; width: 100%; height: 100%; border-radius: 50%; backface-visibility: hidden; background-size: cover; background-position: center; box-shadow: 0 0 20px rgba(245, 215, 123, 0.5); } .coin-front { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 150 150"><circle cx="75" cy="75" r="70" fill="%23f5d77b"/><circle cx="75" cy="75" r="65" fill="%23e6b325"/><circle cx="75" cy="75" r="55" fill="%23f5d77b"/><text x="75" y="80" font-family="Arial" font-size="24" text-anchor="middle" fill="%23111">2024</text><circle cx="75" cy="75" r="40" fill="none" stroke="%23111" stroke-width="1" stroke-dasharray="2,1"/></svg>'); transform: translateZ(2px); } .coin-back { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 150 150"><circle cx="75" cy="75" r="70" fill="%23f5d77b"/><circle cx="75" cy="75" r="65" fill="%23e6b325"/><path d="M75 30 L90 75 L75 120 L60 75 Z" fill="%23111"/><circle cx="75" cy="75" r="25" fill="%23f5d77b"/></svg>'); transform: rotateY(180deg) translateZ(2px); } .coin-edge { position: absolute; width: 100%; height: 100%; transform: rotateY(90deg); transform-origin: left; background: linear-gradient(90deg, #d8a726, #f5d77b, #d8a726, #f5d77b); border-radius: 4px; left: 75px; width: 4px; } .coin-silver { filter: hue-rotate(215deg) saturate(0.4); } .coin-bronze { filter: hue-rotate(30deg) saturate(1.2) brightness(0.8); } .scroll-indicator { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; opacity: 0.7; animation: bounce 2s infinite; } .scroll-indicator span { font-size: 0.8rem; margin-bottom: 5px; } .scroll-icon { width: 20px; height: 30px; border: 2px solid #fff; border-radius: 10px; position: relative; } .scroll-icon::before { content: ''; position: absolute; width: 4px; height: 8px; background: #fff; top: 5px; left: 50%; transform: translateX(-50%); border-radius: 2px; animation: scrollDown 2s infinite; } @keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); } 40% { transform: translateY(-10px) translateX(-50%); } 60% { transform: translateY(-5px) translateX(-50%); } } @keyframes scrollDown { 0% { top: 5px; opacity: 1; } 100% { top: 17px; opacity: 0; } } .highlight-text { color: #f5d77b; font-weight: bold; } .light-ring { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 215, 123, 0.1) 0%, rgba(15, 15, 30, 0) 70%); z-index: -1; transform: translateZ(-50px); pointer-events: none; } .info-box { background: rgba(42, 42, 64, 0.7); backdrop-filter: blur(10px); border-radius: 10px; padding: 1.5rem; max-width: 450px; width: 100%; margin: 1.5rem 0; border: 1px solid rgba(245, 215, 123, 0.3); transition: transform 0.3s ease, box-shadow 0.3s ease; } .info-box:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(245, 215, 123, 0.2); } .feature-list { list-style: none; margin: 1rem 0; } .feature-list li { margin-bottom: 0.5rem; display: flex; align-items: center; } .feature-list li::before { content: '⦿'; color: #f5d77b; margin-right: 0.5rem; } .badge { display: inline-block; background: rgba(245, 215, 123, 0.2); color: #f5d77b; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; margin-right: 0.5rem; margin-bottom: 0.5rem; } #physics-toggle { background: linear-gradient(to right, #f5d77b, #e6b325); color: #0f0f1e; border: none; padding: 0.75rem 1.5rem; border-radius: 25px; font-weight: bold; cursor: pointer; transition: all 0.3s ease; margin-top: 1rem; font-size: 1rem; box-shadow: 0 5px 15px rgba(245, 215, 123, 0.3); } #physics-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(245, 215, 123, 0.4); } #physics-toggle:active { transform: translateY(1px); } .progress-container { width: 100%; height: 5px; background: rgba(42, 42, 64, 0.5); position: fixed; top: 0; left: 0; z-index: 10; } .progress-bar { height: 100%; background: linear-gradient(to right, #f5d77b, #e6b325); width: 0%; } @media (max-width: 500px) { h1 { font-size: 2rem; } p { font-size: 0.9rem; } .coin { width: 120px; height: 120px; } .info-box { padding: 1rem; } } /* Physics mode styles */ .physics-mode .coin { position: absolute; transition: none; } /* Sections */ #intro { z-index: 3; } #features { z-index: 2; } #physics { z-index: 1; } .section-fade { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; } .section-fade.visible { opacity: 1; transform: translateY(0); } </style> </head> <body> <div class="progress-container"> <div class="progress-bar" id="progressBar"></div> </div> <div class="container" id="scrollContainer"> <section id="intro"> <div class="section-fade"> <h1>Digital Currency Visualized</h1> <p>Explore the intricate details of currency through interactive 3D modeling. Scroll to navigate through our collection of meticulously crafted digital coins with <span class="highlight-text">realistic physics and lighting effects</span>.</p> <div class="coins-container" id="introCoins"> <div class="light-ring"></div> <div class="coin" id="goldCoin"> <div class="coin-face coin-front"></div> <div class="coin-face coin-back"></div> <div class="coin-edge"></div> </div> </div> <div class="info-box"> <h3>Interactive 3D Visualization</h3> <p>Each coin responds to your scroll position with parallax effects and realistic lighting. Hover and click to interact directly with each piece.</p> <div class="badges"> <span class="badge">WebGL Rendering</span> <span class="badge">Real-time Physics</span> <span class="badge">Custom Materials</span> </div> </div> </div> <div class="scroll-indicator"> <span>Scroll to explore</span> <div class="scroll-icon"></div> </div> </section> <section id="features"> <div class="section-fade"> <h1>Advanced Rendering Features</h1> <p>Our 3D coin visualization employs cutting-edge web technologies to create physically accurate representations with proper metallurgical properties.</p> <div class="coins-container" id="featuresCoins"> <div class="light-ring"></div> <div class="coin coin-silver" style="left: 35%;"> <div class="coin-face coin-front"></div> <div class="coin-face coin-back"></div> <div class="coin-edge"></div> </div> <div class="coin coin-bronze" style="right: 35%;"> <div class="coin-face coin-front"></div> <div class="coin-face coin-back"></div> <div class="coin-edge"></div> </div> </div> <div class="info-box"> <h3>Technical Specifications</h3> <ul class="feature-list"> <li>Dynamic Environment Mapping for realistic reflections</li> <li>PBR (Physically Based Rendering) materials</li> <li>Ambient occlusion for depth enhancement</li> <li>Parallax scrolling creates depth perception</li> </ul> </div> </div> </section> <section id="physics"> <div class="section-fade"> <h1>Physics Simulation Engine</h1> <p>Experience our custom physics engine that simulates realistic coin movement including momentum, collision detection, and rotational dynamics.</p> <div class="coins-container physics-coins" id="physicsCoins"> <div class="light-ring"></div> <!-- Physics coins will be generated by JavaScript --> </div> <button id="physics-toggle">Toggle Physics Mode</button> <div class="info-box"> <h3>Interaction Methods</h3> <p>In physics mode, coins respond to gravity and collisions. Try clicking and dragging coins to toss them with velocity, or enable auto-physics to watch them interact autonomously.</p> </div> </div> </section> </div> <script> // DOM elements const container = document.getElementById('scrollContainer'); const progressBar = document.getElementById('progressBar'); const sections = document.querySelectorAll('section'); const coins = document.querySelectorAll('.coin'); const physicsModeToggle = document.getElementById('physics-toggle'); const physicsCoinsContainer = document.getElementById('physicsCoins'); // Fade in sections when they come into view const sectionFades = document.querySelectorAll('.section-fade'); const observerOptions = { root: container, rootMargin: '-50px 0px', threshold: 0.1 }; const sectionObserver = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('visible'); } else { entry.target.classList.remove('visible'); } }); }, observerOptions); sectionFades.forEach(fade => { sectionObserver.observe(fade); }); // Progress bar container.addEventListener('scroll', () => { const scrollPosition = container.scrollTop; const scrollHeight = container.scrollHeight - container.clientHeight; const scrollPercentage = (scrollPosition / scrollHeight) * 100; progressBar.style.width = scrollPercentage + '%'; updateParallax(scrollPosition); }); // Parallax effect function updateParallax(scrollPos) { const maxScroll = container.scrollHeight - container.clientHeight; const scrollRatio = scrollPos / maxScroll; // Apply parallax to coins coins.forEach((coin, index) => { const rotationY = scrollRatio * 720; // 2 full rotations const rotationX = 15 + Math.sin(scrollRatio * Math.PI) * 15; coin.style.transform = `rotateY(${rotationY}deg) rotateX(${rotationX}deg)`; }); } // Coin interaction coins.forEach(coin => { coin.addEventListener('mousemove', (e) => { if (document.querySelector('.physics-mode')) return; const rect = coin.getBoundingClientRect(); const x = e.clientX - rect.left - rect.width / 2; const y = e.clientY - rect.top - rect.height / 2; const rotateY = x * 0.2; const rotateX = -y * 0.2; coin.style.transform = `rotateY(${rotateY}deg) rotateX(${rotateX}deg)`; }); coin.addEventListener('mouseleave', () => { if (document.querySelector('.physics-mode')) return; coin.style.transform = `rotateY(0deg) rotateX(15deg)`; setTimeout(() => updateParallax(container.scrollTop), 300); }); coin.addEventListener('click', () => { if (document.querySelector('.physics-mode')) return; // Flip animation coin.style.transform = `rotateY(${Math.random() > 0.5 ? 180 : 360}deg) rotateX(15deg)`; // Add shine effect const shine = document.createElement('div'); shine.classList.add('shine'); shine.style.position = 'absolute'; shine.style.width = '100%'; shine.style.height = '100%'; shine.style.borderRadius = '50%'; shine.style.background = 'radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%)'; shine.style.opacity = '0'; shine.style.pointerEvents = 'none'; shine.style.animation = 'shine 0.6s ease-out'; coin.appendChild(shine); setTimeout(() => { coin.removeChild(shine); }, 600); }); }); // Add keyframes for shine animation const shineStyle = document.createElement('style'); shineStyle.innerHTML = ` @keyframes shine { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } } `; document.head.appendChild(shineStyle); // Physics engine let physicsMode = false; let physicsCoins = []; class PhysicsCoin { constructor(element, x, y) { this.element = element; this.x = x || Math.random() * 600; this.y = y || Math.random() * 150 + 75; this.vx = Math.random() * 2 - 1; this.vy = Math.random() * 2 - 1; this.rotationSpeed = Math.random() * 10 - 5; this.rotation = Math.random() * 360; this.gravity = 0.1; this.friction = 0.98; this.restitution = 0.8; // bounciness this.active = true; this.radius = element.offsetWidth / 2; // Set initial position this.element.style.left = `${this.x}px`; this.element.style.top = `${this.y}px`; this.element.style.transform = `rotateY(${this.rotation}deg)`; // Add event listeners for dragging this.isDragging = false; this.dragStartX = 0; this.dragStartY = 0; this.lastX = 0; this.lastY = 0; this.xVelocityHistory = [0, 0, 0]; this.yVelocityHistory = [0, 0, 0]; this.element.addEventListener('mousedown', (e) => this.startDrag(e)); document.addEventListener('mousemove', (e) => this.drag(e)); document.addEventListener('mouseup', () => this.endDrag()); } update() { if (!this.active || this.isDragging) return; // Apply gravity this.vy += this.gravity; // Apply friction this.vx *= this.friction; this.vy *= this.friction; // Update position this.x += this.vx; this.y += this.vy; // Update rotation this.rotation += this.rotationSpeed; // Boundary collision detection const containerRect = physicsCoinsContainer.getBoundingClientRect(); const containerWidth = containerRect.width; const containerHeight = containerRect.height; if (this.x - this.radius < 0) { this.x = this.radius; this.vx *= -this.restitution; this.rotationSpeed = this.vx * 2; } else if (this.x + this.radius > containerWidth) { this.x = containerWidth - this.radius; this.vx *= -this.restitution; this.rotationSpeed = -this.vx * 2; } if (this.y - this.radius < 0) { this.y = this.radius; this.vy *= -this.restitution; } else if (this.y + this.radius > containerHeight) { this.y = containerHeight - this.radius; this.vy *= -this.restitution; // Add a little extra bounce effect if (Math.abs(this.vy) > 0.5) { this.rotationSpeed = this.vx * 3; } } // Coin-to-coin collision for (let i = 0; i < physicsCoins.length; i++) { const otherCoin = physicsCoins[i]; if (otherCoin === this || !otherCoin.active) continue; const dx = otherCoin.x - this.x; const dy = otherCoin.y - this.y; const distance = Math.sqrt(dx * dx + dy * dy); const minDistance = this.radius + otherCoin.radius; if (distance < minDistance) { // Calculate collision angle const angle = Math.atan2(dy, dx); // Calculate velocities of both coins after collision const speed1 = Math.sqrt(this.vx * this.vx + this.vy * this.vy); const speed2 = Math.sqrt(otherCoin.vx * otherCoin.vx + otherCoin.vy * otherCoin.vy); const direction1 = Math.atan2(this.vy, this.vx); const direction2 = Math.atan2(otherCoin.vy, otherCoin.vx); const velocityX1 = speed1 * Math.cos(direction1 - angle); const velocityY1 = speed1 * Math.sin(direction1 - angle); const velocityX2 = speed2 * Math.cos(direction2 - angle); const velocityY2 = speed2 * Math.sin(direction2 - angle); // Swap velocities along the angle of collision const finalVelocityX1 = velocityX2 * this.restitution; const finalVelocityX2 = velocityX1 * this.restitution; // Convert back to regular velocities this.vx = Math.cos(angle) * finalVelocityX1 + Math.cos(angle + Math.PI/2) * velocityY1; this.vy = Math.sin(angle) * finalVelocityX1 + Math.sin(angle + Math.PI/2) * velocityY1; otherCoin.vx = Math.cos(angle) * finalVelocityX2 + Math.cos(angle + Math.PI/2) * velocityY2; otherCoin.vy = Math.sin(angle) * finalVelocityX2 + Math.sin(angle + Math.PI/2) * velocityY2; // Adjust positions to prevent overlap const overlap = minDistance - distance; const pushX = (overlap * Math.cos(angle)) / 2; const pushY = (overlap * Math.sin(angle)) / 2; this.x -= pushX; this.y -= pushY; otherCoin.x += pushX; otherCoin.y += pushY; // Apply a spin effect based on the collision this.rotationSpeed += (otherCoin.vx - this.vx) * 0.2; otherCoin.rotationSpeed += (this.vx - otherCoin.vx) * 0.2; } } // Update the DOM element this.element.style.left = `${this.x}px`; this.element.style.top = `${this.y}px`; this.element.style.transform = `rotateY(${this.rotation}deg)`; } startDrag(e) { if (!physicsMode) return; this.isDragging = true; this.dragStartX = e.clientX; this.dragStartY = e.clientY; this.lastX = this.x; this.lastY = this.y; this.xVelocityHistory = [0, 0, 0]; this.yVelocityHistory = [0, 0, 0]; this.element.style.zIndex = "100"; e.preventDefault(); } drag(e) { if (!this.isDragging) return; const dx = e.clientX - this.dragStartX; const dy = e.clientY - this.dragStartY; this.x = this.lastX + dx; this.y = this.lastY + dy; // Track velocity for throw effect this.xVelocityHistory.shift(); this.xVelocityHistory.push(e.clientX); this.yVelocityHistory.shift(); this.yVelocityHistory.push(e.clientY); this.element.style.left = `${this.x}px`; this.element.style.top = `${this.y}px`; } endDrag() { if (!this.isDragging) return; this.isDragging = false; this.element.style.zIndex = "1"; // Calculate throw velocity based on drag history const xVelocity = (this.xVelocityHistory[2] - this.xVelocityHistory[0]) * 0.1; const yVelocity = (this.yVelocityHistory[2] - this.yVelocityHistory[0]) * 0.1; this.vx = xVelocity; this.vy = yVelocity; // Add a spin based on horizontal velocity this.rotationSpeed = this.vx * 2; } } function createPhysicsCoins() { physicsCoinsContainer.innerHTML = ''; physicsCoins = []; // Create 5 coins with different metal types const metalTypes = ['', 'coin-silver', 'coin-bronze']; for (let i = 0; i < 5; i++) { const coinDiv = document.createElement('div'); coinDiv.classList.add('coin'); coinDiv.classList.add(metalTypes[i % 3]); const front = document.createElement('div'); front.classList.add('coin-face', 'coin-front'); const back = document.createElement('div'); back.classList.add('coin-face', 'coin-back'); const edge = document.createElement('div'); edge.classList.add('coin-edge'); coinDiv.appendChild(front); coinDiv.appendChild(back); coinDiv.appendChild(edge); physicsCoinsContainer.appendChild(coinDiv); const x = 100 + Math.random() * 400; const y = 50 + Math.random() * 200; const physicsCoin = new PhysicsCoin(coinDiv, x, y); physicsCoins.push(physicsCoin); } } function togglePhysicsMode() { physicsMode = !physicsMode; if (physicsMode) { createPhysicsCoins(); document.body.classList.add('physics-mode'); physicsModeToggle.textContent = 'Disable Physics Mode'; startPhysicsSimulation(); } else { document.body.classList.remove('physics-mode'); physicsModeToggle.textContent = 'Enable Physics Mode'; stopPhysicsSimulation(); } } let animationFrameId; function updatePhysics() { physicsCoins.forEach(coin => coin.update()); animationFrameId = requestAnimationFrame(updatePhysics); } function startPhysicsSimulation() { if (animationFrameId) cancelAnimationFrame(animationFrameId); animationFrameId = requestAnimationFrame(updatePhysics); } function stopPhysicsSimulation() { if (animationFrameId) { cancelAnimationFrame(animationFrameId); animationFrameId = null; } } // Initialize physics mode toggle physicsModeToggle.addEventListener('click', togglePhysicsMode); // Initial parallax update setTimeout(() => { updateParallax(container.scrollTop); // Make first section visible initially document.querySelector('#intro .section-fade').classList.add('visible'); }, 100); // Create light effect that follows cursor container.addEventListener('mousemove', (e) => { const lightRings = document.querySelectorAll('.light-ring'); lightRings.forEach(ring => { const rect = ring.parentElement.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; if (x >= 0 && x <= rect.width && y >= 0 && y <= rect.height) { ring.style.left = `${x}px`; ring.style.top = `${y}px`; ring.style.opacity = '1'; } else { ring.style.opacity = '0.5'; ring.style.left = '50%'; ring.style.top = '50%'; ring.style.transform = 'translate(-50%, -50%)'; } }); }); </script> </body> </html>
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FitCoin - Fitness Challenge Tracker</title> <style> :root { --primary: #2ecc71; --secondary: #3498db; --tertiary: #1abc9c; --dark: #2c3e50; --light: #ecf0f1; --accent: #f39c12; --danger: #e74c3c; --shadow: rgba(0, 0, 0, 0.1); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background-color: #f9f9f9; color: var(--dark); height: 100%; width: 100%; overflow-x: hidden; } .container { max-width: 700px; margin: 0 auto; padding: 20px; height: 100%; display: flex; flex-direction: column; } header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; position: relative; } h1 { font-size: 28px; font-weight: 700; color: var(--dark); position: relative; } h1 span { color: var(--primary); } .user-info { display: flex; align-items: center; gap: 10px; } .avatar { width: 40px; height: 40px; background-color: var(--tertiary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; box-shadow: 0 2px 5px var(--shadow); transition: transform 0.3s ease; } .avatar:hover { transform: scale(1.1); } .streak-badge { background: linear-gradient(135deg, var(--primary), var(--tertiary)); padding: 5px 10px; border-radius: 20px; color: white; font-size: 12px; font-weight: bold; box-shadow: 0 2px 5px var(--shadow); } .stats-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px; } .stat-card { background-color: white; border-radius: 15px; padding: 15px; text-align: center; box-shadow: 0 3px 8px var(--shadow); transition: transform 0.3s ease; } .stat-card:hover { transform: translateY(-5px); } .stat-value { font-size: 28px; font-weight: bold; margin: 10px 0; color: var(--secondary); } .stat-label { font-size: 14px; color: #666; } .coins-container { position: relative; display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-bottom: 25px; } .coin { width: 120px; height: 120px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; font-weight: bold; position: relative; overflow: hidden; box-shadow: 0 5px 15px var(--shadow); transition: all 0.3s ease; cursor: pointer; } .coin:hover { transform: scale(1.05) rotate(5deg); } .coin-inner { width: 100px; height: 100px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: rgba(255, 255, 255, 0.15); border: 2px solid rgba(255, 255, 255, 0.3); } .coin-value { font-size: 24px; margin-bottom: 5px; } .coin-label { font-size: 11px; text-align: center; padding: 0 5px; } .coin.active { animation: pulse 1s ease; } .coin.locked { opacity: 0.6; filter: grayscale(0.7); } .coin.locked:hover { opacity: 0.7; filter: grayscale(0.4); } .gradient-1 { background: linear-gradient(135deg, #2ecc71, #1abc9c); } .gradient-2 { background: linear-gradient(135deg, #3498db, #2980b9); } .gradient-3 { background: linear-gradient(135deg, #1abc9c, #16a085); } .gradient-4 { background: linear-gradient(135deg, #2980b9, #3498db); } .gradient-5 { background: linear-gradient(135deg, #27ae60, #2ecc71); } .gradient-locked { background: linear-gradient(135deg, #95a5a6, #7f8c8d); } .challenges-container { flex: 1; background-color: white; border-radius: 15px; padding: 20px; box-shadow: 0 3px 8px var(--shadow); } .challenges-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; } .challenges-header h2 { font-size: 20px; font-weight: 600; } .filter-tabs { display: flex; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; } .filter-tab { padding: 5px 12px; border-radius: 20px; font-size: 14px; cursor: pointer; transition: all 0.2s ease; } .filter-tab.active { background-color: var(--primary); color: white; box-shadow: 0 2px 5px var(--shadow); } .filter-tab:not(.active):hover { background-color: #eee; } .challenge-list { overflow-y: auto; max-height: 250px; } .challenge-item { display: flex; align-items: center; padding: 12px; border-radius: 10px; margin-bottom: 10px; background-color: #f9f9f9; transition: all 0.2s ease; cursor: pointer; } .challenge-item:hover { background-color: #f0f0f0; transform: translateX(5px); } .challenge-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 15px; color: white; font-size: 18px; } .challenge-info { flex: 1; } .challenge-title { font-weight: 600; margin-bottom: 5px; } .challenge-progress { height: 6px; background-color: #ddd; border-radius: 3px; overflow: hidden; margin-top: 8px; } .progress-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; } .challenge-reward { display: flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 15px; background-color: rgba(46, 204, 113, 0.1); color: var(--primary); font-size: 12px; font-weight: bold; } .add-challenge { position: fixed; right: 50%; transform: translateX(300px); bottom: 30px; width: 60px; height: 60px; border-radius: 50%; background-color: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3); cursor: pointer; transition: all 0.3s ease; border: none; z-index: 100; } .add-challenge:hover { transform: translateX(300px) scale(1.1); background-color: #27ae60; } .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 1000; } .modal.active { opacity: 1; visibility: visible; } .modal-content { background-color: white; border-radius: 15px; padding: 25px; width: 90%; max-width: 400px; transform: translateY(20px); transition: all 0.3s ease; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); } .modal.active .modal-content { transform: translateY(0); } .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .modal-header h3 { font-size: 20px; font-weight: 600; } .close-modal { background: none; border: none; font-size: 20px; cursor: pointer; color: #777; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; } .form-control { width: 100%; padding: 10px 15px; border-radius: 8px; border: 1px solid #ddd; font-size: 14px; transition: all 0.2s ease; } .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2); outline: none; } .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; } .btn { padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; border: none; } .btn-primary { background-color: var(--primary); color: white; } .btn-primary:hover { background-color: #27ae60; } .btn-secondary { background-color: #f5f5f5; color: #333; } .btn-secondary:hover { background-color: #e0e0e0; } .toast { position: fixed; top: 20px; right: 20px; background-color: white; border-radius: 8px; padding: 15px 20px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); display: flex; align-items: center; gap: 10px; transform: translateX(120%); transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); z-index: 1001; } .toast.active { transform: translateX(0); } .toast-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; } .toast-success { background-color: var(--primary); } .toast-content { flex: 1; } .toast-title { font-weight: 600; margin-bottom: 3px; } .toast-message { font-size: 13px; color: #666; } .coin-burst { position: absolute; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; } .trophy-animation { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); width: 150px; height: 150px; background-color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 60px; z-index: 1002; opacity: 0; transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); } .trophy-animation.active { opacity: 1; transform: translate(-50%, -50%) scale(1); } @keyframes pulse { 0% { transform: scale(1); box-shadow: 0 5px 15px var(--shadow); } 50% { transform: scale(1.1); box-shadow: 0 5px 30px rgba(46, 204, 113, 0.4); } 100% { transform: scale(1); box-shadow: 0 5px 15px var(--shadow); } } @keyframes burst { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(2); opacity: 0; } } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @media (max-width: 600px) { .stats-container { grid-template-columns: 1fr 1fr; } .coin { width: 100px; height: 100px; } .coin-inner { width: 85px; height: 85px; } .coin-value { font-size: 20px; } .challenge-list { max-height: 200px; } .add-challenge { right: 20px; transform: none; } .add-challenge:hover { transform: scale(1.1); } } @media (max-width: 400px) { .stats-container { grid-template-columns: 1fr; } .coins-container { gap: 10px; } .coin { width: 80px; height: 80px; } .coin-inner { width: 70px; height: 70px; } .coin-value { font-size: 18px; } .coin-label { font-size: 10px; } } </style> </head> <body> <div class="container"> <header> <h1>Fit<span>Coin</span></h1> <div class="user-info"> <div class="streak-badge">🔥 14 day streak</div> <div class="avatar">JD</div> </div> </header> <div class="stats-container"> <div class="stat-card"> <div class="stat-value">387</div> <div class="stat-label">Total FitCoins</div> </div> <div class="stat-card"> <div class="stat-value">7</div> <div class="stat-label">Active Challenges</div> </div> <div class="stat-card"> <div class="stat-value">23</div> <div class="stat-label">Completed Goals</div> </div> </div> <div class="coins-container"> <div class="coin gradient-1" data-value="50"> <div class="coin-inner"> <div class="coin-value">50</div> <div class="coin-label">Daily Challenge</div> </div> </div> <div class="coin gradient-2" data-value="100"> <div class="coin-inner"> <div class="coin-value">100</div> <div class="coin-label">Weekly Goal</div> </div> </div> <div class="coin gradient-3" data-value="150"> <div class="coin-inner"> <div class="coin-value">150</div> <div class="coin-label">Power Hour</div> </div> </div> <div class="coin gradient-4" data-value="200"> <div class="coin-inner"> <div class="coin-value">200</div> <div class="coin-label">Month Master</div> </div> </div> <div class="coin gradient-locked locked" data-value="500"> <div class="coin-inner"> <div class="coin-value">500</div> <div class="coin-label">Champion</div> </div> </div> </div> <div class="challenges-container"> <div class="challenges-header"> <h2>Current Challenges</h2> </div> <div class="filter-tabs"> <div class="filter-tab active" data-filter="all">All</div> <div class="filter-tab" data-filter="cardio">Cardio</div> <div class="filter-tab" data-filter="strength">Strength</div> <div class="filter-tab" data-filter="wellness">Wellness</div> </div> <div class="challenge-list"> <div class="challenge-item" data-type="cardio" data-progress="75"> <div class="challenge-icon" style="background-color: var(--secondary);"> <i>🏃</i> </div> <div class="challenge-info"> <div class="challenge-title">5K Runner</div> <div>Run 5km in under 30 minutes</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 75%; background-color: var(--secondary);"></div> </div> </div> <div class="challenge-reward">+100</div> </div> <div class="challenge-item" data-type="strength" data-progress="40"> <div class="challenge-icon" style="background-color: var(--primary);"> <i>💪</i> </div> <div class="challenge-info"> <div class="challenge-title">Push-up Champion</div> <div>Complete 100 push-ups in a week</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 40%; background-color: var(--primary);"></div> </div> </div> <div class="challenge-reward">+150</div> </div> <div class="challenge-item" data-type="wellness" data-progress="90"> <div class="challenge-icon" style="background-color: var(--tertiary);"> <i>🧘</i> </div> <div class="challenge-info"> <div class="challenge-title">Mindful Mornings</div> <div>Meditate for 10 minutes daily</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 90%; background-color: var(--tertiary);"></div> </div> </div> <div class="challenge-reward">+50</div> </div> <div class="challenge-item" data-type="cardio" data-progress="20"> <div class="challenge-icon" style="background-color: var(--secondary);"> <i>🚴</i> </div> <div class="challenge-info"> <div class="challenge-title">Cycling Sprint</div> <div>Cycle 100km this month</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 20%; background-color: var(--secondary);"></div> </div> </div> <div class="challenge-reward">+200</div> </div> <div class="challenge-item" data-type="strength" data-progress="60"> <div class="challenge-icon" style="background-color: var(--primary);"> <i>🏋️</i> </div> <div class="challenge-info"> <div class="challenge-title">Weight Training</div> <div>Complete 8 strength sessions</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 60%; background-color: var(--primary);"></div> </div> </div> <div class="challenge-reward">+150</div> </div> <div class="challenge-item" data-type="wellness" data-progress="30"> <div class="challenge-icon" style="background-color: var(--tertiary);"> <i>💧</i> </div> <div class="challenge-info"> <div class="challenge-title">Hydration Hero</div> <div>Drink 2L of water daily</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 30%; background-color: var(--tertiary);"></div> </div> </div> <div class="challenge-reward">+50</div> </div> </div> </div> </div> <button class="add-challenge">+</button> <div class="modal" id="challenge-modal"> <div class="modal-content"> <div class="modal-header"> <h3>Add New Challenge</h3> <button class="close-modal">×</button> </div> <div class="form-group"> <label for="challenge-title">Challenge Title</label> <input type="text" id="challenge-title" class="form-control" placeholder="e.g., Morning Run"> </div> <div class="form-group"> <label for="challenge-description">Description</label> <input type="text" id="challenge-description" class="form-control" placeholder="e.g., Run 3km every morning"> </div> <div class="form-group"> <label for="challenge-type">Type</label> <select id="challenge-type" class="form-control"> <option value="cardio">Cardio</option> <option value="strength">Strength</option> <option value="wellness">Wellness</option> </select> </div> <div class="form-group"> <label for="challenge-reward">Reward (FitCoins)</label> <input type="number" id="challenge-reward" class="form-control" placeholder="e.g., 100" min="10" max="500" step="10" value="100"> </div> <div class="form-actions"> <button class="btn btn-secondary" id="cancel-btn">Cancel</button> <button class="btn btn-primary" id="save-btn">Save Challenge</button> </div> </div> </div> <div class="toast" id="success-toast"> <div class="toast-icon toast-success">✓</div> <div class="toast-content"> <div class="toast-title">Success!</div> <div class="toast-message">Challenge added successfully.</div> </div> </div> <div class="trophy-animation"> 🏆 </div> <script> // DOM Elements const coins = document.querySelectorAll('.coin'); const addChallengeBtn = document.querySelector('.add-challenge'); const modal = document.getElementById('challenge-modal'); const closeModal = document.querySelector('.close-modal'); const cancelBtn = document.getElementById('cancel-btn'); const saveBtn = document.getElementById('save-btn'); const toast = document.getElementById('success-toast'); const challengeList = document.querySelector('.challenge-list'); const filterTabs = document.querySelectorAll('.filter-tab'); const trophyAnimation = document.querySelector('.trophy-animation'); // Event Listeners coins.forEach(coin => { if (!coin.classList.contains('locked')) { coin.addEventListener('click', () => { claimCoin(coin); }); } else { coin.addEventListener('click', () => { showToast('This coin is locked!', 'Complete more challenges to unlock.', 'warning'); }); } }); addChallengeBtn.addEventListener('click', () => { modal.classList.add('active'); }); closeModal.addEventListener('click', () => { modal.classList.remove('active'); }); cancelBtn.addEventListener('click', () => { modal.classList.remove('active'); }); saveBtn.addEventListener('click', addNewChallenge); challengeList.addEventListener('click', event => { const challengeItem = event.target.closest('.challenge-item'); if (challengeItem) { updateChallengeProgress(challengeItem); } }); filterTabs.forEach(tab => { tab.addEventListener('click', () => { filterTabs.forEach(t => t.classList.remove('active')); tab.classList.add('active'); filterChallenges(tab.dataset.filter); }); }); // Functions function claimCoin(coin) { if (coin.classList.contains('active')) return; // Create burst effect const burst = document.createElement('div'); burst.classList.add('coin-burst'); burst.style.background = coin.classList[1]; // Use same gradient as coin burst.style.animation = 'burst 0.6s forwards'; coin.appendChild(burst); // Animate coin coin.classList.add('active'); // Update stats const coinValue = parseInt(coin.dataset.value); const statValue = document.querySelector('.stat-value'); const currentValue = parseInt(statValue.textContent); // Animate counting up let startValue = currentValue; const newValue = currentValue + coinValue; const duration = 1000; const startTime = performance.now(); function updateCounter(timestamp) { const elapsed = timestamp - startTime; const progress = Math.min(elapsed / duration, 1); const currentCount = Math.floor(startValue + (coinValue * progress)); statValue.textContent = currentCount; if (progress < 1) { requestAnimationFrame(updateCounter); } else { // Show trophy animation for high-value coins if (coinValue >= 200) { showTrophyAnimation(); } // Remove burst after animation completes setTimeout(() => { burst.remove(); }, 600); // Reset coin active state after a delay setTimeout(() => { coin.classList.remove('active'); }, 1500); } } requestAnimationFrame(updateCounter); // Play sound effect (just a visual cue here) showToast('Coin Claimed!', `You earned ${coinValue} FitCoins`, 'success'); } function showToast(title, message, type = 'success') { const toastIcon = document.querySelector('.toast-icon'); const toastTitle = document.querySelector('.toast-title'); const toastMessage = document.querySelector('.toast-message'); toastTitle.textContent = title; toastMessage.textContent = message; if (type === 'warning') { toastIcon.classList.remove('toast-success'); toastIcon.classList.add('toast-warning'); toastIcon.style.backgroundColor = '#f39c12'; toastIcon.textContent = '!'; } else { toastIcon.classList.add('toast-success'); toastIcon.classList.remove('toast-warning'); toastIcon.style.backgroundColor = var(--primary); toastIcon.textContent = '✓'; } toast.classList.add('active'); setTimeout(() => { toast.classList.remove('active'); }, 3000); } function addNewChallenge() { const title = document.getElementById('challenge-title').value; const description = document.getElementById('challenge-description').value; const type = document.getElementById('challenge-type').value; const reward = document.getElementById('challenge-reward').value; if (!title || !description || !reward) { showToast('Error', 'Please fill in all fields', 'warning'); return; } // Create new challenge element const newChallenge = document.createElement('div'); newChallenge.classList.add('challenge-item'); newChallenge.dataset.type = type; newChallenge.dataset.progress = 0; let iconBackground; switch(type) { case 'cardio': iconBackground = 'var(--secondary)'; icon = '🏃'; break; case 'strength': iconBackground = 'var(--primary)'; icon = '💪'; break; case 'wellness': iconBackground = 'var(--tertiary)'; icon = '🧘'; break; } newChallenge.innerHTML = ` <div class="challenge-icon" style="background-color: ${iconBackground};"> <i>${icon}</i> </div> <div class="challenge-info"> <div class="challenge-title">${title}</div> <div>${description}</div> <div class="challenge-progress"> <div class="progress-bar" style="width: 0%; background-color: ${iconBackground};"></div> </div> </div> <div class="challenge-reward">+${reward}</div> `; // Add to list and update stats challengeList.prepend(newChallenge); // Update active challenges count const challengesStat = document.querySelectorAll('.stat-value')[1]; challengesStat.textContent = parseInt(challengesStat.textContent) + 1; // Reset form & close modal document.getElementById('challenge-title').value = ''; document.getElementById('challenge-description').value = ''; document.getElementById('challenge-reward').value = '100'; modal.classList.remove('active'); // Show success notification showToast('Challenge Added', 'New challenge has been created!', 'success'); } function updateChallengeProgress(challengeItem) { const currentProgress = parseInt(challengeItem.dataset.progress); let newProgress = currentProgress + 10; if (newProgress > 100) newProgress = 100; challengeItem.dataset.progress = newProgress; const progressBar = challengeItem.querySelector('.progress-bar'); progressBar.style.width = `${newProgress}%`; // If challenge completed if (newProgress === 100) { // Get the reward value const rewardText = challengeItem.querySelector('.challenge-reward').textContent; const rewardValue = parseInt(rewardText.replace('+', '')); // Update total coins const totalCoins = document.querySelectorAll('.stat-value')[0]; const currentCoins = parseInt(totalCoins.textContent); totalCoins.textContent = currentCoins + rewardValue; // Update completed goals const completedGoals = document.querySelectorAll('.stat-value')[2]; completedGoals.textContent = parseInt(completedGoals.textContent) + 1; // Show celebration showTrophyAnimation(); // Remove challenge with animation setTimeout(() => { challengeItem.style.height = challengeItem.offsetHeight + 'px'; challengeItem.style.overflow = 'hidden'; challengeItem.style.opacity = '0'; challengeItem.style.height = '0'; challengeItem.style.margin = '0'; challengeItem.style.padding = '0'; setTimeout(() => { challengeItem.remove(); // Update active challenges count const challengesStat = document.querySelectorAll('.stat-value')[1]; challengesStat.textContent = parseInt(challengesStat.textContent) - 1; }, 300); }, 500); showToast('Challenge Completed!', `You earned ${rewardValue} FitCoins`, 'success'); } } function showTrophyAnimation() { trophyAnimation.classList.add('active'); setTimeout(() => { trophyAnimation.classList.remove('active'); }, 1500); } function filterChallenges(filter) { const challenges = document.querySelectorAll('.challenge-item'); challenges.forEach(challenge => { if (filter === 'all' || challenge.dataset.type === filter) { challenge.style.display = 'flex'; } else { challenge.style.display = 'none'; } }); } // Check if any modal or overlay is clicked outside its content window.addEventListener('click', event => { if (event.target === modal) { modal.classList.remove('active'); } }); // Initialize with some random progress updates function simulateActivity() { const challenges = document.querySelectorAll('.challenge-item'); if (challenges.length > 0) { const randomIndex = Math.floor(Math.random() * challenges.length); const randomChallenge = challenges[randomIndex]; // Only update if not completed const currentProgress = parseInt(randomChallenge.dataset.progress); if (currentProgress < 100) { setTimeout(() => { updateChallengeProgress(randomChallenge); }, 5000); } } // Schedule next update setTimeout(simulateActivity, Math.random() * 15000 + 8000); } // Start simulation setTimeout(simulateActivity, 10000); </script> </body> </html>