LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
html, body {
  height: 100%;
  font-family: Roboto;
  font-size: 1em;
  background: -webkit-linear-gradient(transparent, #f3f3f3 10%, transparent);
  background: linear-gradient(transparent, #f3f3f3 10%, transparent);
  background-size: 4px;
}

* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
}

.application {
  height: 100%;
  background-size: cover;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
}

.super-line {
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
  text-align: center;
  position: relative;
}
.super-line:before {
  content: "";
  display: inline-block;
  border-bottom: 1px solid #fff;
  margin-bottom: 3px;
  margin-right: 20px;
  width: 80px;
}
.super-line:after {
  content: "";
  display: inline-block;
  border-bottom: 1px solid #fff;
  margin-bottom: 3px;
  margin-left: 20px;
  width: 80px;
}
.super-line.b {
  background: #fff;
  color: #7E9BA0;
}
.super-line.b:before, .super-line.b:after {
  border-bottom: 1px solid #7E9BA0;
}

.wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
}

.wrapper > .loading {
  margin: auto;
  width: 200px;
  text-align: center;
}
.wrapper > .loading span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #880e4f;
  margin: 0px 10px;
  opacity: 0.1;
}
.wrapper > .loading span:nth-child(1) {
  -webkit-animation: blink 1.3s infinite;
          animation: blink 1.3s infinite;
  -webkit-animation-delay: .300s;
          animation-delay: .300s;
}
.wrapper > .loading span:nth-child(2) {
  -webkit-animation: blink 1.3s infinite;
          animation: blink 1.3s infinite;
  -webkit-animation-delay: .400s;
          animation-delay: .400s;
}
.wrapper > .loading span:nth-child(3) {
  -webkit-animation: blink 1.3s infinite;
          animation: blink 1.3s infinite;
  -webkit-animation-delay: .500s;
          animation-delay: .500s;
}
.wrapper > .loading span:nth-child(4) {
  -webkit-animation: blink 1.3s infinite;
          animation: blink 1.3s infinite;
  -webkit-animation-delay: .600s;
          animation-delay: .600s;
}
.wrapper > .loading span:nth-child(5) {
  -webkit-animation: blink 1.3s infinite;
          animation: blink 1.3s infinite;
  -webkit-animation-delay: .700s;
          animation-delay: .700s;
}

@-webkit-keyframes blink {
  0% {
    opacity: 1;
    background: #880e4f;
  }
  50% {
    opacity: 1;
    background: #fff;
  }
  100% {
    opacity: 0.1;
    background: #fff;
  }
}

@keyframes blink {
  0% {
    opacity: 1;
    background: #880e4f;
  }
  50% {
    opacity: 1;
    background: #fff;
  }
  100% {
    opacity: 0.1;
    background: #fff;
  }
}
.wrapper > .card {
  margin: auto;
  width: 360px;
  border-radius: 5px 5px 0px 0px;
  background: #f06292;
  box-shadow: 6px 6px 8px #999;
}
.wrapper > .card .header {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  border-radius: 5px 5px 0px 0px;
  height: 200px;
}
.wrapper > .card .header .avatar, .wrapper > .card .header .avatar > img {
  width: 100px;
  height: 100px;
}
.wrapper > .card .header .avatar {
  overflow: hidden;
  border-radius: 100%;
  border: 3px solid #eee;
  margin: auto;
}

.wrapper > .card > .header {
  background: #fff;
}
.wrapper > .card > .header span.repos-count {
  position: absolute;
  left: 130px;
  top: 90px;
  background: #f06292;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
}
.wrapper > .card > .header span.repos-count:after {
  content: "repos";
  position: absolute;
  color: #7E9BA0;
  text-transform: uppercase;
  font-size: 8px;
  bottom: -20px;
  left: 0px;
}
.wrapper > .card > .header a.userlink {
  background: #7E9BA0;
  color: #fff;
  padding: 4px 10px;
  position: absolute;
  right: 0px;
  top: 0px;
  text-decoration: none;
}
.wrapper > .card > .header a.userlink:hover {
  background: #f06292;
}
.wrapper > .card > .header a.userlink i {
  font-size: 12px;
  margin: 0px 0px 0px 5px;
}
.wrapper > .card > .header .userinfo {
  text-align: center;
  padding: 0px 0px 20px 0px;
}
.wrapper > .card > .header .userinfo h2 {
  color: #7E9BA0;
}
.wrapper > .card > .header .userinfo p {
  color: #7E9BA0;
}

.wrapper > .card > .top-repos {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
  padding: 10px 0px 0px 0px;
  background: #f06292;
  text-align: center;
}
.wrapper > .card > .top-repos .repository {
  margin: 5px 0px;
  -webkit-box-flex: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  text-align: center;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
}
.wrapper > .card > .top-repos .repository i {
  display: block;
  margin-bottom: 5px;
  font-size: 8px;
}
.wrapper > .card > .top-repos .repository .title {
  text-transform: uppercase;
  font-size: 12px;
}

.wrapper > .card > .pie-chart-wrap {
  position: relative;
  text-align: center;
}
.wrapper > .card > .pie-chart-wrap .pie-chart {
  margin-top: 40px;
}
.wrapper > .card > .pie-chart-wrap .pie-chart-totals {
  position: absolute;
  top: 100px;
  width: 100%;
  color: #fff;
  font-weight: bold;
  font-size: 22px;
}
.wrapper > .card > .pie-chart-wrap .pie-chart-totals i {
  display: block;
  margin-bottom: 10px;
}

.wrapper > .card > .chart {
  position: relative;
  border: none;
  background: #fff;
  width: 360px;
  overflow: hidden;
  height: 100px;
}
.wrapper > .card > .chart canvas {
  border: none;
  position: absolute;
  left: -5px;
  bottom: -9px;
}

.wrapper > .card > .activity-line {
  padding-top: 40px;
}

.wrapper > .card > .totals {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
  padding: 10px 0px 5px 0px;
  background: #fff;
}
.wrapper > .card > .totals > div {
  -webkit-box-flex: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  text-align: center;
  font-size: 16px;
  color: #7E9BA0;
}
.wrapper > .card > .totals > div:nth-child(2) {
  border-right: 1px solid #ddd;
  border-left: 1px solid #ddd;
}
.wrapper > .card > .totals > div .desc {
  text-transform: uppercase;
  font-size: 9px;
}
JS
/*
Home : https://github.com/c0ncept/github-user-card
*/

const GITHUB_USER = 'linuxenko'
const GITHUB_URL = 'https://api.github.com/users/'



Chart.defaults.global = {
  animation: true,
  animationSteps: 50,
  animationEasing: "easeOutBounce",
  scaleLabel: "<%=value%>",
  bezierCurve: true,
  bezierCurveTension: 1,
  scaleIntegersOnly: true,
  scaleBeginAtZero: false,
  maintainAspectRatio: false,
  onAnimationProgress: function() {},
  onAnimationComplete: function() {}
}

class Repo extends React.Component {
  render() {
    let {repo} = this.props
    return (
        
          
{repo.name}
) } } class DataChart extends React.Component { eventsRange(event) { let range = [] for (let i = 11; i > 0; i--) { range.push(moment().subtract(i, 'days').format('YYYY-MM-DD')) } let evtmp = this.props.events .filter(e => event(e.type)) .map(e => e.created_at.match(/^(\d{4}-\d{2}-\d{2}).*/)[1]) return range.map(r => evtmp.reduce(function(p,c) { return r === c ? p + 1 : p}, 0)) } componentDidMount() { let pushEvents = this.eventsRange((e) => e === 'PushEvent') let miscEvents = this.eventsRange((e) => e !== 'PushEvent') var lineChartData = { labels: pushEvents, datasets: [{ fillColor: "#7E9BA0", strokeColor: "rgba(0,0,0,0)", pointColor: "rgba(255, 255, 255, 0)", pointStrokeColor: "rgba(255, 255, 255, 0)", data: pushEvents }, { fillColor: "#f06292", strokeColor: "rgba(0,0,0,0)", pointColor: "rgba(255, 255, 255, 0)", pointStrokeColor: "rgba(255, 255, 255, 0)", data: miscEvents }] }; var ctx1 = document.getElementById("chart").getContext("2d"); this.chart = new Chart(ctx1).Line(lineChartData); } render() { return (
) } } class RepoChart extends React.Component { componentDidMount() { var htmlData = [ { value: this.props.repos[0].stargazers_count, color: "#f8bbd0" }, { value : this.props.repos[1].stargazers_count, color : "#ec407a" }, { value : this.props.repos[2].stargazers_count, color : "#fff" } ]; var ctx2 = document.getElementById("pie").getContext("2d"); new Chart(ctx2).Doughnut(htmlData, { segmentShowStroke: false, percentageInnerCutout : 80 }) } render() { let totals = this.props.repos.reduce(function(p,c) { return p + c.stargazers_count },0) return (
{totals}
) } } class Card extends React.Component { render() { let reposData = this.props.repos .sort((a,b) => b.stargazers_count - a.stargazers_count) .slice(0,3) let repos = reposData .map((r,i) => ) let starred = this.props.repos .reduce(function(p,c) {return p + Number(c.stargazers_count) }, 0) let forked = this.props.repos .reduce(function(p,c) {return p + Number(c.forks_count) }, 0) return (
{this.props.user.login}
{this.props.user.public_repos}

{this.props.user.name || this.props.user.login}

{this.props.user.location}

{this.props.user.followers}
Followers
{starred}
Total stars
{forked}
Times Forked


TOP Rated
{repos}


) } } class Application extends React.Component { constructor() { super() this.state = {user : {}, repos : []} this.loadGitHubUser(GITHUB_USER) } loadGitHubUser(user) { Promise.all([ fetch(GITHUB_URL + user).then(r => r.json()), fetch(GITHUB_URL + user + '/repos').then(r => r.json()), fetch(GITHUB_URL + user + '/events?per_page=300').then(r => r.json()) ]).then((resp) => { this.setState({user: resp[0], repos : resp[1], events : resp[2]}) }) } render() { let children = this.state.user.hasOwnProperty('login') ? :
return (
{children}
) } } ReactDOM.render(, document.getElementById('application'))

Description

GitHub User Card Home : https://github.com/c0ncept/github-user-card
Term
Mon, 11/27/2017 - 21:19

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv