Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARNOLD THERIGAN #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
626 changes: 625 additions & 1 deletion README.md

Large diffs are not rendered by default.

Binary file added client/assets/bgmain.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/assets/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/assets/text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
455 changes: 455 additions & 0 deletions client/index.html

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions client/main/chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
function sendChat(event) {
event.preventDefault()
let chat_txt = $('#msg').val()
$('.chat-history').append(`
<div class="chat-message clearfix">
<img src="https://api.adorable.io/avatars/300/${localStorage.getItem('name')}" width="32" height="32">

<div class="chat-message-content clearfix">


<h5>${localStorage.getItem('name')}</h5>

<p>${$('#msg').val()}</p>

</div> <!-- end chat-message-content -->

</div> <!-- end chat-message -->

<hr>
`)
$('#msg').val('')
$(".chat-history").animate({ scrollTop: $(".chat-history")[0].scrollHeight})

$.ajax({
url: baseUrl + '/chat',
method: 'POST',
data: {
text: chat_txt
}
})
.done(data => {
$('.chat-history').append(`
<div class="chat-message clearfix">
<img src="https://rebot.me/assets/images/mini-avatars/159.png?r=1485965356" width="32" height="32">

<div class="chat-message-content clearfix">

<h5>Simi-Simi</h5>

<p>${data.atext}</p>

</div> <!-- end chat-message-content -->

</div> <!-- end chat-message -->

<hr>
`)
$('#msg').val('')
$(".chat-history").animate({ scrollTop: $(".chat-history")[0].scrollHeight})

})
.fail(err => {
Swal.fire({
type: 'error',
title: 'Oops...',
text: err.responseJSON.message,
})
})
}
Loading