add already written scripts
This commit is contained in:
commit
adc8b6093f
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import random
|
||||
import os
|
||||
|
||||
time=int(random.random()*100)
|
||||
timestr=str(time)+"%"
|
||||
os.system("mpv ~/youtube-dl-vids/bergensbanen.mp4 --start=%s" %timestr)
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
pidof elm-server || (cd "$HOME/.local/lib" elm-server) &
|
||||
|
||||
sleep 1
|
||||
|
||||
chromium-browser --app="http://localhost:8000/cookie.elm"
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
mpv --loop=inf ~/youtube-dl-vids/maya.mp4
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
wait 3
|
||||
mpv ~/youtube-dl-vids/narwhals.mp4
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import random
|
||||
import os
|
||||
|
||||
time=int(random.random()*100)
|
||||
timestr=str(time)+"%"
|
||||
os.system("mpv ~/youtube-dl-vids/nordlandsbanen.mp4 --start=%s" %timestr)
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
echo "Hold your breath and wait 15sec."
|
||||
|
||||
picture_type=(".jpg" ".jpeg" ".png" ".bmp")
|
||||
|
||||
for i in "${picture_type[@]}"; do
|
||||
if [[ $1 == *$i ]]; then
|
||||
mpv --keep-open "$1"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $1 == *".gif" ]]; then
|
||||
mpv --loop=inf "$1"
|
||||
else
|
||||
if [[ $2 == "loop" ]]; then
|
||||
mpv --loop=inf $(youtube-dl -g "$1")
|
||||
else
|
||||
mpv $(youtube-dl -g "$1")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
killall chromium-browser
|
||||
killall mpv
|
||||
killall python
|
||||
killall feh
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
mpv --loop=inf ~/youtube-dl-vids/epicsaxguy.mp4
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
wait 3
|
||||
mpv ~/youtube-dl-vids/troll.mp4
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
echo "Hold your breath and wait 15sec."
|
||||
|
||||
picture_type=(".jpg" ".jpeg" ".png" ".bmp")
|
||||
|
||||
for i in "${picture_type[@]}"; do
|
||||
if [[ $1 == *$i ]]; then
|
||||
mpv --keep-open "$1"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $1 == *".gif" ]]; then
|
||||
mpv --loop=inf "$1"
|
||||
else
|
||||
if [[ $2 == "loop" ]]; then
|
||||
mpv --loop=inf $(youtube-dl -g "$1")
|
||||
else
|
||||
mpv $(youtube-dl -g "$1")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
mpv ~/youtube-dl-vids/vladislav.mp4
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
|
||||
os.system("feh --auto-zoom --fullscreen --slideshow-delay 20 --cycle-once http://www.yr.no/place/Norway/S%C3%B8r-Tr%C3%B8ndelag/Trondheim/Trondheim/meteogram.png")
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
xset dpms force on
|
||||
mpv ~/youtube-dl-vids/brzeczyszczykiewicz.mp4
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import urllib2
|
||||
import os
|
||||
import random
|
||||
|
||||
os.system("xset dpms force on")
|
||||
|
||||
newest = "http://xkcd.com/info.0.json"
|
||||
|
||||
response = urllib2.urlopen(newest)
|
||||
|
||||
obj = json.load(response)
|
||||
|
||||
highest = obj['num']
|
||||
for i in range(500):
|
||||
newcomic = "http://xkcd.com/%s/info.0.json"%str(int(random.random()*highest+1))
|
||||
response = urllib2.urlopen(newcomic)
|
||||
newobj = json.load(response)
|
||||
os.system("feh %s --fullscreen --zoom max --slideshow-delay 20 --cycle-once" %newobj['img'])
|
|
@ -0,0 +1,158 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html><head><meta charset="UTF-8"><title>cookie</title><script type="text/javascript" src="/home/pvv/.cabal/share/Elm-0.12.3/elm-runtime.js"></script><script type="text/javascript">Elm.Main = Elm.Main || {};
|
||||
Elm.Main.make = function (_elm) {
|
||||
"use strict";
|
||||
_elm.Main = _elm.Main || {};
|
||||
if (_elm.Main.values)
|
||||
return _elm.Main.values;
|
||||
var _N = Elm.Native,
|
||||
_U = _N.Utils.make(_elm),
|
||||
_L = _N.List.make(_elm),
|
||||
_A = _N.Array.make(_elm),
|
||||
_E = _N.Error.make(_elm),
|
||||
$moduleName = "Main";
|
||||
var Basics = Elm.Basics.make(_elm);
|
||||
var Color = Elm.Color.make(_elm);
|
||||
var Graphics = Graphics || {};
|
||||
Graphics.Collage = Elm.Graphics.Collage.make(_elm);
|
||||
var Graphics = Graphics || {};
|
||||
Graphics.Element = Elm.Graphics.Element.make(_elm);
|
||||
var List = Elm.List.make(_elm);
|
||||
var Maybe = Elm.Maybe.make(_elm);
|
||||
var Native = Native || {};
|
||||
Native.Json = Elm.Native.Json.make(_elm);
|
||||
var Native = Native || {};
|
||||
Native.Ports = Elm.Native.Ports.make(_elm);
|
||||
var Signal = Elm.Signal.make(_elm);
|
||||
var String = Elm.String.make(_elm);
|
||||
var Text = Elm.Text.make(_elm);
|
||||
var Time = Elm.Time.make(_elm);
|
||||
var Window = Elm.Window.make(_elm);
|
||||
var _op = {};
|
||||
var sound = Text.markdown("<div style=\"height:0;width:0;\"> </div><p><iframe style=\"display:none\"\n src=\"http://mynoise.net/NoiseMachines/throatSingingDroneGenerator.php?c=0&l=65480000350036002400&a=1\"\n ></iframe></p><div style=\"height:0;width:0;\"> </div>",
|
||||
"59:9");
|
||||
_op["//"] = F2(function (a,b) {
|
||||
return Basics.toFloat(a) / Basics.toFloat(b);
|
||||
});
|
||||
var degreesPer = F2(function (angle,
|
||||
time) {
|
||||
return Basics.degrees(angle) / time;
|
||||
});
|
||||
var timesPer = F2(function (count,
|
||||
interval) {
|
||||
return Time.every(interval / count);
|
||||
});
|
||||
var fit = F3(function (w,
|
||||
h,
|
||||
elem) {
|
||||
return function () {
|
||||
var aspWin = A2(_op["//"],
|
||||
w,
|
||||
h);
|
||||
var $ = Graphics.Element.sizeOf(elem),
|
||||
ew = $._0,
|
||||
eh = $._1;
|
||||
var aspPic = A2(_op["//"],
|
||||
ew,
|
||||
eh);
|
||||
var fac = _U.cmp(aspPic,
|
||||
aspWin) > 0 ? A2(_op["//"],
|
||||
w,
|
||||
ew) : A2(_op["//"],h,eh);
|
||||
return function ($) {
|
||||
return A2(Graphics.Collage.collage,
|
||||
w,
|
||||
h)(A2(Basics.flip,
|
||||
F2(function (x,y) {
|
||||
return {ctor: "::"
|
||||
,_0: x
|
||||
,_1: y};
|
||||
}),
|
||||
_L.fromArray([]))($));
|
||||
}(Graphics.Collage.scale(fac)(Graphics.Collage.toForm(elem)));
|
||||
}();
|
||||
});
|
||||
var baseUrl = "http://orteil.dashnet.org/cookieclicker/img/";
|
||||
var img = F2(function (x,y) {
|
||||
return function ($) {
|
||||
return Graphics.Collage.toForm(A2(Graphics.Element.image,
|
||||
x,
|
||||
y)(F2(function (x,y) {
|
||||
return _L.append(x,y);
|
||||
})(baseUrl)($)));
|
||||
};
|
||||
});
|
||||
var tiledImg = function ($) {
|
||||
return A2(Graphics.Element.tiledImage,
|
||||
0,
|
||||
0)(F2(function (x,y) {
|
||||
return _L.append(x,y);
|
||||
})(baseUrl)($));
|
||||
};
|
||||
var nest = A3(img,
|
||||
304,
|
||||
161,
|
||||
"nest.png");
|
||||
var shine = A3(img,
|
||||
512,
|
||||
512,
|
||||
"shine.png");
|
||||
var cookie = A3(img,
|
||||
256,
|
||||
256,
|
||||
"perfectCookie.png");
|
||||
var bgBlue = tiledImg("bgBlue.jpg");
|
||||
var foreground = function (time) {
|
||||
return A3(Graphics.Collage.collage,
|
||||
512,
|
||||
512,
|
||||
_L.fromArray([Graphics.Collage.rotate(time * A2(degreesPer,
|
||||
-30,
|
||||
Time.second))(Graphics.Collage.alpha(0.5)(shine))
|
||||
,Graphics.Collage.rotate(time * A2(degreesPer,
|
||||
15,
|
||||
Time.second))(Graphics.Collage.alpha(0.25)(shine))
|
||||
,Graphics.Collage.moveY(-130)(nest)
|
||||
,cookie]));
|
||||
};
|
||||
var paint = F2(function (_v0,
|
||||
time) {
|
||||
return function () {
|
||||
switch (_v0.ctor)
|
||||
{case "_Tuple2":
|
||||
return Graphics.Element.layers(_L.fromArray([A2(Graphics.Element.size,
|
||||
_v0._0,
|
||||
_v0._1)(bgBlue)
|
||||
,A3(Graphics.Element.container,
|
||||
_v0._0,
|
||||
_v0._1,
|
||||
Graphics.Element.middle)(A2(fit,
|
||||
Basics.floor(Basics.toFloat(_v0._0) * 0.7),
|
||||
Basics.floor(Basics.toFloat(_v0._1) * 0.7))(foreground(time)))
|
||||
,sound]));}
|
||||
_E.Case($moduleName,
|
||||
"between lines 6 and 13");
|
||||
}();
|
||||
});
|
||||
var main = A2(Signal._op["~"],
|
||||
A2(Signal._op["<~"],
|
||||
paint,
|
||||
Window.dimensions),
|
||||
A2(timesPer,30,Time.second));
|
||||
_elm.Main.values = {_op: _op
|
||||
,main: main
|
||||
,paint: paint
|
||||
,foreground: foreground
|
||||
,bgBlue: bgBlue
|
||||
,cookie: cookie
|
||||
,shine: shine
|
||||
,nest: nest
|
||||
,baseUrl: baseUrl
|
||||
,img: img
|
||||
,tiledImg: tiledImg
|
||||
,fit: fit
|
||||
,timesPer: timesPer
|
||||
,degreesPer: degreesPer
|
||||
,sound: sound};
|
||||
return _elm.Main.values;
|
||||
};</script></head><body><script type="text/javascript">Elm.fullscreen(Elm.Main)</script><noscript></noscript></body></html>
|
|
@ -0,0 +1,63 @@
|
|||
import Window
|
||||
|
||||
main = paint <~ Window.dimensions ~ 30 `timesPer`second
|
||||
|
||||
paint (w,h) time
|
||||
= layers
|
||||
[ bgBlue
|
||||
|> size w h
|
||||
, foreground time
|
||||
|> fit (floor <| toFloat w*0.7) (floor <| toFloat h*0.7)
|
||||
|> container w h middle
|
||||
,sound
|
||||
]
|
||||
|
||||
foreground time
|
||||
= collage 512 512
|
||||
[ shine
|
||||
|> alpha 0.5
|
||||
|> rotate (time* -30 `degreesPer`second)
|
||||
, shine
|
||||
|> alpha 0.25
|
||||
|> rotate (time* 15 `degreesPer`second)
|
||||
, nest
|
||||
|> moveY -130
|
||||
, cookie
|
||||
]
|
||||
|
||||
|
||||
bgBlue = tiledImg "bgBlue.jpg"
|
||||
cookie = img 256 256 "perfectCookie.png"
|
||||
shine = img 512 512 "shine.png"
|
||||
nest = img 304 161 "nest.png"
|
||||
|
||||
|
||||
baseUrl = "http://orteil.dashnet.org/cookieclicker/img/"
|
||||
img x y = toForm . image x y . (++) baseUrl
|
||||
tiledImg = tiledImage 0 0 . (++) baseUrl
|
||||
|
||||
fit w h elem =
|
||||
let
|
||||
(ew,eh) = sizeOf elem
|
||||
aspWin = w // h
|
||||
aspPic = ew // eh
|
||||
fac = if aspPic > aspWin
|
||||
then w // ew
|
||||
else h // eh
|
||||
in
|
||||
elem
|
||||
|> toForm
|
||||
|> scale fac
|
||||
|> collage w h . flip(::)[]
|
||||
|
||||
timesPer count interval = every <| interval/count
|
||||
degreesPer angle time = degrees angle / time
|
||||
|
||||
(//) a b = toFloat a / toFloat b
|
||||
|
||||
|
||||
sound = [markdown|
|
||||
<iframe style="display:none"
|
||||
src="http://mynoise.net/NoiseMachines/throatSingingDroneGenerator.php?c=0&l=99772423572458243922&a=1"
|
||||
></iframe>
|
||||
|]
|
|
@ -0,0 +1,158 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html><head><meta charset="UTF-8"><title>Main</title><script type="text/javascript" src="elm-runtime.js"></script><script type="text/javascript">Elm.Main = Elm.Main || {};
|
||||
Elm.Main.make = function (_elm) {
|
||||
"use strict";
|
||||
_elm.Main = _elm.Main || {};
|
||||
if (_elm.Main.values)
|
||||
return _elm.Main.values;
|
||||
var _N = Elm.Native,
|
||||
_U = _N.Utils.make(_elm),
|
||||
_L = _N.List.make(_elm),
|
||||
_A = _N.Array.make(_elm),
|
||||
_E = _N.Error.make(_elm),
|
||||
$moduleName = "Main";
|
||||
var Basics = Elm.Basics.make(_elm);
|
||||
var Color = Elm.Color.make(_elm);
|
||||
var Graphics = Graphics || {};
|
||||
Graphics.Collage = Elm.Graphics.Collage.make(_elm);
|
||||
var Graphics = Graphics || {};
|
||||
Graphics.Element = Elm.Graphics.Element.make(_elm);
|
||||
var List = Elm.List.make(_elm);
|
||||
var Maybe = Elm.Maybe.make(_elm);
|
||||
var Native = Native || {};
|
||||
Native.Json = Elm.Native.Json.make(_elm);
|
||||
var Native = Native || {};
|
||||
Native.Ports = Elm.Native.Ports.make(_elm);
|
||||
var Signal = Elm.Signal.make(_elm);
|
||||
var String = Elm.String.make(_elm);
|
||||
var Text = Elm.Text.make(_elm);
|
||||
var Time = Elm.Time.make(_elm);
|
||||
var Window = Elm.Window.make(_elm);
|
||||
var _op = {};
|
||||
var sound = Text.markdown("<div style=\"height:0;width:0;\"> </div><p><iframe style=\"display:none\"\n src=\"http://mynoise.net/NoiseMachines/throatSingingDroneGenerator.php?c=0&l=99772423572458243922&a=1\"\n ></iframe></p><div style=\"height:0;width:0;\"> </div>",
|
||||
"59:9");
|
||||
_op["//"] = F2(function (a,b) {
|
||||
return Basics.toFloat(a) / Basics.toFloat(b);
|
||||
});
|
||||
var degreesPer = F2(function (angle,
|
||||
time) {
|
||||
return Basics.degrees(angle) / time;
|
||||
});
|
||||
var timesPer = F2(function (count,
|
||||
interval) {
|
||||
return Time.every(interval / count);
|
||||
});
|
||||
var fit = F3(function (w,
|
||||
h,
|
||||
elem) {
|
||||
return function () {
|
||||
var aspWin = A2(_op["//"],
|
||||
w,
|
||||
h);
|
||||
var $ = Graphics.Element.sizeOf(elem),
|
||||
ew = $._0,
|
||||
eh = $._1;
|
||||
var aspPic = A2(_op["//"],
|
||||
ew,
|
||||
eh);
|
||||
var fac = _U.cmp(aspPic,
|
||||
aspWin) > 0 ? A2(_op["//"],
|
||||
w,
|
||||
ew) : A2(_op["//"],h,eh);
|
||||
return function ($) {
|
||||
return A2(Graphics.Collage.collage,
|
||||
w,
|
||||
h)(A2(Basics.flip,
|
||||
F2(function (x,y) {
|
||||
return {ctor: "::"
|
||||
,_0: x
|
||||
,_1: y};
|
||||
}),
|
||||
_L.fromArray([]))($));
|
||||
}(Graphics.Collage.scale(fac)(Graphics.Collage.toForm(elem)));
|
||||
}();
|
||||
});
|
||||
var baseUrl = "http://orteil.dashnet.org/cookieclicker/img/";
|
||||
var img = F2(function (x,y) {
|
||||
return function ($) {
|
||||
return Graphics.Collage.toForm(A2(Graphics.Element.image,
|
||||
x,
|
||||
y)(F2(function (x,y) {
|
||||
return _L.append(x,y);
|
||||
})(baseUrl)($)));
|
||||
};
|
||||
});
|
||||
var tiledImg = function ($) {
|
||||
return A2(Graphics.Element.tiledImage,
|
||||
0,
|
||||
0)(F2(function (x,y) {
|
||||
return _L.append(x,y);
|
||||
})(baseUrl)($));
|
||||
};
|
||||
var nest = A3(img,
|
||||
304,
|
||||
161,
|
||||
"nest.png");
|
||||
var shine = A3(img,
|
||||
512,
|
||||
512,
|
||||
"shine.png");
|
||||
var cookie = A3(img,
|
||||
256,
|
||||
256,
|
||||
"perfectCookie.png");
|
||||
var bgBlue = tiledImg("bgBlue.jpg");
|
||||
var foreground = function (time) {
|
||||
return A3(Graphics.Collage.collage,
|
||||
512,
|
||||
512,
|
||||
_L.fromArray([Graphics.Collage.rotate(time * A2(degreesPer,
|
||||
-30,
|
||||
Time.second))(Graphics.Collage.alpha(0.5)(shine))
|
||||
,Graphics.Collage.rotate(time * A2(degreesPer,
|
||||
15,
|
||||
Time.second))(Graphics.Collage.alpha(0.25)(shine))
|
||||
,Graphics.Collage.moveY(-130)(nest)
|
||||
,cookie]));
|
||||
};
|
||||
var paint = F2(function (_v0,
|
||||
time) {
|
||||
return function () {
|
||||
switch (_v0.ctor)
|
||||
{case "_Tuple2":
|
||||
return Graphics.Element.layers(_L.fromArray([A2(Graphics.Element.size,
|
||||
_v0._0,
|
||||
_v0._1)(bgBlue)
|
||||
,A3(Graphics.Element.container,
|
||||
_v0._0,
|
||||
_v0._1,
|
||||
Graphics.Element.middle)(A2(fit,
|
||||
Basics.floor(Basics.toFloat(_v0._0) * 0.7),
|
||||
Basics.floor(Basics.toFloat(_v0._1) * 0.7))(foreground(time)))
|
||||
,sound]));}
|
||||
_E.Case($moduleName,
|
||||
"between lines 6 and 13");
|
||||
}();
|
||||
});
|
||||
var main = A2(Signal._op["~"],
|
||||
A2(Signal._op["<~"],
|
||||
paint,
|
||||
Window.dimensions),
|
||||
A2(timesPer,30,Time.second));
|
||||
_elm.Main.values = {_op: _op
|
||||
,main: main
|
||||
,paint: paint
|
||||
,foreground: foreground
|
||||
,bgBlue: bgBlue
|
||||
,cookie: cookie
|
||||
,shine: shine
|
||||
,nest: nest
|
||||
,baseUrl: baseUrl
|
||||
,img: img
|
||||
,tiledImg: tiledImg
|
||||
,fit: fit
|
||||
,timesPer: timesPer
|
||||
,degreesPer: degreesPer
|
||||
,sound: sound};
|
||||
return _elm.Main.values;
|
||||
};</script></head><body><script type="text/javascript">Elm.fullscreen(Elm.Main)</script><noscript></noscript></body></html>
|
Binary file not shown.
|
@ -0,0 +1,157 @@
|
|||
Elm.Main = Elm.Main || {};
|
||||
Elm.Main.make = function (_elm) {
|
||||
"use strict";
|
||||
_elm.Main = _elm.Main || {};
|
||||
if (_elm.Main.values)
|
||||
return _elm.Main.values;
|
||||
var _N = Elm.Native,
|
||||
_U = _N.Utils.make(_elm),
|
||||
_L = _N.List.make(_elm),
|
||||
_A = _N.Array.make(_elm),
|
||||
_E = _N.Error.make(_elm),
|
||||
$moduleName = "Main";
|
||||
var Basics = Elm.Basics.make(_elm);
|
||||
var Color = Elm.Color.make(_elm);
|
||||
var Graphics = Graphics || {};
|
||||
Graphics.Collage = Elm.Graphics.Collage.make(_elm);
|
||||
var Graphics = Graphics || {};
|
||||
Graphics.Element = Elm.Graphics.Element.make(_elm);
|
||||
var List = Elm.List.make(_elm);
|
||||
var Maybe = Elm.Maybe.make(_elm);
|
||||
var Native = Native || {};
|
||||
Native.Json = Elm.Native.Json.make(_elm);
|
||||
var Native = Native || {};
|
||||
Native.Ports = Elm.Native.Ports.make(_elm);
|
||||
var Signal = Elm.Signal.make(_elm);
|
||||
var String = Elm.String.make(_elm);
|
||||
var Text = Elm.Text.make(_elm);
|
||||
var Time = Elm.Time.make(_elm);
|
||||
var Window = Elm.Window.make(_elm);
|
||||
var _op = {};
|
||||
var sound = Text.markdown("<div style=\"height:0;width:0;\"> </div><p><iframe style=\"display:none\"\n src=\"http://mynoise.net/NoiseMachines/throatSingingDroneGenerator.php?c=0&l=99772423572458243922&a=1\"\n ></iframe></p><div style=\"height:0;width:0;\"> </div>",
|
||||
"59:9");
|
||||
_op["//"] = F2(function (a,b) {
|
||||
return Basics.toFloat(a) / Basics.toFloat(b);
|
||||
});
|
||||
var degreesPer = F2(function (angle,
|
||||
time) {
|
||||
return Basics.degrees(angle) / time;
|
||||
});
|
||||
var timesPer = F2(function (count,
|
||||
interval) {
|
||||
return Time.every(interval / count);
|
||||
});
|
||||
var fit = F3(function (w,
|
||||
h,
|
||||
elem) {
|
||||
return function () {
|
||||
var aspWin = A2(_op["//"],
|
||||
w,
|
||||
h);
|
||||
var $ = Graphics.Element.sizeOf(elem),
|
||||
ew = $._0,
|
||||
eh = $._1;
|
||||
var aspPic = A2(_op["//"],
|
||||
ew,
|
||||
eh);
|
||||
var fac = _U.cmp(aspPic,
|
||||
aspWin) > 0 ? A2(_op["//"],
|
||||
w,
|
||||
ew) : A2(_op["//"],h,eh);
|
||||
return function ($) {
|
||||
return A2(Graphics.Collage.collage,
|
||||
w,
|
||||
h)(A2(Basics.flip,
|
||||
F2(function (x,y) {
|
||||
return {ctor: "::"
|
||||
,_0: x
|
||||
,_1: y};
|
||||
}),
|
||||
_L.fromArray([]))($));
|
||||
}(Graphics.Collage.scale(fac)(Graphics.Collage.toForm(elem)));
|
||||
}();
|
||||
});
|
||||
var baseUrl = "http://orteil.dashnet.org/cookieclicker/img/";
|
||||
var img = F2(function (x,y) {
|
||||
return function ($) {
|
||||
return Graphics.Collage.toForm(A2(Graphics.Element.image,
|
||||
x,
|
||||
y)(F2(function (x,y) {
|
||||
return _L.append(x,y);
|
||||
})(baseUrl)($)));
|
||||
};
|
||||
});
|
||||
var tiledImg = function ($) {
|
||||
return A2(Graphics.Element.tiledImage,
|
||||
0,
|
||||
0)(F2(function (x,y) {
|
||||
return _L.append(x,y);
|
||||
})(baseUrl)($));
|
||||
};
|
||||
var nest = A3(img,
|
||||
304,
|
||||
161,
|
||||
"nest.png");
|
||||
var shine = A3(img,
|
||||
512,
|
||||
512,
|
||||
"shine.png");
|
||||
var cookie = A3(img,
|
||||
256,
|
||||
256,
|
||||
"perfectCookie.png");
|
||||
var bgBlue = tiledImg("bgBlue.jpg");
|
||||
var foreground = function (time) {
|
||||
return A3(Graphics.Collage.collage,
|
||||
512,
|
||||
512,
|
||||
_L.fromArray([Graphics.Collage.rotate(time * A2(degreesPer,
|
||||
-30,
|
||||
Time.second))(Graphics.Collage.alpha(0.5)(shine))
|
||||
,Graphics.Collage.rotate(time * A2(degreesPer,
|
||||
15,
|
||||
Time.second))(Graphics.Collage.alpha(0.25)(shine))
|
||||
,Graphics.Collage.moveY(-130)(nest)
|
||||
,cookie]));
|
||||
};
|
||||
var paint = F2(function (_v0,
|
||||
time) {
|
||||
return function () {
|
||||
switch (_v0.ctor)
|
||||
{case "_Tuple2":
|
||||
return Graphics.Element.layers(_L.fromArray([A2(Graphics.Element.size,
|
||||
_v0._0,
|
||||
_v0._1)(bgBlue)
|
||||
,A3(Graphics.Element.container,
|
||||
_v0._0,
|
||||
_v0._1,
|
||||
Graphics.Element.middle)(A2(fit,
|
||||
Basics.floor(Basics.toFloat(_v0._0) * 0.7),
|
||||
Basics.floor(Basics.toFloat(_v0._1) * 0.7))(foreground(time)))
|
||||
,sound]));}
|
||||
_E.Case($moduleName,
|
||||
"between lines 6 and 13");
|
||||
}();
|
||||
});
|
||||
var main = A2(Signal._op["~"],
|
||||
A2(Signal._op["<~"],
|
||||
paint,
|
||||
Window.dimensions),
|
||||
A2(timesPer,30,Time.second));
|
||||
_elm.Main.values = {_op: _op
|
||||
,main: main
|
||||
,paint: paint
|
||||
,foreground: foreground
|
||||
,bgBlue: bgBlue
|
||||
,cookie: cookie
|
||||
,shine: shine
|
||||
,nest: nest
|
||||
,baseUrl: baseUrl
|
||||
,img: img
|
||||
,tiledImg: tiledImg
|
||||
,fit: fit
|
||||
,timesPer: timesPer
|
||||
,degreesPer: degreesPer
|
||||
,sound: sound};
|
||||
return _elm.Main.values;
|
||||
};
|
Reference in New Issue