
tek dosya oldugu için githuba yüklemek istmedim direk bu kodu index.html kaydet ve çlaıştır
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ultra Premium Calculator</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/particles.js/2.0.0/particles.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet">
<style>
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&display=swap');
@keyframes gradient {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
@keyframes float {
0% { transform: translateY(0px) rotate(0deg) scale(1); }
25% { transform: translateY(-15px) rotate(1deg) scale(1.02); }
50% { transform: translateY(0px) rotate(0deg) scale(1); }
75% { transform: translateY(15px) rotate(-1deg) scale(0.98); }
100% { transform: translateY(0px) rotate(0deg) scale(1); }
}
@keyframes glow {
0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); }
50% { box-shadow: 0 0 30px rgba(255, 255, 255, 0.2); }
100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); }
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
@keyframes neon {
0% { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #1e3a8a, 0 0 20px #1e3a8a, 0 0 25px #1e3a8a, 0 0 30px #1e3a8a, 0 0 35px #1e3a8a; }
50% { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #1e3a8a, 0 0 40px #1e3a8a, 0 0 50px #1e3a8a, 0 0 60px #1e3a8a, 0 0 70px #1e3a8a; }
100% { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #1e3a8a, 0 0 20px #1e3a8a, 0 0 25px #1e3a8a, 0 0 30px #1e3a8a, 0 0 35px #1e3a8a; }
}
@keyframes rainbow {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.calculator-btn {
@apply rounded-2xl transition-all duration-500 shadow-lg hover:shadow-2xl active:scale-95 backdrop-blur-sm;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.1);
position: relative;
overflow: hidden;
transform-style: preserve-3d;
perspective: 1000px;
}
.calculator-btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.1);
transition: 0.8s;
animation: shine 3s infinite;
}
.calculator-btn::after {
content: '';
position: absolute;
inset: -2px;
background: #e5e7eb;
z-index: -1;
border-radius: 1rem;
opacity: 0.5;
filter: blur(5px);
}
@keyframes shine {
0% { left: -100%; }
50% { left: 100%; }
100% { left: 100%; }
}
.number-btn {
@apply text-black;
background: #e5e7eb;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
animation: glow 3s infinite;
}
.number-btn:hover {
background: #f3f4f6;
animation: pulse 1.5s infinite;
transform: translateY(-5px) scale(1.05) rotateX(10deg) rotateY(10deg);
}
.operation-btn {
@apply text-black;
background: #d1d5db;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
animation: glow 3s infinite;
}
.operation-btn:hover {
background: #e5e7eb;
animation: pulse 1.5s infinite;
transform: translateY(-5px) scale(1.05) rotateX(10deg) rotateY(10deg);
}
.special-btn {
@apply text-black;
background: #e5e7eb;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
animation: glow 3s infinite;
}
.special-btn:hover {
background: #f3f4f6;
animation: pulse 1.5s infinite;
transform: translateY(-5px) scale(1.05) rotateX(10deg) rotateY(10deg);
}
.calculator-container {
background: #0f172a;
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 25px 45px rgba(0, 0, 0, 0.3);
animation: float 12s ease-in-out infinite;
position: relative;
transform-style: preserve-3d;
}
.calculator-container::before {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
background: #1e3a8a;
z-index: -1;
border-radius: 3rem;
opacity: 0.5;
filter: blur(5px);
}
.calculator-container::after {
content: '';
position: absolute;
inset: -10px;
background: #1e3a8a;
z-index: -2;
opacity: 0.1;
animation: pulse 6s infinite;
}
.display-container {
background: #0f172a;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
position: relative;
overflow: hidden;
transform-style: preserve-3d;
}
.display-container::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
transform: translateX(-100%);
animation: shine 3s infinite;
}
body {
background: #0a192f;
background-size: 400% 400%;
animation: gradient 15s ease infinite;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
perspective: 1000px;
overflow: hidden;
}
#particles-js {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
#three-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -2;
}
.display-text {
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
font-family: 'Orbitron', sans-serif;
letter-spacing: 2px;
animation: neon 3s infinite;
}
#display {
transition: all 0.3s ease;
transform-style: preserve-3d;
}
#display.animate {
animation: pop 0.3s ease;
}
@keyframes pop {
0% { transform: scale(1) translateZ(0); }
50% { transform: scale(1.1) translateZ(20px); }
100% { transform: scale(1) translateZ(0); }
}
.button-press {
animation: press 0.3s ease;
}
@keyframes press {
0% { transform: translateY(0) scale(1); }
50% { transform: translateY(2px) scale(0.95); }
100% { transform: translateY(0) scale(1); }
}
.success-animation {
animation: success 0.5s ease;
}
@keyframes success {
0% { transform: scale(1); }
50% { transform: scale(1.2); background: #48ff00; }
100% { transform: scale(1); }
}
.error-animation {
animation: error 0.5s ease;
}
@keyframes error {
0% { transform: scale(1); }
50% { transform: scale(1.2); background: #ff0000; }
100% { transform: scale(1); }
}
.ripple {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.4);
transform: scale(0);
animation: ripple 0.6s linear;
pointer-events: none;
}
@keyframes ripple {
to {
transform: scale(4);
opacity: 0;
}
}
</style>
</head>
<body class="p-4">
<div id="particles-js"></div>
<div id="three-container"></div>
<div class="calculator-container max-w-sm w-full mx-auto rounded-3xl overflow-hidden p-6">
<!-- Display -->
<div class="display-container rounded-2xl p-6 mb-6">
<div id="expression" class="text-slate-400 text-right text-sm h-6 overflow-hidden mb-2"></div>
<div id="display" class="display-text text-white text-right text-5xl font-light h-14 overflow-hidden">0</div>
</div>
<!-- Buttons -->
<div class="grid grid-cols-4 gap-4">
<!-- Row 1 -->
<button class="calculator-btn special-btn p-5 text-xl font-medium" onclick="clearAll()">AC</button>
<button class="calculator-btn special-btn p-5 text-xl font-medium" onclick="clearEntry()">CE</button>
<button class="calculator-btn special-btn p-5 text-xl font-medium" onclick="appendOperator('%')">%</button>
<button class="calculator-btn operation-btn p-5 text-xl font-medium" onclick="appendOperator('/')">÷</button>
<!-- Row 2 -->
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('7')">7</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('8')">8</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('9')">9</button>
<button class="calculator-btn operation-btn p-5 text-xl font-medium" onclick="appendOperator('*')">×</button>
<!-- Row 3 -->
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('4')">4</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('5')">5</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('6')">6</button>
<button class="calculator-btn operation-btn p-5 text-xl font-medium" onclick="appendOperator('-')">−</button>
<!-- Row 4 -->
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('1')">1</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('2')">2</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('3')">3</button>
<button class="calculator-btn operation-btn p-5 text-xl font-medium" onclick="appendOperator('+')">+</button>
<!-- Row 5 -->
<button class="calculator-btn special-btn p-5 text-xl font-medium" onclick="toggleSign()">±</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendNumber('0')">0</button>
<button class="calculator-btn number-btn p-5 text-xl font-medium" onclick="appendDecimal()">.</button>
<button class="calculator-btn operation-btn p-5 text-xl font-medium" onclick="calculate()">=</button>
</div>
</div>
<script>
// Three.js setup
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ alpha: true });
renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById('three-container').appendChild(renderer.domElement);
// Create floating particles
const particles = [];
const particleCount = 100;
const geometry = new THREE.SphereGeometry(0.1, 32, 32);
const material = new THREE.MeshBasicMaterial({ color: 0xffffff, transparent: true, opacity: 0.5 });
for (let i = 0; i < particleCount; i++) {
const particle = new THREE.Mesh(geometry, material);
particle.position.set(
Math.random() * 40 - 20,
Math.random() * 40 - 20,
Math.random() * 40 - 20
);
particle.velocity = new THREE.Vector3(
Math.random() * 0.02 - 0.01,
Math.random() * 0.02 - 0.01,
Math.random() * 0.02 - 0.01
);
particles.push(particle);
scene.add(particle);
}
camera.position.z = 30;
function animate() {
requestAnimationFrame(animate);
particles.forEach(particle => {
particle.position.add(particle.velocity);
particle.rotation.x += 0.01;
particle.rotation.y += 0.01;
});
renderer.render(scene, camera);
}
animate();
// Particles.js configuration
particlesJS('particles-js', {
particles: {
number: { value: 80, density: { enable: true, value_area: 800 } },
color: { value: '#ffffff' },
shape: { type: 'circle' },
opacity: { value: 0.5, random: true },
size: { value: 3, random: true },
line_linked: {
enable: true,
distance: 150,
color: '#ffffff',
opacity: 0.4,
width: 1
},
move: {
enable: true,
speed: 2,
direction: 'none',
random: true,
straight: false,
out_mode: 'out',
bounce: false
}
},
interactivity: {
detect_on: 'canvas',
events: {
onhover: { enable: true, mode: 'repulse' },
onclick: { enable: true, mode: 'push' },
resize: true
}
},
retina_detect: true
});
let currentInput = '0';
let currentExpression = '';
let calculated = false;
const display = document.getElementById('display');
const expressionDisplay = document.getElementById('expression');
function updateDisplay() {
display.textContent = currentInput;
expressionDisplay.textContent = currentExpression;
display.classList.add('animate');
setTimeout(() => display.classList.remove('animate'), 300);
}
function appendNumber(number) {
if (currentInput === '0' || calculated) {
currentInput = number;
calculated = false;
} else {
currentInput += number;
}
updateDisplay();
animateButton(event.target);
createRipple(event);
}
function appendDecimal() {
if (calculated) {
currentInput = '0.';
calculated = false;
} else if (!currentInput.includes('.')) {
currentInput += '.';
}
updateDisplay();
animateButton(event.target);
createRipple(event);
}
function appendOperator(operator) {
let displayOperator = operator;
if (operator === '*') displayOperator = '×';
if (operator === '/') displayOperator = '÷';
if (operator === '-') displayOperator = '−';
currentExpression = currentInput + ' ' + displayOperator + ' ';
calculated = false;
currentInput = '0';
updateDisplay();
animateButton(event.target);
createRipple(event);
}
function clearAll() {
currentInput = '0';
currentExpression = '';
calculated = false;
updateDisplay();
animateButton(event.target);
createRipple(event);
}
function clearEntry() {
currentInput = '0';
updateDisplay();
animateButton(event.target);
createRipple(event);
}
function toggleSign() {
currentInput = (parseFloat(currentInput) * -1).toString();
updateDisplay();
animateButton(event.target);
createRipple(event);
}
function calculate() {
try {
let expressionToEvaluate = currentExpression.replace('×', '*').replace('÷', '/').replace('−', '-');
expressionToEvaluate += currentInput;
expressionToEvaluate = expressionToEvaluate.replace(/%/g, '/100');
const result = eval(expressionToEvaluate);
currentExpression += currentInput + ' = ';
currentInput = result.toString();
calculated = true;
updateDisplay();
animateButton(event.target);
createRipple(event);
display.classList.add('success-animation');
setTimeout(() => display.classList.remove('success-animation'), 500);
} catch (e) {
currentInput = 'Error';
updateDisplay();
display.classList.add('error-animation');
setTimeout(() => {
display.classList.remove('error-animation');
clearAll();
}, 1500);
}
}
function animateButton(button) {
button.classList.add('button-press');
setTimeout(() => button.classList.remove('button-press'), 300);
}
function createRipple(event) {
const button = event.target;
const ripple = document.createElement('span');
const rect = button.getBoundingClientRect();
const size = Math.max(rect.width, rect.height);
const x = event.clientX - rect.left - size / 2;
const y = event.clientY - rect.top - size / 2;
ripple.style.width = ripple.style.height = `${size}px`;
ripple.style.left = `${x}px`;
ripple.style.top = `${y}px`;
ripple.className = 'ripple';
button.appendChild(ripple);
setTimeout(() => ripple.remove(), 600);
}
// Initialize
updateDisplay();
</script>
</body>
</html>