Compare commits
4 commits
597b276825
...
8ff27ca2bc
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ff27ca2bc | |||
| 9ef246e399 | |||
| 09da7eee8a | |||
| a9705e7ab1 |
3 changed files with 4434 additions and 3655 deletions
30
index.html
30
index.html
|
|
@ -94,7 +94,35 @@
|
|||
<h2>State lifespans</h2>
|
||||
<span id="historyRange">-</span>
|
||||
</div>
|
||||
<canvas id="stateGraph" width="300" height="720" aria-label="State lifespan graph"></canvas>
|
||||
<div class="history-controls">
|
||||
<select id="historyFilter" aria-label="State graph filter">
|
||||
<option value="all">All</option>
|
||||
<option value="active">Living</option>
|
||||
<option value="ended">Past</option>
|
||||
</select>
|
||||
<select id="historySort" aria-label="State graph sort">
|
||||
<option value="important">Important</option>
|
||||
<option value="active">Active</option>
|
||||
<option value="oldest">Oldest</option>
|
||||
<option value="strongest">Strongest</option>
|
||||
<option value="largest">Largest</option>
|
||||
</select>
|
||||
<select id="historyMetric" aria-label="State graph metric">
|
||||
<option value="power">Power</option>
|
||||
<option value="population">Population</option>
|
||||
<option value="cities">Cities</option>
|
||||
<option value="loyalty">Loyalty</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="history-group-controls" aria-label="State graph groups">
|
||||
<button id="toggleActiveStates" type="button" aria-pressed="true">Living</button>
|
||||
<button id="togglePastStates" type="button" aria-pressed="true">Past</button>
|
||||
</div>
|
||||
<div class="state-graph-scroll">
|
||||
<canvas id="stateGraph" width="300" height="720" aria-label="State lifespan graph"></canvas>
|
||||
<div id="stateGraphTooltip" class="state-graph-tooltip" hidden></div>
|
||||
</div>
|
||||
<div id="stateGraphInfo" class="state-graph-info">Hover a row for details</div>
|
||||
</section>
|
||||
</aside>
|
||||
</main>
|
||||
|
|
|
|||
119
styles.css
119
styles.css
|
|
@ -90,17 +90,94 @@ select {
|
|||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
#stateGraph {
|
||||
display: block;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
min-height: 420px;
|
||||
.history-controls,
|
||||
.history-group-controls {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.history-controls {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.history-controls select,
|
||||
.history-group-controls button {
|
||||
min-width: 0;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
background: #101315;
|
||||
color: var(--text);
|
||||
font-size: 11px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.history-group-controls {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.history-group-controls button[aria-pressed="false"] {
|
||||
color: var(--muted);
|
||||
background: #171b1d;
|
||||
}
|
||||
|
||||
#stateGraph {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
border: 0;
|
||||
background: #101315;
|
||||
image-rendering: auto;
|
||||
}
|
||||
|
||||
.state-graph-scroll {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
background: #101315;
|
||||
}
|
||||
|
||||
.state-graph-tooltip {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
max-width: min(240px, calc(100% - 16px));
|
||||
padding: 7px 9px;
|
||||
border: 1px solid #435057;
|
||||
border-radius: 6px;
|
||||
background: rgba(15, 18, 20, 0.50);
|
||||
color: var(--text);
|
||||
font-size: 11px;
|
||||
line-height: 1.3;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
|
||||
}
|
||||
|
||||
.state-graph-tooltip strong {
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.state-graph-tooltip span {
|
||||
display: block;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.state-graph-info {
|
||||
min-height: 18px;
|
||||
margin-top: 7px;
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
line-height: 1.25;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.brand h1 {
|
||||
margin: 0 0 6px;
|
||||
font-size: 24px;
|
||||
|
|
@ -290,7 +367,7 @@ canvas#world {
|
|||
padding: 8px 10px;
|
||||
border: 1px solid #435057;
|
||||
border-radius: 6px;
|
||||
background: rgba(15, 18, 20, 0.96);
|
||||
background: rgba(15, 18, 20, 0.80);
|
||||
color: var(--text);
|
||||
font-size: 11px;
|
||||
line-height: 1.35;
|
||||
|
|
@ -300,10 +377,28 @@ canvas#world {
|
|||
|
||||
.tooltip strong {
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
margin-bottom: 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tooltip section {
|
||||
padding-top: 5px;
|
||||
margin-top: 5px;
|
||||
border-top: 1px solid rgba(168, 177, 170, 0.16);
|
||||
}
|
||||
|
||||
.tooltip section:first-of-type {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.tooltip h3 {
|
||||
margin: 0 0 3px;
|
||||
color: var(--text);
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.tooltip span {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
@ -311,6 +406,12 @@ canvas#world {
|
|||
color: var(--muted);
|
||||
}
|
||||
|
||||
.tooltip em {
|
||||
color: var(--text);
|
||||
font-style: normal;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
body {
|
||||
overflow: auto;
|
||||
|
|
@ -330,7 +431,7 @@ canvas#world {
|
|||
.history-sidebar {
|
||||
border-left: 0;
|
||||
border-top: 1px solid var(--line);
|
||||
overflow: visible;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sim {
|
||||
|
|
@ -343,7 +444,7 @@ canvas#world {
|
|||
height: min(calc(100vw - 20px), 92vh);
|
||||
}
|
||||
|
||||
#stateGraph {
|
||||
.state-graph-scroll {
|
||||
height: 420px;
|
||||
flex: none;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue