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
Binary file added Easy/MayureshSurveIssue10/RetroCon.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Easy/MayureshSurveIssue10/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions Easy/MayureshSurveIssue10/calc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
*{
font-family: "Press Start 2P";
}

body{
background: url(retrobg.jpeg) no-repeat center center fixed;
background-size: 100vw 100vh;
overflow: hidden;
margin: 2em 0em;
}

.calculator{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
gap: 0.25em;
}

.display{
width: 69.5%;
height: 1.5em;
font-size: 2em;
text-align: right;
background: transparent;
color: white;
}

.back{
width: 3.25em;
height: 3.25em;
}

.options{
display: grid;
grid-template-columns: repeat(4,1fr);
gap: 1em;
margin-bottom: 4em;
max-width: 70vw;
max-height: 70vh;
width: 75%;
height: 50%;
}

button{
font-size: 0.5em;
padding: 1em;
color: white;
background-color: rgb(127, 136, 117);
}
59 changes: 59 additions & 0 deletions Easy/MayureshSurveIssue10/calc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Retro PC | Calculator</title>
<meta name="description" content="Calculator">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/jpeg" href="RetroCon.jpeg">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<link rel="stylesheet" href="calc.css">
</head>
<body>
<div class="bg">
<div class="calculator">
<a href="index.html"> <img class="back" src="back.png" ></a>
<input type="text" class="display" disabled>
<div class="options">
<button style="background-color: rgb(191, 17, 17);" onclick="cleardisplay()">AC</button>
<button style="background-color: rgb(85, 90, 78);" onclick="del()">DEL</button>
<button style="background-color: rgb(85, 90, 78);" onclick="appendValue('(')">(</button>
<button style="background-color: rgb(85, 90, 78);" onclick="appendValue(')')">)</button>
<button style="background-color: rgb(163, 115, 27);" onclick="appendValue('sin(')">sin</button>
<button style="background-color: rgb(163, 115, 27);" onclick="appendValue('cos(')">cos</button>
<button style="background-color: rgb(163, 115, 27);" onclick="appendValue('tan(')">tan</button>
<button style="background-color: rgb(84, 84, 188);" onclick="appendValue('π')">π</button>
<button style="background-color: rgb(163, 115, 27);" onclick="appendValue('sin⁻¹(')">sin<sup>-1</sup></button>
<button style="background-color: rgb(163, 115, 27);" onclick="appendValue('cos⁻¹(')">cos<sup>-1</sup></button>
<button style="background-color: rgb(163, 115, 27);" onclick="appendValue('tan⁻¹(')">tan<sup>-1</sup></button>
<button style="background-color: rgb(84, 84, 188);" onclick="appendValue('e')">e</button>
<button onclick="appendValue('7')">7</button>
<button onclick="appendValue('8')">8</button>
<button onclick="appendValue('9')">9</button>
<button style="background-color: rgb(85, 90, 78);" onclick="appendValue('÷')">÷</button>
<button onclick="appendValue('4')">4</button>
<button onclick="appendValue('5')">5</button>
<button onclick="appendValue('6')">6</button>
<button style="background-color: rgb(85, 90, 78);" onclick="appendValue('x')">x</button>
<button onclick="appendValue('1')">1</button>
<button onclick="appendValue('2')">2</button>
<button onclick="appendValue('3')">3</button>
<button style="background-color: rgb(85, 90, 78);" onclick="appendValue('-')">-</button>
<button onclick="appendValue('00')">00</button>
<button onclick="appendValue('0')">0</button>
<button onclick="appendValue('.')">.</button>
<button style="background-color: rgb(85, 90, 78);" onclick="appendValue('+')">+</button>
<button style="background-color: rgb(152, 135, 21);" >v1.0</button>
<button style="background-color: rgb(84, 84, 188);" onclick="appendValue('√')">√</button>
<button style="background-color: rgb(84, 84, 188);" onclick="appendValue('^')">EXP</button>
<button style="background-color: rgb(53, 97, 141);" onclick="calc()">=</button>
</div>
</div>
</div>

