Skip to content

Commit f772a5d

Browse files
committed
Add LESS
1 parent e832ebd commit f772a5d

File tree

11 files changed

+352
-302
lines changed

11 files changed

+352
-302
lines changed

public/index.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@
1010
<link rel="preconnect" href="https://fonts.googleapis.com" />
1111
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1212

13-
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap"
14-
rel="stylesheet" />
15-
16-
<link rel="stylesheet" href="./src/css/normalize.min.css" />
17-
<link rel="stylesheet" href="./src/css/sweetalert2.dark.min.css" />
18-
<link rel="stylesheet" href="./src/css/app.css" />
19-
20-
<script src="https://kit.fontawesome.com/7b4d67b6f2.js"></script>
13+
<link rel="stylesheet" href="./src/styles/normalize.min.css" />
14+
<link rel="stylesheet/less" type="text/css" href="./src/styles/styles.less" />
15+
<script src="./src/javascript/less.js"></script>
2116

2217
</head>
2318

@@ -27,8 +22,8 @@
2722
<h2>JavaScript ChatBot</h2>
2823
<p class="typing">bot is typing. . .</p>
2924
</div>
30-
<div onclick="toogleShowQuestions()">
31-
<img src="./src/images/chat_icon.png" alt="" srcset="">
25+
<div id="toogle-chat" >
26+
<img src="./src/images/chat_icon.png" class="suggest-chat" >
3227
</div>
3328
</header>
3429

@@ -43,6 +38,8 @@ <h3>JavaScript ChatBot</h3>
4338
</div>
4439

4540
<section class="all-questions">
41+
<h2>Suggested Chats</h2>
42+
<div class="questions container"></div>
4643
</section>
4744

4845
<footer>
@@ -58,9 +55,7 @@ <h3>JavaScript ChatBot</h3>
5855
</footer>
5956

6057
<script src="./src/javascript/jquery.min.js"></script>
61-
<script src="./src/javascript/sweetalert2.min.js"></script>
6258
<script src="./src/javascript/typed.min.js"></script>
63-
<script src="./src/javascript/notyf.min.js"></script>
6459
<script src="./src/javascript/app.js"></script>
6560
</body>
6661

public/src/css/app.css

Lines changed: 0 additions & 280 deletions
This file was deleted.

public/src/css/notyf.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/src/css/sweetalert2.dark.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/src/javascript/app.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-unused-vars */
12
// submit form
23
const submitForm = () => {
34
const chatInput = $(".chat-input").val();
@@ -46,8 +47,6 @@ window.onload = () => {
4647
if (document.querySelectorAll(".chat-msg-box").length == 0) {
4748
$.ajax({
4849
url: "./api/welcome",
49-
method: "GET",
50-
cache: false,
5150
beforeSend: () => {
5251
$(".typing").show();
5352
$("main").append(`
@@ -78,10 +77,10 @@ window.onload = () => {
7877
}, 3000);
7978

8079
$.ajax({
81-
url: "./api/allquestions",
80+
url: "http://javascript-chatbot.vercel.app/api/allquestions",
8281
success: (data) => {
8382
data.forEach((qus) => {
84-
$("section.all-questions").append(`
83+
$(".questions.container").append(`
8584
<div class="question">
8685
<p>${qus}</p>
8786
</div>
@@ -101,18 +100,22 @@ window.onresize = () => {
101100

102101
const toogleShowQuestions = () => {
103102
if ($("main").css("display") == "none") {
104-
$("section.all-questions").hide();
103+
$(".questions.container").hide();
105104
$("header img").attr("src", "./src/images/chat_icon.png");
106105
$("main").show();
107106
$("footer").show();
108107
} else {
109-
$("section.all-questions").css("display", "flex");
108+
$(".questions.container").css("display", "flex");
110109
$("header img").attr("src", "./src/images/close.png");
111110
$("main").hide();
112111
$("footer").hide();
113112
}
114113
};
115114

115+
$("#toogle-chat").on("click", () => {
116+
toogleShowQuestions();
117+
});
118+
116119
$("#chat-form").submit((e) => {
117120
e.preventDefault();
118121
submitForm();

public/src/javascript/less.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)