Skip to content

Commit

Permalink
Added feedback form
Browse files Browse the repository at this point in the history
  • Loading branch information
vasanthv committed Jan 12, 2023
1 parent 35e9b81 commit 361adf6
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tlk",
"version": "3.1.0",
"version": "3.1.1",
"description": "Free video call app for the web.",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions www/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const App = Vue.createApp({
name: window.localStorage.name,
typing: "",
chats: [],
callEnded: false,
};
},
methods: {
Expand Down Expand Up @@ -268,9 +269,7 @@ const App = Vue.createApp({
for (let peer_id in peers) {
peers[peer_id].close();
}
setTimeout(() => {
alert("You have been disconnected. You can now close this window.");
}, 100);
this.callEnded = true;
},
},
}).mount("#app");
17 changes: 17 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@
</div>
</div>

<div id="callFeedbackWrap" v-if="callEnded">
<div id="callFeedback">
<div class="bold">Your call has been disconnected. You can now close this window.</div>
<br />

<div id="feedbackWrap">
<div class="question italic">How was the quality of call?</div>
<div class="thankYou bold">Thank you for your feedback</div>
<div id="feedbackButtons">
<button data-cabin-event="call-quality-nah">😟<br />Nah!</button>
<button data-cabin-event="call-quality-meh">😐<br />Meh!</button>
<button data-cabin-event="call-quality-yay">😀<br />Yay!</button>
</div>
</div>
</div>
</div>

<div id="chatWrap" v-if="showChat">
<div id="chats">
<div class="chat" v-for="(chat, i) in chats" v-bind:key="i">
Expand Down
68 changes: 68 additions & 0 deletions www/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

:root {
--body-bg: #1e1f23;
--blanket-color: rgb(30, 31, 35, 0.9);
--intro-bg: #ffffff;
--intro-cl: #000000;
--chat-wrap-bg: #ffffff;
Expand Down Expand Up @@ -53,6 +54,12 @@ input {
.light {
color: #878787;
}
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
#blanket {
position: absolute;
z-index: -1;
Expand Down Expand Up @@ -368,6 +375,67 @@ input {
color: #e74c3c !important;
}

#callFeedbackWrap {
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background: var(--blanket-color);
z-index: 110;
}
#callFeedback {
position: absolute;
padding: 1rem;
box-sizing: border-box;
width: 100%;
max-width: 400px;
height: 320px;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
margin: auto;
background: var(--settings-bg);
border-radius: 1rem;
}
#feedbackWrap .thankYou {
display: none;
}
#feedbackWrap:focus-within .question {
display: none;
}
#feedbackWrap:focus-within .thankYou {
display: block;
}
#feedbackButtons {
display: flex;
justify-content: space-between;
margin: 1rem auto;
}
#feedbackButtons button {
cursor: pointer;
border: none;
background: #7f8c8d;
border: 5px solid #7f8c8d;
width: 30%;
font-size: 2rem;
padding: 0.5rem 0px;
border-radius: 1rem;
}
#feedbackButtons button[data-cabin-event="call-quality-nah"] {
background: #c0392b;
border-color: #c0392b;
}
#feedbackButtons button[data-cabin-event="call-quality-yay"] {
background: #27ae60;
border-color: #27ae60;
}
#feedbackButtons button:active,
#feedbackButtons button:focus {
border-color: #000;
}

@media only screen and (max-width: 960px) {
.video {
float: left;
Expand Down

0 comments on commit 361adf6

Please # to comment.