Skip to content

Commit

Permalink
[TASK] UI Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime authored and Maxime committed Mar 8, 2019
1 parent 379c21d commit 3387081
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
8 changes: 2 additions & 6 deletions src/labelize.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ function parseItem(item, count,currentPage, currentSymbol){
return;
}
let json = {};
console.log(item.type+"");
switch(item.type){
case "Artboard":
currentPage = helpers.format(item.name+"").split('-')[0].replace(/\n/g,' ').replace(/;/g,',').trim();
Expand All @@ -257,9 +258,7 @@ function parseItem(item, count,currentPage, currentSymbol){
case "Text":
try {
let value = item.sketchObject.stringValue()+"";
if (typeof item.value !== 'string' || item.value.replace(/\n/g, ' ').trim() === '') {
return;
}

value = value.replace(/\n/g, ' ');

helpers.sendMessage('insertNewLabel',currentPage + "__" + item.name + ";"+helpers.sanitize(value));
Expand All @@ -274,9 +273,6 @@ function parseItem(item, count,currentPage, currentSymbol){
case "Override":
case "OverriddeValue":
try {
if (typeof item.value !== 'string' ) {
return;
}
var itemV = item.value + "";
itemV = itemV.replace(/\n/g, ' ').replace(/;/g, ',').replace(/\"/g,'\\"').trim();
const regex = new RegExp("[A-Z0-9]{8}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{4}[-][A-Z0-9]{12}");
Expand Down
36 changes: 23 additions & 13 deletions src/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
background-color: rgba(0, 0, 255, 0.2);
padding: 4px;
border-radius: 3px;
}

}
.container {
padding: 1em;
}
.nav {
display: flex;
justify-content: space-between;
}
.card {
padding: 1em;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
Expand Down Expand Up @@ -75,20 +78,23 @@
border: 1px solid darkgrey;
padding: 4px;
}

textarea {
width: 100%;
height: 80px;
font-size: 16px;
}

.hide {
display: none;
}



</style>
<style id="loader">
.loader {
margin: auto;
position: absolute;
top: 108px;
top: 0;
bottom: 0;
left: 0;
right: 0;
Expand Down Expand Up @@ -134,13 +140,8 @@
opacity:0.1;
}
}
.hide {
display: none;
}
.nav {
display: flex;
justify-content: space-between;
}
</style>
<style id="notifications">
.notif.green{
border: #8bc34a 1px solid;
background-color: #dcedc8;
Expand All @@ -162,6 +163,7 @@
align-items: center;
justify-content: center;
padding: 1em;
z-index: 1000;
}
.notif.active {
transition: all .5s ease-in-out;
Expand All @@ -185,6 +187,14 @@
}
</style>
<style id="btn-style">
.btns {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.btns .btn {
margin-bottom: 1em;
}
.btn {
padding: 8px;
border-radius: 4px;
Expand Down Expand Up @@ -246,12 +256,12 @@
</head>
<body>
<div id="notification" class="notif"></div>
<div id="feedback"></div>
<div class="loader hide">
<div id="dot1" class="dot"></div>
<div id="dot2" class="dot"></div>
<div id="dot3" class="dot"></div>
</div>
<div id="feedback"></div>
<div id="0" class="card container">
<div class="header">
<h1>Labelizer</h1>
Expand Down

0 comments on commit 3387081

Please sign in to comment.