import React, { useState } from 'react'; import confetti from 'canvas-confetti'; import…
- User
import React, { useState } from 'react'; import confetti from 'canvas-confetti'; import { motion } from 'framer-motion';
const MultiCalc = () => { const [input, setInput] = useState(''); const [result, setResult] = useState(null);
const handleCalculate = () => { // منطق حسابي بسيط كمثال (يمكنك تغييره حسب نوع الحاسبة) const val = eval(input); setResult(val);
// تفعيل احتفال القصاصات الملونة confetti({ particleCount: 150, spread: 70, origin: { y: 0.6 } });};
return ( {/* Header */} <motion.header initial={{ y: -50 }} animate={{ y: 0 }} className="glass-header"> MultiCalc 🧮 </motion.header>
{/* Main Calculator Body */} <main className="main-content"> <motion.div initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} className="calculator-box" > <input type="text" value={input} onChange={(e) => setInput(e.target.value)} placeholder="Enter your numbers..." /> <button className="calculate-btn" onClick={handleCalculate}> Calculate Now 🚀 </button> {result !== null && ( <motion.div initial={{ scale: 0 }} animate={{ scale: 1 }} className="result-display" > <h2>Result: {result}</h2> <p>Great job! ✨</p> </motion.div> )} </motion.div> </main> {/* Footer */} <footer className="fun-footer"> <p>Built with passion for your productivity ⚡</p> <motion.div animate={{ y: [0, -10, 0] }} transition={{ repeat: Infinity, duration: 2 }}> 🤖 ✨ ⚡ </motion.div> </footer> </div>); };
export default MultiCalc; /* Animated Gradient Background */ .app-container { min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background-size: 400% 400%; animation: gradientBG 15s ease infinite; display: flex; flex-direction: column; align-items: center; font-family: 'Segoe UI', sans-serif; }
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.glass-header { width: 100%; padding: 20px; text-align: center; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); color: white; }
.calculator-box { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); margin-top: 50px; text-align: center; }
.calculate-btn { background: #ff7e5f; color: white; padding: 15px 30px; border: none; border-radius: 50px; cursor: pointer; margin-top: 20px; font-weight: bold; }
.fun-footer { margin-top: auto; padding: 20px; color: white; text-align: center; }
Assistant
- User
import React, { useState } from 'react'; import confetti from 'canvas-confetti'; import { motion } from 'framer-motion';
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.