og/views/user.eta

75 lines
1.8 KiB
Text
Raw Normal View History

2023-12-16 22:36:07 -05:00
<% 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">
2023-12-21 07:46:47 -05:00
<p class="title">
<span class="word name"><%= it.user.full_name || it.user.username %></span>
2023-12-21 07:52:56 -05:00
<span class="word username">@<%= it.user.username %></span>
2023-12-21 07:46:47 -05:00
</p>
2023-12-21 09:21:50 -05:00
<p class="description"><%= description %></p>
</div>
2023-12-16 22:36:07 -05:00
<div class="graphics">
2023-12-21 07:46:47 -05:00
<% if (it.user.avatar_url) { %>
<img width="120" height="120" src="<%= it.user.avatar_url %>"></img>
<% } %>
2023-12-16 22:36:07 -05:00
</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;
gap: 1rem;
2023-12-21 07:46:47 -05:00
align-items: center;
}
.user .title .name {
font-size: 4rem;
overflow: hidden;
text-overflow: ellipsis;
flex-shrink: 0;
2023-12-16 22:36:07 -05:00
}
.user .title .username {
2023-12-21 07:46:47 -05:00
font-size: 3.5rem;
2023-12-16 22:36:07 -05:00
font-weight: 400;
color: #6d728f;
2023-12-21 07:46:47 -05:00
overflow: hidden;
text-overflow: ellipsis;
2023-12-16 22:36:07 -05:00
}
.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>