Cooler animations

This commit is contained in:
Neale Pickett 2012-11-10 20:23:06 -07:00
parent 2599817b6d
commit fc761a5377
9 changed files with 36 additions and 55 deletions

BIN
res/BadGirl.swf Normal file

Binary file not shown.

BIN
res/FasterFaster.swf Normal file

Binary file not shown.

BIN
res/HolyShot.swf Normal file

Binary file not shown.

BIN
res/Ouch.swf Normal file

Binary file not shown.

BIN
res/Pow.swf Normal file

Binary file not shown.

BIN
res/Zounds.swf Normal file

Binary file not shown.

View File

@ -69,7 +69,7 @@ body {
} }
/* Jammer indicators */ /* Jammer indicators */
.jammer { #jammer-a, #jammer-b {
font-family: monospace; font-family: monospace;
position: absolute; position: absolute;
bottom: 0em; bottom: 0em;
@ -169,37 +169,17 @@ body {
/* /*
* Notices * Notices
*/ */
#notice div { #notice {
display: none;
background: silver;
border: solid white 10px;
border-radius: 90px;
font-size: 150%;
font-family: Magenta, sans-serif;
font-weight: normal;
text-align: center;
opacity: 0.9;
position: absolute; position: absolute;
bottom: 1.3em; bottom: 1.3em;
left: 50%; left: 50%;
width: 3em; width: 4em;
margin-left: -1.5em; height: 3em;
} margin-left: -2em;
#notice .active {
display: inherit;
-moz-animation-duration: 0.5s;
-moz-animation-name: grow;
-moz-animation-iteration-count: infinite;
-moz-animation-direction: alternate;
} }
@-moz-keyframes grow { #notice embed {
0% {color: red;} width: 100%;
50% {color: yellow;} height: 100%;
75% {color: blue;}
100% {color: magenta;}
} }

View File

@ -191,30 +191,35 @@ function transition(newstate) {
/*********************************** /***********************************
* Notices * Notices
*/ */
var notices = [
false,
'<embed src="res/Zounds.swf" type="text/html">',
'<embed src="res/Ouch.swf" type="text/html">',
'<embed src="res/Pow.swf" type="text/html">',
'<embed src="res/HolyShot.swf" type="text/html">',
'<embed src="res/FasterFaster.swf" type="text/html">',
'<embed src="res/BadGirl.swf" type="text/html">',
];
var notice_timer; var notice_timer;
function notice_expire(n) { function notice_expire() {
var p = document.getElementById("notice-vanish"); var c = document.getElementById("notice");
var pClassName = "";
for (var i = 0; i < 10; i += 1) { c.innerHTML = "";
var e = document.getElementById("notice-" + i);
if (! e) continue;
if (i == n) {
e.className = "active";
pClassName = "notice";
} else {
e.className = "";
}
}
if (p) p.className = pClassName;
} }
function notice(n) { function notice(n) {
clearTimeout(notice_timer); var c = document.getElementById("notice");
notice_timer = setTimeout(function() {notice_expire()}, 8000);
notice_expire(n); if (notices[n]) {
c.innerHTML = notices[n];
clearTimeout(notice_timer);
notice_timer = setTimeout(function() {notice_expire()}, 8000);
} else {
notice_expire();
}
} }
function e(id) { function e(id) {

View File

@ -54,10 +54,6 @@
</div> </div>
<div id="notice"> <div id="notice">
<div id="notice-1">Power Jam</div>
<div id="notice-2">Grand Slam</div>
<div id="notice-3">Ouch</div>
<div id="notice-4">OMG</div>
</div> </div>
</body> </body>
</html> </html>