Browse Source

Merge remote-tracking branch 'origin/master'

pull/11/head
Jeffery Russell 5 years ago
parent
commit
3b157c7345
8 changed files with 135 additions and 24 deletions
  1. +15
    -0
      public/about.css
  2. +53
    -2
      public/about.html
  3. BIN
      public/img/email.png
  4. BIN
      public/img/github.png
  5. BIN
      public/img/linkedin.png
  6. +5
    -1
      public/index.html
  7. +62
    -21
      public/js/profileGen.js
  8. +0
    -0
      public/js/repoGen.js

+ 15
- 0
public/about.css View File

@ -20,6 +20,12 @@
position: relative; position: relative;
padding-top: 20px; padding-top: 20px;
} }
.card {
background-color: rgb(208, 208, 208);
}
.card-body {
background-color: rgb(242, 242, 242);
}
.rounder { .rounder {
border-radius: 20px !important; border-radius: 20px !important;
} }
@ -29,6 +35,15 @@
position: relative; position: relative;
width: 70%; width: 70%;
} }
.links {
padding: 10px;
}
.links a {
text-decoration: none;
}
.link-ico {
width: 40px;
}
.plink { .plink {
color: rgb(250, 152, 33); color: rgb(250, 152, 33);
} }

+ 53
- 2
public/about.html View File

@ -18,7 +18,7 @@
</div> </div>
<ul id="navigation" class="nav justify-content-end"> <ul id="navigation" class="nav justify-content-end">
<li class="nav-item"> <li class="nav-item">
<a href="./GraphTest.html">
<a href="./FriendsGraph.html">
Generate graphs Generate graphs
</a> </a>
</li> </li>
@ -51,7 +51,7 @@
</div> </div>
<div id="content-body" class="container"> <div id="content-body" class="container">
<p style="padding: 10px;"> <p style="padding: 10px;">
This project was made for participation in <a class="plink" href="https://brickhack.io/">BrickHack V</a>.
This project was completed in 24 hours for participation in <a class="plink" href="https://brickhack.io/">BrickHack V</a> at the Rochester Institute of Technology.
</p> </p>
</div> </div>
<div id="content-title" style="border-radius: 20px;"> <div id="content-title" style="border-radius: 20px;">
@ -68,6 +68,23 @@
did stuff did stuff
</p> </p>
</div> </div>
<div class="links row text-center">
<div class="col">
<a href="https://github.com/jrtechs">
<img class="link-ico" src="./img/github.png" />
</a>
</div>
<div class="col">
<a href="https://www.linkedin.com/in/jrtechs/">
<img class="link-ico" src="./img/linkedin.png" />
</a>
</div>
<div class="col">
<a href="mailto:jeffery@jrtechs.net">
<img class="link-ico" src="./img/email.png" />
</a>
</div>
</div>
</div> </div>
<div class="card rounder"> <div class="card rounder">
<img class="avatar mx-auto d-block" src="https://avatars0.githubusercontent.com/u/32306409?s=400&v=4" /> <img class="avatar mx-auto d-block" src="https://avatars0.githubusercontent.com/u/32306409?s=400&v=4" />
@ -79,6 +96,23 @@
also did stuff also did stuff
</p> </p>
</div> </div>
<div class="links row text-center">
<div class="col">
<a href="https://github.com/theshmurph">
<img class="link-ico" src="./img/github.png" />
</a>
</div>
<div class="col">
<a href="https://www.linkedin.com/in/theshmurph">
<img class="link-ico" src="./img/linkedin.png" />
</a>
</div>
<div class="col">
<a href="mailto:brshmurphy@gmail.com">
<img class="link-ico" src="./img/email.png" />
</a>
</div>
</div>
</div> </div>
<div class="card rounder"> <div class="card rounder">
<img class="avatar mx-auto d-block" src="https://avatars3.githubusercontent.com/u/32624140?s=400&v=4" /> <img class="avatar mx-auto d-block" src="https://avatars3.githubusercontent.com/u/32624140?s=400&v=4" />
@ -90,6 +124,23 @@
kinda did stuff kinda did stuff
</p> </p>
</div> </div>
<div class="links row text-center">
<div class="col">
<a href="https://github.com/CetaceanNation">
<img class="link-ico" src="./img/github.png" />
</a>
</div>
<div class="col">
<a href="mailto:axn5966@rit.edu">
<img class="link-ico" src="./img/linkedin.png" />
</a>
</div>
<div class="col">
<a href="https://github.com/CetaceanNation">
<img class="link-ico" src="./img/email.png" />
</a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

