diff --git a/sites/fast-website/src/app/components/content-placement-container/content-placement-container.styles.ts b/sites/fast-website/src/app/components/content-placement-container/content-placement-container.styles.ts index 7d355a7d1e5..5f140c98ff4 100644 --- a/sites/fast-website/src/app/components/content-placement-container/content-placement-container.styles.ts +++ b/sites/fast-website/src/app/components/content-placement-container/content-placement-container.styles.ts @@ -2,11 +2,10 @@ import { css } from "@microsoft/fast-element"; import { display } from "@microsoft/fast-foundation"; import { elevation } from "@microsoft/fast-components/dist/esm/styles/elevation.js"; import { - neutralForegroundHintBehavior, - neutralForegroundHoverBehavior, - neutralOutlineRestBehavior, - neutralFillActiveBehavior, accentForegroundRestBehavior, + neutralFillFocusBehavior, + neutralForegroundHintBehavior, + neutralForegroundRestBehavior, } from "@microsoft/fast-components"; export const ContentPlacementContainerStyles = css` @@ -21,14 +20,19 @@ export const ContentPlacementContainerStyles = css` overflow: hidden; } + :host([section="feature"]) { + --flow: column; + grid-template-rows: repeat(4, min-content); + grid-auto-flow: var(--flow); + justify-content: center; + counter-reset: feature-counter; + } + :host([section="community"]) { grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); } /* this creates the numbering for feature*/ - :host([section="feature"]) { - counter-reset: feature-counter; - } :host([section="feature"]) site-feature-card { counter-increment: feature-counter; @@ -38,6 +42,7 @@ export const ContentPlacementContainerStyles = css` display: block; content: counter(feature-counter, decimal-leading-zero); font-size: var(--type-ramp-base-font-size); + margin-bottom: calc(var(--design-unit) * 2px); } :host([section="feature"]) site-feature-card:hover :first-child::before { @@ -48,20 +53,27 @@ export const ContentPlacementContainerStyles = css` /* This creates the color, background, and elevation changes on hover */ - :host([section="feature"]:hover) site-card-section, + :host([section="feature"]:hover), :host([section="community"]:hover) site-content-placement, :host([section="community"]:hover) site-content-placement ::part(content) { color: var(--neutral-foreground-hint); } + :host([section="feature"]:hover) site-feature-card { + filter: saturate(0); + } + :host([section="feature"]) site-feature-card:hover { color: var(--neutral-foreground-rest); + background: var(--neutral-fill-focus); + cursor: pointer; + filter: saturate(1); } :host([section="community"]) site-content-placement:hover { --elevation: 4; cursor: pointer; - background: var(--neutral-fill-active); + background: var(--neutral-fill-focus); border-radius: calc(var(--corner-radius) * 1px); color: currentColor; ${elevation} @@ -87,6 +99,19 @@ export const ContentPlacementContainerStyles = css` font-size: var(--type-ramp-plus-2-font-size); } + site-feature-card:not(:nth-of-type(4n)):hover + site-feature-card::before { + opacity: 0; + } + + @media screen and (max-width: 1330px) { + :host([section="feature"]) { + --flow: row; + } + site-feature-card:hover + site-feature-card::before { + opacity: 0; + } + } + @media screen and (max-width: 750px) { :host([section="community"]) { grid-template-columns: unset; @@ -105,8 +130,7 @@ export const ContentPlacementContainerStyles = css` } `.withBehaviors( accentForegroundRestBehavior, + neutralFillFocusBehavior, neutralForegroundHintBehavior, - neutralForegroundHoverBehavior, - neutralOutlineRestBehavior, - neutralFillActiveBehavior + neutralForegroundRestBehavior ); diff --git a/sites/fast-website/src/app/components/content-placement-container/content-placement-container.template.ts b/sites/fast-website/src/app/components/content-placement-container/content-placement-container.template.ts index ac1f0ca662a..d9ce87f4933 100644 --- a/sites/fast-website/src/app/components/content-placement-container/content-placement-container.template.ts +++ b/sites/fast-website/src/app/components/content-placement-container/content-placement-container.template.ts @@ -1,73 +1,9 @@ -import { html, repeat, when } from "@microsoft/fast-element"; +import { html, repeat } from "@microsoft/fast-element"; import { ContentPlacementContainer } from "./content-placement-container"; +import { SiteContentPlacement } from "../content-placement"; + +const template = html` ${(x, c) => c.parent.selectTemplate()} `; export const ContentPlacementContainerTemplate = html` - ${when( - x => x.section === "framework", - html` - ${repeat( - x => x.frameworkContentPlacementData, - html` - -

- ${x => (x.headerSubscript ? x.header + " " : x.header)} - ${x => x.headerSubscript} -

-

${x => x.body}

-
- ` - )} - ` - )} - ${when( - x => x.section === "feature", - html` - - ${repeat( - x => x.featureCardData, - html` - -

${x => x.header}

-

${x => x.body}

- x.githubLink} - appearance="lightweight" - >View Github - x.documentationLink} - appearance="lightweight" - >Read Documentation -
- ` - )} -
- ` - )} - ${when( - x => x.section === "community", - html` - ${repeat( - x => x.communityContentPlacementData, - html` - -
x.icon}>
-

${x => x.header}

-

${x => x.body}

- x.actionLink} - >${x => x.actionText} -
- ` - )} - ` - )} + ${repeat(x => x.selectData(), template)} `; diff --git a/sites/fast-website/src/app/components/content-placement-container/content-placement-container.ts b/sites/fast-website/src/app/components/content-placement-container/content-placement-container.ts index 765cad548e1..f1b4a407782 100644 --- a/sites/fast-website/src/app/components/content-placement-container/content-placement-container.ts +++ b/sites/fast-website/src/app/components/content-placement-container/content-placement-container.ts @@ -8,13 +8,36 @@ import { frameworkContentPlacementData, } from "../../data/framework.data"; import { FeatureCardData, featureCardData } from "../../data/feature.data"; +import frameworkTemplate from "./templates/framework.template"; +import featureTemplate from "./templates/feature.template"; +import communityTemplate from "./templates/community.template"; export class ContentPlacementContainer extends FASTElement { @attr section: string; - communityContentPlacementData: CommunityContentPlacementData[] = communityContentPlacementData.filter( + frameworkData: FrameworkContentPlacementData[] = frameworkContentPlacementData; + featureData: FeatureCardData[] = featureCardData; + communityData: CommunityContentPlacementData[] = communityContentPlacementData.filter( x => x.header !== "Medium" ); - frameworkContentPlacementData: FrameworkContentPlacementData[] = frameworkContentPlacementData; - featureCardData: FeatureCardData[] = featureCardData; + + dataByType = { + framework: this.frameworkData, + feature: this.featureData, + community: this.communityData, + }; + + templateByType = { + framework: frameworkTemplate, + feature: featureTemplate, + community: communityTemplate, + }; + + selectTemplate() { + return this.templateByType[this.section]; + } + + selectData() { + return this.dataByType[this.section]; + } } diff --git a/sites/fast-website/src/app/components/content-placement-container/templates/community.template.ts b/sites/fast-website/src/app/components/content-placement-container/templates/community.template.ts new file mode 100644 index 00000000000..fb7ffec7f2b --- /dev/null +++ b/sites/fast-website/src/app/components/content-placement-container/templates/community.template.ts @@ -0,0 +1,12 @@ +import { html } from "@microsoft/fast-element"; + +const communityTemplate = html` +
x.icon}>
+

