Skip to content

Instantly share code, notes, and snippets.

@themiurgo themiurgo/index.html
Last active Sep 8, 2016

Embed
What would you like to do?
: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
You can’t perform that action at this time.