State | EV | |||||
AK | 3 | |||||
AL | 9 | |||||
AR | 6 | |||||
AZ | 11 | |||||
CA | 54 | |||||
CO | 10 | |||||
CT | 7 | |||||
DC | 3 | |||||
DE | 3 | |||||
FL | 30 | |||||
GA | 16 | |||||
HI | 4 | |||||
IA | 6 | |||||
ID | 4 | |||||
IL | 19 | |||||
IN | 11 | |||||
KS | 6 | |||||
KY | 8 | |||||
LA | 8 | |||||
MA | 11 | |||||
MD | 10 | |||||
ME | 4 | |||||
MI | 15 | |||||
MN | 10 | |||||
MO | 10 | |||||
MS | 6 | |||||
MT | 4 | |||||
NC | 16 | |||||
ND | 3 | |||||
NE | 5 | |||||
NH | 4 | |||||
NJ | 14 | |||||
NM | 5 | |||||
NV | 6 | |||||
NY | 28 | |||||
OH | 17 | |||||
OK | 7 | |||||
OR | 8 | |||||
PA | 19 | |||||
RI | 4 | |||||
SC | 9 | |||||
SD | 3 | |||||
TN | 11 | |||||
TX | 40 | |||||
UT | 6 | |||||
VA | 13 | |||||
VT | 3 | |||||
WA | 12 | |||||
WI | 10 | |||||
WV | 4 | |||||
WY | 3 |
This repl creates interactive maps with HTML, JS, CSS, and SVG. Drag left or right on a state to change the color.
To view this on TripleLog, click here.
The index.html is regenerated every time the server creates a new map (not really a good idea for most scenarios).
The CSS is inline and some may not be needed.
The index.js file serves two files. One to set some options like colors and then it posts the form data to create the interactive map.
The template is an extension/modification of the CSS maps so it may not be exactly ideal.
The mapSlider.js file performs the logic of updating the data/visuals when a state is dragged left/right.
The map is SVG and other maps could be used with some adjustments to the server.