Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

Commit bf15f31

Browse files
committed
Mario icon for demo
1 parent a36a473 commit bf15f31

8 files changed

Lines changed: 32 additions & 4 deletions

File tree

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"json-formatter": "~0.2.7",
2323
"lodash": "~3.10.1",
2424
"ng-clip": "~0.2.6",
25-
"semantic": "semantic-ui#~2.1.3"
25+
"semantic": "semantic-ui#~2.1.3",
26+
"favico.js": "~0.3.10"
2627
},
2728
"resolutions": {
2829
"jquery": "~2.1.4",

demo/app/index.constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
'use strict';
33

44
angular.module('angularJsonapiExample')
5-
/* global _: false */
5+
/* global _: false, Favico: false */
66
.constant('_', _)
77
.constant('apiURL', 'http://localhost:3000')
8-
;
8+
.constant('Favico', Favico);
99
})();

demo/app/index.run.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
'use strict';
33

44
angular.module('angularJsonapiExample')
5-
.run(logEvents);
5+
.run(logEvents)
6+
.run(marioFavicon);
67

78
function logEvents(
89
$rootScope,
@@ -50,4 +51,29 @@
5051
});
5152
}
5253
}
54+
55+
function marioFavicon(Favico, $interval) {
56+
var favicon = new Favico({
57+
animation:'slide',
58+
position: 'up'
59+
});
60+
var up = new Image();
61+
up.src = 'assets/images/mario-up.gif';
62+
63+
var down = new Image();
64+
down.src = 'assets/images/mario-down.gif';
65+
66+
var isDown = true;
67+
68+
$interval(changeIcon, 10);
69+
70+
function changeIcon() {
71+
isDown = !isDown;
72+
if (isDown) {
73+
favicon.image(down);
74+
} else {
75+
favicon.image(up);
76+
}
77+
}
78+
}
5379
})();

demo/assets/images/mario-down.gif

227 Bytes
Loading

demo/assets/images/mario-up.gif

223 Bytes
Loading

demo/favicon.gif

369 Bytes
Loading

demo/favicon.ico

-4.19 KB
Binary file not shown.

demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<title>angularJsonapi</title>
66
<meta name="description" content="">
77
<meta name="viewport" content="initial-scale=1">
8+
<link rel="shortcut icon" href="favicon.gif" />
89
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
910

1011
<!-- build:css({.tmp/serve,src}) styles/vendor.css -->

0 commit comments

Comments
 (0)