updated electron app ui

This commit is contained in:
milad 2019-11-05 17:28:21 -08:00
parent e1b02fb73a
commit e08ddf521c
3 changed files with 83 additions and 23 deletions

View file

@ -43,7 +43,7 @@ for (let index = 0; index < images; index++) {
let currentScreensharePickID = ""; let currentScreensharePickID = "";
function screensharePicked(id){ function screensharePicked(id){
currentScreensharePickID = id; currentScreensharePickID = id;
// console.log(currentScreensharePickID); console.log(currentScreensharePickID);
document.getElementById("share_pick").innerHTML = ""; document.getElementById("share_pick").innerHTML = "";
addSource(sourceMap[id], "share_pick"); addSource(sourceMap[id], "share_pick");
togglePage(); togglePage();
@ -77,14 +77,22 @@ function togglePage(){
let sourceBody = document.createElement('div') let sourceBody = document.createElement('div')
let thumbnail = isBrowser ? source.thumbnail : source.thumbnail.toDataURL(); let thumbnail = isBrowser ? source.thumbnail : source.thumbnail.toDataURL();
sourceBody.classList.add("box") sourceBody.classList.add("box")
if (type === "share_pick") {
sourceBody.style.marginLeft = "0px";
}
let circle = `<div class="circle" onclick="screensharePicked('${source.id}')"}></div>` let circle = `<div class="circle" onclick="screensharePicked('${source.id}')"}></div>`
let image = "";
if (source.appIcon) {
image = `<img class="icon" src="${source.appIcon.toDataURL()}" />`;
}
sourceBody.innerHTML = ` sourceBody.innerHTML = `
<div class="heading"> <div class="heading">
${type === "selects" ? circle : ""} ${image}
<span class="screen_label">${source.name}</span> <span class="screen_label">${source.name}</span>
</div> </div>
<div class="image"> <div class="${type === "share_pick" ? "image_no_hover" : "image"}" onclick="screensharePicked('${source.id}')">
<img src="${thumbnail}"></img> <img src="${thumbnail}" />
</div> </div>
` `
// console.log(sourceBody.innerHTML); // console.log(sourceBody.innerHTML);
@ -92,6 +100,7 @@ function togglePage(){
document.getElementById("selects").appendChild(sourceBody); document.getElementById("selects").appendChild(sourceBody);
} else { } else {
document.getElementById("share_pick").appendChild(sourceBody); document.getElementById("share_pick").appendChild(sourceBody);
document.getElementById("content_name").innerHTML = source.name;
} }
} }
@ -110,14 +119,15 @@ function togglePage(){
thumbnailSize: { thumbnailSize: {
width: imageWidth, width: imageWidth,
height: imageHeight height: imageHeight
} },
fetchWindowIcons: true
}, (error, sources) => { }, (error, sources) => {
if (error) { if (error) {
console.log("Error getting sources", error); console.log("Error getting sources", error);
} }
for (let source of sources) { for (let source of sources) {
console.log(JSON.stringify(sources,null,4)); // console.log(JSON.stringify(sources,null,4));
sourceMap[source.id] = source; sourceMap[source.id] = source;
//*if (source.id.indexOf("screen") > -1) { //*if (source.id.indexOf("screen") > -1) {
// console.log("Adding:", source.id) // console.log("Adding:", source.id)

View file

@ -40,14 +40,14 @@
Others will be able to everything contained within this view. Others will be able to everything contained within this view.
</p> </p>
</div> </div>
<div id="button_selection" > <div id="button_selection">
<div id="yes" class="button_confirmation" style="color: #ffffff" onClick="screenConfirmed(true)"> <div id="yes" class="button_confirmation" style="color: #ffffff" onClick="screenConfirmed(true)">
Yes, share this content Yes, share this content
</div> </div>
<div id="no" class="button_confirmation" style="color: #009ee0" onClick="screenConfirmed(false)"> <div id="no" class="button_confirmation" style="color: #009ee0" onClick="screenConfirmed(false)">
No, don't share this content No, don't share this content
</div> </div>
</div> <!-- button_selection --> </div> button_selection
</div> <!-- confirmation screen --> </div> <!-- confirmation screen -->
<script src="app.js"></script> <script src="app.js"></script>
<script src="https://static.opentok.com/v2/js/opentok.min.js"></script> <script src="https://static.opentok.com/v2/js/opentok.min.js"></script>

View file

@ -1,14 +1,53 @@
body { body {
background: black; background: black;
box-sizing: 0px; box-sizing: border-box;
/* display: -webkit-flex; */ /* display: -webkit-flex; */
/* -webkit-justify-content: center; */ /* -webkit-justify-content: center; */
/* -webkit-align-items: center; */ /* -webkit-align-items: center; */
/* -webkit-flex-direction: column; */ /* -webkit-flex-direction: column; */
font-family: "Graphik"; font-family: "Graphik";
margin: 0px; margin: 0px;
}
html::-webkit-scrollbar {
overflow: scroll;
overflow-x: hidden;
width: 0px;
} }
#confirmation_screen {
/* background-color: orange; */
width: 100%;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
}
#confirmation_text {
margin-top: 25px;
font-size: 25px;
line-height: 25px;
}
#confirmation_text p {
margin: 0px;
}
#button_selection {
margin-top: 25px;
width: 100%;
display: flex;
text-align: center;
justify-content: center;
align-items: center;
flex-direction: column;
}
#share_pick {
/* background-color: blue; */
}
.text_title { .text_title {
color: white; color: white;
@ -54,8 +93,8 @@ h3 {
.screen_label { .screen_label {
max-width: 220px; max-width: 220px;
font-size: 18px; font-size: 25px;
line-height: 24px; line-height: 25px;
margin-left: 15px; margin-left: 15px;
color: white; color: white;
white-space: nowrap; white-space: nowrap;
@ -63,11 +102,11 @@ h3 {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.circle { .icon {
display: inline-block; display: inline-block;
background: #C4C4C4; background: #C4C4C4;
width: 30px; width: 20px;
height: 30px; height: 20px;
border-radius: 50%; border-radius: 50%;
} }
@ -80,25 +119,28 @@ h3 {
margin: 4px; margin: 4px;
cursor: pointer; cursor: pointer;
width: 250px; width: 250px;
height: 75px;
line-height: 75px;
text-align: center;
vertical-align: middle;
} }
.button_confirmation:hover { .button_confirmation:hover {
border: 2px solid white; outline: solid white 2px;
width: 250px; width: 250px;
} }
.box { .box {
background-color: orange; /* background-color: orange; */
height: 165px; height: 165px;
width: 265px; width: 265px;
display: inline-block; display: inline-block;
margin-left: 20px; margin-left: 35px;
margin-bottom: 40px; margin-bottom: 40px;
margin-top: 20px; margin-top: 20px;
} }
.heading { .heading {
background-color: red;
height: 35px; height: 35px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -112,18 +154,26 @@ h3 {
max-width: 265px; max-width: 265px;
} }
.image:hover {
outline: solid white 3px;
}
.image_no_hover {
background-color: blue;
width: 265px;
height: 165px;
max-height: 165px;
max-width: 265px;
}
img { img {
width: 265px; width: 265px;
height: 165px; height: 165px;
} }
.scrollbar { .scrollbar {
/* background-color: #F5F5F5; */
float: right; float: right;
height: 100%; height: 470px;
/* margin-bottom: 25px; */
/* margin-left: 22px; */
/* margin-top: 40px; */
margin-right: 20px; margin-right: 20px;
width: 100%; width: 100%;
overflow-y: scroll; overflow-y: scroll;