even more style

master
evan 2019-10-08 15:15:49 -07:00
parent 12fed6164c
commit 9b35a9851f
5 changed files with 124 additions and 76 deletions

View File

@ -181,7 +181,7 @@ export class FrameHandler {
// frame number update
this.frameNumberDiv.className = '';
this.frameNumberDiv.innerText =
'Frame ' + (this.currentFrame + 1).toString() + ' / ' + this.filenames.length.toString();
(this.currentFrame + 1).toString() + ' / ' + this.filenames.length.toString();
// draw pins
for (let i = 0; i < 10; i++) {
this.canvasContext.strokeStyle = '#FF0000';

View File

@ -239,7 +239,7 @@ export class Page {
// console.log('checking frame ' + f + ' for pinID ' + this.animationData.pins[p].name);
if (this.animationData.frames[f][pinIDtoCheck] === undefined) {
if (!errorOnFrame) {
pinDataErrorString += ' Frame ' + f + ' :\n';
pinDataErrorString += f + ' :\n';
}
pinDataErrorString += ' Pin: ' + this.animationData.pins[p].name + '\n';
passPinData = false;

View File

@ -39,7 +39,6 @@ export class PinHandler {
for (let i = 0; i < this.allPinContainers.length; i++) {
const pinDiv = this.allPinContainers[i];
pinDiv.classList.remove('selected', 'warning');
if (i > 0) {
if (this.GetPinNumberFromID(this.allPinContainers[i].id) === this.projectData.currentlySelectedPin) {
this.allPinContainers[i].classList.add('selected');
}
@ -55,7 +54,6 @@ export class PinHandler {
}
}
}
}
if (this.animationData.originX === null || this.animationData.originY === null) {
this.originPin.classList.add('warning');
}
@ -137,7 +135,8 @@ export class PinHandler {
newDiv.appendChild(removePinButton);
removePinButton.textContent = 'X';
removePinButton.className = 'removeButton';
removePinButton.addEventListener('click', () => {
removePinButton.addEventListener('click', (event: MouseEvent) => {
event.stopPropagation();
// get ID number for this div
const idNumber = this.GetPinNumberFromID(newDiv.id);
let indexToDelete: number = 0;
@ -155,9 +154,11 @@ export class PinHandler {
// remove the div itself
newDiv.remove();
this.UpdateAnimationPinNames();
//reset to origin
this.SelectOriginPin();
});
// break
newDiv.appendChild(document.createElement('br'));
this.UpdateAnimationPinNames();
this.UpdatePinBoxStatus();
@ -178,6 +179,11 @@ export class PinHandler {
this.UpdateAnimationPinNames();
};
private SelectOriginPin = () => {
this.projectData.currentlySelectedPin = 0;
this.UpdatePinBoxStatus();
};
private RemovePinDataForID = (pinID: number) => {
// check for matching id in pin list and remove

View File

@ -41,8 +41,6 @@ div {
padding: 0;
min-width: 200px;
border: 1px solid;
border-style: dashed;
border-radius: 10px;
background-color: $canvas-bg-color;
}
@ -57,25 +55,27 @@ div {
#settings {
display: flex;
flex-direction: column;
justify-content: flex-end;
width: 20%;
max-width: 150px;
min-width: 100px;
flex-direction: row;
justify-content: center;
align-content: center;
}
.settingsItem {
display: flex;
flex-direction: row;
margin: 12px;
padding: 4px;
text-align: center;
border: 1px solid;
border-radius: 5px;
input {
width: 80%;
}
.label {
margin: 5px;
}
}
.settingsItem {
@ -84,8 +84,23 @@ div {
}
}
#frameNumber {
text-align: right;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type='number'] {
-moz-appearance:textfield;
}
#framerate {
width: 30px;
width: 50px;
text-align: center;
}
.borderbox {
@ -143,6 +158,8 @@ div {
width: 50%;
border: 4px solid $warning-border-color;
padding: 1px;
text-align: center;
margin: 0 auto;
//background-color: $warning-bg-color;
//color: $warning-text-color;
}
@ -171,7 +188,7 @@ body {
display: inline-grid;
}
$pin-button-size: 6vw;
$pin-button-size: 75px;
.pinButtonContainer {
grid-row-start: 1;
@ -192,6 +209,10 @@ $pin-button-size: 6vw;
&.warning {
border: 2px solid $warning-border-color;
background-color: $warning-bg-color;
input {
background-color: $warning-bg-color;
}
}
&.selected {
@ -200,12 +221,27 @@ $pin-button-size: 6vw;
&.warning {
border: 2px solid $warning-selected-border-color;
background-color: $warning-selected-bg-color;
input {
background-color: $warning-selected-bg-color;
}
}
input {
background-color: $selected-bg-color;
}
}
input {
background-color: $bg-color;
width: 80%;
transform: translateY($pin-button-size / 2);
height: 20px;
transform: translateY($pin-button-size / 2 - 10px);
border: none;
color: $main-font-color;
text-align: center;
font-size: 10px;
}
}
@ -218,11 +254,12 @@ $pin-button-size: 6vw;
}
.removeButton {
display: block;
margin: 0 auto;
position: relative;
transform: translate($pin-button-size / 2, -$pin-button-size / 2);
width: 15px;
height: 15px;
border-radius: 5px;
border-radius: 50%;
background-color: rgb(158, 15, 34);
color: rgb(227, 227, 236);
}

7
dist/index.html vendored
View File

@ -1,17 +1,21 @@
<html>
<head>
<title>AnimationTool</title>
<meta charset="utf-8">
<link rel="icon" href="/favicon.ico">
</head>
<body>
<div id="dropZone" class="center">
<div id="dropZone">
<div id="allTop">
<div id="top">
<div id="canvasStyle">
<canvas id="canvasImage" class="spriteCanvas" alt=""></canvas>
<div id="frameNumber"></div>
</div>
</div>
<div id="settings">
<div class="settingsItem">
<div class="label">Name</div>
@ -49,4 +53,5 @@
<script src="bundle.js"></script>
</body>
</html>