TAAFT
Free mode
100% free
Freemium
Free Trial
Create tool
  • Code Humanizer
    Transform AI code into human-like programming
    Open
    2,565
    813
    3.4
    1,069
    Released 3mo ago
    100% Free
    /* Creative Calculator */ body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #f0f4f8, #a3c9ff); font-family: "Segoe UI", sans-serif; } .calculator { background: #ffffff; padding: 25px; border-radius: 25px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); width: 300px; } .display { background: #eef6ff; color: #333; padding: 20px; border-radius: 15px; text-align: right; font-size: 1.7rem; margin-bottom: 20px; min-height: 50px; box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1); overflow-x: auto; } .buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } button { border: none; padding: 15px; border-radius: 15px; font-size: 1.2rem; cursor: pointer; background: #dbe9ff; transition: all 0.2s ease-in-out; } button:hover { background: #6fa8ff; color: white; transform: scale(1.05); } .equal { grid-column: span 2; background: #4c7ee8; color: white; font-weight: bold; } .clear { background: #ff6767; color: white; } .special { background: #ffd966; } </style> <div class="calculator"> <div id="display" class="display"></div> <div class="buttons"> <button class="special">Ans</button> <button>C</button> <button>7</button> <button>8</button> <button>9</button> <button>/</button> <button>4</button> <button>5</button> <button>6</button> <button>*</button> <button>1</button> <button>2</button> <button>3</button> <button>-</button> <button>0</button> <button>.</button> <button>+</button> <button class="equal">=</button> </div> </div> <script> // Get the display element and all buttons const displayElement = document.getElementById('display'); const buttons = document.querySelectorAll('button'); // Store the current calculation and previous answer let currentCalculation = ''; let previousAnswer = ''; // Add event listeners to all buttons buttons.forEach(button => { button.addEventListener('click', handleButtonClick); }); // Handle button clicks function handleButtonClick(event) { const button = event.target; const buttonText = button.textContent; // Handle equals button if (buttonText === '=') { try { // Evaluate the current calculation const result = eval(currentCalculation); displayElement.textContent = result; previousAnswer = result; currentCalculation = result.toString(); } catch (error) { displayElement.textContent = 'Error!'; currentCalculation = ''; } } // Handle clear button else if (buttonText === 'C') { displayElement.textContent = ''; currentCalculation = ''; } // Handle answer button else if (buttonText === 'Ans') { currentCalculation += previousAnswer; displayElement.textContent = currentCalculation; } // Handle digit or operator button else { currentCalculation += buttonText; displayElement.textContent = currentCalculation; } } </script>

Featured matches

Verified tools

Other tools

Post
0 AIs selected
Clear selection
#
Name
Task