A clean, responsive web calculator built with Node.js, Express, and Vanilla JavaScript. This project features a dynamic history tracking system that clears itself on command.
- Real-time Calculations: Powered by JavaScript's math engine.
- Smart History: Tracks your last 5 calculations.
- Conditional UI: The "Delete History" button only appears when there is at least 1 entry (Logic: 1=1 clear history).
- Responsive Design: Works on desktop and mobile browsers.
- Node.js (v14 or higher)
-
Clone the repository:
git clone [https://github.com/your-username/node-calc.git](https://github.com/your-username/node-calc.git)
-
Install dependencies:
npm install
-
Start the server:
npm run dev
-
Open your browser to http://localhost:3000
The following technologies, languages and frameworks were used throughout the creation of this program:
- Backend: Node.js, Express
- Frontend: HTML5, CSS3, JavaScript (ES6+)
The history visibility is controlled by a state-check in script.js:
function renderHistory() {
clearHistoryBtn.style.display = (history.length >= 1) ? "block" : "none";
}This project uses UTF-8 encoding throughout.
- Line endings are enforced as LF via
.gitattributes - PowerShell output/input is expected to be UTF-8
- Emojis and Unicode characters are supported
If emojis do not render correctly, ensure UTF-8 is enabled:
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
chcp 65001You should see:
modified: README.md