Skip to content

Commit 69566eb

Browse files
petemillNejcZdovcrossmoodyimptrx
authored
Welcome Page: Move from brave-ui to brave-core (#2896)
Welcome Page: Move from brave-ui to brave-core Co-authored-by: Nejc Zdovc <[email protected]> Co-authored-by: Ross Moody <[email protected]> Co-authored-by: Pete Miller <[email protected]> Co-authored-by: Peter Xu <[email protected]>
2 parents 56adfda + d95463f commit 69566eb

37 files changed

+1984
-25
lines changed

components/brave_welcome_ui/brave_welcome.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Theme from 'brave-ui/theme/brave-default'
1111
import { ThemeProvider } from 'brave-ui/theme'
1212

1313
// Components
14-
import App from './components/app'
14+
import App from './containers/app'
1515

1616
// Utils
1717
import store from './store'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License. v. 2.0. If a copy of the MPL was not distributed with this file.
3+
* You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
import { ComponentType } from 'react'
6+
import styled, { css } from 'brave-ui/theme'
7+
import Button, { Props as ButtonProps } from 'brave-ui/components/buttonsIndicators/button'
8+
9+
interface BaseButtonProps {
10+
active?: boolean
11+
}
12+
13+
const BaseButton = styled<BaseButtonProps, 'button'>('button')`
14+
box-sizing: border-box;
15+
padding: 0;
16+
margin: 0;
17+
display: block;
18+
line-height: 1;
19+
background: none;
20+
border: none;
21+
cursor: pointer;
22+
outline: inherit;
23+
`
24+
25+
export const FooterButton = styled(Button as ComponentType<ButtonProps>)`
26+
outline: none;
27+
border: 1px solid ${p => p.theme.palette.grey400};
28+
color: ${p => p.theme.color.text};
29+
30+
&:hover {
31+
opacity: .9;
32+
}
33+
34+
&:focus {
35+
box-shadow: 0 0 0 2px rgba(255,80,0,0.2);
36+
}
37+
`
38+
39+
export const SkipButton = styled(BaseButton)`
40+
color: ${p => p.theme.color.text};
41+
text-decoration: underline;
42+
font-weight: 300;
43+
letter-spacing: 0;
44+
45+
&:hover {
46+
opacity: .9;
47+
}
48+
`
49+
50+
export const PrimaryButton = styled(Button as ComponentType<ButtonProps>)`
51+
outline: none;
52+
53+
&:hover {
54+
opacity: .9;
55+
}
56+
57+
&:focus {
58+
box-shadow: 0 0 0 2px rgba(255,80,0,0.2);
59+
}
60+
`
61+
62+
export const Bullet = styled(BaseButton as ComponentType<any>)`
63+
padding: 0 7px;
64+
font-size: 36px;
65+
color: #7C7D8C;
66+
letter-spacing: 0;
67+
68+
&:hover {
69+
color: #343546;
70+
}
71+
72+
${p => p.active && css`
73+
color: #FB542B;
74+
75+
&:hover {
76+
color: #C72E03;
77+
}
78+
`}
79+
`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License. v. 2.0. If a copy of the MPL was not distributed with this file.
3+
* You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
import styled, { keyframes } from 'styled-components'
6+
7+
import LionImage from './lion_logo.svg'
8+
import ImportImage from './welcome_import.svg'
9+
import RewardsImage from './welcome_rewards.svg'
10+
import SearchImage from './welcome_search.svg'
11+
import ShieldsImage from './welcome_shields.svg'
12+
import ThemeImage from './welcome_theme.svg'
13+
import WelcomeImage from './welcome_bg.svg'
14+
15+
const BaseImage = styled<{}, 'img'>('img')`
16+
box-sizing: border-box;
17+
display: block;
18+
max-width: 100%;
19+
`
20+
21+
export const WelcomeLionImage = styled(BaseImage).attrs({ src: LionImage })`
22+
height: 140px;
23+
`
24+
25+
export const WelcomeImportImage = styled(BaseImage).attrs({ src: ImportImage })`
26+
height: 190px;
27+
`
28+
29+
export const WelcomeRewardsImage = styled(BaseImage).attrs({ src: RewardsImage })`
30+
height: 190px;
31+
`
32+
33+
export const WelcomeSearchImage = styled(BaseImage).attrs({ src: SearchImage })`
34+
height: 190px;
35+
`
36+
37+
export const WelcomeShieldsImage = styled(BaseImage).attrs({ src: ShieldsImage })`
38+
height: 190px;
39+
`
40+
41+
export const WelcomeThemeImage = styled(BaseImage).attrs({ src: ThemeImage })`
42+
height: 190px;
43+
`
44+
45+
interface BackgroundProps {
46+
position: string
47+
}
48+
49+
export const topToBottom = keyframes`
50+
from {
51+
transform: translateY(-100%);
52+
}
53+
54+
to {
55+
transform: translateY(0);
56+
}
57+
`
58+
59+
export const BackgroundContainer = styled<{}, 'div'>('div')`
60+
box-sizing: border-box;
61+
width: inherit;
62+
height: inherit;
63+
position: absolute;
64+
animation-delay: 0s;
65+
animation-name: ${topToBottom};
66+
animation-duration: 2000ms;
67+
animation-timing-function: ease-in-out;
68+
animation-fill-mode: forwards;
69+
animation-iteration-count: 1;
70+
overflow: hidden;
71+
`
72+
73+
export const Background = styled<BackgroundProps, 'div'>('div')`
74+
box-sizing: border-box;
75+
background: url('${WelcomeImage}') repeat-x;
76+
width: 500%;
77+
height: inherit;
78+
will-change: transform;
79+
transform: translateX(${p => p.position});
80+
transition: transform ease-in-out 1200ms;
81+
`
Loading
Loading

0 commit comments

Comments
 (0)