Skip to content

Commit

Permalink
add Billboard component
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei committed Jul 14, 2020
1 parent 5ba5d79 commit 314c94f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/components/Billboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';
import LinearGradient from 'react-native-linear-gradient';
import styled from 'styled-components';

import { THEME } from '../utils/theme';
import { Text } from 'react-native';

const Billboard = ({ name, blend }) => (
<>
<StyledText hue={340} len={name.length}>
{name}
</StyledText>

<LinearGradient {...GRADIENT} colors={['transparent', THEME[blend].bg]} />
</>
);

const GRADIENT = {
locations: [0.0, 1.0],
end: { x: 0.0, y: 1.0 },
start: { x: 0.0, y: 0.0 },
style: { height: 130, top: 5 },
useViewFrame: false,
};

const StyledText = styled(Text)`
left: ${({ len }) => (len % len ? '20' : '-10')}%;
opacity: 0.3;
text-transform: uppercase;
position: absolute;
font-weight: 700;
font-size: 110px;
width: 1000px;
color: white;
`;

export default Billboard;

0 comments on commit 314c94f

Please sign in to comment.