Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 202 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
* {
margin: 0;
box-sizing: border-box;
}

body {
/* background-image: url("download (10).jpg"); */
font-family: sans-serif;
}

.heading{
background-color: white;
color: black;
font-size: 5rem;
text-align: center;
font-family: 'Roboto Slab', serif;
}

.flex-container-column {
display: flex;
flex-direction: column;
background-color: #ced4da;
max-width: 800px;
margin: auto;
text-align: right;
padding: 20px;
}

.flex-container-row {
display: flex;
}

.navbarBg{
background-color: #e7ebee;
}

.button {
flex-basis: 25%;
color: black;
font-size: 1.5em;
text-align: center;
padding: 40px;
border: 1px solid black;
background-color: #e3e3e3;
cursor: pointer;
}

.double {
flex-basis: 50%;
}

.display {
color: white;
width: 100%;
padding: 10px 20px;
background-color: black;
border: 1px solid black;

height: 15vh;
}
#displaynumber{
font-size: 2.5rem ;
}

/* .backspace{
flex-basis: 25%;
color: black;
font-size: 1.5em;
text-align: center;
padding: 40px;
border: 1px solid black;
background: #f6f6f8;
cursor: pointer;

} */


.operator,
.negative,
.equals {
background: #f6f6f8;
color: black;
}

.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
border-radius: 5px;
padding: 30px;
/* margin-top: 20px; */
background-color: #ced4da;
margin: 20px auto;
}

.button:hover {
font-weight: bold;
}

@media screen and (max-width:513px) {
.button {
padding: 10px;
margin: auto;
}
}

.history {
width: 80%;
margin: 30px auto 0 auto;
overflow: scroll;
/* color: white; */
}

table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}

th,
td {
text-align: center;
padding: 16px;
}

th {
background-color: black;

color: white;
}

tr:nth-child(even) {
background-color: #f6f6f8;
}
tr:nth-child(odd) {
background-color: #e3e3e3;
}

.center {
margin-top: 50px;
text-align: center;
font-size: 5rem;
margin: auto;
font-family: 'Roboto Slab', serif;
background-color: white;
color: black;
padding: 10px;
}


@media screen and (max-width: 840px) {

.button {
padding: 20px;
}
.card{
margin: 20px;
}
.heading{
font-size: 4.2rem;
}
.center{
font-size: 4.2rem;
}
}
@media screen and (max-width: 513px) {
.button {
padding: 10px;
}

.history {
width: 80%;
}
.heading{
font-size: 3.5rem;
}
.center{
font-size: 3.5rem;
}

}
@media screen and (max-width: 400px) {

.button {
padding: 8px;
}
.display{
height: 12vh;
}
.heading{
font-size: 2.5rem;
}
.center{
font-size: 2.5rem;
}
.history {
width: 80%;
margin: 30px auto 0 auto;
overflow: scroll;
/* color: white; */
}

}
122 changes: 122 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web Calculator</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300&family=Merriweather+Sans&family=Roboto+Slab&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/index.css">
</head>

<body>
<div>
<p class="heading" style="margin-bottom: 0px;">Calculator</p>
</div>

<nav class="navbar navbar-expand-lg navbar-light navbarBg">
<div class="container-fluid">
<a class="navbar-brand" id="darkTheme" href="#">Switch to Dark Theme</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-link" id="sciCal" href="#">Scientific Calculator</a>
</div>
<div class="navbar-nav">
<a class="nav-link" href="https://matrix.reshish.com/">Matrix Calculator</a>
</div>
<div class="navbar-nav">
<a class="nav-link" href="https://www.desmos.com/calculator">Graph Calculator</a>
</div>
</div>
</div>
</nav>

<div class="flex-container-column card">
<div class="display">
<h1 id="displayNumber" style="font-size: 4.5rem;">
0
</h1>
</div>
<div class="flex-container-row">
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">sin^-1</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">cos^-1</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">tan^-1</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">e</div>
</div>
<div class="flex-container-row">
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">|x|</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">x^2</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">sqrt</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">ln</div>

</div>
<div class="flex-container-row">

<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">log</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">sin</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">cos</div>
<div class="button operator hideme" style="font-family: 'Roboto Slab', serif;">tan</div>
</div>
<div class="flex-container-row">
<div class="button operator" style="font-family: 'Roboto Slab', serif;">%</div>
<div class="button operator" style="font-family: 'Roboto Slab', serif;">/</div>
<div class="button operator" style="font-family: 'Roboto Slab', serif;">*</div>
<div class="button backspace" style="font-family: 'Roboto Slab', serif;">CE</div>
</div>
<div class="flex-container-row">
<div class="button" style="font-family: 'Roboto Slab', serif;">7</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">8</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">9</div>
<div class="button negative" style="font-family: 'Roboto Slab', serif;">+/-</div>
</div>
<div class="flex-container-row">
<div class="button" style="font-family: 'Roboto Slab', serif;">4</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">5</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">6</div>
<div class="button operator" style="font-family: 'Roboto Slab', serif;">-</div>
</div>
<div class="flex-container-row">
<div class="button" style="font-family: 'Roboto Slab', serif;">1</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">2</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">3</div>
<div class="button operator" style="font-family: 'Roboto Slab', serif;">+</div>
</div>
<div class="flex-container-row">
<div class="button clear" style="font-family: 'Roboto Slab', serif;">AC</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">0</div>
<div class="button" style="font-family: 'Roboto Slab', serif;">.</div>
<div class="button equals" style="font-family: 'Roboto Slab', serif;">=</div>
</div>
</div>

<div class="history card">
<h2>History</h2>
<table>
<thead>
<tr>
<th style="font-family: 'Roboto Slab', serif;">First Num</th>
<th style="font-family: 'Roboto Slab', serif;">Operator</th>
<th style="font-family: 'Roboto Slab', serif;">Second Num</th>
<th style="font-family: 'Roboto Slab', serif;">Result</th>
</tr>
</thead>
<tbody id="historyList"></tbody>
</table>
</div>

<div>
<p class="center" style="margin-top: 50px;">Copyright 2022 Phantom</p>
</div>
<script src="index.js"></script>
<script src="storingData.js"></script>

</body>

</html>
Loading