36 lines
990 B
HTML
36 lines
990 B
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Schulzeit Erfassung</title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
|
<style>
|
|
html, body {
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script src="/elm.js"></script>
|
|
<script>
|
|
var storedToken = localStorage.getItem('authToken');
|
|
|
|
var app = Elm.Main.init({
|
|
node: document.getElementById('app'),
|
|
flags: storedToken
|
|
});
|
|
|
|
// Save token to localStorage
|
|
app.ports.saveToken.subscribe(function(token) {
|
|
localStorage.setItem('authToken', token);
|
|
});
|
|
|
|
// Remove token from localStorage
|
|
app.ports.removeToken.subscribe(function() {
|
|
localStorage.removeItem('authToken');
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|