Skip to content
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

Ready to make a difference block #46

Merged
merged 7 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
73 changes: 73 additions & 0 deletions blocks/career-apply/career-apply.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.career-apply-wrapper {
bosschaert marked this conversation as resolved.
Show resolved Hide resolved
background-color: var(--primary);
}

.career-apply {
color: var(--white);
text-align: left;
max-width: unset;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max-width is not needed here

padding-inline: 16px;
padding-block: 48px;
}

.career-apply h2 {
color: var(--white);
font-size: 28px;
margin-bottom: 16px;
}

.career-apply p {
line-height: 24px;
margin-bottom: 24px;
}

.career-apply .button-container {
display: inline-flex;
flex-direction: column;
}

.career-apply a {
margin: 8px 0;
}

.career-apply a.button.primary.linkedin {
bosschaert marked this conversation as resolved.
Show resolved Hide resolved
background-color: var(--primary);
border: 1px solid white;
padding-left: 40px;
}

.career-apply span.icon-linkedin {
margin-left: 10px;
margin-right: 16px;
height: 32px;
bosschaert marked this conversation as resolved.
Show resolved Hide resolved
width: 34px;
}

.career-apply span.icon-linkedin svg {
/* This is needed as otherwise the icon is shown twice */
display: none;
bosschaert marked this conversation as resolved.
Show resolved Hide resolved
}

@media (min-width: 62rem) {
.career-apply {
max-width: 720px;
text-align: center;
padding-block: 80px;
}

.career-apply h2 {
font-size: var(--heading-font-size-mxl);
}

.career-apply p {
margin-bottom: 50px;
}

.career-apply .button-container {
flex-direction: row;
}

.career-apply a {
margin: 0 8px;
}
}
38 changes: 38 additions & 0 deletions blocks/career-apply/career-apply.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { getLanguage } from '../../scripts/scripts.js';
import { decorateIcons, fetchPlaceholders } from '../../scripts/lib-franklin.js';

export default async function decorate(block) {
const placeholders = await fetchPlaceholders(getLanguage());

const section = document.querySelector('.section.career-apply-container');
if (section) {
section.classList.add('full-width');
bosschaert marked this conversation as resolved.
Show resolved Hide resolved
}

const title = document.createElement('h2');
title.innerText = placeholders['career-apply-title'];
block.appendChild(title);

const msg = document.createElement('p');
msg.innerText = placeholders['career-apply-msg'];
block.appendChild(msg);

const buttonBar = document.createElement('p');
buttonBar.classList.add('button-container');
const search = document.createElement('a');
search.innerText = placeholders['career-apply-search'];
search.classList.add('button', 'primary');
search.href = '#';
bosschaert marked this conversation as resolved.
Show resolved Hide resolved
buttonBar.appendChild(search);

const linkedin = document.createElement('a');
linkedin.innerText = placeholders['career-apply-linkedin'];
linkedin.classList.add('button', 'primary', 'linkedin');
linkedin.href = '#';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above for this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the code to pick these up from the placeholders.xslx - that way they don't have to be duplicated on every career testimonial page.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdmcraft do you think this is an acceptable approach?

const sprite = document.createElement('span');
sprite.classList.add('icon', 'icon-linkedin');
linkedin.appendChild(sprite);
decorateIcons(linkedin);
buttonBar.append(linkedin);
block.appendChild(buttonBar);
}