A modern, responsive calculator application built with vanilla JavaScript, HTML, and CSS. Inspired by Sentry's design system with a sleek dark theme and smooth animations.
https://adal3n3.github.io/sentry-calculator/
- Modern UI: Clean, professional interface inspired by Sentry's design language
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Keyboard Support: Full keyboard navigation and input support
- Visual Feedback: Button press animations and ripple effects
- Error Handling: Graceful error handling for edge cases like division by zero
- Accessibility: WCAG compliant with proper focus management and high contrast support
- Basic arithmetic operations (addition, subtraction, multiplication, division)
- Decimal number support
- Percentage calculations
- Clear and delete operations
- Keyboard shortcuts for all operations
- Auto-scaling display for long numbers
- Number formatting with thousand separators
- Numbers:
0-9
- Input numbers - Operations:
+
,-
,*
,/
- Arithmetic operations - Decimal:
.
or,
- Add decimal point - Calculate:
=
orEnter
- Perform calculation - Clear:
Escape
orDelete
- Clear all - Backspace:
Backspace
- Delete last digit - Percentage:
%
- Convert to percentage
- HTML5: Semantic markup structure
- CSS3: Modern styling with CSS Grid, Flexbox, and custom properties
- JavaScript (ES6+): Object-oriented calculator logic with event handling
- Google Fonts: Inter font family for typography
Calculator/
├── index.html # Main HTML structure
├── styles.css # CSS styles and responsive design
├── script.js # JavaScript calculator logic
├── tests/ # Test files
│ ├── calculator.test.js
│ └── e2e.test.js
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/Adal3n3/sentry-calculator.git
-
Navigate to the project directory:
cd sentry-calculator
-
Open
index.html
in your web browser or serve it using a local server:# Using Python 3 python -m http.server 8000 # Using Node.js (if you have http-server installed) npx http-server
-
Visit
http://localhost:8000
in your browser
The calculator uses a carefully crafted color palette inspired by Sentry:
- Primary Colors: Purple gradient (
#9a7aff
to#7c5dfa
) - Background: Dark theme with layered backgrounds
- Typography: Inter font family for optimal readability
- Spacing: Consistent 8px grid system
- Shadows: Layered shadows for depth and hierarchy
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is open source and available under the MIT License.
- Design inspiration from Sentry
- Icons from Heroicons
- Typography from Google Fonts (Inter)