summaryrefslogtreecommitdiff
path: root/deps/npm/docs/src/components/home/Terminal.js
blob: 19d890cb980576bad8e91013edca8b237cd113c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import React from 'react'
import styled, {keyframes} from 'styled-components'
import {Flex, Box, Button as RebassButton} from 'rebass'
import closeX from '../../images/x.svg'
import {LinkButton} from '../Button'
import bracket from '../../images/bracket.svg'

const TerminalBody = styled(Flex)`
  background-color: ${(props) => props.theme.colors.purpleBlack};
  border: 2px solid ${(props) => props.theme.colors.purpleBlack};
  color: ${(props) => props.theme.colors.white};
  flex-direction: column;
  max-width: 620px;
  width: 100%;
  height: 100%;
  box-shadow: 0px 0px 17px 1px #dc3bc180;
  border-radius: 2px;
  top: ${(props) => props.top};
  left: ${(props) => props.left};  
  right: 0;
  position: absolute;
`

const Top = styled(Flex)`
  background-color: ${(props) => props.theme.colors.white};
  height: 18px;
`

const SiteName = styled(Flex)`
  font-size: 45px;
  font-family: 'Inconsolata', sans-serif;
  font-weight: 700;
  letter-spacing: 5px;
  text-shadow: 3px 2px 4px #abf1e04d;

  @media screen and (min-width: ${(props) => props.theme.breakpoints.TABLET}) {
    font-size: 70px;
  }
`

const Bottom = styled(Flex)`
  flex-direction: column;
  padding: 30px;

  @media screen and (min-width: ${(props) => props.theme.breakpoints.TABLET}) {
    font-size: 70px;
    padding: 30px 50px;

  }
`

const blink = keyframes`
  0% {
    opacity: 0;
  }
  50% {
    opacity 1;
  }
  100% {
    opacity: 0;
  }
`

const Cursor = styled.span`
  color: ${(props) => props.theme.colors.red};
  text-shadow: none;
  opacity: 1;
  animation: ${blink};
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
`

const Bracket = styled.span`
  background: center / contain no-repeat url(${bracket});
  width: 25px;
  margin-right: 5px;
  margin-top: 10px;
`

const Text = styled.span`
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.4;

  @media screen and (min-width: ${(props) => props.theme.breakpoints.TABLET}) {
    font-size: 18px;
  }
`

const ModalButton = styled(RebassButton)`
  cursor: pointer;
  background: center no-repeat  url(${closeX});
  width: 14px;
  height: 14px;
`

const Terminal = ({onClose, top, left}) => {
  return (
    <TerminalBody m={'auto'} top={top} left={left}>
      <Top alignItems='center'>
        <ModalButton onClick={onClose} ml={1} p={1} />
      </Top>
      <Bottom>
        <SiteName py={3}><Bracket />npm cli <Cursor>_</Cursor></SiteName>
        <Text>
          The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
        </Text>
        <Box mx={'auto'} my={4}>
          <LinkButton to='/cli-commands/npm'>
            read docs
          </LinkButton>
        </Box>
      </Bottom>
    </TerminalBody>
  )
}

export default Terminal