Simple Timeline
This repository will show you how to make a simple timeline with SVG
See the demo ππ»here
How?
scrollbars ππ» "single move" ππ» only change relative translate transform.
mask ππ» "group move" ππ» change absolute translate transform.
While moving, calculate translate and scale value for data-display area to make it move accordingly!
Some Little Math
rate = w / L
dataVisible length = rate * dataLength
dataInvisible length = - x * dataLength / L
assume the dataLength after scaling is L1, we get:
w / L = L` / L1
so scale = L1 / dataLength = L` / (rate * dataLength)
so d = dataInvisible length * scale