diff --git a/css/_export.scss b/css/_export.scss new file mode 100644 index 0000000..c4a4e39 --- /dev/null +++ b/css/_export.scss @@ -0,0 +1,19 @@ +#export { + .export-configuration { + display: flex; + flex-direction: column; + + input { + flex: 1; + } + } + + .export-actions { + display: flex; + justify-content: center; + + button { + font-size: 18px; + } + } +} \ No newline at end of file diff --git a/css/_popup-container.scss b/css/_popup-container.scss index 5191f9c..c38aea1 100644 --- a/css/_popup-container.scss +++ b/css/_popup-container.scss @@ -77,6 +77,18 @@ text-align: center; } } + + div.pixel-export { + input { + background: $indent; + border: none; + border-radius: 4px; + color: $indenttext; + padding: 10px 20px; + margin: 0; + text-align: left; + } + } /* input { background: $indent; diff --git a/css/pixel-editor.scss b/css/pixel-editor.scss index 3f87961..2d59fc7 100644 --- a/css/pixel-editor.scss +++ b/css/pixel-editor.scss @@ -14,4 +14,5 @@ @import 'compatibility'; @import 'resize-menus'; @import 'palette-editor'; -@import 'splash-page'; \ No newline at end of file +@import 'splash-page'; +@import "export"; \ No newline at end of file diff --git a/js/_fileMenu.js b/js/_fileMenu.js index 16c6b1c..b206661 100644 --- a/js/_fileMenu.js +++ b/js/_fileMenu.js @@ -67,59 +67,7 @@ for (var i = 1; i < mainMenuItems.length; i++) { break; case 'Export': - if (documentCreated) { - //create name - var selectedPalette = getText('palette-button'); - if (selectedPalette != 'Choose a palette...'){ - var paletteAbbreviation = palettes[selectedPalette].abbreviation; - var fileName = 'pixel-'+paletteAbbreviation+'-'+canvasSize[0]+'x'+canvasSize[1]+'.png'; - } else { - var fileName = 'pixel-'+canvasSize[0]+'x'+canvasSize[1]+'.png'; - selectedPalette = 'none'; - } - - //set download link - var linkHolder = document.getElementById('save-image-link-holder'); - // Creating a tmp canvas to flatten everything - var exportCanvas = document.createElement("canvas"); - var emptyCanvas = document.createElement("canvas"); - var layersCopy = layers.slice(); - - exportCanvas.width = canvasSize[0]; - exportCanvas.height = canvasSize[1]; - - emptyCanvas.width = canvasSize[0]; - emptyCanvas.height = canvasSize[1]; - - // Sorting the layers by z index - layersCopy.sort((a, b) => (a.canvas.style.zIndex > b.canvas.style.zIndex) ? 1 : -1); - - // Merging every layer on the export canvas - for (let i=0; i (a.canvas.style.zIndex > b.canvas.style.zIndex) ? 1 : -1); + + // Merging every layer on the export canvas + for (let i=0; i changelog-popup}} {{> credits-popup}} {{> settings-popup}} + {{> pixel-export-popup}} diff --git a/views/pixel-export-popup.hbs b/views/pixel-export-popup.hbs new file mode 100644 index 0000000..464d4f8 --- /dev/null +++ b/views/pixel-export-popup.hbs @@ -0,0 +1,14 @@ +
+ + +

Export File

+ +
+

File Name

+ +
+ +
+ +
+
\ No newline at end of file