${x => x.header}

+

${x => x.body}

+ x.actionLink} + >${x => x.actionText} +
`; + +export default communityTemplate; diff --git a/sites/fast-website/src/app/components/content-placement-container/templates/feature.template.ts b/sites/fast-website/src/app/components/content-placement-container/templates/feature.template.ts new file mode 100644 index 00000000000..b303c9918f0 --- /dev/null +++ b/sites/fast-website/src/app/components/content-placement-container/templates/feature.template.ts @@ -0,0 +1,14 @@ +import { html } from "@microsoft/fast-element"; + +const featureTemplate = html` +

${x => x.header}

+

${x => x.body}

+ x.githubLink} appearance="lightweight" + >View Github + x.documentationLink} appearance="lightweight" + >Read Documentation +
`; + +export default featureTemplate; diff --git a/sites/fast-website/src/app/components/content-placement-container/templates/framework.template.ts b/sites/fast-website/src/app/components/content-placement-container/templates/framework.template.ts new file mode 100644 index 00000000000..c2fc008976b --- /dev/null +++ b/sites/fast-website/src/app/components/content-placement-container/templates/framework.template.ts @@ -0,0 +1,11 @@ +import { html } from "@microsoft/fast-element"; + +const frameworkTemplate = html` +

+ ${x => (x.headerSubscript ? x.header + " " : x.header)} + ${x => x.headerSubscript} +

+

${x => x.body}

+
`; + +export default frameworkTemplate; diff --git a/sites/fast-website/src/app/components/feature-card/feature-card.styles.ts b/sites/fast-website/src/app/components/feature-card/feature-card.styles.ts index 42da335cfd0..838a8ce3891 100644 --- a/sites/fast-website/src/app/components/feature-card/feature-card.styles.ts +++ b/sites/fast-website/src/app/components/feature-card/feature-card.styles.ts @@ -11,6 +11,7 @@ export const FeatureCardStyles = css` color: inherit; box-sizing: border-box; padding: calc(var(--design-unit) * 5px); + border-radius: calc(var(--corner-radius) * 1px); box-shadow: unset; position: relative; }