forked from simoneas02/made-with-heart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
made-with-heart.html
76 lines (66 loc) · 2.35 KB
/
made-with-heart.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
<link rel="import" href="../polymer/polymer.html">
<dom-module id="made-with-heart">
<template>
<style>
:host {
--made-with-heart-color-text-default: #000;
--made-with-heart-color-default: #6309a0;
--made-with-heart-size-default: 10px;
color: var(--made-with-heart-text-color, --made-with-heart-color-text-default);
@apply (--made-with-heart-text);
}
.heart {
margin: 0 5px;
width: var(--made-with-heart-size, var(--made-with-heart-size-default));
height: var(--made-with-heart-size, var(--made-with-heart-size-default));
background-color: var(--made-with-heart-color, var(--made-with-heart-color-default));
position: relative;
display: inline-block;
animation: pulse .5s infinite alternate ease-in;
}
.heart:before {
width: var(--made-with-heart-size, var(--made-with-heart-size-default));
height: var(--made-with-heart-size, var(--made-with-heart-size-default));
border-radius: 50%;
background-color: var(--made-with-heart-color, var(--made-with-heart-color-default));
position: absolute;
top: 0;
left: 50%;
content: "";
}
.heart:after {
width: var(--made-with-heart-size, var(--made-with-heart-size-default));
height: var(--made-with-heart-size, var(--made-with-heart-size-default));
border-radius: 50%;
background-color: var(--made-with-heart-color, var(--made-with-heart-color-default));
position: absolute;
top: 50%;
left: 0;
content: "";
}
@keyframes pulse {
from {transform: rotate(-135deg) scale(1);}
to {transform: rotate(-135deg) scale(1.2);}
}
a {
color: var(--made-with-heart-text-color, var(--made-with-heart-color-text-default));
text-decoration: none;
}
</style>
Made with <span class="heart"></span> by <a href=[[href]] target="_blank"><slot></slot></a>
</template>
<script>
class madeWithHeart extends Polymer.Element {
static get is() { return 'made-with-heart'; }
static get properties() {
return {
href: {
type: String,
value: "#"
}
};
}
}
window.customElements.define(madeWithHeart.is, madeWithHeart);
</script>
</dom-module>