Skip to content

Commit

Permalink
New work page layout (mainmatter#333)
Browse files Browse the repository at this point in the history
* Work: Shape for cases

* Use spaces over tabs, add editorconfig
  • Loading branch information
pichfl authored and marcoow committed Apr 12, 2019
1 parent d9e9e88 commit 88efbba
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 89 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
32 changes: 32 additions & 0 deletions src/ui/components/ShapeCase/component-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import hbs from '@glimmer/inline-precompile';
import { render, setupRenderingTest } from '@glimmer/test-helpers';

const { module, test } = QUnit;

module('Component: ShapeCase', function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function (assert) {
/*
* You may pass data into the component through arguments set on the
* `testContext`
*
* For example:
*
* ```
* this.foo = { foo: '123' };
*
* await render(hbs`<ShapeCase @foo={{this.foo}} />`)
*
* // or
*
* this.foo = 'bar';
* await render(hbs`<p>{{this.foo}}</p>`);
*
* assert.dom('p').text('bar');
* ```
*/
await render(hbs`<ShapeCase />`);
assert.ok(this.containerElement.querySelector('div'));
});
});
19 changes: 19 additions & 0 deletions src/ui/components/ShapeCase/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Component from '@glimmer/component';

export default class ShapeCase extends Component {
public clipId = Math.random().toString(36).substr(2, 5);

get imageClipStyle() {
const shouldClip = this.args.clipImage || true;

if (!shouldClip) {
return '';
}

return `clip-path: url(#${this.clipId});`;
}

get shapeStyle() {
return `fill: ${this.args.color || '#007DF6'}`
}
}
48 changes: 48 additions & 0 deletions src/ui/components/ShapeCase/stylesheet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@block typography from "../../styles/blocks/typography.block.css";

:scope {
position: relative;
}

.shape {
display: block;
position: relative;
left: 50%;
transform: translate(-50%);
width: 100vw;
height: auto;
margin: -8rem 0 6rem;
}

.logo {
position: absolute;
top: calc(50vw - 12rem);
}

.logo-img {
display: block;
height: 4rem;
width: auto;
}

.floating {
position: absolute;
top: 13rem;
left: 50%;
transform: translate(22rem);
}

.floating-background {
fill: var(--link-color);
}

