-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add background image and preliminary effects (#3185)
* Update eslintrc rule * Add background-design component * Revert webpack dev settings * Compress background svg * Fix background container structure * Remove scrolling filter effect
- Loading branch information
1 parent
92f8737
commit b6bc671
Showing
9 changed files
with
171 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
sites/fast-website/src/app/components/background-design/background-design.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { css } from "@microsoft/fast-element"; | ||
import { display } from "@microsoft/fast-foundation"; | ||
import { neutralFillRestBehavior } from "@microsoft/fast-components"; | ||
|
||
export const BackgroundDesignStyles = css` | ||
${display("block")} :host { | ||
contain: content; | ||
height: 99vh; /* https://developers.google.com/web/updates/2016/12/url-bar-resizing */ | ||
isolation: isolate; | ||
position: fixed; | ||
z-index: 0; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
} | ||
:host .background-image { | ||
align-items: center; | ||
display: flex; | ||
height: 100%; | ||
justify-content: center; | ||
position: relative; | ||
width: 100%; | ||
} | ||
:host .background-image::after { | ||
background: var(--background-color); | ||
content: ""; | ||
display: block; | ||
height: 100%; | ||
left: 0; | ||
opacity: 0.45; | ||
position: absolute; | ||
top: 0; | ||
width: 100%; | ||
} | ||
:host .background-image svg { | ||
height: auto; | ||
min-width: 1440px; | ||
object-fit: cover; | ||
object-position: 50% 50%; | ||
width: 100%; | ||
} | ||
`.withBehaviors(neutralFillRestBehavior); |
11 changes: 11 additions & 0 deletions
11
sites/fast-website/src/app/components/background-design/background-design.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { html } from "@microsoft/fast-element"; | ||
import BackgroundImage from "svg/background.svg"; | ||
import { BackgroundDesign } from "./background-design"; | ||
|
||
export const BackgroundDesignTemplate = html<BackgroundDesign>` | ||
<template> | ||
<div class="background-image"> | ||
${BackgroundImage} | ||
</div> | ||
</template> | ||
`; |
3 changes: 3 additions & 0 deletions
3
sites/fast-website/src/app/components/background-design/background-design.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { FASTElement } from "@microsoft/fast-element"; | ||
|
||
export class BackgroundDesign extends FASTElement {} |
11 changes: 11 additions & 0 deletions
11
sites/fast-website/src/app/components/background-design/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { customElement } from "@microsoft/fast-element"; | ||
import { BackgroundDesign } from "./background-design"; | ||
import { BackgroundDesignTemplate as template } from "./background-design.template"; | ||
import { BackgroundDesignStyles as styles } from "./background-design.styles"; | ||
|
||
@customElement({ | ||
name: "background-design", | ||
styles, | ||
template, | ||
}) | ||
export class SiteBackgroundDesign extends BackgroundDesign {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
export { SiteBackgroundDesign } from "./background-design"; | ||
export { SiteCardSection } from "./card-section"; | ||
export { SiteColorSwatch } from "./color-swatch"; | ||
export { SiteSectionHeader } from "./section-header"; | ||
export { FastFrame } from "./fast-frame"; | ||
export { SiteNavigation } from "./navigation"; | ||
export { SiteContentPlacement } from "./content-placement"; | ||
export { SiteContentPlacementContainer } from "./content-placement-container"; | ||
export { FastFrame } from "./fast-frame"; | ||
export { SiteFeatureCard } from "./feature-card"; | ||
export { SiteCardSection } from "./card-section"; | ||
export { SiteNavigation } from "./navigation"; | ||
export { SiteSectionHeader } from "./section-header"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters