You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
2.1 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <script src="https://cdn.tailwindcss.com"></script>
  7. <script src="//unpkg.com/alpinejs" defer></script>
  8. <title>Calculator</title>
  9. <style>
  10. #calculator button {
  11. align-self: center;
  12. text-align: center;
  13. font-size: 10vh;
  14. border-radius: 20%;
  15. margin-right: 2vw;
  16. margin-left: 2vw;
  17. }
  18. </style>
  19. </head>
  20. <body class="bg-zinc-400 flex h-screen justify-center items-start " x-data="{}" @keypress="console.log($event)">
  21. <div id='calculator' class="bg-slate-800 w-screen grid grid-cols-[3fr,1fr] h-screen ">
  22. <div id="screen" class="hover:ring-4 ring-blue-400 m-2 p-8 text-right text-[8vh] text-white bg-black col-span-4 row-span-4 h-[20vh] rounded-xl">
  23. RESULT
  24. </div>
  25. <div class="grid grid-cols-3 gap-3 mb-4">
  26. <template x-for="x in 3">
  27. <template x-for="y in 3">
  28. <button class="active:bg-blue-400 hover:ring-4 ring-blue-400 border-double border-4 border-slate-800 bg-slate-600" x-text="x*3+y-3"></button>
  29. </template>
  30. </template>
  31. <button class="active:bg-blue-400 hover:ring-4 ring-blue-400 col-span-2 bg-slate-600 border-double border-4 border-slate-800">0</button>
  32. <button class="active:bg-blue-400 hover:ring-4 ring-blue-400 bg-slate-600 border-double border-4 border-slate-800">.</button>
  33. </div>
  34. <div class="grid grid-rows-4 gap-3 mb-4">
  35. <button class="active:bg-blue-400 hover:ring-4 ring-blue-400 border-double border-4 border-slate-600 bg-slate-900 text-white ">+</button>
  36. <button class="active:bg-blue-400 hover:ring-4 ring-blue-400 border-double border-4 border-slate-600 bg-slate-900 text-white ">-</button>
  37. <button class="active:bg-blue-400 hover:ring-4 ring-blue-400 border-double border-4 border-slate-600 bg-slate-900 text-white row-span-2 h-full bg-slate-300">=</button>
  38. </div>
  39. </div>
  40. </body>
  41. </html>