sdy

create FE main

1 +/* import fonts */
2 +@import url('https://fonts.googleapis.com/css?family=Red+Hat+Display:400,500,900&display=swap');
3 +
4 +/* variables */
5 +:root {
6 + --text-1: #333;
7 + --text-2: #666;
8 + --text-3: #999;
9 + --line: #CCC;
10 + --time-bg: #EEE;
11 + --background: #F7F7F7;
12 + --link: #3c90ff;
13 +}
14 +
15 +body, html {
16 + font-family: "Red hat Display", sans-serif;
17 + font-weight: 400;
18 + line-height: 1.25em;
19 + letter-spacing: 0.025em;
20 + color: var(--text-1);
21 + background: var(--background);
22 +}
23 +
24 +/* contents background */
25 +.container {
26 + position: absolute;
27 + top: 50%;
28 + left: calc(40% + 12rem);
29 + transform: translate(-50%, -50%);
30 +}
31 +
32 +/* picture */
33 +.pic {
34 + width: 3rem;
35 + height: 3rem;
36 + background-size: cover;
37 + background-position: center;
38 + border-radius: 50%;
39 + margin-right: 1rem;
40 +}
41 +
42 +.pic.menu-icon {
43 + background-image: url("./img/menu-icon.svg");
44 +}
45 +
46 +.pic.bot {
47 + width: 4rem;
48 + height: 4rem;
49 + background-image: url("./img/chatbot.svg");
50 +}
51 +
52 +.pic.call {
53 + background-image: url("./img/phone-call.svg");
54 +}
55 +
56 +.pic.mask {
57 + background-image: url("./img/mask.svg");
58 +}
59 +
60 +.pic.bar {
61 + background-image: url("./img/bars.svg");
62 +}
63 +
64 +.pic.vaccine {
65 + background-image: url("./img/injection.svg");
66 +}
67 +
68 +/* quick menu box */
69 +.menu-box {
70 + position: absolute;
71 + top: 50%;
72 + left: 0;
73 + transform: translate(-6rem, -50%);
74 +
75 + width: 24rem;
76 + height: 32rem;
77 + padding: 1rem 2rem 1rem 1rem;
78 + box-sizing: border-box;
79 + border-radius: 1rem 0 0 1rem;
80 +
81 + cursor: pointer;
82 + background-color: white;
83 + box-shadow: 0 0 8rem 0 rgba(0, 0, 0, 0.1), 2rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5);
84 +
85 + transition: transform 500ms;
86 +}
87 +
88 +.menu-box:hover{
89 + transform: translate(-23rem, -50%);
90 +}
91 +
92 +/* quick menu header */
93 +.menu-header {
94 + display: flex;
95 + flex-direction: row;
96 + align-items: center;
97 +}
98 +
99 +/* quick menu item */
100 +.menu-item {
101 + position: relative;
102 + margin-bottom: 1rem;
103 + padding-left: 5rem;
104 + height: 4.5rem;
105 +
106 + display: flex;
107 + flex-direction: column;
108 + justify-content: center;
109 +}
110 +
111 +.menu-item .pic {
112 + position: absolute;
113 + left: 0;
114 +}
115 +
116 +.menu-item a {
117 + font-weight: 500;
118 + margin-bottom: 0.125rem;
119 + color: var(--link);
120 +}
121 +
122 +/* chats */
123 +.chat {
124 + position: relative;
125 +
126 + display: flex;
127 + flex-direction: column;
128 + justify-content: space-between;
129 +
130 + width: 24rem;
131 + height: 38rem;
132 + z-index: 2;
133 + box-sizing: border-box;
134 + border-radius: 1rem;
135 +
136 + background-color: white;
137 + box-shadow: 0 0 8rem 0 rgba(0, 0, 0, 0.1), 0 2rem 4rem -3rem rgba(0, 0, 0, 0.5);
138 +}
139 +
140 +.chat-header {
141 + flex-basis: 3.5rem;
142 + flex-shrink: 0;
143 + margin: 1rem;
144 + box-sizing: border-box;
145 +
146 + display: flex;
147 + flex-direction: row;
148 + align-items: center;
149 +}
150 +
151 +.historyContainer {
152 + height: 100%;
153 + padding: 1rem;
154 + background: var(--background);
155 + flex-shrink: 2;
156 + overflow-y: auto;
157 +
158 + box-shadow: inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05);
159 +}
160 +
161 +.historyContainer .msg {
162 + box-sizing: border-box;
163 + padding: 0.5rem 1rem;
164 + margin: 1rem;
165 + background: #FFF;
166 + border-radius: 1.125rem 1.125rem 1.125rem 0;
167 + min-height: 2.25rem;
168 + width: fit-content;
169 + max-width: 66%;
170 +
171 + box-shadow: 0 0 2rem rgba(0, 0, 0, 0.075), 0 1rem 1rem -1rem rgba(0, 0, 0, 0.1);
172 +}
173 +
174 +.historyContainer .msg.user {
175 + margin: 1rem 1rem 1rem auto;
176 + border-radius: 1.125rem 1.125rem 0 1.125rem;
177 + background: var(--text-1);
178 + color: white;
179 +}
180 +
181 +.historyContainer .msg.label {
182 + color: var(--link);
183 +}
184 +
185 +.historyContainer .bot-image-box .bot-image {
186 +
187 +}
188 +
189 +/* input tag */
190 +.chat .input {
191 + box-sizing: border-box;
192 + flex-basis: 4rem;
193 + flex-shrink: 0;
194 + display: flex;
195 + align-items: center;
196 + padding: 0 0.5rem 0 1.5rem;
197 +}
198 +
199 +.chat .input input {
200 + border: none;
201 + background-image: none;
202 + background-color: white;
203 + padding: 0.5rem 1rem;
204 + margin-right: 1rem;
205 + border-radius: 1.125rem;
206 + flex-grow: 2;
207 + box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1), 0 1rem 1rem -1rem rgba(0, 0, 0, 0.2);
208 +
209 + font-family: "Red hat Display", sans-serif;
210 + font-weight: 400;
211 + letter-spacing: 0.025em;
212 +}
213 +
214 +.chat .input input::placeholder {
215 + color: var(--text-3);
216 +}
1 +import React from "react";
2 +import "./App.css";
3 +
4 +import { Provider } from "react-redux";
5 +import store from "./store";
6 +
7 +import Chat from "./components/chat/Chat";
8 +import Menu from "./components/menu/Menu";
9 +
10 +const App = () => {
11 + return (
12 + <Provider store={store}>
13 + <div className="container">
14 + <Chat />
15 + <Menu />
16 + </div>
17 + </Provider>
18 + );
19 +};
20 +
21 +export default App;
1 +import React from "react";
2 +import ReactDOM from "react-dom";
3 +import App from "./App";
4 +
5 +ReactDOM.render(
6 + <React.StrictMode>
7 + <App />
8 + </React.StrictMode>,
9 + document.getElementById("root")
10 +);