Skip to content

Commit e832ebd

Browse files
committed
add responsiveness
1 parent fab5c48 commit e832ebd

File tree

8 files changed

+29
-20
lines changed

8 files changed

+29
-20
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coming soon ...

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ const sendAnswer = async (req, res) => {
198198
isFallback = true;
199199
} else if (action != "wikipedia") {
200200
responseText = responseText
201-
.replace(/(\[NAME\])/g, developerName)
202-
.replace(/(\[EMAIL\])/g, developerEmail)
201+
.replace(/(\[DEVELOPER_NAME\])/g, developerName)
202+
.replace(/(\[DEVELOPER_EMAIL\])/g, developerEmail)
203203
.replace(/(\[BUG_URL\])/g, bugReportUrl);
204204
}
205205

@@ -243,6 +243,5 @@ app.get("/api/welcome", sendWelcomeMessage);
243243
app.get("/api/allQuestions", sendAllQuestions);
244244
app.use(serveStatic(path.join(__dirname, "public")));
245245
app.get("*", notFound);
246-
app.get("");
247246

248247
app.listen(port, () => console.log(`app listening on port ${port}!`));

intents/support.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
"I want to contact your developers by email",
1919
"your developers email"
2020
],
21-
"answers": [
22-
"My developer email is [EMAIL]."
23-
]
21+
"answers": ["My developer email is [DEVELOPER_EMAIL]."]
2422
},
2523
{
2624
"questions": [
@@ -58,7 +56,7 @@
5856
"who is your developer",
5957
"I said who made you tell me"
6058
],
61-
"answers": []
59+
"answers": ["I am developed by [DEVELOPER_EMAIL]"]
6260
},
6361
{
6462
"questions": [
@@ -79,8 +77,6 @@
7977
"I need to report a bug that I've found in you",
8078
"send problem to developers"
8179
],
82-
"answers": [
83-
"You can report your bug here."
84-
]
80+
"answers": ["You can report your bug at [BUG_URL]."]
8581
}
8682
]

public/index.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
88
<title>JavaScript ChatBot</title>
99

10-
<link rel="apple-touch-icon" sizes="180x180" href="./assets/apple-touch-icon.png" />
11-
<link rel="icon" type="image/png" sizes="32x32" href="./assets/favicon-32x32.png" />
12-
<link rel="icon" type="image/png" sizes="16x16" href="./assets/favicon-16x16.png" />
13-
<link rel="manifest" href="./site.webmanifest" />
14-
1510
<link rel="preconnect" href="https://fonts.googleapis.com" />
1611
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1712

1813
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap"
1914
rel="stylesheet" />
20-
<link
21-
href="https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,100;0,200;0,300;0,400;0,500;1,100;1,200;1,300;1,400&display=swap"
22-
rel="stylesheet" />
2315

2416
<link rel="stylesheet" href="./src/css/normalize.min.css" />
2517
<link rel="stylesheet" href="./src/css/sweetalert2.dark.min.css" />
@@ -36,7 +28,7 @@ <h2>JavaScript ChatBot</h2>
3628
<p class="typing">bot is typing. . .</p>
3729
</div>
3830
<div onclick="toogleShowQuestions()">
39-
<div class="status"></div>
31+
<img src="./src/images/chat_icon.png" alt="" srcset="">
4032
</div>
4133
</header>
4234

public/src/css/app.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ header {
3434
box-shadow: #000 2px 0px 4px;
3535
justify-content: space-around;
3636
transition: all 1s;
37+
font-family: "Comfortaa", cursive;
38+
}
39+
40+
header h2 {
41+
font-size: 1.35em;
3742
}
3843

3944
.typing {
@@ -42,6 +47,10 @@ header {
4247
display: none;
4348
}
4449

50+
body > header > div:nth-child(2) > img {
51+
width: 2em;
52+
}
53+
4554
.status {
4655
width: 0.6em;
4756
height: 0.6em;
@@ -127,6 +136,7 @@ section.all-questions .question:nth-child(1) {
127136
border-radius: 0.4em;
128137
box-shadow: #000 2px 2px 6px;
129138
font-size: 14px;
139+
background: linear-gradient(223deg, #616161, #454545);
130140
}
131141

132142
.question p::selection {
@@ -141,7 +151,7 @@ footer {
141151
position: fixed;
142152
bottom: 0;
143153
width: 100vw;
144-
height: 3.5em;
154+
height: 3em;
145155
display: flex;
146156
align-items: center;
147157
box-shadow: #000 -2px 0px 4px 1px;
@@ -223,6 +233,15 @@ footer {
223233
}
224234
}
225235

236+
@media screen and (max-width: 680px) {
237+
div p{
238+
font-size: 14px;
239+
}
240+
.chat-input{
241+
font-size: 14px;
242+
}
243+
}
244+
226245
@-webkit-keyframes sk-bouncedelay {
227246
0%,
228247
80%,

public/src/images/chat_icon.png

592 Bytes
Loading

public/src/images/close.png

752 Bytes
Loading

public/src/javascript/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ window.onresize = () => {
102102
const toogleShowQuestions = () => {
103103
if ($("main").css("display") == "none") {
104104
$("section.all-questions").hide();
105+
$("header img").attr("src", "./src/images/chat_icon.png");
105106
$("main").show();
106107
$("footer").show();
107108
} else {
108109
$("section.all-questions").css("display", "flex");
110+
$("header img").attr("src", "./src/images/close.png");
109111
$("main").hide();
110112
$("footer").hide();
111113
}

0 commit comments

Comments
 (0)