* Move HexComparere to Hex::Comparer service * Create USER_COLORS constant and constant specs * Move formats to constants * Rename Hex::Comparer to Color::CompareHex
69 lines
3.3 KiB
Text
69 lines
3.3 KiB
Text
<% unless internal_navigation? || user_signed_in? %>
|
|
<script type="application/ld+json">
|
|
<%= @organization_json_ld.to_json.html_safe %>
|
|
</script>
|
|
<% end %>
|
|
<style>
|
|
:root {
|
|
--profile-brand-color: <%= Color::CompareHex.new([user_colors(@user)[:bg], user_colors(@user)[:text]]).brightness(0.88) %>;
|
|
}
|
|
</style>
|
|
<div class="brand-bg">
|
|
<div class="crayons-layout pt-7 m:pt-9">
|
|
<header class="profile-header crayons-card mt-2">
|
|
<div class="relative profile-header__top">
|
|
<span class="crayons-logo crayons-logo--3xl">
|
|
<img src="<%= Images::Profile.call(@user.profile_image_url, length: 320) %>" alt="<%= @user.name %> logo" width="128" height="128" alt="<%= @user.name %> profile picture" class="crayons-logo__image">
|
|
</span>
|
|
|
|
<div class="profile-header__actions">
|
|
<button id="user-follow-butt" class="crayons-btn whitespace-nowrap follow-action-button user-profile-follow-button" data-info='{"id":<%= @user.id %>,"className":"<%= @user.class.name %>"}'>Follow</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-header__details">
|
|
<h1 class="crayons-title fw-heavy mb-2"><%= sanitize @user.name %></h1>
|
|
<% if @user.tag_line.present? %>
|
|
<p class="fs-l m:fs-xl color-base-70 mb-4 mx-auto max-w-100 m:max-w-75"><%= sanitize @user.tag_line %></p>
|
|
<% end %>
|
|
<p class="fs-base m:fs-l color-base-90 mb-4 mx-auto max-w-100 m:max-w-75"><%= sanitize(@user.summary.presence || "404 bio not found") %></p>
|
|
|
|
<div class="profile-header__meta">
|
|
<% if @organization.location.present? %>
|
|
<span class="profile-header__meta__item">
|
|
<%= inline_svg_tag("location.svg", aria: true, class: "crayons-icon mr-2 shrink-0", title: "Location") %>
|
|
<%= sanitize @organization.location %>
|
|
</span>
|
|
<% end %>
|
|
|
|
<span class="profile-header__meta__item">
|
|
<%= inline_svg_tag("cake.svg", aria: true, class: "crayons-icon mr-2 shrink-0", title: "Joined") %>
|
|
Joined on
|
|
<%= local_date(@user.created_at) %>
|
|
</span>
|
|
|
|
<span class="profile-header__meta__item -ml-1">
|
|
<% if @user.twitter_username.present? %>
|
|
<a href="https://twitter.com/<%= @user.twitter_username %>" target="_blank" rel="noopener me" class="px-1 align-middle inline-block">
|
|
<%= inline_svg_tag("twitter.svg", class: "crayons-icon", aria: true, title: "Twitter logo") %>
|
|
</a>
|
|
<% end %>
|
|
<% if @user.github_username.present? %>
|
|
<a href="https://github.com/<%= @user.github_username %>" target="_blank" rel="noopener me" class="px-1 align-middle inline-block">
|
|
<%= inline_svg_tag("github.svg", class: "crayons-icon", aria: true, title: "GitHub logo") %>
|
|
</a>
|
|
<% end %>
|
|
<% if @user.website_url.present? %>
|
|
<a href="<%= @user.website_url %>" target="_blank" rel="noopener nofollow me" class="px-1 align-middle inline-block">
|
|
<%= inline_svg_tag("external.svg", class: "crayons-icon", aria: true, title: "External link icon") %>
|
|
</a>
|
|
<% end %>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render "organizations/metadata" %>
|
|
|
|
</header>
|
|
</div>
|
|
</div>
|