Giter Site home page Giter Site logo

chatty-beta-1's Introduction

SnoopyChat

A fun chat application based on the Peanuts comic strip.

Features

  • On page load, users may choose a character to post a message as
  • Users may input a message, click send or push return, and the message will appear on the page with a time & date stamp on it
  • Once a message is posted, users have the ability to edit or remove a message
  • Certain word pairings will trigger a bot response... or three bot responses, yo!
  • A limit of 20 messages appear on the page
  • Users may choose to change the page theme to "dark mode"
  • Users have the option to enlarge text on the page
  • Users can clear all messages from the page

Tech Used

  • JQuery
  • Bootstrap
  • Webpack
  • JavaScript ES6
  • SASS
  • HTML

Code Example

The code example below iterates through an array of key words for the chat bots to reply to. Then prints their responses after a random time.

for (let i = 0; i < Bot.bots.length; i += 1) {
      const lowerCaseMessageValue = messageValue.toLowerCase();
      if (
        lowerCaseMessageValue.includes(
          Bot.bots[i].respondTo.find((word) => lowerCaseMessageValue.includes(word))
        )
      ) {
        const botMessage = {
          id: (idNumber + 1).toString(),
          user: `${Bot.bots[i].user}`,
          image: `${Bot.bots[i].image}`,
          message: `${
            Bot.bots[i].message[
              Math.floor(Math.random() * Bot.bots[i].message.length)
            ]
          }`,
          timestamp: moment().format('MMMM Do YYYY, h:mm a'),
        };
        idNumber += 1;
        setTimeout(() => {
          Message.getMessages().push(botMessage);
          Print.printMessages();
        }, Math.floor(Math.random() * 10000) + 1000);
      }
    }

Wireframe

Figma Wireframe

Screenshots

Chatty Input Chatty Edit

Link

See the site here

Credits

chatty-beta-1's People

Contributors

bandstrar avatar drteresavasquez avatar jacobpaine avatar kaitvan avatar michaelpfohl avatar ryanmcnair avatar

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.