Skip to content

Instantly share code, notes, and snippets.

@themiurgo
Last active September 8, 2016 22:51
Show Gist options
  • Save themiurgo/be8a5f38b97ceec9ae13 to your computer and use it in GitHub Desktop.
Save themiurgo/be8a5f38b97ceec9ae13 to your computer and use it in GitHub Desktop.
:P Language app that switches every day/week
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
<style>
div.container-fluid {
width: 100%;
height: 50%;
position: relative;
top: 50%;
transform: translateY(-50%);
text-align: center;
font-size: 20pt;
}
</style>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<h1 id="lang">h1. Bootstrap heading</h1>
</div>
<script>
var start = moment("2015-07-10");
var end = moment({hour: 0});
var jour = end.diff(start, "days") % 2;
var week = moment().week() % 2;
var lang = "Français";
if (week)
lang = "Italiano";
document.getElementById("lang").innerHTML = lang;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment