71 lines
1.8 KiB
Text
71 lines
1.8 KiB
Text
<% layout('layout') %>
|
|
<%
|
|
let description = it.user.description?.replace(/https?:\/\/([\S]+)/g, '$1')
|
|
function prettyNumber(number) {
|
|
if (number < 30) return number
|
|
if (number < 1000) return Math.floor(number/10) * 10 + '+'
|
|
return Math.floor(number / 1000)+'k'
|
|
}
|
|
%>
|
|
<div class="main user">
|
|
<div class="contents">
|
|
<div class="info">
|
|
<p class="title"><span><%= it.user.full_name || it.user.username %></span> <span class="username">@<%= it.user.username %></span></p>
|
|
<p class="description"><%= description %></p>
|
|
</div>
|
|
<div class="graphics">
|
|
<% if (it.user.avatar_url) { %>
|
|
<img width="120" height="120" src="<%= it.user.avatar_url %>"></img>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
<div class="info-line">
|
|
<div class="fact">
|
|
<p class="fact-heading"><%= it.user.followers_count %></p>
|
|
<p class="fact-subtitle">Followers</p>
|
|
</div>
|
|
<div class="fact">
|
|
<p class="fact-heading"><%= it.user.following_count %></p>
|
|
<p class="fact-subtitle">Following</p>
|
|
</div>
|
|
<div class="fact">
|
|
<p class="fact-heading"><%= prettyNumber(it.user.repo_count) %></p>
|
|
<p class="fact-subtitle">Repos</p>
|
|
</div>
|
|
<div class="fact">
|
|
<p class="fact-heading"><%= it.user.starred_repos_count %></p>
|
|
<p class="fact-subtitle">Stars Given</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<style>
|
|
.user .title {
|
|
white-space: nowrap;
|
|
display: flex;
|
|
}
|
|
.user .title span:not(.username) {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
font-size: 3rem;
|
|
font-weight: 600;
|
|
color: #aeb3d0;
|
|
}
|
|
.user .title .username {
|
|
font-size: 1.75rem;
|
|
gap: 0.5rem;
|
|
font-weight: 400;
|
|
color: #6d728f;
|
|
}
|
|
.fact {
|
|
display: flex;
|
|
margin-right: 0.5em;
|
|
font-size: 1.5rem;
|
|
flex-direction: column;
|
|
}
|
|
.fact-heading {
|
|
color: #8c91af;
|
|
font-size: 2rem;
|
|
font-weight: 600;
|
|
}
|
|
</style> |