This commit is contained in:
Sam Keddy 2020-03-07 22:46:25 +00:00
parent 37c758d455
commit d899929816
4 changed files with 97 additions and 73 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

@ -127,7 +127,7 @@ svg {
float: left;
height: 100%;
}
li button {
li button, li a {
color: color(menu, foreground);
height: 100%;
padding: 17px;
@ -156,15 +156,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

@ -43,7 +43,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>
@ -215,12 +215,12 @@
<script>
palettes = { {{#palettes}}
'{{name}}': {
'{{title}}': {
colors: '{{colors}}'.split(',')
},
{{/palettes}}
{{#specifiedPalette}}
'{{name}}': {
'{{title}}': {
colors: '{{colors}}'.split(','),
specified: true
}