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

Chat markup #80

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ if (!(Test-Path ./certs/server.key) -or -!(Test-Path ./certs/server.crt)) {
docker-compose -f dist/docker-compose.yml build
docker-compose -f dist/docker-compose.yml down
docker-compose -f dist/docker-compose.yml up -d

Read-Host
echo "done"
119 changes: 110 additions & 9 deletions static/css/chat.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,116 @@
@import url('https://fonts.googleapis.com/css?family=Press+Start+2P');
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700&subset=cyrillic');
body {
font-family: 'Ubuntu Mono', monospace;
background-color: #dddddd;
margin: 0;
box-sizing: border-box;
}
input,
button {
font-family: 'Ubuntu Mono', monospace;
}
textarea {
font-size: 20px;
font-family: 'Ubuntu Mono', monospace;
}
.wrapper .header {
display: flex;
min-height: 100vh;
flex-direction: column;
justify-content: center;
margin-top: 50px;
}
.wrapper .header .logo h1 {
font-size: 60px;
text-transform: uppercase;
font-family: 'Press Start 2P', cursive;
}
.wrapper .header .logo a {
color: #000000;
text-decoration: none;
}
.wrapper .main {
max-width: 900px;
margin: 0 auto;
padding-bottom: 20px;
}
main {
flex: 1 0 auto;
.wrapper .main .chat_content {
background-color: #ffffff;
min-height: 70vh;
}
#chat-messages {
min-height: 10vh;
height: 60vh;
.wrapper .main .message_input {
display: flex;
}
.wrapper .main .message_input input {
flex: 1;
border: none;
font-size: inherit;
padding: 10px;
height: 30px;
}
.wrapper .main .message_input input:focus {
outline: none;
}
.wrapper .main .message_input .chat_button {
background-color: #ffffff;
border: none;
display: flex;
align-items: center;
width: 15%;
cursor: pointer;
justify-content: center;
z-index: 2;
-webkit-transition: 0.4s ease-out;
-moz-transition: 0.4s ease-out;
-o-transition: 0.4s ease-out;
transition: 0.4s ease-out;
}
.wrapper .main .message_input .chat_button:hover {
background-color: #000000;
color: white;
}
.wrapper .main .message_input .chat_button:focus {
outline: none;
}
.wrapper .main .group {
position: relative;
}
.wrapper .main .group .bar {
position: absolute;
width: 100%;
overflow-y: scroll;
padding-bottom: 50px;
display: block;
bottom: 0;
}
.wrapper .chip {
display: inline-flex;
align-items: center;
padding: 10px;
margin-right: 50px;
width: 200px;
border-right: 1px solid #ddd;
background-color: #eee;
}
.wrapper .chip:nth-child(n) {
border-bottom: 1px solid #ddd;
}
.bar:before,
.bar:after {
content: '';
height: 2px;
width: 0;
bottom: 0;
position: absolute;
background: #cc26b6;
-webkit-transition: .5s ease all;
-moz-transition: .5s ease all;
transition: .5s ease all;
}
.bar:before {
left: 50%;
}
.bar:after {
right: 50%;
}
input:focus ~ .bar:before,
input:focus ~ .bar:after {
width: 50%;
}
134 changes: 122 additions & 12 deletions static/css/chat.less
Original file line number Diff line number Diff line change
@@ -1,17 +1,127 @@
@import url('https://fonts.googleapis.com/css?family=Press+Start+2P');
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700&subset=cyrillic');

@mainColor: #ddd;
@fontColor: #000;
@fontFamily: 'Ubuntu Mono', monospace;
@fontFamilyLogo: 'Press Start 2P', cursive;

body {
display: flex;
min-height: 100vh;
flex-direction: column;
font-family: @fontFamily;
background-color: @mainColor;
margin: 0;
box-sizing: border-box;
}
input, button {
font-family: @fontFamily;
}
textarea {
font-size: 20px;
font-family: @fontFamily;
}
.wrapper {
.header {
display: flex;
justify-content: center;
margin-top: 50px;
.logo {
h1 {
font-size: 60px;
text-transform: uppercase;
font-family: @fontFamilyLogo;
}
a {
color: @fontColor;
text-decoration: none;
}
}
}
.main {
max-width: 900px;
margin: 0 auto;
padding-bottom: 20px;
.chat_content {
background-color: #ffffff;
min-height: 70vh;
}
.message_input {
display: flex;
input {
flex: 1;
border: none;
font-size: inherit;
padding: 10px;
height: 30px;
&:focus {
outline: none;
}
}
.chat_button {
background-color: #ffffff;
border: none;
display: flex;
align-items: center;
width: 15%;
cursor: pointer;
justify-content: center;
z-index: 2;
-webkit-transition: .4s ease-out;
-moz-transition: .4s ease-out;
-o-transition: .4s ease-out;
transition: .4s ease-out;
&:hover {
background-color: @fontColor;
color: white;
}
&:focus {
outline: none;
}
}
}
.group {
position: relative;
.bar {
position: absolute;
width: 100%;
display: block;
bottom: 0;
}
}
}
.chip {
display: inline-flex;
align-items: center;
padding: 10px;
margin-right: 50px;
width: 200px;
border-right: 1px solid #ddd;
background-color: #eee;
}
.chip:nth-child(n) {
border-bottom: 1px solid #ddd;
}
}
.bar:before,
.bar:after {
content: '';
height: 2px;
width: 0;
bottom: 0;
position: absolute;
background: #cc26b6;
-webkit-transition: .5s ease all;
-moz-transition: .5s ease all;
transition: .5s ease all;
}
.bar:before {
left: 50%;
}
.bar:after {
right: 50%;
}

main {
flex: 1 0 auto;
input:focus ~ .bar:before,
input:focus ~ .bar:after {
width:50%;
}

#chat-messages {
min-height: 10vh;
height: 60vh;
width: 100%;
overflow-y: scroll;
padding-bottom: 50px;
}
63 changes: 25 additions & 38 deletions static/html/joinchat.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,40 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>TechnoChat</title>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css"> -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/emojione/2.2.6/assets/css/emojione.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/emojione/2.2.6/assets/css/emojione.min.css">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/css/chat.css">

</head>

<body>
<header>
<nav>
<div class="nav-wrapper">
<a href="/" class="brand-logo right">TechnoChat</a>
</div>
</nav>
</header>
<main id="app">
<div v-if="okconnected">
<div class="row">
<div class="col s12">
<div class="card horizontal">
<div id="chat-messages" class="card-content" v-html="chatContent">
</div>
</div>
</div>
</div>
<div class="row" style="position: fixed; height: 50px; width: 100%;">
<div class="input-field col s8">
<input type="text" v-model="newMsg" @keyup.enter="send">
</div>
<div class="input-field col s4">
<button class="waves-effect waves-light btn" @click="send">
<i class="material-icons right">chat</i>
Send
</button>
</div>
</div>
</div>
<div v-if="!okconnected">
poshel nah
</div>
</main>
<footer class="page-footer">
</footer>

<div class="wrapper">
<div class="header">
<div class="logo">
<h1><a href="/">Technochat</a></h1>
</div>
</div>
<div class="main" id="app">
<div v-if="okconnected">
<div class="chat_content">
<div id="chat-messages" class="card-content" v-html="chatContent"></div>
</div>
<div class="message_input group">
<input type="text" v-model="newMsg" @keyup.enter="send">
<span class="bar"></span>
<button class="chat_button" @click="send">
<i class="material-icons">send</i>
</button>
</div>
</div>
<div v-if="!okconnected">Poshel nah</div>
</div>
</div>
<script src="https://unpkg.com/vue@2.1.3/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/emojione/2.2.6/lib/js/emojione.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
Expand Down