BIN
public/img/email.png View File

Before After
Width: 512  |  Height: 512  |  Size: 6.9 KiB

BIN
public/img/github.png View File

Before After
Width: 512  |  Height: 512  |  Size: 8.4 KiB

BIN
public/img/linkedin.png View File

Before After
Width: 512  |  Height: 512  |  Size: 8.6 KiB

+ 5
- 1
public/index.html View File

@ -43,7 +43,11 @@
</div> </div>
<div class="text-content"> <div class="text-content">
<p style="position: relative; padding-left: 10px; padding-right: 10px;"> <p style="position: relative; padding-left: 10px; padding-right: 10px;">
Head over to the 'Generate graphs' page and enter the username of the user you want to generate your graph around.
Head over to the 'Generate graphs' page and enter
the username of a GitHub user. The space on that
page will then populate with the requested GitHub
user and all the related user, visualizing the
connections between them.
</p> </p>
</div> </div>
</div> </div>

+ 62
- 21
public/js/profileGen.js View File

@ -1,27 +1,68 @@
function profileGen(username, container) { function profileGen(username, container) {
queryAPIByUser("", username, (data) => {
console.log(data);
html =
"<div> \
<img src=\""+data.avatar_url+"\"></img> \
<h1>"+data.name+"</h1> \
<h2>"+data.login+"</h2> \
<p>Followers: "+data.followers+"</p> \
<p>Following: "+data.following+"</p> \
<p>"+(data.bio != null ? "Bio: "+data.bio : "")+"</p> \
<p>"+(data.location != null ? "Location: "+data.location : "")+"</p> \
<p>"+(data.email != null ? "Email: "+data.email : "")+"</p> \
<p>"+(data.blog != null ? "Site: "+data.blog : "")+"</p> \
<p>"+(data.company != null ? "Company: "+data.company : "")+"</p> \
<a href=\""+data.html_url+"\">"+data.html_url+"</h2> \
<h2></h2> \
</div>"
$("#"+container).html(html);
queryAPIByUser("", username, (user) => {
parseOrgs(user.login).then(function(orgsReturn) {
let html =
"<div> \
<img src=\""+user.avatar_url+"\"></img> \
<h1>"+user.name+"</h1> \
<h2>"+user.login+"</h2> \
<p>Followers: "+user.followers+"</p> \
<p>Following: "+user.following+"</p> \
<p>"+(user.bio != null ? "Bio: "+user.bio : "")+"</p> \
<p>"+(user.location != null ? "Location: "+user.location : "")+"</p> \
<p>"+(user.email != null ? "Email: "+user.email : "")+"</p> \
<p>"+(user.blog != null ? "Site: "+user.blog : "")+"</p> \
<p>"+(user.company != null ? "Company: "+user.company : "")+"</p> \
<p>"+(user.organizations_url != null ? "Organizations: "+orgsReturn: "")+"</p> \
<a href=\""+user.html_url+"\">"+user.html_url+"</h2> \
<h2></h2> \
</div>"
$("#"+container).html(html);
})
}, () => { }, () => {
console.log("error");
console.error("error getting user info");
}); });
} }
function parseOrgs(oranization_url) {
async function parseOrgs(name) {
const urlpath = `api/users/${name}/orgs`;
let orgs_final = [];
await queryUrl(urlpath, async (orgs) => {
orgs.map(org => {
return new Promise(function (res, rej) {
url = org.url;
queryUrl(url, (orgData) => {
orgs_final.push("<a href=\"" + orgData.html_url + "\"><img src=\"" + orgData.avatar_url + "\"></img></a>");
//console.log(orgs_final);
res();
}, () => {
console.error("error getting org info");
});
});
});
console.log(orgs);
await Promise.all(orgs);
}, () => {
console.error("error getting orgs");
});
console.log(orgs_final);
console.log(orgs_final.length);
console.log(orgs_final[0]);
return orgs_final.join(" ");
}
function queryUrl(url, successCallBack, errorCallBack) {
console.log(url);
$.ajax({
type:'GET',
url: url,
crossDomain: true,
dataType: "json",
success: successCallBack,
error:errorCallBack
});
} }

+ 0
- 0
public/js/repoGen.js View File


Loading…
Cancel
Save