Merge branch 'master' into master

This commit is contained in:
Lospec 2020-03-07 17:52:45 -05:00 committed by GitHub
commit 7c29ba2d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 96 additions and 72 deletions

View File

@ -1,6 +1,8 @@
$base-color: #332f35;
$shop: #b63831;
$red: #e3474a;
$orange: #df7c25;
$green: #70a630;
$palettes: (
base: (
@ -28,9 +30,13 @@ $palettes: (
background: (
default: darken($base-color, 3%),
hover: darken($base-color, 1.5%),
highlight: lighten($base-color, 3%),
highlight-hover: lighten($base-color, 5%),
),
foreground: (
default: lighten($base-color, 50%),
symbol: lighten($base-color, 8%),
text: lighten($base-color, 50%),
hover: lighten($base-color, 100%),
)
),
@ -48,11 +54,16 @@ $palettes: (
background: (
default: lighten($base-color, 10%),
hover: lighten($base-color, 15%),
weak: lighten($base-color, 5%),
),
foreground: (
default: lighten($base-color, 80%),
default: lighten($base-color, 50%),
dropdown: lighten($base-color, 50%),
text: lighten($base-color, 100%),
text: lighten($base-color, 60%),
symbol: lighten($base-color, 50%),
indent: lighten($base-color, 5%),
weak: lighten($base-color, 25%),
hover: lighten($base-color, 75%),
)
),
selectedTool: (
@ -81,6 +92,7 @@ $palettes: (
),
foreground: (
default: #fff,
text: lighten($base-color, 40%),
symbol: lighten($base-color, 5%),
symbol-hover: lighten($base-color, 20%),
weak: lighten($base-color, 20%),
@ -102,9 +114,19 @@ $palettes: (
button-hover: lighten($base-color, 70%),
)
),
indent-darker: (
background: (
default: darken($base-color, 8%),
),
foreground: (
default: lighten($base-color, 15%),
)
),
footer: (
background: (
default: darken($base-color, 9%),
hover: darken($base-color, 2%),
),
foreground: (
default: lighten($base-color, 20%),

View File

@ -138,7 +138,7 @@ svg {
float: left;
height: 100%;
}
li button {
li button, li a {
color: color(menu, foreground);
height: 100%;
padding: 17px;
@ -167,15 +167,21 @@ svg {
padding-bottom: 2px;
li {
width: 100%;
button {
button, a {
width: 100%;
text-align: left;
padding: 8px 32px 8px 16px;
font-size: 1em;
&:hover {
background-color: color(menu, background, hover);
color: color(menu, foreground, hover);
}
}
a {
display: block;
text-decoration: none;
box-sizing: border-box;
}
}
}
.disabled {

View File

@ -26,7 +26,7 @@ for (var i = 1; i < mainMenuItems.length; i++) {
var subMenuItem = subMenuItems[j];
var subMenuButton = subMenuItem.children[0];
subMenuButton.addEventListener("click", function () {
subMenuButton.addEventListener("click", function (e) {
switch(this.textContent) {
@ -77,23 +77,19 @@ for (var i = 1; i < mainMenuItems.length; i++) {
break;
case 'Exit':
console.log('exit')
//if a document exists, make sure they want to delete it
if (documentCreated && confirm('Exiting will discard your current pixel. Are you sure you want to do that?')) {
if (documentCreated) {
//ask user if they want to leave
if (confirm('Exiting will discard your current pixel. Are you sure you want to do that?'))
//skip onbeforeunload prompt
window.onbeforeunload = null;
//go back to main site
window.location.href = "https://lospec.com/pixel-editor";
else
e.preventDefault();
}
else {
//skip onbeforeunload prompt
window.onbeforeunload = null;
//go back to main site
window.location.href = "https://lospec.com/pixel-editor";
}
break;
//Edit Menu
case 'Undo':

View File

@ -51,7 +51,7 @@
<li><button>New</button></li>
<li><button>Open</button></li>
<li><button id="save-as-button" class="disabled">Save as...</button></li>
<li><button>Exit</button></li>
<li><a href="/pixel-editor">Exit</a></li>
</ul>
</li>
<li>
@ -238,12 +238,12 @@
<script>
palettes = { {{#palettes}}
'{{name}}': {
'{{title}}': {
colors: '{{colors}}'.split(',')
},
{{/palettes}}
{{#specifiedPalette}}
'{{name}}': {
'{{title}}': {
colors: '{{colors}}'.split(','),
specified: true
}