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

added a github repo url input #14

Closed
wants to merge 2 commits into from
Closed
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
25 changes: 25 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ p {
margin: auto;
}

.repo-url{
position: relative;
margin: 0;
width: 100%;
font-size: 24px;
font-family: inherit;
font-weight: inherit;
line-height: 1.4em;
border: 0;
outline: none;
color: inherit;
padding: 6px;
border: 1px solid #999;
box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
padding: 16px 16px 16px 60px;
border: none;
background: rgba(209, 129, 129, 0.13);
box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03);
}

/**
* Demo Code
*/
Expand Down Expand Up @@ -167,3 +191,4 @@ footer span {
margin-bottom: -8px;
}
}

26 changes: 25 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

<!-- CSS -->
<link href="./css/styles.css" rel="stylesheet" type="text/css">

</head>
<body>
<div class="wrapper">
Expand All @@ -28,6 +27,9 @@ <h1>
</p>
</header>
<section class="examples">
<div class="repo-url-wrapper">
<input type="url" id="repo-url" class="repo-url" placeholder="https://github.com/{username}/{reponame}">
</div>

<!-- Right side, white on black -->
<div class="version">
Expand Down Expand Up @@ -179,6 +181,28 @@ <h1>
<path class="octo-body" d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="#ffffff"></path>
</svg>
</a>

<script>
var input = document.getElementById("repo-url");
var textareas = document.querySelectorAll('textarea');

input.addEventListener("keyup", function(e){
changeExampleCodes(this.value)
}, false);

function replaceUrl(text, url){
var text = text.split("\"");
text[1] = url;

return text.join("\"");
}

function changeExampleCodes(url){
[].forEach.call(textareas, function(textarea){
textarea.innerHTML = replaceUrl(textarea.innerHTML, url);
});
}
</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
</body>
Expand Down