Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: default values to set
- @ECHO off
- SETLOCAL ENABLEEXTENSIONS
- SETLOCAL EnableDelayedExpansion
- SET me=%~n0
- SET parent=%~dp0
- set height=
- set width=
- set heightcounter=0
- set counter=0
- set textindent=0
- mkdir out
- cd %parent%
- for %%v in (*.gif) do (
- set filename=%%~nv
- set filename=!filename: =!
- (magick "%%v" -coalesce -resize x80 tmp%%05d.jpg)
- (magick tmp00000.jpg -ping -format "%%h" info:) > height.txt
- (magick tmp00000.jpg -ping -format "%%w" info:) > width.txt
- for /f "delims=" %%x in (height.txt) do set height=%%x
- for /f "delims=" %%x in (width.txt) do set width=%%x
- for /f %%A in ('dir ^| find "tmp"') do set /A counter+=1
- (magick tmp*.jpg -append "out\!filename!.jpg")
- set /A steps=!counter!-1
- set /A backgroundheight=!height!*!steps!
- set /A duration=!steps!/24
- set /A textindent=!width!+5
- echo counter: !counter!
- echo steps: !steps!
- echo width: !width!
- echo height: !height!
- echo background-height !backgroundheight!
- echo duration: !duration!
- type NUL > out\!filename!-stylesheet.css
- echo .flair-!filename! { >> out\!filename!-stylesheet.css
- echo border: 0; >> out\!filename!-stylesheet.css
- echo padding: 0; >> out\!filename!-stylesheet.css
- echo height: !height!px; >> out\!filename!-stylesheet.css
- echo min-width: !width!px; >> out\!filename!-stylesheet.css
- echo text-indent: !textindent!px; >> out\!filename!-stylesheet.css
- echo background: url(%%%%!filename!%%%%^) repeat-y; >> out\!filename!-stylesheet.css
- echo -webkit-animation: !filename! !duration!s steps(!steps!^) infinite; >> out\!filename!-stylesheet.css
- echo animation: !filename! !duration!s steps(!steps!^) infinite; >> out\!filename!-stylesheet.css
- echo display: inline-block; >> out\!filename!-stylesheet.css
- echo } >> out\!filename!-stylesheet.css
- echo
- echo @-webkit-keyframes !filename!{ >> out\!filename!-stylesheet.css
- echo from {background-position: 0 0;} >> out\!filename!-stylesheet.css
- echo to { background-position: 0 !backgroundheight!px;} >> out\!filename!-stylesheet.css
- echo } >> out\!filename!-stylesheet.css
- echo @keyframes !filename!{ >> out\!filename!-stylesheet.css
- echo from {background-position: 0 0;} >> out\!filename!-stylesheet.css
- echo to { background-position: 0 !backgroundheight!px;} >> out\!filename!-stylesheet.css
- echo } >> out\!filename!-stylesheet.css
- set counter=0
- del tmp*.jpg
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement