Skip to content

Commit

Permalink
Add styling for sponsors (#161)
Browse files Browse the repository at this point in the history
* Add styling for sponsors

* Adjust the "work in progress" sponsors page
  • Loading branch information
lukaszklis authored Apr 11, 2018
1 parent 3f50998 commit 501d9a6
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 37 deletions.
21 changes: 19 additions & 2 deletions contents/css/_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
margin-top: 4rem;
}


.grid-item-sponsor {
grid-column: 2 / span 12;
@media (--small) {
grid-column: 3 / span 10;
}
}

@media (--small) {
.grid-item-speaker {
margin-top: 0;
Expand All @@ -76,7 +84,6 @@
}
}


@media (--large) {
.grid-item-speaker:nth-child(2n+2) {
margin-top: 0;
Expand Down Expand Up @@ -227,10 +234,20 @@
background-position: -13rem -2rem;
}
}
.page-speakers{

.page-speakers {
@media (--xsmall) {
background-image: url('contents:svg/form-speakers.svg');
background-size: 100%;
background-position: top center;
}
}

.page-sponsors,
.page-sponsors-list {
@media (--xsmall) {
background-image: url('contents:svg/form-sponsors.svg');
background-size: 100%;
background-position: top center;
}
}
20 changes: 20 additions & 0 deletions contents/css/_sponsor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.sponsor {
align-items: center;
background-color: var(--clearwhite);
border-radius: 2px;
box-shadow: 0 0 10px 0 rgba(123, 136, 157, .15);
display: flex;
}

.sponsor a {
padding: 1.25rem;
width: 100%;
}

.sponsor-community a {
padding: .25rem;
}

.sponsor img {
display: block;
}
40 changes: 40 additions & 0 deletions contents/css/_sponsors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.sponsors {
--sponsors-grid-count: 1;
--sponsors-grid-gap: 1.25rem;
--sponsors-margin-bottom: calc(var(--sponsors-grid-gap) * 2);

display: grid;
grid-template-columns: repeat(var(--sponsors-grid-count), 1fr);
grid-gap: var(--sponsors-grid-gap);
margin-bottom: var(--sponsors-margin-bottom);
margin-top: var(--sponsors-grid-gap);

@media (--xsmall) {
--sponsors-grid-count: 2;
}

@media (--small) {
--sponsors-grid-count: 3;
--sponsors-margin-bottom: calc(var(--sponsors-grid-gap) * 4);
}
}

.sponsors-supporting {
@media (--xsmall) {
--sponsors-grid-count: 3;
}

@media (--small) {
--sponsors-grid-count: 4;
}
}

.sponsors-community {
@media (--xsmall) {
--sponsors-grid-count: 4;
}

@media (--small) {
--sponsors-grid-count: 6;
}
}
2 changes: 2 additions & 0 deletions contents/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
@import '_layout.css';
@import '_topbar.css';
@import '_speaker.css';
@import '_sponsor.css';
@import '_sponsors.css';
@import '_utility-backgrounds.css';
6 changes: 3 additions & 3 deletions contents/sponsors-work-in-progress.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pageId": "sponsors-list",
"template": "pages/sponsors-list.html.njk",
"pageId": "sponsors",
"template": "pages/sponsors-work-in-progress.html.njk",
"filename": ":file/index.html",
"title": "Sponsors"
"title": "Sponsors (WIP)"
}
1 change: 1 addition & 0 deletions contents/svg/form-sponsors.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 0 additions & 31 deletions templates/pages/sponsors-list.html.njk

This file was deleted.

55 changes: 55 additions & 0 deletions templates/pages/sponsors-work-in-progress.html.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% extends "../layouts/default.html.njk" %}

{% block header %}
{% if page.metadata.title %}
<section class="grid">
<div class="grid-item-sponsor">
<h1 class="tl">
{{ page.metadata.title }}
</h1>
</div>
</section>
{% endif %}
{% endblock %}

{% block content %}
{% set sponsorTypes = ['double down', 'main', 'supporting', 'community'] %}

{% for sponsorType in sponsorTypes %}
{% set sponsors = contents.sponsors._.pages |
filterObjects('metadata.sponsor.type', sponsorType) |
sortObjects('metadata.sponsor.order', 100, 'number') %}
{% set firstSponsor = sponsors | first %}
{% set sponsorsTitle = firstSponsor.metadata.sponsor.title %}
{% set sponsorsType = sponsorType | replace(' ', '-') %}

{% if sponsors.length > 0 %}
<section class="grid">
<div class="grid-item-sponsor">
<h2>{{ sponsorsTitle }}</h2>
<div class="sponsors sponsors-{{ sponsorsType }}">
{% for page in sponsors %}
{% set sponsor = page.metadata.sponsor %}

<div class="sponsor sponsor-{{ sponsorsType }}"
id="{{ sponsor.id }}">
<a href="{{ sponsor.link }}"
rel="nofollow"
target="_blank">
<img src="{{ contents.images.sponsor[sponsor.image.filename].url }}"
alt="{{ sponsor.name }}">
</a>
</div>
{% endfor %}
</div>
</div>
</section>
{% endif %}
{% endfor %}

<section class="grid">
<div class="grid-item-center md-content">
{{ contents.copy.sponsors['sponsors.md'].html }}
</div>
</section>
{% endblock %}
47 changes: 46 additions & 1 deletion templates/pages/sponsors.html.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,56 @@
{% extends "../layouts/default.html.njk" %}

{% block header %}
{% if page.metadata.title %}
<section class="grid">
<div class="grid-item-sponsor">
<h1 class="tl">
{{ page.metadata.title }}
</h1>
</div>
</section>
{% endif %}
{% endblock %}

{% block content %}
{% set sponsorTypes = ['double down', 'main', 'supporting', 'community'] %}

{% for sponsorType in sponsorTypes %}
{% set sponsors = contents.sponsors._.pages |
filterObjects('metadata.sponsor.type', sponsorType) |
filterObjects('metadata.sponsor.reviewed', true) |
sortObjects('metadata.sponsor.order', 100, 'number') %}
{% set firstSponsor = sponsors | first %}
{% set sponsorsTitle = firstSponsor.metadata.sponsor.title %}
{% set sponsorsType = sponsorType | replace(' ', '-') %}

{% if sponsors.length > 0 %}
<section class="grid">
<div class="grid-item-sponsor">
<h2>{{ sponsorsTitle }}</h2>
<div class="sponsors sponsors-{{ sponsorsType }}">
{% for page in sponsors %}
{% set sponsor = page.metadata.sponsor %}

<div class="sponsor sponsor-{{ sponsorsType }}"
id="{{ sponsor.id }}">
<a href="{{ sponsor.link }}"
rel="nofollow"
target="_blank">
<img src="{{ contents.images.sponsor[sponsor.image.filename].url }}"
alt="{{ sponsor.name }}">
</a>
</div>
{% endfor %}
</div>
</div>
</section>
{% endif %}
{% endfor %}

<section class="grid">
<div class="grid-item-center md-content">
{{ contents.copy.sponsors['sponsors.md'].html }}
</div>
</section>

{% endblock %}

0 comments on commit 501d9a6

Please sign in to comment.