forked from webcomponents/polymer-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
104 lines (93 loc) · 3.85 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title><shape-shifter></title>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<!-- Importing Custom Elements -->
<link rel="import" href="shape-shifter.html">
</head>
<body>
<a href="https://github.com/MaKleSoft/shape-shifter"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<dom-module id="shape-shifter-demo">
<template>
<style>
:host {
font-family: monospace;
}
h1 {
text-align: center;
padding: 30px;
font-family: monospace;
}
.hero {
display: block;
margin: 30px auto;
width: 300px;
height: 300px;
}
.gallery {
text-align: center;
}
.gallery > shape-shifter {
width: 50px;
height: 50px;
cursor: pointer;
}
.springy span {
cursor: pointer;
}
.springy input {
display: none;
}
.springy input:not(:checked) + span {
text-decoration: line-through;
}
</style>
<shape-shifter id="hero" shape="{{ shape }}" class="hero" springy="{{ springy }}"></shape-shifter>
<div class="gallery">
<shape-shifter shape="plus" on-tap="shift"></shape-shifter>
<shape-shifter shape="cancel" on-tap="shift"></shape-shifter>
<shape-shifter shape="check" on-tap="shift"></shape-shifter>
<shape-shifter shape="menu" on-tap="shift"></shape-shifter>
<shape-shifter shape="more" on-tap="shift"></shape-shifter>
<shape-shifter shape="right" on-tap="shift"></shape-shifter>
<shape-shifter shape="left" on-tap="shift"></shape-shifter>
<shape-shifter shape="up" on-tap="shift"></shape-shifter>
<shape-shifter shape="down" on-tap="shift"></shape-shifter>
<shape-shifter shape="copy" on-tap="shift"></shape-shifter>
<shape-shifter shape="edit" on-tap="shift"></shape-shifter>
<shape-shifter shape="home" on-tap="shift"></shape-shifter>
<shape-shifter shape="save" on-tap="shift"></shape-shifter>
<shape-shifter shape="trash" on-tap="shift"></shape-shifter>
</div>
<h1><
shape-shifter shape="<span>{{ shape }}</span>"
<label class="springy"><input type="checkbox" checked="{{ springy::change }}"><span>springy</span></label>
></h1>
</template>
<script>
window.addEventListener("WebComponentsReady", function() {
Polymer({
is: "shape-shifter-demo",
properties: {
shape: {
type: String,
value: "plus"
},
springy: {
type: Boolean,
value: true
}
},
shift: function(e) {
this.shape = e.currentTarget.shape;
}
});
});
</script>
</dom-module>
<shape-shifter-demo></shape-shifter-demo>
</body>
</html>