forked from pazguille/github-card
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
58 lines (50 loc) · 2.47 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!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=0, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<title><github-card>: A web component to show a profile-card for your Github account.</title>
<link rel="stylesheet" href="src/normalize.css">
<link rel="stylesheet" href="src/styles.css">
<link rel="import" href="webcomponent/github-card.html">
</head>
<body>
<header>
<h1><github-card></h1>
<h2>A web component to show a profile-card for your Github account.</h2>
</header>
<output id="cards">
<figure>
<img src="src/assets/example.png" width="267" height="302">
</figure>
</output>
<form id="create-card">
<input id="username" type="text" placeholder="Enter a Github username">
<button>Show</button>
</form>
<footer>
<iframe id="twitter" allowtransparency="true" frameborder="0" width="100" height="22" scrolling="no" src="https://platform.twitter.com/widgets/tweet_button.html?text=<github-card>%3A%20A%20Web%20Component%20to%20show%20a%20profile-card%20for%20your%20Github%20account.&url=http%3A%2F%2Fpazguille.github.io%2Fgithub-card"></iframe>
<a href="https://github.com/pazguille/github-card" id="github-ribbon"><img width="149" height="149" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
by <a href="http://pazguille.me/">Guille Paz</a> with <a href="http://welovefrontend.org/" class="heart">❤</a>
<iframe id="github-button" src="http://ghbtns.com/github-btn.html?user=pazguille&repo=github-card&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="152" height="30"></iframe>
</footer>
<script>
window.onload = function() {
var inp = document.querySelector('#username'),
frm = document.querySelector('#create-card'),
output = document.querySelector('#cards');
frm.addEventListener('submit', function(eve) {
var user = inp.value,
github;
eve.preventDefault();
if (user === '') { return false; }
github = document.createElement('github-card');
github.setAttribute('user', user);
output.innerHTML = '';
output.appendChild(github);
}, true);
};
</script>
</body>
</html>