-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
35 lines (33 loc) · 1.05 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Polymer playground</title>
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="elements/calculator/calculator.html" />
<style type="text/css">
body {
font-family: Helvetica Neue, Helvetica, Arial;
}
#swapTheme {
font-size: 16px;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('swapTheme').addEventListener('click', function () {
var calculator = document.getElementById('calc');
if (calculator.getAttribute('theme') === 'dark') {
calculator.setAttribute('theme', 'light');
}
else {
calculator.setAttribute('theme', 'dark');
}
});
});
</script>
</head>
<body>
<x-calculator id="calc" theme="light"></x-calculator>
<button id="swapTheme">Swap theme</button>
</body>
</html>