Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chat app</title>
    <link rel="stylesheet" href="css/main.css">
    <script defer src="./socket.io/socket.io.js"></script>
    <script defer src="./js/index.js"></script>
</head>

<body>
    <main>
        <section class="app">
            <div class="container">
                <!-- contacts -->
                <aside>
                    <button>
                    <div class="user" data-id="1">
                        <div class="avatar">
                            <img src="./assets/user.jpg" alt="" srcset="">
                        </div>
                        <div class="details">
                            <div class="name">
                                <h3>Saskia Boom</h3>
                            </div>
                            <div class="message">
                                <h6 class="green">Is aan het typen...</h6>
                            </div>
                        </div>
                    </div>
                </button>
                    <button>
                    <div class="user" data-id="2">
                        <div class="avatar">
                            <img src="./assets/dirk.jpg" alt="" srcset="">
                        </div>
                        <div class="details">
                            <div class="name">
                                <h3>Dirk jan</h3>
                            </div>
                            <div class="message">
                                <h6>Is goed man</h6>
                            </div>
                        </div>
                    </div>
                </button>
                    <button>
                    <div class="user" data-id="3">
                        <div class="avatar">
                            <img src="./assets/marleen.jpg" alt="" srcset="">
                        </div>
                        <div class="details">
                            <div class="name">
                                <h3>Marleen Boter</h3>
                            </div>
                            <div class="message">
                                <h6>Ja, lijkt me leuk 🎉</h6>
                            </div>
                        </div>
                    </div>
                </button>
                    <button>
                    <div class="user" data-id="4">
                        <div class="avatar">
                            <img src="./assets/Irma.jpg" alt="" srcset="">
                        </div>
                        <div class="details">
                            <div class="name">
                                <h3>Irma sloot</h3>
                            </div>
                            <div class="message">
                                <h6>Ik laat het je weten!</h6>
                            </div>
                        </div>
                    </div>
                </button>
                    <button>
                    <div class="user" data-id="5">
                        <div class="avatar">
                            <img src="./assets/frans.jpg" alt="" srcset="">
                        </div>
                        <div class="details">
                            <div class="name">
                                <h3>Frans Kosse</h3>
                            </div>
                            <div class="message">
                                <h6>🎈 Ik ben er klaar voor</h6>
                            </div>
                        </div>
                    </div>
                </button>
                    <button>
                    <div class="user" data-id="6">
                        <div class="avatar">
                            <img src="./assets/rowin.jpg" alt="" srcset="">
                        </div>
                        <div class="details">
                            <div class="name">
                                <h3>Rowin</h3>
                            </div>
                            <div class="message">
                                <h6>Dankjewel</h6>
                            </div>
                        </div>
                    </div>
                </button>
                </aside>
                <!-- chat -->
                <div class="chat">
                    <!-- background -->
                    <img src="./assets/background.jpg" alt="background">
                    <ul>
                    </ul>
                    <!-- navbar -->
                    <header>
                        <nav>
                            <ul>
                            </ul>
                        </nav>
                    </header>
                    <!-- Enter message form -->
                    <div class="message">
                        <form id="chat-form">
                            <input type="text" name="message" id="message" placeholder="Type een bericht">
                            <button type="submit">Send</button>
                        </form>
                    </div>
                </div>
            </div>
        </section>
    </main>
</body>

</html>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #090E11;
  min-height: 100vh;
}

main {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  height: 100%;
  width: 1200px;
  background-color: #131C21;
  display: flex;
  border-radius: 10px;
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.25);
}
.container .chat {
  position: relative;
  width: 1200px;
}
.container .chat .self {
  background-color: #056162;
  display: inline;
  margin-left: 80%;
}
.container .chat header {
  width: 100%;
  background-color: #1E2428;
  position: absolute;
  top: 0;
  z-index: 2;
  height: 10vh;
}
.container .chat header nav ul {
  color: #fff;
}
.container .chat img {
  height: 100%;
  width: 100%;
  filter: brightness(20%);
}
.container .chat ul {
  position: absolute;
  top: 0;
  padding: 30px;
  width: 100%;
  list-style: none;
  display: flex;
  flex-direction: column;
}
.container .chat ul li {
  background-color: #262D31;
  color: #fff;
  display: inline;
  margin-bottom: 1rem;
  position: relative;
  border-radius: 5px;
  text-align: center;
}
.container .chat ul .other {
  background-color: #262D31;
  color: #fff;
  display: inline;
  margin-bottom: 1rem;
  position: relative;
  border-radius: 5px;
  text-align: center;
  margin-right: 80%;
}
.container .chat .message {
  width: 100%;
  height: 3rem;
  background-color: #1E2428;
  position: absolute;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.container .chat .message input[type=text] {
  border: none;
  border-color: #1E2428;
  color: white;
  text-align: center;
  height: 1.5rem;
  background-color: #1E2428;
  font-weight: 600;
}
.container .chat .message button {
  opacity: 0;
}
.container aside {
  height: 610px;
  width: 350px;
  background: #131C21;
  overflow-y: auto;
  border-top-left-radius: 10px;
}
.container aside button {
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  width: 100%;
}
.container aside button:active .user {
  background-color: #0F1A20;
}
.container aside button:focus .user {
  background-color: #0F1A20;
}
.container aside .user {
  color: #fff;
  display: flex;
  flex-direction: row;
  padding: 15px;
  cursor: pointer;
  margin-top: 1rem;
}
.container aside .user:hover {
  background-color: #0F1A20;
  transition: 0.2s ease-in-out;
}
.container aside .user .avatar img {
  border-radius: 50%;
  height: 60px;
  width: 60px;
  margin-right: 40px;
  -o-object-fit: cover;
     object-fit: cover;
}
.container aside .user .details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: -15px;
  align-items: baseline;
}
.container aside .user .details .green {
  color: #25D366;
  font-size: 0.9rem;
}
.container aside .user .details .name h3 {
  font-size: 1rem;
  font-weight: 500;
}
.container aside .user .details .message h6 {
  font-size: 0.8rem;
  font-weight: 300;
}/*# sourceMappingURL=main.css.map */
              
            
!

JS

              
                
              
            
!
999px

Console