diff --git a/assets/index-Dru5ejaU.js b/assets/index-Dru5ejaU.js new file mode 100644 index 0000000..a3fb364 --- /dev/null +++ b/assets/index-Dru5ejaU.js @@ -0,0 +1,2 @@ +var Ie=(u,a)=>()=>(a||u((a={exports:{}}).exports,a),a.exports);var Re=Ie((De,L)=>{(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))C(d);new MutationObserver(d=>{for(const g of d)if(g.type==="childList")for(const M of g.addedNodes)M.tagName==="LINK"&&M.rel==="modulepreload"&&C(M)}).observe(document,{childList:!0,subtree:!0});function v(d){const g={};return d.integrity&&(g.integrity=d.integrity),d.referrerPolicy&&(g.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?g.credentials="include":d.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function C(d){if(d.ep)return;d.ep=!0;const g=v(d);fetch(d.href,g)}})();var L={};(function u(a,v,C,d){var g=!!(a.Worker&&a.Blob&&a.Promise&&a.OffscreenCanvas&&a.OffscreenCanvasRenderingContext2D&&a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype.transferControlToOffscreen&&a.URL&&a.URL.createObjectURL),M=typeof Path2D=="function"&&typeof DOMMatrix=="function",x=function(){if(!a.OffscreenCanvas)return!1;var r=new OffscreenCanvas(1,1),e=r.getContext("2d");e.fillRect(0,0,1,1);var n=r.transferToImageBitmap();try{e.createPattern(n,"no-repeat")}catch{return!1}return!0}();function _(){}function B(r){var e=v.exports.Promise,n=e!==void 0?e:a.Promise;return typeof n=="function"?new n(r):(r(_,_),null)}var D=function(r,e){return{transform:function(n){if(r)return n;if(e.has(n))return e.get(n);var o=new OffscreenCanvas(n.width,n.height),i=o.getContext("2d");return i.drawImage(n,0,0),e.set(n,o),o},clear:function(){e.clear()}}}(x,new Map),q=function(){var r=Math.floor(16.666666666666668),e,n,o={},i=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(e=function(s){var l=Math.random();return o[l]=requestAnimationFrame(function t(c){i===c||i+r-1{if(!k)throw new Error("Display error");k.value=I},xe=()=>{I="",R()},Oe=()=>{I=I.slice(0,-1),R()},$=u=>{I+=u},N=u=>u==="^"?3:["*","/"].includes(u)?2:["+","-"].includes(u)?1:0,Fe=u=>{console.log("STARTING OPERATION : "+u);const a=[],v=[],C=/(\d+(\.\d+)?|[+\-*^\/%])/g,d=u.match(C);if(console.log("Reg expression thats been split : "+d),!d)throw new Error("Invalid operation string");for(let g=0;gN(a[a.length-1])&&a.length!==0)a.push(M);else if(a.length===0||N(M)===N(a[a.length-1]))a.push(M);else if(N(M)0;){let x=a.pop();v.push(x)}a.push(M)}}for(let g=a.length-1;g>=0;g--)v.push(a[g]);if(!v)throw new Error("Error occured");return console.log("FINAL SHUNTING EXPRESSION: "+v),v},Ne=u=>{const a=[];console.log("Starting post fix: "+u);for(let v=0;v{const a=Ne(Fe(u));return Pe({particleCount:500,spread:1e4}),Number(a)},Ae=()=>{I&&!A.includes(I.charAt(I.length-1))&&(I=ke(I).toString(),R())},Le=u=>{Number(u)>=0&&Number(u)<=9||u==="."?$(u):u==="AC"?xe():u==="DEL"?Oe():A.includes(u)&&!A.includes(I.slice(-1))?$(u):Ae(),R()};J.forEach(u=>{u.addEventListener("click",()=>Le(u.innerText))});z&&z.addEventListener("click",function(){this.classList.toggle("active");const u=document.querySelector(".toggle-handle");u&&(u.style.transform=this.classList.contains("active")?"translateX(20px)":"translateX(0)");const a=z.classList.contains("active");document.body.style.backgroundColor=a?"beige":"",Y.style.backgroundColor=a?"rgb(45, 42, 42)":"",J.forEach(v=>{v.style.backgroundColor=a?"rgb(55, 52, 52)":"",v.style.color=a?"beige":""}),k.style.backgroundColor=a?"rgb(45, 42, 42)":"",k.style.color=a?"beige":""})});export default Re(); diff --git a/assets/index-hs0m3d77.css b/assets/index-hs0m3d77.css new file mode 100644 index 0000000..215b6d4 --- /dev/null +++ b/assets/index-hs0m3d77.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap";*{margin:0;padding:0;box-sizing:border-box;font-family:poppins,sans-serif}.calculator__buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;transition:background-color .3s ease}.calculator__buttons .calculator__button--span-two{grid-column-end:span 2}.calculator__button{background-color:#e7e7e7;border-radius:8px;padding:10px;border:none;font-size:25px;cursor:pointer}.calculator__button:active{transform:scale(.9)}.calculator__button--operator{color:gray}body{transition:background-color .3s ease;height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:#2d2a2a}.calculator{max-width:300px;width:100%;padding:20px;border-radius:10px;background-color:#f5f5f5;box-shadow:0 5px 10px #00000080;transition:background-color .3s ease;z-index:1000}.calculator__display{transition:background-color .3s ease;height:80px;width:100%;border:none;outline:none;text-align:right;margin-bottom:10px;font-size:30px;background-color:#f5f5f5}.dark-mode-switch{position:absolute;top:10px;left:10px;display:flex;align-items:center;justify-content:space-between;cursor:pointer}.dark-mode-switch .toggle{height:20px;width:40px;background-color:#ddd;border-radius:20px;padding:2px;transition:background-color .3s ease}.dark-mode-switch .toggle-handle{height:16px;width:16px;background-color:#fff;border-radius:50%;transition:transform .3s ease;transform:translate(0)} diff --git a/index.html b/index.html new file mode 100644 index 0000000..dff0317 --- /dev/null +++ b/index.html @@ -0,0 +1,60 @@ + + + + + + + Calculator + + + + + +
+
+
+
+
+
+ +
+ +
+
+ + diff --git a/vite.svg b/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file