diff options
| author | Astrid Smith | 2018-12-20 20:35:54 -0800 |
|---|---|---|
| committer | Astrid Smith | 2018-12-20 20:35:54 -0800 |
| commit | 2f99436545828e4af07e0c9e787dde3399968069 (patch) | |
| tree | 7fc6a497b024cb426f853beeb3d431f2d10d9bd2 /doit.sh | |
Diffstat (limited to 'doit.sh')
| -rwxr-xr-x | doit.sh | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#!/bin/bash + +GIFURL="$1" +GIF=$( basename "$GIFURL" ) +FMT=cursor_%03d.png + +if [ ! -f "$GIF" ] ; then + wget "$GIFURL" -O "$GIF" +fi + +convert -coalesce "$GIF" $FMT + +FRAMES=$( ls cursor_*.png | wc -l ) +INCR=$( echo 4k 100 $FRAMES / p | dc ) + +cat <<EOF +/* + * gif cursor from $GIFURL + * dumb idea from https://css-tricks.com/forums/topic/animated-cursor/ + */ +* { animation: cursor 1s infinite; } +@keyframes cursor { +EOF +for P in $( seq 0 $(( $FRAMES - 1 )) ) ; do + echo $( echo 15k 100 $FRAMES 1- / $P \* 0k 1/ p | dc )'% { cursor: url('$( printf $FMT $P )'), auto; }' +done +echo '}' |
