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
51 changes: 51 additions & 0 deletions HTML_5_Calculator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# FANCY-CALCULATOR

## Author

[kahenya-anita](https://github.com/kahenya-anita)

## Description

This is a simple calculator for basic arithmetic.


## Live Page
* [https://kahenya-anita.github.io/Fancy-Calculator]

## Screen shot

![Screenshot from 2020-06-16 16-16-34](https://user-images.githubusercontent.com/62019551/84779385-012c1e80-afed-11ea-812c-faf27983a6d1.png)




## Installation / Setup instruction
* Open Terminal {Ctrl+Alt+T}

* git clone ```https://github.com/kahenya-anita/Fancy-Calculator.git```

* cd Fancy-Calculator

* code . or atom . depending on the text editor of your choise.

* Use browser of your choice.

## Technologies Used

* HTML5
* CSS
* JQUERY
* JAVA SCRIPT


## Known Bugs
* No known bugs

## Contact Information

* If you have any question or contributions, please email me at [[email protected]]

## License

* Licenced under the [MIT License](LICENSE)
* Copyright (c) 2022 **ANITA KAHENYA**
71 changes: 71 additions & 0 deletions HTML_5_Calculator/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@import url('https://fonts.googleapis.com/css?family=poppins:300,400,500,600,700,800,900&dispal=swap');
h1{
text-align: center;
justify-content: center;
align-self: start;
font-size: xx-large;
font-weight: bolder;
font-stretch: extra-expanded;
font-style: inherit;
color: lavenderblush;
}
.
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'poppins', sans-serif;
}
body
{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #091921;
}
.calculator
{
position: relative;
display: grid;
}
.calculator .value
{
grid-column: span 4;
height: 100px;
text-align: right;
border: none;
outline: none;
padding: 10px;
font-size: 18px;
}
.calculator span
{
display: grid;
width: 60px;
height: 60px;
color: #fff;
background: #0c2835;
place-items: center;
border: 1px solid rgba(0,0,0,.1);
}
.calculator span:active
{
background: #74ff3b;
color: #111;
}
.calculator span.clear
{
grid-column: span 2;
width: 120px;
background: #ff3077;
}
.calculator span.plus
{
grid-row: span 2;
height: 120px;
}
.calculator span.equal
{
background: #03b1ff;
}
35 changes: 35 additions & 0 deletions HTML_5_Calculator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Fancy Calculator</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<h1>Fancy Calculator !</h1>
</head>
<body>
<form class="calculator" name="calc">
<input class="value" type="text" name="txt" readonly="" placeholder="0">
<span class="num clear" onclick="document.calc.txt.value =''">c</span>
<span class="num" onclick="document.calc.txt.value +='/'">/</span>
<span class="num" onclick="document.calc.txt.value +='*'">*</span>
<span class="num" onclick="document.calc.txt.value +='7'">7</span>
<span class="num" onclick="document.calc.txt.value +='8'">8</span>
<span class="num" onclick="document.calc.txt.value +='9'">9</span>
<span class="num" onclick="document.calc.txt.value +='-'">-</span>
<span class="num" onclick="document.calc.txt.value +='4'">4</span>
<span class="num" onclick="document.calc.txt.value +='5'">5</span>
<span class="num" onclick="document.calc.txt.value +='6'">6</span>
<span class="num plus" onclick="document.calc.txt.value +='+'">+</span>
<span class="num" onclick="document.calc.txt.value +='3'">3</span>
<span class="num" onclick="document.calc.txt.value +='2'">2</span>
<span class="num" onclick="document.calc.txt.value +='1'">1</span>
<span class="num" onclick="document.calc.txt.value +='0'">0</span>
<span class="num" onclick="document.calc.txt.value +='00'">00</span>
<span class="num" onclick="document.calc.txt.value +='.'">.</span>
<span class="num equal" onclick="document.calc.txt.value = eval(calc.txt.value)">=</span>

</form>

</body>
</html>