Skip to content

Instantly share code, notes, and snippets.

@charlesBochet
Last active December 4, 2018 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlesBochet/802c2d61bdb6126142a21df849e2b405 to your computer and use it in GitHub Desktop.
Save charlesBochet/802c2d61bdb6126142a21df849e2b405 to your computer and use it in GitHub Desktop.
<!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