<script src="script.js" async defer></script>
</body>
</html>
Binary file added Easy/MayureshSurveIssue10/calc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Easy/MayureshSurveIssue10/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Easy/MayureshSurveIssue10/gallery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions Easy/MayureshSurveIssue10/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Retro Personal Computer</title>
<meta name="description" content="Retro Personal Computer">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/jpeg" href="RetroCon.jpeg">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<link rel="stylesheet" href="retro.css">
</head>
<body>
<div class="bg">
<div class="home">
<div class="app"><img class="homeimg" src="mypc.png">
<p class="appname">My PC</p>
</div>
<div class="app"><img class="homeimg" src="gallery.png">
<p class="appname">Gallery</p>
</div>
<div class="app"><a href="calc.html"><img class="homeimg" src="calc.png"></a>
<p class="appname">Calculator</p>
</div>

</div>
</div>

<script>

</script>
</body>
</html>
Binary file added Easy/MayureshSurveIssue10/mypc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Easy/MayureshSurveIssue10/next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 131 additions & 0 deletions Easy/MayureshSurveIssue10/retro.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
*{
font-family: "Press Start 2P";
}

body{
background: url(retrobg.jpeg) no-repeat center center fixed;
background-size: 100vw 100vh;
overflow: hidden;
margin: 2em 0em;
}

.bg{
width: 100vw;
height: 100vh;
align-items: center;
margin: 2em 0em;
}

.home{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 3em;
width: 100vw;
height: 100vh;
}

.app{
display: flex;
flex-direction: column;
align-items: center;
}

.appname{
font-size: 0.7em;
text-align: center;
color: white;
}

.homeimg, .back{
width: 3.25em;
height: 3.25em;
}


.box{
display: none;
margin-top: 3em;
margin-left: 3.5em;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
gap: 0.5em;
max-width:100vw;
max-height: 100vh;
width: 90%;
height: 80%;
padding: 0.75em;
}

.back{
position: absolute;
left: 5.25em;
}

.gallery{
display: grid;
grid-template-columns: repeat(3,1fr);
grid-template-rows: repeat(3,1fr);
gap: 2em;
height: auto;
}

.userimg{
width: 100%;
max-width: 7em;
height: auto;
border: 1px solid rgb(191, 191, 191);
}

.popup{
display: none;
z-index: 1000;
position: fixed;
top: 0;
left: 50%;
transform: translate(-50%,50%);
width: 22em;
height: 22em;
background-color: rgb(179, 179, 179);
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
border: 1px solid gray;
}

.close, .prev, .next{
width:2em;
height:2em;
}

.close{
background-color: rgb(169, 29, 29);
margin-right: 0.25em;
}

.navbar, .slide{
display: flex;
justify-content: space-between;
align-items: center;
width: 22em;
background-color: rgb(22, 22, 112);
border: 1px solid white;
border-left: 0;
border-right: 0;
}

.popimg{
margin-top: 0.25em;
width: 16em;
height: 16em;
}

.name{
color:white;
margin-left: 0.25em;
}
Binary file added Easy/MayureshSurveIssue10/retrobg.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions Easy/MayureshSurveIssue10/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

let ans = document.querySelector('.display');


function appendValue(value) {
console.log("Before : ", ans.value)
ans.value += value;
console.log("After : ", ans.value)
}

function cleardisplay() {
ans.value = "";
}

function del() {
ans.value = ans.value.slice(0,-1);
}

function dtor(degrees) {
return degrees*(Math.PI/180);
}

function rtod(radians) {
return radians*(180/Math.PI);
}

function calc() {

try{
let expression = ans.value;

expression = expression.replace(/÷/g,'/');
expression = expression.replace(/x/g,'*');
expression = expression.replace(/sin⁻¹([^)]+)/g,'rtod(Math.asin($1))');
expression = expression.replace(/cos⁻¹([^)]+)/g,'rtod(Math.acos($1))');
expression = expression.replace(/tan⁻¹([^)]+)/g,'rtod(Math.atan($1))');
expression = expression.replace(/\bsin([^)]+)/g,'Math.sin(dtor($1))');
expression = expression.replace(/\bcos([^)]+)/g,'Math.cos(dtor($1))');
expression = expression.replace(/\btan([^)]+)/g,'Math.tan(dtor($1))');
expression = expression.replace(/π/g,'Math.PI');
expression = expression.replace(/e/g,'Math.E');
expression = expression.replace(/\^/g,'**');
expression = expression.replace(/√([^)]+)/g,'Math.sqrt($1)');

let answer = eval(expression);

ans.value = answer;
}

catch(error) {
ans.value = "Error";
}
}