Skip to content

Instantly share code, notes, and snippets.

@charlesBochet charlesBochet/pi.html
Last active Dec 4, 2018

Embed
What would you like to do?
<!DOCTYPE html>
<html>
<head>
<title>Pi Calculator</title>
<style>
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
.pi-calculator-container {
background-color: white;
width: 500px;
border-radius: 10px;
text-align: center;
padding: 10px;
min-height: 300px;
}
.pi-calculator-container button {
background: #0084ff;
border: none;
border-radius: 5px;
padding: 8px 14px;
font-size: 15px;
color: #fff;
cursor: pointer;
}
.pi-calculator-container .pi-content {
color: #aaa;
font-size: 0.8em;
min-height: 200px;
word-break: break-all;
}
</style>
</head>
<body>
<div class="pi-calculator-container">
<h1>Pi Calculator</h1>
<p id="pi" class="pi-content"></p>
<button onclick="computePi()">Compute me</button>
</div>
</body>
<script type="text/javascript">
function computePi() {
document.getElementById('pi').textContent = '3.14'
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.