Giter VIP home page Giter VIP logo

powerfront's Introduction

Requirements

Must

  • Create a new JS file to handle the display of the live chat program
  • Use the supplied function 'chat.getChatHistory(callback)' to load and display the chat history in the '#chatHistory' container. This will simulate a server request for data
  • Use the supplied function 'chat.sendChat(message)' to send a chat typed into the input box - Bind to the event "chat received" using "chat.addListener('chat received', function (data) { ... })" to receive and display any chats sent, as well as the dummy responses
  • Display chat messages with datetime, from and message
  • Modify the existing HTML and CSS files as required
  • Fix any existing bugs in the code
  • Add styling, this is a front end developer test. Style matters
  • The app should be well presented with a clear and amazing UI

Bonus

  • Implement responsive design
  • Protect against XSS and other forms of hacking
  • Display the time in the readable format. Be creative
  • Add some animations when the messages are added to the history
  • Fix the message textarea and button to the bottom of the page
  • Make the User Experience as simple as possible
  • Convert the code to not rely on jQuery

What I have done?

UI and project structure

UI Project structure.

Description

  • Implemented responsive UI (added css classes in css/chat.css, fixed chat.html).
  • Fixed bugs in chat.js and added some functions to add message data to localStorage and functions to show spinners until receive other's message.
    • There was an critical issue in addListener function in chat.js.
    • Added saveChatHistory() function and fixed getChatHistory(), dispatchChatEvent(), sendChat().
  • Added listeners and defined some helper functions in init.js.

For the bonus

  • Responsive Design - done
  • Wrote js codes to protect against XSS without jQuery.
  • Display message time in readable format. ex: "6:32am Today"
  • Add some animations when the messages are added to the history - done
  • Fix the message textarea and button to the bottom of the page - done
  • For the UX, display spinner during other is typing and send message when press ctrl+Enter.

* spent time: more or less 3hours

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.