-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app-board): add scenario panel and text logo
- Loading branch information
Showing
24 changed files
with
405 additions
and
38 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
49 changes: 49 additions & 0 deletions
49
packages/game-app/src/_shared/components/ExpandableTopPanel/ExpandableTopPanel.styled.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,49 @@ | ||
import styled, { css } from 'styled-components'; | ||
|
||
export const PanelHeader = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 40px; | ||
position: relative; | ||
`; | ||
|
||
export const PanelWrapper = styled.div` | ||
width: 400px; | ||
background: rgba(255, 255, 255, 0.5); | ||
border-radius: 4px; | ||
backdrop-filter: blur(20px); | ||
cursor: pointer; | ||
`; | ||
|
||
export const PanelContentWrapper = styled.div<{ collapsed: boolean }>` | ||
transition: all 0.5s ease-out; | ||
box-sizing: border-box; | ||
overflow: hidden; | ||
${({ collapsed }) => | ||
collapsed | ||
? css` | ||
max-height: 0 !important; | ||
` | ||
: css` | ||
max-height: 500px; | ||
transition: max-height 0.5s ease-in; | ||
`} | ||
`; | ||
|
||
export const PanelContent = styled.div<{ collapsed: boolean }>` | ||
padding: 14px 24px 24px 24px; | ||
`; | ||
|
||
export const ExpandIcon = styled.div<{ collapsed: boolean }>` | ||
position: absolute; | ||
right: 24px; | ||
transition: transform 0.3s ease-in; | ||
${({ collapsed }) => | ||
!collapsed && | ||
css` | ||
transform: rotate(180deg); | ||
`} | ||
`; |
38 changes: 38 additions & 0 deletions
38
packages/game-app/src/_shared/components/ExpandableTopPanel/ExpandableTopPanel.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,38 @@ | ||
import React, { useState } from 'react'; | ||
import { ExpandIcon, PanelContent, PanelContentWrapper, PanelHeader, PanelWrapper } from './ExpandableTopPanel.styled'; | ||
|
||
type Props = { | ||
className?: string; | ||
/** | ||
* Label to show in the header of the collapsible panel | ||
*/ | ||
label: string; | ||
/** | ||
* Content placed into the space that appears when the panel in expanded | ||
*/ | ||
children: React.ReactNode; | ||
}; | ||
|
||
/** | ||
* Animated expandable panel that shows the header always on top. | ||
* and expands itself in the top direction | ||
*/ | ||
const ExpandableTopPanel: React.FC<Props> = ({ className, label, children }) => { | ||
const [collapsed, setCollapsed] = useState(true); | ||
|
||
return ( | ||
<PanelWrapper className={className} onClick={() => setCollapsed(c => !c)}> | ||
<PanelHeader> | ||
{label} | ||
<ExpandIcon collapsed={collapsed}>^</ExpandIcon> | ||
</PanelHeader> | ||
<PanelContentWrapper collapsed={collapsed}> | ||
<PanelContent collapsed={collapsed}>{children}</PanelContent> | ||
</PanelContentWrapper> | ||
</PanelWrapper> | ||
); | ||
}; | ||
|
||
ExpandableTopPanel.displayName = 'ExpandableTopPanel'; | ||
|
||
export default ExpandableTopPanel; |
3 changes: 3 additions & 0 deletions
3
packages/game-app/src/_shared/components/ExpandableTopPanel/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,3 @@ | ||
import ExpandableTopPanel from './ExpandableTopPanel'; | ||
|
||
export default ExpandableTopPanel; |
22 changes: 20 additions & 2 deletions
22
packages/game-app/src/_shared/components/Typography/Typography.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
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,24 @@ | ||
import { css, keyframes } from 'styled-components'; | ||
|
||
const shakeDefinition = keyframes` | ||
0% { | ||
transform: translate(0); | ||
} | ||
25%{ | ||
transform: translate(15px); | ||
} | ||
50%{ | ||
transform: translate(0px); | ||
} | ||
75%{ | ||
transform: translate(15px); | ||
} | ||
100% { | ||
transform: translate(0); | ||
} | ||
`; | ||
|
||
export const shake = () => | ||
css` | ||
animation: ${shakeDefinition} linear 0.3s 2; | ||
`; |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
packages/game-app/src/gameView/components/BottomWidgetsRow/BottomWidgetsRow.styled.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,22 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const BottomWidgetsRowContainer = styled.div` | ||
position: absolute; | ||
left: 40px; | ||
bottom: 40px; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-end; | ||
`; | ||
|
||
export const PoweredByContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
margin-left: 50px; | ||
`; | ||
|
||
export const TextLogoWrapper = styled.div` | ||
margin-left: 8px; | ||
width: 50px; | ||
`; |
27 changes: 27 additions & 0 deletions
27
packages/game-app/src/gameView/components/BottomWidgetsRow/BottomWidgetsRow.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,27 @@ | ||
import React from 'react'; | ||
import { BottomWidgetsRowContainer, PoweredByContainer, TextLogoWrapper } from './BottomWidgetsRow.styled'; | ||
import ScenarioPanel from '../ScenarioPanel'; | ||
import { ReactComponent as EficodeTextLogo } from '@assets/images/eficode-text-logo.svg'; | ||
import { Typography } from '@pipeline/components'; | ||
|
||
type Props = {}; | ||
|
||
const BottomWidgetsRowStyled: React.FC<Props> = ({}) => { | ||
return ( | ||
<BottomWidgetsRowContainer> | ||
<ScenarioPanel /> | ||
<PoweredByContainer> | ||
<Typography variant="label" color="#9F998F" as="span"> | ||
Powered By | ||
</Typography> | ||
<TextLogoWrapper> | ||
<EficodeTextLogo /> | ||
</TextLogoWrapper> | ||
</PoweredByContainer> | ||
</BottomWidgetsRowContainer> | ||
); | ||
}; | ||
|
||
BottomWidgetsRowStyled.displayName = 'BottomWidgetsRow'; | ||
|
||
export default BottomWidgetsRowStyled; |
3 changes: 3 additions & 0 deletions
3
packages/game-app/src/gameView/components/BottomWidgetsRow/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,3 @@ | ||
import BottomWidgetsRow from './BottomWidgetsRow'; | ||
|
||
export default BottomWidgetsRow; |
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
Oops, something went wrong.