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

feat: adds density slider to marketing site #3166

Merged
merged 2 commits into from
May 20, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const FastFrameStyles = css`
.wrapper {
display: grid;
grid-template-columns: 500px 1fr;
height: 500px;
min-height: 500px;
}

.content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export const FastFrameTemplate = html<FastFrame>`
<template>
<div class="wrapper">
<fast-tabs orientation="vertical" id="myTab" activeId="TabTwo">
<fast-tab id="TabOne" title="Mode">${ContrastIcon}</fast-tab>
<fast-tab id="TabTwo" title="Color">${PaletteIcon}</fast-tab>
<fast-tab id="TabThree" title="Styles">${SwatchesIcon}</fast-tab>
<fast-tab id="TabFour" title="Density">${ScreenIcon}</fast-tab>
<fast-tab-panel id="TabPanelOne">
<fast-tab id="contrast-tab" title="Mode">${ContrastIcon}</fast-tab>
<fast-tab id="palette-tab" title="Color">${PaletteIcon}</fast-tab>
<fast-tab id="swatches-tab" title="Styles">${SwatchesIcon}</fast-tab>
<fast-tab id="density-tab" title="Density">${ScreenIcon}</fast-tab>
<fast-tab-panel id="contrast-tab-panel">
<fast-switch
checked="${x => x.darkMode}"
@change="${(x, c) => x.themeChange(c.event as MouseEvent)}"
>
Dark Mode
</fast-switch>
</fast-tab-panel>
<fast-tab-panel id="TabPanelTwo">
<fast-tab-panel id="palette-tab-panel">
<div class="content">
<h1>FAST FRAME COLORS</h1>
<h2>Pre-existing color you can customize.</h2>
Expand Down Expand Up @@ -75,11 +75,23 @@ export const FastFrameTemplate = html<FastFrame>`
</fast-radio-group>
</div>
</fast-tab-panel>
<fast-tab-panel id="TabPanelThree">
<fast-tab-panel id="swatches-tab-panel">
Tab three content. This is for testing.
</fast-tab-panel>
<fast-tab-panel id="TabPanelFour">
Tab four content. This is for testing.
<fast-tab-panel id="density-tab-panel">
<div class="content">
<label for="density-slider">Density</label>
<fast-slider
id="density-slider"
min="0"
max="3"
step="1"
value="0"
@change="${(x, c) =>
x.densityChangeHandler(c.event as MouseEvent)}"
>
</fast-slider>
</div>
</fast-tab-panel>
</fast-tabs>
<fast-design-system-provider
Expand All @@ -90,6 +102,7 @@ export const FastFrameTemplate = html<FastFrame>`
: StandardLuminance.LightMode}"
background-color="${x => x.backgroundColor}"
accent-base-color="${x => x.accentColor}"
density="${x => x.density}"
:accentPalette=${x => x.accentPalette}
>
<fast-card>
Expand Down Expand Up @@ -150,11 +163,11 @@ export const FastFrameTemplate = html<FastFrame>`
<div class="control-container">
<fast-button appearance="accent">
Button
<span slot="end">${DownloadIcon}</span>
<span slot="start">${DownloadIcon}</span>
</fast-button>
<fast-button appearance="neutral">
Button
<span slot="end">${PlayIcon}</span>
<span slot="start">${PlayIcon}</span>
</fast-button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export class FastFrame extends FASTElement {
@observable
public accentPalette: string[];

@observable
public density: number = 0;

public accentChangeHandler = (e: any): void => {
const element: HTMLInputElement = e.target;
if (element.checked) {
Expand All @@ -57,6 +60,10 @@ export class FastFrame extends FASTElement {
}
};

public densityChangeHandler = (e: any): void => {
this.density = e.target.value;
};

public themeChange = (e: any): void => {
this.darkMode = !this.darkMode;
if (!this.darkMode) {
Expand Down