Skip to content

Commit

Permalink
Some work on blink, some placeholder files
Browse files Browse the repository at this point in the history
  • Loading branch information
zinas committed May 11, 2014
1 parent dc4049c commit fb5f347
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
36 changes: 36 additions & 0 deletions nineties-blink/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>90s Blink</title>

<!-- Importing Custom Elements -->
<!-- <link rel="import" href="nineties-blink.html"> -->

<script>
var Blink = Object.create(HTMLElement.prototype);

Blink.blink = function() {
if (this.style.visibility === 'hidden') {
this.style.visibility = '';
} else {
this.style.visibility = 'hidden';
}
}

Blink.attachedCallback = function () {
var self = this;
setInterval(function () {self.blink();},this.dataset.duration/2);
}

document.registerElement('nineties-blink', {prototype: Blink});
</script>

</head>
<body>

<!-- Using Custom Elements -->
<nineties-blink data-duration="5000">Hello there!</nineties-blink>

</body>
</html>
5 changes: 5 additions & 0 deletions nineties-blink/nineties-blink.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
var Blink = document.registerElement('nineties-blink');

Blink.addEventListener('click', function () {alert('aaa');})
</script>
Empty file added nineties-marquee/index.html
Empty file.
Empty file.
29 changes: 29 additions & 0 deletions nineties-welcome/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>90s Blink</title>

<!-- Importing Custom Elements -->
<!-- <link rel="import" href="nineties-blink.html"> -->

<script>
var Welcome = Object.create(HTMLElement.prototype);

Welcome.attachedCallback = function () {
var msg = this.innerHTML;
this.innerHTML = '';
alert(msg);
}

document.registerElement('nineties-welcome', {prototype: Welcome});
</script>

</head>
<body>

<!-- Using Custom Elements -->
<nineties-welcome>Hello there, Nikos!</nineties-blink>

</body>
</html>
Empty file.

0 comments on commit fb5f347

Please sign in to comment.