-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big Sky GF: Update design choice screen according to design (#99139)
* add images * create goals first variation of the design choice
- Loading branch information
Showing
7 changed files
with
188 additions
and
9 deletions.
There are no files selected for viewing
Binary file added
BIN
+7.73 KB
...epper/declarative-flow/internals/steps-repository/design-choices/big-sky-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31 KB
...epper/declarative-flow/internals/steps-repository/design-choices/big-sky-fg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions
79
...declarative-flow/internals/steps-repository/design-choices/goals-first-design-choice.scss
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,79 @@ | ||
@import '@automattic/typography/styles/fonts'; | ||
|
||
.goals-first-design-choice { | ||
position: relative; | ||
width: 380px; | ||
padding: 24px; | ||
border-radius: 4px; | ||
outline: var( --studio-gray-5 ) solid 1px; | ||
transition: outline ease-in 0.15s; | ||
height: 100%; | ||
cursor: pointer; | ||
|
||
.goals-first-design-choice__background { | ||
position: relative; | ||
margin-bottom: 16px; | ||
background-color: var( --studio-gray-5 ); | ||
} | ||
|
||
.goals-first-design-choice__background-item { | ||
position: relative; | ||
width: 100%; | ||
aspect-ratio: 4 / 3; | ||
overflow: hidden; | ||
|
||
img { | ||
width: 100%; | ||
height: 100%; | ||
display: block; | ||
object-fit: cover; | ||
} | ||
|
||
.goals-first-design-choice__foreground-image { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
transition: transform 0.15s ease-in-out; | ||
} | ||
} | ||
|
||
.goals-first-design-choice__title { | ||
margin-bottom: 4px; | ||
color: var( --studio-gray-90 ); | ||
font-size: $font-body; | ||
font-weight: 500; | ||
line-height: 24px; | ||
text-align: left; | ||
} | ||
|
||
.goals-first-design-choice__description { | ||
color: var( --studio-gray-50 ); | ||
font-size: $font-body-small; | ||
font-weight: 400; | ||
line-height: 20px; | ||
text-align: start; | ||
} | ||
|
||
.badge--info-blue { | ||
background-color: var( --wp-components-color-accent, var( --wp-admin-theme-color ) ); | ||
color: var( --wp-components-color-accent-inverted, #fff ); | ||
} | ||
|
||
.goals-first-design-choice__price-badge { | ||
position: absolute; | ||
top: -0.5em; | ||
right: -0.5em; | ||
z-index: 2; | ||
} | ||
|
||
&:hover, | ||
&:focus-visible { | ||
outline: #3858e9 solid 2px; | ||
|
||
.goals-first-design-choice__foreground-image { | ||
transform: scale( 1.05 ); | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
.../declarative-flow/internals/steps-repository/design-choices/goals-first-design-choice.tsx
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,60 @@ | ||
import { Badge } from '@automattic/components'; | ||
import clsx from 'clsx'; | ||
import { preventWidows } from 'calypso/lib/formatting'; | ||
import './goals-first-design-choice.scss'; | ||
|
||
interface Props { | ||
className?: string; | ||
title: string; | ||
description: string; | ||
bgImageSrc?: string; | ||
fgImageSrc?: string; | ||
destination: string; | ||
onSelect: ( destination: string ) => void; | ||
badgeLabel?: React.ReactElement | string | number; | ||
} | ||
|
||
const GoalsFirstDesignChoice = ( { | ||
className, | ||
title, | ||
description, | ||
bgImageSrc, | ||
fgImageSrc, | ||
destination, | ||
onSelect, | ||
badgeLabel, | ||
}: Props ) => ( | ||
<button | ||
className={ clsx( 'goals-first-design-choice', className ) } | ||
aria-label={ title } | ||
onClick={ () => onSelect( destination ) } | ||
> | ||
<div className="goals-first-design-choice__content"> | ||
<div className="goals-first-design-choice__background"> | ||
{ badgeLabel && ( | ||
<Badge type="info-blue" className="goals-first-design-choice__price-badge"> | ||
{ badgeLabel } | ||
</Badge> | ||
) } | ||
<div className="goals-first-design-choice__background-item"> | ||
{ bgImageSrc && <img src={ bgImageSrc } alt={ title } /> } | ||
{ fgImageSrc && ( | ||
<img | ||
className="goals-first-design-choice__foreground-image" | ||
src={ fgImageSrc } | ||
alt={ title } | ||
/> | ||
) } | ||
</div> | ||
</div> | ||
<div className="goals-first-design-choice__foreground"> | ||
<div className="goals-first-design-choice__title">{ title }</div> | ||
<div className="goals-first-design-choice__description"> | ||
{ preventWidows( description ) } | ||
</div> | ||
</div> | ||
</div> | ||
</button> | ||
); | ||
|
||
export default GoalsFirstDesignChoice; |
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
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
Binary file added
BIN
+53.8 KB
.../declarative-flow/internals/steps-repository/design-choices/theme-choice-fg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.