-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some work on blink, some placeholder files
- Loading branch information
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.