.floating-content {
position: absolute;
top: calc(50% - 21rem);
right: calc(-56.5rem + 100vw);
width: 25rem;
transform: translate(-50%);
text-align: right;

--link-color: #fff;
}
42 changes: 42 additions & 0 deletions src/ui/components/ShapeCase/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<figure>
<svg class="shape" height="900" viewBox="0 0 1800 900" width="1800" xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id={{this.clipId}}>
<path
d="m840.577137 0 862.961153 498.230855-231.96152 401.769145h-512.153907l-862.9611537-498.230855 231.9615247-401.769145z"
fill-rule="evenodd"
></path>
</clipPath>
</defs>
<g style="clip-path: url(#{{this.clipId}});">
<rect x="0" y="0" width="100%" height="100%" style={{this.shapeStyle}}></rect>
</g>
{{#if @image}}
<g style={{this.imageClipStyle}}>
<image x="0" y="0" xlink:href="{{@image}}" width="100%" height="100%"></image>
</g>
{{/if}}
</svg>
<figcaption>
<div class="floating">
<svg class="shape" height="900" viewBox="0 0 1800 900" width="1800" xmlns="http://www.w3.org/2000/svg">
<path
d="m840.577137 0 862.961153 498.230855-231.96152 401.769145h-512.153907l-862.9611537-498.230855 231.9615247-401.769145z"
fill-rule="evenodd"
class="floating-background"
></path>
</svg>
<div class="floating-content">
<a href="{{@link}}" data-internal>
{{if @linkLabel @linkLabel 'Read Case Study'}}
</a>
</div>
</div>
{{#if @logo}}
<div class="logo">
<img class="logo-img" src="{{@logo}}" alt="" />
</div>
{{/if}}
{{yield}}
</figcaption>
</figure>
170 changes: 81 additions & 89 deletions src/ui/components/Work/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,38 @@
<div class="contents">
<div class="container">
<Navigation />
<div class="header-block">
<header class="header-block">
<p class="typography.small-text">
Work
</p>
<h1 class="typography.display">
We have a track record of successful projects for international clients
</h1>
</div>
<!--page-header-->
</header>
</div>
<div class="container">
<ShapeCase
@color="#90E9D4"
@image="/assets/images/trainline-comp.jpg"
@logo="/assets/images/logos/trainline.svg"
@link="#"
@linkLabel="Read about Trainline"
>
<h2 class="typography.small-text">
Our latest Case Study
</h2>
<h3 class="typography.headline-2">
Leveraging Trainline's full market potential
</h3>
<p class="typography.body-text">
Trainline is Europe’s leading independent rail and coach platform. We worked with them to deliver a high-performance mobile web app, along with an improved engineering process, enabling Trainline to achieve their business goals for years to come.
</p>
<a href="#" data-internal>
Read Case Study
</a>
</ShapeCase>
</div>
<!--container-->
<div class="container">
<div class="main-block">
<div class="main-block.content-full-width">
<div class="main-block.content-item">
<div class="main-block.content-heading">
<h2 class="typography.headline-1">
Case Studies
</h2>
<p class="typography.lead">
We turn ideas into products and help tech teams move faster with confidence, enabling the long-term success of our clients' businesses.
</p>
</div>
<!--heading-->
<div class="main-block.content-section">
<div class="main-block.content-section-item">
<h3 class="typography.headline-2">
Leveraging Trainline's full market potential
</h3>
<p class="typography.body-text">
Trainline is Europe’s leading independent rail and coach platform. We worked with them to deliver a high-performance mobile web app, along with an improved engineering process, enabling Trainline to achieve their business goals for years to come.
</p>
<a href="#" class="typography.arrow-link" data-internal>
Read Case Study
</a>
<div class="main-block.body-image">
<img class="fluid-image.image" src="/assets/images/trainline-comp.jpg" />
<p class="main-block.body-image-caption">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<!--body-image-->
</div>
</div>
<!--section-->
<div class="main-block.content-section">
<div class="main-block.content-section-item">
<h3 class="typography.headline-2">
Modern online appointment scheduling
</h3>
<p class="typography.body-text">
When Timify decided it was time to re-engineer their existing product, they trusted us to bring them into the future. We added engineering capacity and technology expertise to Timify's internal team and helped to build a solid foundation that enabled them to iterate fast and launch on-schedule, without sacrificing quality.
</p>
<a href="#" class="typography.arrow-link" data-internal>
Read Case Study
</a>
<div class="main-block.body-image">
<img class="fluid-image.image" src="/assets/images/trainline-comp.jpg" />
<p class="main-block.body-image-caption">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<!--body-image-->
</div>
</div>
<!--section-->
<div class="main-block.content-section">
<div class="main-block.content-section-item">
<h3 class="typography.headline-2">
A modern UI for an open-source router firmware
</h3>
<a href="#" class="typography.arrow-link" data-internal>
Read Case Study
</a>
</div>
</div>
<!--section-->
<div class="main-block.content-section">
<div class="main-block.content-section-item">
<h3 class="typography.headline-2">
An online travel magazine for global citizens
</h3>
<a href="#" class="typography.arrow-link" data-internal>
Read Case Study
</a>
</div>
</div>
<!--section-->
</div>
<!--content-item-->
</div>
<!--content-->
</div>
<!--main-block-->
<div class="grid-block">
<div class="grid-block.heading">
<h2 class="typography.headline-1">
Expand All @@ -108,7 +49,6 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<!--item-->
<div class="grid-block.item">
<div class="grid-block.image-wrapper">
<img class="grid-block.image" src="/assets/images/logos/timify.svg" />
Expand All @@ -117,7 +57,6 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<!--item-->
<div class="grid-block.item">
<div class="grid-block.image-wrapper">
<img class="grid-block.image" src="/assets/images/logos/cardstack.svg" />
Expand All @@ -126,9 +65,62 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<!--item-->
</div>
</div>
</div>
<div class="container">
<ShapeCase
@color="#90E9D4"
@image="/assets/images/trainline-comp.jpg"
@link="#"
@linkLabel="Read about Trainline"
>
<h3 class="typography.headline-2">
Modern online appointment scheduling
</h3>
<p class="typography.body-text">
When Timify decided it was time to re-engineer their existing product, they trusted us to bring them into the future. We added engineering capacity and technology expertise to Timify's internal team and helped to build a solid foundation that enabled them to iterate fast and launch on-schedule, without sacrificing quality.
</p>
<a href="#" data-internal>
Read Case Study
</a>
</ShapeCase>
</div>
<div class="container">
<h2 class="typography.headline-1">
More Case Studies
</h2>
<div class="main-block">
<div class="main-block.content-full-width">
<div class="main-block.content-item">
<div class="main-block.content-section">
<div class="main-block.content-section-item">
<h3 class="typography.headline-2">
A modern UI for an open-source router firmware
</h3>
<a href="#" data-internal>
Read Case Study
</a>
</div>
</div>
<!--section-->
<div class="main-block.content-section">
<div class="main-block.content-section-item">
<h3 class="typography.headline-2">
An online travel magazine for global citizens
</h3>
<a href="#" data-internal>
Read Case Study
</a>
</div>
</div>
<!--section-->
</div>
<!--content-item-->
</div>
<!--content-->
</div>
<!--main-block-->
<!--grid-block-->
</div>
<div class="container">
Expand Down

0 comments on commit 88efbba

Please sign in to comment.