Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additions #8

Open
wants to merge 8 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# github_id
Find out a github user's id
25 changes: 18 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
text-align: center;
margin: auto 0;
margin-top: 5em;
color: white;
background-color: #171A22;
font-family: Courier, monospace;
}

Expand All @@ -25,15 +27,25 @@
form p {
display: none;
}

.go-back-button {
color: white;
text-decoration: none;
transition: color .5s ease-in-out;
}

.go-back-button:hover, .go-back-button:focus {
color: #1D9AF1;
}

#footer {
margin-top: 5em;
font-size: 50%;
color: #555;
color: #bfbfbf;
}

#footer a {
color: #555;
color: #bfbfbf;
text-decoration: none;
border-bottom: 1px dotted;
}
Expand All @@ -50,19 +62,17 @@
if (id) {
callback(username, id)
}
$("form p").text(username + " not found.")
return false
});
}

function add_twitter_link_for (username, id) {
var tweet = $('<a>').text("Tweet this").attr('href', "https://twitter.com?status=" + encodeURIComponent("Found out I'm GitHub user " + id + " by using http://caius.github.com/github_id/#" + username + " #GitHub_id")).insertAfter("#success h1")
}

function show_user (username, id) {
$('#username').text(username)
$('#id').text(id)
$('form').hide()
$('#success').show()
$('#goback').show()
}

$(document).ready(function() {
Expand All @@ -85,7 +95,6 @@
var name = $("#github_username").val().trim()

get_github_id_for(name, function(username, id) {
add_twitter_link_for(username, id)
show_user(username, id)
document.location.hash = "#" + username
})
Expand All @@ -112,6 +121,7 @@

<div id="success">
<h1><span id="username"></span> is GitHub user #<span id="id"></span></h1>
<a href="/github_id" class="go-back-button">Go back</a>
</div>

<form id="input" action="#" accept-charset="utf-8">
Expand All @@ -126,6 +136,7 @@ <h1>Find GitHub User ID</h1>

<div id="footer">
<p>A hack born out of idle curiosity by GitHub user #696: <a href="http://caius.name/">Caius Durling</a></p>
<p>Darkmode created by: <a href="https://store.hyperz.net/">Hyperz#0001</a></p>
</div>
</body>
</html>