Skip to content

feat(): Introduce Avatar component #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/_includes/components/avatar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% assign contributor = page.contributors | first %}
{% assign day = contributor.date | date: "%-d" %}

{% if contributor %}
<div class="avatar">
<div class="flex gutter gutter--large">
<div class="flex__column flex__column--shrink">
<img src="{{ site.baseurl }}/images/{{ contributor.image_path }}" alt="">
</div>

<div class="flex__column">
<div class="avatar__content">
<div>
<p class="avatar__title">Updated on
{% case day %}
{% when '1' or '21' or '31' %}{{ day }}st
{% when '2' or '22' %}{{ day }}nd
{% when '3' or '23' %}{{ day }}rd
{% else %}{{ day }}th
{% endcase %}
{{ contributor.date | date: "%B" }},
{{ contributor.date | date: "%Y" }}
</p>

<p class="avatar__info">by {{ contributor.name }} - {{ contributor.position }}</p>
</div>

<div>
{% include components/button-link.html text="See all contributors" href="#" %}
</div>
</div>
</div>
</div>
</div>
{% endif %}
26 changes: 26 additions & 0 deletions src/_sass/components/_avatar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.avatar {
font-size: 14px;
line-height: 18px;

&__content {
& > * + * {
margin-top: 5px;
}
}

&__title {
color: #2b5a99;
font-weight: 500;
}

&__info {
color: #6f859a;
}

img {
width: 40px;
height: 40px;
margin-top: 0;
margin-bottom: 0;
}
}
1 change: 1 addition & 0 deletions src/_sass/segment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
@import "components/feedback-box";
@import "components/media-icon";
@import "components/media-thumbnail";
@import "components/avatar";

// Pages
// =================================================
Expand Down
Binary file added src/images/paul-mccall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ title: Styleguide
description: The styleguide of front-end components
hidden: true
layout: page
contributors:
- name: Paul Mccall
position: Lead Developer
image_path: paul-mccall.png
date: 23.08.2019
---

---
Expand Down Expand Up @@ -79,6 +84,12 @@ analytics.identify('025pikachu025', {

---

## Avatar

{% include components/avatar.html %}

---

## Media Icons

{% include components/media-icon.html variant="small" href="#" icon="icon-academy.svg" title="Title" content="Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto ratione ipsum fugiat nostrum velit iure, molestiae accusamus tempora quos laborum, ex modi illum delectus. Suscipit nesciunt labore nulla numquam excepturi?" excerpt="Read more" %}
Expand Down