uhr erzeugt html-elemente selber

This commit is contained in:
Manuel Friedli 2013-11-27 16:20:47 +01:00
parent fe243507ec
commit 300477cc3f
2 changed files with 8 additions and 9 deletions

View file

@ -24,15 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head> </head>
<body> <body>
<div id="uhr" class="uhr"> <div id="uhr" class="uhr"></div>
<span class="item dot dot1"></span>
<span class="item dot dot2"></span>
<span class="item dot dot3"></span>
<span class="item dot dot4"></span>
<div class="letterarea"></div>
<!-- glossy reflection -->
<span class="reflection"></span>
</div>
<select id="themeswitcher"> <select id="themeswitcher">
<option value="black">Schwarz</option> <option value="black">Schwarz</option>
<option value="red">Rot</option> <option value="red">Rot</option>

7
uhr.js
View file

@ -19,6 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
function Uhr(clockarea, themeElement) { function Uhr(clockarea, themeElement) {
this.clockarea = clockarea; this.clockarea = clockarea;
this.clockarea.empty();
this.clockarea.append('<span class="item dot dot1"></span>');
this.clockarea.append('<span class="item dot dot2"></span>');
this.clockarea.append('<span class="item dot dot3"></span>');
this.clockarea.append('<span class="item dot dot4"></span>');
this.clockarea.append('<div class="letterarea"></div>');
this.clockarea.append('<div class="reflection"></div>');
this.letterarea = clockarea.find('.letterarea'); this.letterarea = clockarea.find('.letterarea');
this.themeElement = themeElement; this.themeElement = themeElement;
this.timer = null; this.timer = null;