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

FE-132 Add centennial in-page nav #357

Merged
merged 5 commits into from
Aug 14, 2024
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
4 changes: 4 additions & 0 deletions app/components/centennial/centennial-nav/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Component from '@ember/component';

export default Component.extend({
});
11 changes: 11 additions & 0 deletions app/components/centennial/centennial-nav/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="centennial-nav centennial-module l-constrained">
<ul>
<li><a href="#explore">Explore the Centennial</a></li>
<li><a href="#support">Support us</a></li>
<li><a href="#history">Our History</a></li>
<li><a href="#events">Events</a></li>
<li><a href="#stories">Share your New York Stories</a></li>
<li><a href="#sponsors">Sponsors</a></li>
</ul>
</div>

1 change: 1 addition & 0 deletions app/styles/_centennial.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import 'centennial/centennial-base';

@import 'centennial/centennial-header';
@import 'centennial/centennial-nav';
@import 'centennial/centennial-logo-wnyc';
@import 'centennial/centennial-timeline';
@import 'centennial/centennial-archives';
Expand Down
18 changes: 18 additions & 0 deletions app/styles/centennial/_centennial-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
--centennial-header-line-height: 1.2;
--centennial-module-spacing: 64px;
}

.centennial-home {
position: relative;
}


.centennial-nav-anchor {
position: relative;
top: -60px;
}

@media screen and (min-width: 1025px) {
.centennial-nav-anchor {
position: inherit;
}
}


.centennial-module {
margin-bottom: var(--centennial-module-spacing);
}
Expand Down
2 changes: 1 addition & 1 deletion app/styles/centennial/_centennial-header.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.centennial-header {
margin-bottom: var(--centennial-module-spacing);
margin-bottom: 32px;
}

.centennial-header__hero, .centennial-header__hero img {
Expand Down
30 changes: 30 additions & 0 deletions app/styles/centennial/_centennial-nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.centennial-nav ul, .centennial-nav li {
margin: 0;
padding: 0;
list-style: none;
}

.centennial-nav ul {
display: flex;
justify-content: space-between;
}
@media (max-width: 1210px) {
.centennial-nav ul {
flex-direction: column;
row-gap: 32px;
}
}

.centennial-nav li a {
font-size: 16px;
font-weight: 700;
text-decoration: none;
border: none;
text-transform: uppercase;
color: rgb(51, 51, 51);
&:hover {
border: none;
text-decoration: none;
color: #d3008c;
}
}
9 changes: 9 additions & 0 deletions app/templates/centennial.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
</HeadLayout>
<div class="centennial-home">
{{centennial/centennial-header}}

{{centennial/centennial-nav}}

{{centennial/centennial-message}}
<span class="centennial-nav-anchor" id="explore"></span>
{{centennial/centennial-explore
category1Title=model.featuredCategory1.title
category1Items=model.featuredCategory1.bucketItems
Expand All @@ -13,11 +17,16 @@
category3Items=model.featuredCategory3.bucketItems
}}
{{centennial/centennial-cta-narrow}}
<span class="centennial-nav-anchor" id="support"></span>
{{centennial/centennial-legacy-giving}}
<span class="centennial-nav-anchor" id="history"></span>
{{centennial/centennial-timeline}}
{{centennial/centennial-archives items=model.archiveItems}}
<span class="centennial-nav-anchor" id="events"></span>
{{centennial/centennial-events events=model.events}}
<span class="centennial-nav-anchor" id="stories"></span>
{{centennial/centennial-new-york-stories}}
{{centennial/centennial-double-cta}}
<span class="centennial-nav-anchor" id="sponsors"></span>
{{centennial/centennial-major-sponsor}}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { module, skip } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Component | centennial/centennial-nav', function(hooks) {
setupRenderingTest(hooks);

skip('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });

await render(hbs`{{centennial/centennial-nav}}`);

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#centennial/centennial-nav}}
template block text
{{/centennial/centennial-nav}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
});
});