JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script>
<div class="wrapper">
<div class="pointer">
<span class="server"><strong>Server-Zeit</strong><span>00:00</span></span>
<span class="local"><strong>Unsere Zeit</strong><span>00:00</span></span>
</div>
</div>
CSS
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400, 700);
body {
font-family:'Open Sans', sans-serif;
font-size: 14px;
color: #333;
}
.wrapper {
position: relative;
padding-top: 2em;
}
.pointer {
position: absolute;
height: 4000%;
border-left: 2px solid red;
z-index:400;
top: 0;
transition: left 1s ease-in-out;
}
.pointer .server {
position: absolute;
left: 0;
background: red;
color: white;
font-size: 0.8em;
font-weight: bold;
padding: 4px 6px;
margin-left: -2px;
}
.pointer .local {
position: absolute;
right: 2px;
background: #B6B6B6;
color: white;
font-size: 0.8em;
font-weight: bold;
padding: 4px 6px;
margin-left: 0px;
}
.pointer .server strong {
position: absolute;
top: 2.1em;
color: #B9B9B9;
left: 6px;
width: 10em;
}
.pointer .local strong {
position: absolute;
top: 2.1em;
color: #B9B9B9;
right: 6px;
width: 10em;
text-align: right;
}
.bar {
display: flex;
flex-wrap: nowrap;
}
h2 {
font-size: 1em;
font-weight: bold;
width: 100%;
margin: 0.25em 0;
color: #AAA;
}
.bar > div {
box-sizing: border-box;
padding: 0.5em;
font-size: 0.8em;
position: relative;
font-weight: bold;
}
.bar > div > span {
display: inline-block;
padding: 0px 0 2px 0;
margin: 2px;
color: rgba(0,0,0,0.6);
font-weight: normal;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.bar > div > strong {
display: block;
}
}
JavaScript
// Information on all the map metas
// Each has a name and a list of phases, with
// each phase having an offset from the previous phase
// (or start of every even hour for the first phase per meta)
// using server time (UTC)
var metas = {
vb: {
name: "Grasgrüne Schwelle",
phases: [
{ name: "", duration: 10, color: "#84C147" },
{ name: "Bosse in der Nacht", duration: 20, color: "#6DAC2F" },
{ name: "Tag", duration: 75, color: "#C4E2A5" },
{ name: "Nacht", duration: 15, color: "#84C147" },
]
},
ab: {
name: "Güldener Talkessel",
phases: [
{ name: "Pylone", duration: 45, color: "#FFE37F" },
{ name: "Herausforderungen", duration: 15, color: "#FFD53D" },
//{ name: "", duration: 5, color: "#FFE37F" },
{ name: "Rankenkraken", duration: 20, color: "#EAB700" },
{ name: "Pause", duration: 10, color: "#FFF1C1" },
{ name: "Pylone", duration: 30, color: "#FFE37F" },
]
},
td: {
name: "Verschlungene Tiefen",
phases: [
{ name: "", duration: 25, color: "#FFD7D7" },
{ name: "Vorbereitung", duration: 5, color: "#ffbdbd" },
{ name: "Chak-Potentant", duration: 20, color: "#f99" },
{ name: "Außenposten", duration: 70, color: "#FFD7D7" },
]
},
ds: {
name: "Widerstand des Drachen",
phases: [
{ name: "", duration: 90, color: "linear-gradient( 90deg, #c8c5e5, #DFDDF7 )" },
{ name: "Start", duration: 30, color: "linear-gradient( 90deg, #9f99cc, #c8c5e5 )" }
]
},
dt: {
name: "Trockenkuppe",
phases: [
{ name: "Normale Events", duration: 40, color: "#FCFADC" },
{ name: "Sandsturm", duration: 20, color: "#DED98A" },
{ name: "Normale Events", duration: 40, color: "#FCFADC" },
{ name:...