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

View File

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

View File

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

View File

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