diff --git a/creator/index.php b/creator/index.php
index 671a90c1..8242873e 100644
--- a/creator/index.php
+++ b/creator/index.php
@@ -216,6 +216,7 @@ include('../globalHTML/header-1.php');
{bold}
Bolds text
{/bold}
Removes bold
{lns}
Moves to the next line without an extra space (stands for line-no-space)
+ {divider}
Moves to the next line and draws the flavor text bar
{flavor}
Moves to the next line, draws the flavor text bar, and italicizes
{fontsize#}
Changes the font size by # pixels (relative - use negative integers to shrink text - ie '{fontsize-12}')
{fontcolor___}
Changes the font color to ___ (ie '{fontcolor#00FF00}')
diff --git a/img/frames/custom/deckCover/b.png b/img/frames/custom/deckCover/b.png
new file mode 100644
index 00000000..b5e99882
Binary files /dev/null and b/img/frames/custom/deckCover/b.png differ
diff --git a/img/frames/custom/deckCover/bThumb.png b/img/frames/custom/deckCover/bThumb.png
new file mode 100644
index 00000000..b08ab890
Binary files /dev/null and b/img/frames/custom/deckCover/bThumb.png differ
diff --git a/img/frames/custom/deckCover/c.png b/img/frames/custom/deckCover/c.png
new file mode 100644
index 00000000..a8525dbb
Binary files /dev/null and b/img/frames/custom/deckCover/c.png differ
diff --git a/img/frames/custom/deckCover/cThumb.png b/img/frames/custom/deckCover/cThumb.png
new file mode 100644
index 00000000..04e2939a
Binary files /dev/null and b/img/frames/custom/deckCover/cThumb.png differ
diff --git a/img/frames/custom/deckCover/g.png b/img/frames/custom/deckCover/g.png
new file mode 100644
index 00000000..928dda50
Binary files /dev/null and b/img/frames/custom/deckCover/g.png differ
diff --git a/img/frames/custom/deckCover/gThumb.png b/img/frames/custom/deckCover/gThumb.png
new file mode 100644
index 00000000..d469b5ab
Binary files /dev/null and b/img/frames/custom/deckCover/gThumb.png differ
diff --git a/img/frames/custom/deckCover/m.png b/img/frames/custom/deckCover/m.png
new file mode 100644
index 00000000..5e23c3a7
Binary files /dev/null and b/img/frames/custom/deckCover/m.png differ
diff --git a/img/frames/custom/deckCover/mThumb.png b/img/frames/custom/deckCover/mThumb.png
new file mode 100644
index 00000000..e9b59cc4
Binary files /dev/null and b/img/frames/custom/deckCover/mThumb.png differ
diff --git a/img/frames/custom/deckCover/r.png b/img/frames/custom/deckCover/r.png
new file mode 100644
index 00000000..bc283ae0
Binary files /dev/null and b/img/frames/custom/deckCover/r.png differ
diff --git a/img/frames/custom/deckCover/rThumb.png b/img/frames/custom/deckCover/rThumb.png
new file mode 100644
index 00000000..18feab38
Binary files /dev/null and b/img/frames/custom/deckCover/rThumb.png differ
diff --git a/img/frames/custom/deckCover/u.png b/img/frames/custom/deckCover/u.png
new file mode 100644
index 00000000..e984fdab
Binary files /dev/null and b/img/frames/custom/deckCover/u.png differ
diff --git a/img/frames/custom/deckCover/uThumb.png b/img/frames/custom/deckCover/uThumb.png
new file mode 100644
index 00000000..c492be78
Binary files /dev/null and b/img/frames/custom/deckCover/uThumb.png differ
diff --git a/img/frames/custom/deckCover/w.png b/img/frames/custom/deckCover/w.png
new file mode 100644
index 00000000..3b917618
Binary files /dev/null and b/img/frames/custom/deckCover/w.png differ
diff --git a/img/frames/custom/deckCover/wThumb.png b/img/frames/custom/deckCover/wThumb.png
new file mode 100644
index 00000000..979187f5
Binary files /dev/null and b/img/frames/custom/deckCover/wThumb.png differ
diff --git a/img/manaSymbols/bThumb.png b/img/manaSymbols/bThumb.png
new file mode 100644
index 00000000..859558b2
Binary files /dev/null and b/img/manaSymbols/bThumb.png differ
diff --git a/img/manaSymbols/gThumb.png b/img/manaSymbols/gThumb.png
new file mode 100644
index 00000000..4c996397
Binary files /dev/null and b/img/manaSymbols/gThumb.png differ
diff --git a/img/manaSymbols/rThumb.png b/img/manaSymbols/rThumb.png
new file mode 100644
index 00000000..1c63f1b4
Binary files /dev/null and b/img/manaSymbols/rThumb.png differ
diff --git a/img/manaSymbols/uThumb.png b/img/manaSymbols/uThumb.png
new file mode 100644
index 00000000..1e71219b
Binary files /dev/null and b/img/manaSymbols/uThumb.png differ
diff --git a/img/manaSymbols/wThumb.png b/img/manaSymbols/wThumb.png
new file mode 100644
index 00000000..fac14c50
Binary files /dev/null and b/img/manaSymbols/wThumb.png differ
diff --git a/js/creator-23.js b/js/creator-23.js
index e5f6be7b..d922f466 100644
--- a/js/creator-23.js
+++ b/js/creator-23.js
@@ -706,6 +706,31 @@ function hsl(canvas, inputH, inputS, inputL) {
//then put the new image data back
context.putImageData(imageData, 0, 0);
}
+function croppedCanvas(oldCanvas, sensitivity = 0) {
+ var oldContext = oldCanvas.getContext('2d');
+ var newCanvas = document.createElement('canvas');
+ var newContext = newCanvas.getContext('2d');
+ var pixels = oldContext.getImageData(0, 0, oldCanvas.width, oldCanvas.height).data;
+ var pixX = [];
+ var pixY = [];
+ for (var x = 0; x < oldCanvas.width; x += 1) {
+ for (var y = 0; y < oldCanvas.height; y += 1) {
+ if (pixels[(y * oldCanvas.width + x) * 4 + 3] > sensitivity) {
+ pixX.push(x);
+ pixY.push(y);
+ }
+ }
+ }
+ pixX.sort(function(a, b) { return a - b });
+ pixY.sort(function(a, b) { return a - b });
+ var n = pixX.length - 1;
+ var newWidth = 1 + pixX[n] - pixX[0];
+ var newHeight = 1 + pixY[n] - pixY[0];
+ newCanvas.width = newWidth;
+ newCanvas.height = newHeight;
+ newContext.putImageData(oldCanvas.getContext('2d').getImageData(pixX[0], pixY[0], newWidth, newHeight), 0, 0);
+ return newCanvas;
+}
/*
shoutout to https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion for providing the hsl-rgb conversion algorithms
*/
@@ -854,7 +879,7 @@ function writeText(textObject, targetContext) {
if (rawText.toLowerCase().includes('{cardname}')) {
rawText = rawText.replace(/{cardname}/ig, getCardName());
}
- var splitText = rawText.replace(/\n/g, '{line}').replace(/{flavor}/g, '{lns}{bar}{lns}{fixtextalign}{i}').replace(/{/g, splitString + '{').replace(/}/g, '}' + splitString).replace(/ /g, splitString + ' ' + splitString).split(splitString);
+ var splitText = rawText.replace(/\n/g, '{line}').replace(/{divider}/g, '{lns}{bar}{lns}{fixtextalign}').replace(/{flavor}/g, '{lns}{bar}{lns}{fixtextalign}{i}').replace(/{/g, splitString + '{').replace(/}/g, '}' + splitString).replace(/ /g, splitString + ' ' + splitString).split(splitString);
splitText = splitText.filter(item => item);
if (textObject.vertical) {
newSplitText = [];
@@ -1682,7 +1707,9 @@ function drawCard() {
cardContext.drawImage(planeswalkerPostFrameCanvas, 0, 0, cardCanvas.width, cardCanvas.height);
} else if (card.version.includes('planeswalker') && typeof planeswalkerCanvas !== "undefined") {
cardContext.drawImage(planeswalkerCanvas, 0, 0, cardCanvas.width, cardCanvas.height);
- } // REMOVE/DELETE ME AFTER A FEW WEEKS
+ } else if (card.version.includes('QRCode') && typeof qrCodeCanvas !== "undefined") {
+ cardContext.drawImage(qrCodeCanvas, 0, 0, cardCanvas.width, cardCanvas.height);
+ } // REMOVE/DELETE PLANESWALKERCANVAS AFTER A FEW WEEKS
// guidelines
if (document.querySelector('#show-guidelines').checked) {
cardContext.drawImage(guidelinesCanvas, scaleX(card.marginX) / 2, scaleY(card.marginY) / 2, cardCanvas.width, cardCanvas.height);
diff --git a/js/frames/groupCustom.js b/js/frames/groupCustom.js
index fafc8ca2..4641c0de 100644
--- a/js/frames/groupCustom.js
+++ b/js/frames/groupCustom.js
@@ -1,5 +1,6 @@
loadFramePacks([
{name:'Misc. Custom Frames', value:'MiscCustom'},
+ {name:'Deck Covers', value:'CustomDeckCover'},
{name:'Classicshifted', value:'Classicshifted'},
{name:'Classicshifted Lands', value:'ClassicshiftedLands'},
{name:'Classicshifted Planeswalkers', value:'ClassicshiftedPlaneswalker'},
diff --git a/js/frames/packCustomDeckCover.js b/js/frames/packCustomDeckCover.js
new file mode 100644
index 00000000..d98d86e3
--- /dev/null
+++ b/js/frames/packCustomDeckCover.js
@@ -0,0 +1,49 @@
+//defines available frames
+availableFrames = [
+ {name:'White Frame', src:'/img/frames/custom/deckCover/w.png'},
+ {name:'Blue Frame', src:'/img/frames/custom/deckCover/u.png'},
+ {name:'Black Frame', src:'/img/frames/custom/deckCover/b.png'},
+ {name:'Red Frame', src:'/img/frames/custom/deckCover/r.png'},
+ {name:'Green Frame', src:'/img/frames/custom/deckCover/g.png'},
+ {name:'Multicolored Frame', src:'/img/frames/custom/deckCover/m.png'},
+ {name:'Colorless Frame', src:'/img/frames/custom/deckCover/c.png'},
+ {name:'White Mana Symbol', src:'/img/manaSymbols/w.svg', bounds:{x:0.1594, y:0.7529, width:0.06, height:0.0429}},
+ {name:'Blue Mana Symbol', src:'/img/manaSymbols/u.svg', bounds:{x:0.23, y:0.7896, width:0.06, height:0.0429}},
+ {name:'Black Mana Symbol', src:'/img/manaSymbols/b.svg', bounds:{x:0.2027, y:0.8486, width:0.06, height:0.0429}},
+ {name:'Red Mana Symbol', src:'/img/manaSymbols/r.svg', bounds:{x:0.116, y:0.8486, width:0.06, height:0.0429}},
+ {name:'Green Mana Symbol', src:'/img/manaSymbols/g.svg', bounds:{x:0.0887, y:0.7896, width:0.06, height:0.0429}}
+];
+//disables/enables the "Load Frame Version" button
+document.querySelector('#loadFrameVersion').disabled = false;
+//defines process for loading this version, if applicable
+document.querySelector('#loadFrameVersion').onclick = async function() {
+ //resets things so that every frame doesn't have to
+ await resetCardIrregularities();
+ //sets card version
+ card.version = 'customQRCodeDeckCover';
+ card.onload = '/js/frames/versionQRCode.js';
+ loadScript('/js/frames/versionQRCode.js');
+ //art bounds
+ card.artBounds = {x:0, y:0, width:1, height:0.7162};
+ autoFitArt();
+ //set symbol bounds
+ card.setSymbolBounds = {x:0.5, y:0.9681, width:0.12, height:0.0410, vertical:'center', horizontal: 'center'};
+ resetSetSymbol();
+ //watermark bounds
+ card.watermarkBounds = {x:0.5, y:0.7762, width:0.75, height:0.2305};
+ resetWatermark();
+ //text
+ loadTextOptions({
+ title: {name:'Title', text:'', x:0.0474, y:0.0234, width:0.9054, height:0.0534, oneLine:true, font:'beleren', size:0.0534, color:'white', align:'center', shadowX:0.0027, shadowY:0.002},
+ notes: {name:'Description', text:'', x:0.69, y:0.7358, width:0.27, height:0.18, font:'beleren', size:0.0362, color:'white', align:'center', shadowX:0.002, shadowY:0.0015}
+ });
+ //bottom info
+ await loadBottomInfo({
+ midLeft: {text:'{elemidinfo-set}*{elemidinfo-language} {fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
+ bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003},
+ wizards: {name:'wizards', text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0647, y:0.9549, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003},
+ bottomRight: {text:'CardConjurer.com', x:0.0647, y:0.972, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003}
+ });
+}
+//loads available frames
+loadFramePack();
\ No newline at end of file
diff --git a/js/frames/versionQRCode.js b/js/frames/versionQRCode.js
new file mode 100644
index 00000000..cc48eeaf
--- /dev/null
+++ b/js/frames/versionQRCode.js
@@ -0,0 +1,47 @@
+//checks to see if it needs to run
+if (!loadedVersions.includes('/js/frames/versionQRCode.js')) {
+ loadedVersions.push('/js/frames/versionQRCode.js');
+ card.qrCode = {
+ x:0.35,
+ y:0.7224,
+ size:0.2143,
+ fgColor:'#fff',
+ fgAlpha:1,
+ bgColor:'#000',
+ bgAlpha:0,
+ padding:0,
+ url:'https://cardconjurer.com/'
+ }
+ sizeCanvas('qrious');
+ sizeCanvas('qrCode');
+ document.querySelector('#creator-menu-tabs').innerHTML += 'QR Code
';
+ var newHTML = document.createElement('div');
+ newHTML.id = 'creator-menu-qrCode';
+ newHTML.classList.add('hidden');
+ newHTML.innerHTML = `
+
+
+
+
+ `;
+ document.querySelector('#creator-menu-sections').appendChild(newHTML);
+ loadScript('/js/qrious.min.js');
+}
+
+function updateQRCode(url = card.qrCode.url) {
+ //generate qr code
+ var qr = new QRious({
+ background: card.qrCode.bgColor,
+ backgroundAlpha: card.qrCode.bgAlpha,
+ foreground: card.qrCode.fgColor,
+ foregroundAlpha: card.qrCode.fgAlpha,
+ padding: scaleHeight(card.qrCode.padding),
+ size: scaleHeight(card.qrCode.size),
+ element: qriousCanvas,
+ value: url
+ });
+ //draw cropped qr code to correct location
+ qrCodeCanvas.getContext('2d').drawImage(croppedCanvas(qriousCanvas), scaleWidth(card.qrCode.x), scaleHeight(card.qrCode.y), scaleHeight(card.qrCode.size), scaleHeight(card.qrCode.size));
+ //draw the card
+ drawCard();
+}
\ No newline at end of file
diff --git a/js/qrious.min.js b/js/qrious.min.js
new file mode 100644
index 00000000..5735ea62
--- /dev/null
+++ b/js/qrious.min.js
@@ -0,0 +1,6 @@
+/*! QRious v4.0.2 | (C) 2017 Alasdair Mercer | GPL v3 License
+Based on jsqrencode | (C) 2010 tz@execpc.com | GPL v3 License
+*/
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRious=e()}(this,function(){"use strict";function t(t,e){var n;return"function"==typeof Object.create?n=Object.create(t):(s.prototype=t,n=new s,s.prototype=null),e&&i(!0,n,e),n}function e(e,n,s,r){var o=this;return"string"!=typeof e&&(r=s,s=n,n=e,e=null),"function"!=typeof n&&(r=s,s=n,n=function(){return o.apply(this,arguments)}),i(!1,n,o,r),n.prototype=t(o.prototype,s),n.prototype.constructor=n,n.class_=e||o.class_,n.super_=o,n}function i(t,e,i){for(var n,s,a=0,h=(i=o.call(arguments,2)).length;a>1&1,n=0;n0;e--)n[e]=n[e]?n[e-1]^_.EXPONENT[v._modN(_.LOG[n[e]]+t)]:n[e-1];n[0]=_.EXPONENT[v._modN(_.LOG[n[0]]+t)]}for(t=0;t<=i;t++)n[t]=_.LOG[n[t]]},_checkBadness:function(){var t,e,i,n,s,r=0,o=this._badness,a=this.buffer,h=this.width;for(s=0;sh*h;)u-=h*h,c++;for(r+=c*v.N4,n=0;n=o-2&&(t=o-2,s>9&&t--);var a=t;if(s>9){for(r[a+2]=0,r[a+3]=0;a--;)e=r[a],r[a+3]|=255&e<<4,r[a+2]=e>>4;r[2]|=255&t<<4,r[1]=t>>4,r[0]=64|t>>12}else{for(r[a+1]=0,r[a+2]=0;a--;)e=r[a],r[a+2]|=255&e<<4,r[a+1]=e>>4;r[1]|=255&t<<4,r[0]=64|t>>4}for(a=t+3-(s<10);a=5&&(i+=v.N1+n[e]-5);for(e=3;et||3*n[e-3]>=4*n[e]||3*n[e+3]>=4*n[e])&&(i+=v.N3);return i},_finish:function(){this._stringBuffer=this.buffer.slice();var t,e,i=0,n=3e4;for(e=0;e<8&&(this._applyMask(e),(t=this._checkBadness())>=1)1&n&&(s[r-1-e+8*r]=1,e<6?s[8+r*e]=1:s[8+r*(e+1)]=1);for(e=0;e<7;e++,n>>=1)1&n&&(s[8+r*(r-7+e)]=1,e?s[6-e+8*r]=1:s[7+8*r]=1)},_interleaveBlocks:function(){var t,e,i=this._dataBlock,n=this._ecc,s=this._eccBlock,r=0,o=this._calculateMaxLength(),a=this._neccBlock1,h=this._neccBlock2,f=this._stringBuffer;for(t=0;t1)for(t=u.BLOCK[n],i=s-7;;){for(e=s-7;e>t-3&&(this._addAlignment(e,i),!(e6)for(t=d.BLOCK[r-7],e=17,i=0;i<6;i++)for(n=0;n<3;n++,e--)1&(e>11?r>>e-12:t>>e)?(s[5-i+o*(2-n+o-11)]=1,s[2-n+o-11+o*(5-i)]=1):(this._setMask(5-i,2-n+o-11),this._setMask(2-n+o-11,5-i))},_isMasked:function(t,e){var i=v._getMaskBit(t,e);return 1===this._mask[i]},_pack:function(){var t,e,i,n=1,s=1,r=this.width,o=r-1,a=r-1,h=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(e=0;ee&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,i+=t},_modN:function(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t},N1:3,N2:3,N3:40,N4:10}),p=v,m=f.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var t=this.element;t.width=t.height=this.qrious.size}}),g=h.extend(function(t,e,i,n){this.name=t,this.modifiable=Boolean(e),this.defaultValue=i,this._valueTransformer=n},{transform:function(t){var e=this._valueTransformer;return"function"==typeof e?e(t,this):t}}),k=h.extend(null,{abs:function(t){return null!=t?Math.abs(t):null},hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},noop:function(){},toUpperCase:function(t){return null!=t?t.toUpperCase():null}}),w=h.extend(function(t){this.options={},t.forEach(function(t){this.options[t.name]=t},this)},{exists:function(t){return null!=this.options[t]},get:function(t,e){return w._get(this.options[t],e)},getAll:function(t){var e,i=this.options,n={};for(e in i)k.hasOwn(i,e)&&(n[e]=w._get(i[e],t));return n},init:function(t,e,i){"function"!=typeof i&&(i=k.noop);var n,s;for(n in this.options)k.hasOwn(this.options,n)&&(s=this.options[n],w._set(s,s.defaultValue,e),w._createAccessor(s,e,i));this._setAll(t,e,!0)},set:function(t,e,i){return this._set(t,e,i)},setAll:function(t,e){return this._setAll(t,e)},_set:function(t,e,i,n){var s=this.options[t];if(!s)throw new Error("Invalid option: "+t);if(!s.modifiable&&!n)throw new Error("Option cannot be modified: "+t);return w._set(s,e,i)},_setAll:function(t,e,i){if(!t)return!1;var n,s=!1;for(n in t)k.hasOwn(t,n)&&this._set(n,t[n],e,i)&&(s=!0);return s}},{_createAccessor:function(t,e,i){var n={get:function(){return w._get(t,e)}};t.modifiable&&(n.set=function(n){w._set(t,n,e)&&i(n,t)}),Object.defineProperty(e,t.name,n)},_get:function(t,e){return e["_"+t.name]},_set:function(t,e,i){var n="_"+t.name,s=i[n],r=t.transform(null!=e?e:t.defaultValue);return i[n]=r,r!==s}}),M=w,b=h.extend(function(){this._services={}},{getService:function(t){var e=this._services[t];if(!e)throw new Error("Service is not being managed with name: "+t);return e},setService:function(t,e){if(this._services[t])throw new Error("Service is already managed with name: "+t);e&&(this._services[t]=e)}}),B=new M([new g("background",!0,"white"),new g("backgroundAlpha",!0,1,k.abs),new g("element"),new g("foreground",!0,"black"),new g("foregroundAlpha",!0,1,k.abs),new g("level",!0,"L",k.toUpperCase),new g("mime",!0,"image/png"),new g("padding",!0,null,k.abs),new g("size",!0,100,k.abs),new g("value",!0,"")]),y=new b,O=h.extend(function(t){B.init(t,this,this.update.bind(this));var e=B.get("element",this),i=y.getService("element"),n=e&&i.isCanvas(e)?e:i.createCanvas(),s=e&&i.isImage(e)?e:i.createImage();this._canvasRenderer=new c(this,n,!0),this._imageRenderer=new m(this,s,s===e),this.update()},{get:function(){return B.getAll(this)},set:function(t){B.setAll(t,this)&&this.update()},toDataURL:function(t){return this.canvas.toDataURL(t||this.mime)},update:function(){var t=new p({level:this.level,value:this.value});this._canvasRenderer.render(t),this._imageRenderer.render(t)}},{use:function(t){y.setService(t.getName(),t)}});Object.defineProperties(O.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var A=O,L=h.extend({getName:function(){}}).extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(t){},isImage:function(t){}}).extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(t){return t instanceof HTMLCanvasElement},isImage:function(t){return t instanceof HTMLImageElement}});return A.use(new L),A});
+
+//# sourceMappingURL=qrious.min.js.map
\ No newline at end of file