Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbirnholz committed Jul 27, 2024
2 parents 96a8e25 + b2ae1ed commit 1bd91d3
Show file tree
Hide file tree
Showing 25 changed files with 82 additions and 31 deletions.
3 changes: 2 additions & 1 deletion creator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ <h5>{e}</h5><h5>Energy symbol</h5>
<h5>{+1}</h5><h5>+1 loyalty icon</h5>
<h5>{planeswalker}</h5><h5>Planeswalker icon</h5>
<h5>{chaos}</h5><h5>Chaos symbol (planechase)</h5>
<h5>{p}</h5><h5>Bloomburrow pawprint symbol</h5>
<h5>Notes</h5><h5>Hybrid/Phyrexian mana only works with WUBRG</h5>
</div>
</div>
Expand Down Expand Up @@ -742,7 +743,7 @@ <h5 onclick='downloadCard(true);' id='downloadAlt' href='' target='_blank' class
<span class='checkmark'></span>
</label> -->
</div>

</div>
</div>
<!--
Expand Down
4 changes: 2 additions & 2 deletions data/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function addToManaSymbolList(folderPath, newManaSymbolList) {
}
}

addToManaSymbolList('/data/images/cardImages/manaSymbols/', ["0.svg", "1.svg", "2.svg", "3.svg", "4.svg", "5.svg", "6.svg", "7.svg", "8.svg", "9.svg", "10.svg", "11.svg", "12.svg", "13.svg", "14.svg", "15.svg", "16.svg", "17.svg", "18.svg", "19.svg", "20.svg", "w.svg", "u.svg", "b.svg", "r.svg", "g.svg", "2w.svg", "2u.svg", "2b.svg", "2r.svg", "2g.svg", "pw.svg", "pu.svg", "pb.svg", "pr.svg", "pg.svg", "wu.svg", "wb.svg", "ub.svg", "ur.svg", "br.svg", "bg.svg", "rg.svg", "rw.svg", "gw.svg", "gu.svg", "x.svg", "s.svg", "c.svg", "t.svg","untap.svg", "e.svg", "y.svg", "z.svg", "half.svg", "inf.svg", "chaos.svg", "l+", "l-", "l0", "oldtap.svg", "artistbrush.svg", "bar", "whitebar", "whiteBrush", "blackBrush", 'star.svg'])
addToManaSymbolList('/data/images/cardImages/manaSymbols/', ["0.svg", "1.svg", "2.svg", "3.svg", "4.svg", "5.svg", "6.svg", "7.svg", "8.svg", "9.svg", "10.svg", "11.svg", "12.svg", "13.svg", "14.svg", "15.svg", "16.svg", "17.svg", "18.svg", "19.svg", "20.svg", "w.svg", "u.svg", "b.svg", "r.svg", "g.svg", "2w.svg", "2u.svg", "2b.svg", "2r.svg", "2g.svg", "pw.svg", "pu.svg", "pb.svg", "pr.svg", "pg.svg", "wu.svg", "wb.svg", "ub.svg", "ur.svg", "br.svg", "bg.svg", "rg.svg", "rw.svg", "gw.svg", "gu.svg", "x.svg", "s.svg", "c.svg", "t.svg","untap.svg", "e.svg", "y.svg", "z.svg", "half.svg", "inf.svg", "chaos.svg", "l+", "l-", "l0", "oldtap.svg", "artistbrush.svg", "bar", "whitebar", "whiteBrush", "blackBrush", 'star.svg', "p.svg"])

function newCanvas(name) {
window[name + 'Canvas'] = document.createElement('canvas')
Expand Down Expand Up @@ -397,7 +397,7 @@ function loadMaskImages(listOfMasks) {
maskImageList.push(maskImage)
maskNameList.push(listOfMasks[i][0])
}

}
}
function loadFrameImages(listOfFrames, frameClass) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/bThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/g.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/gThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/mThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/r.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/rThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/u.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/uThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/frames/m15/fullTextAlt/wThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/manaSymbols/h.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion img/manaSymbols/p.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions js/creator-23.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ async function resetCardIrregularities({canvas = [getStandardWidth(), getStandar
}
});
if (resetOthers) {
setBottomInfoStyle();
setBottomInfoStyle();
//onload
card.onload = null;

card.hideBottomInfoBorder = false;
card.showsFlavorBar = true;
}
Expand Down Expand Up @@ -323,8 +323,8 @@ const mana = new Map();
// var manaSymbols = [];
loadManaSymbols(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20',
'w', 'u', 'b', 'r', 'g', 'c', 'x', 'y', 'z', 't', 'untap', 's', 'oldtap', 'originaltap', 'purple', "inf", "alchemy"]);
loadManaSymbols(true, ['e', 'a']);
loadManaSymbols(['wu', 'wb', 'ub', 'ur', 'br', 'bg', 'rg', 'rw', 'gw', 'gu', '2w', '2u', '2b', '2r', '2g', 'wp', 'up', 'bp', 'rp', 'gp', 'p',
loadManaSymbols(true, ['e', 'a', 'p']);
loadManaSymbols(['wu', 'wb', 'ub', 'ur', 'br', 'bg', 'rg', 'rw', 'gw', 'gu', '2w', '2u', '2b', '2r', '2g', 'wp', 'up', 'bp', 'rp', 'gp', 'h',
'wup', 'wbp', 'ubp', 'urp', 'brp', 'bgp', 'rgp', 'rwp', 'gwp', 'gup', 'purplew', 'purpleu', 'purpleb', 'purpler', 'purpleg',
'2purple', 'purplep', 'cw', 'cu', 'cb', 'cr', 'cg'], [1.2, 1.2]);
loadManaSymbols(['bar.png', 'whitebar.png']);
Expand Down Expand Up @@ -1063,7 +1063,7 @@ async function autoM15NewFrame(colors, mana_cost, type_line, power, style = 'reg
frames.push(makeM15NewFrameByLetter(properties.pinlineRight, 'Inner Crown', true, style));
}

frames.push(makeM15NewFrameByLetter(properties.pinline, 'Inner Crown', false, style));
frames.push(makeM15NewFrameByLetter(properties.pinline, 'Inner Crown', false, style));
}

if (properties.pinlineRight) {
Expand Down Expand Up @@ -4636,8 +4636,8 @@ function drawCard() {
} else {
cardContext.drawImage(bottomInfoCanvas, 0, 0, cardCanvas.width, cardCanvas.height);
}


// cutout the corners
cardContext.globalCompositeOperation = 'destination-out';
if (!card.noCorners && (card.marginX == 0 && card.marginY == 0)) {
Expand Down Expand Up @@ -4723,34 +4723,34 @@ function scryfallCardFromText(text) {
}

lines = lines.map(item => item.trim()).filter(item => item != "");

var name = lines.shift();
var manaCost;
var manaCostStartIndex = name.indexOf("{");
if (manaCostStartIndex > 0) {
manaCost = name.substring(manaCostStartIndex).trim();
name = name.substring(0, manaCostStartIndex).trim();
}

var cardObject = {
"name": name,
"lang": "en"
};

if (manaCost !== undefined) {
cardObject.mana_cost = manaCost;
}

if (lines.count == 0) {
return cardObject;
}

cardObject.type_line = lines.shift().trim();

if (lines.count == 0) {
return cardObject;
}

var regex = /[0-9+\-*]+\/[0-9+*]+/
var match = lines[lines.length-1].match(regex);
if (match) {
Expand All @@ -4759,13 +4759,13 @@ function scryfallCardFromText(text) {
cardObject.toughness = pt[1];
lines.pop();
}

if (lines.count == 0) {
return cardObject;
}

cardObject.oracle_text = lines.join("\n");

return cardObject;
}

Expand Down Expand Up @@ -4838,11 +4838,11 @@ function changeCardIndex() {
card.text.middleStatTitle.text = '';
card.text.rightStatTitle.text = '';
}

} else {
card.text.rules.text = langFontCode + rulesText;
}

if (cardToImport.flavor_text) {
var flavorText = cardToImport.flavor_text;
var flavorTextCounter = 1;
Expand All @@ -4865,13 +4865,13 @@ function changeCardIndex() {
card.text.rules.text += '{flavor}';
card.text.rulesnoncreature.text += curlyQuotes(flavorText.replace('\n', '{lns}'));
}

} else {
card.text.rules.text += '{flavor}';
card.text.rules.text += curlyQuotes(flavorText.replace('\n', '{lns}'));
}


}
} else if (card.text.case) {
rulesText = rulesText.replace(/(\r\n|\r|\n)/g, '//{bar}//');
Expand Down Expand Up @@ -4969,7 +4969,7 @@ function changeCardIndex() {
document.querySelector('#info-number').value = number;
}


bottomInfoEdited();
}
}
Expand Down
1 change: 1 addition & 0 deletions js/frameSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const frameNames = new Map ([
['Universes Beyond (Full art)', 'UBFull'],
['Universes Beyond (Extended art)', 'UBExtendedArt'],
['Full Text', 'FullText'],
['Full Text (Alt)', 'FullTextAlt'],
['Etched', 'Etched'],
['Etched (Nyx)', 'EtchedNyx'],
['Etched (Snow)', 'EtchedSnow'],
Expand Down
1 change: 1 addition & 0 deletions js/frames/groupShowcase-5.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ loadFramePacks([
{name:'Extended Art (Shorter Textbox)', value:'M15ExtendedArtShort'},
{name:'FNM Promo (Inverted Promos)', value:'FNM'},
{name:'Full Text', value:'FullText'},
{name:'Full Text (Alt)', value:'FullTextAlt'},
{name:'Foil-Etched', value:'disabled'},
{name:'Etched', value:'Etched'},
{name:'Etched (Nyx)', value:'EtchedNyx'},
Expand Down
4 changes: 2 additions & 2 deletions js/frames/packAdventure.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//Create objects for common properties across available frames
var masks = [{src:'/img/frames/adventure/regular/pinline.svg', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/m15/regular/m15MaskType.png', name:'Type'}, {src:'/img/frames/adventure/regular/book.svg', name:'Rules'}, {src:'/img/frames/adventure/regular/bookLeft.png', name:'Rules (Left)'}, {src:'/img/frames/adventure/regular/bookLeftMulticolor.png', name:'Rules (Left, Multicolor)'}, {src:'/img/frames/adventure/regular/bookRight.png', name:'Rules (Right)'}];
var masks = [{src:'/img/frames/adventure/regular/pinline.svg', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/m15/regular/m15MaskType.png', name:'Type'}, {src:'/img/frames/adventure/regular/book.svg', name:'Rules'}, {src:'/img/frames/adventure/regular/bookLeft.png', name:'Rules (Left)'}, {src:'/img/frames/adventure/regular/bookLeftMulticolor.png', name:'Rules (Left, Multicolor)'}, {src:'/img/frames/adventure/regular/bookRight.png', name:'Rules (Right)'}, {src:'/img/frames/adventure/regular/bookRightMulticolor.png', name:'Rules (Right, Multicolor)'}];
var bounds = {x:0.7573, y:0.8848, width:0.188, height:0.0733};
//defines available frames
availableFrames = [
Expand Down Expand Up @@ -55,4 +55,4 @@ loadFramePack();
//Only for the main version as the webpage loads:
if (!card.text) {
document.querySelector('#loadFrameVersion').click();
}
}
47 changes: 47 additions & 0 deletions js/frames/packFullTextAlt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//Create objects for common properties across available frames
var masks = [{src:'/img/frames/m15/fullText/pinline.svg', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/m15/fullText/rules.svg', name:'Rules'}, {src:'/img/frames/m15/fullText/frame.svg', name:'Frame'}, {src:'/img/frames/m15/regular/m15MaskBorder.png', name:'Border'}];
var bounds = {x:0.7573, y:0.8848, width:0.188, height:0.0733};
//defines available frames
availableFrames = [
{name:'White Frame', src:'/img/frames/m15/fullTextAlt/w.png', masks:masks},
{name:'Blue Frame', src:'/img/frames/m15/fullTextAlt/u.png', masks:masks},
{name:'Black Frame', src:'/img/frames/m15/fullTextAlt/b.png', masks:masks},
{name:'Red Frame', src:'/img/frames/m15/fullTextAlt/r.png', masks:masks},
{name:'Green Frame', src:'/img/frames/m15/fullTextAlt/g.png', masks:masks},
{name:'Multicolored Frame', src:'/img/frames/m15/fullTextAlt/m.png', masks:masks},
{name:'White Power/Toughness', src:'/img/frames/m15/regular/m15PTW.png', bounds:bounds},
{name:'Blue Power/Toughness', src:'/img/frames/m15/regular/m15PTU.png', bounds:bounds},
{name:'Black Power/Toughness', src:'/img/frames/m15/regular/m15PTB.png', bounds:bounds},
{name:'Red Power/Toughness', src:'/img/frames/m15/regular/m15PTR.png', bounds:bounds},
{name:'Green Power/Toughness', src:'/img/frames/m15/regular/m15PTG.png', bounds:bounds},
{name:'Multicolored Power/Toughness', src:'/img/frames/m15/regular/m15PTM.png', bounds:bounds},
{name:'Artifact Power/Toughness', src:'/img/frames/m15/regular/m15PTA.png', bounds:bounds},
{name:'Colorless Power/Toughness', src:'/img/frames/m15/regular/m15PTC.png', bounds:bounds}
];
//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 = 'fullText';
//art bounds
card.artBounds = {x:0, y:0, width:0, height:0};
autoFitArt();
//set symbol bounds
card.setSymbolBounds = {x:0.9213, y:0.1396, width:0.12, height:0.0410, vertical:'center', horizontal: 'right'};
resetSetSymbol();
//watermark bounds
card.watermarkBounds = {x:0.5, y:0.5505, width:0.75, height:0.4562};
resetWatermark();
//text
loadTextOptions({
mana: {name:'Mana Cost', text:'', y:0.0613, width:0.9292, height:71/2100, oneLine:true, size:71/1638, align:'right', shadowX:-0.001, shadowY:0.0029, manaCost:true, manaSpacing:0},
title: {name:'Title', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381},
rules: {name:'Rules Text', text:'', x:0.086, y:0.1157, width:0.828, height:0.8024, size:0.0362},
pt: {name:'Power/Toughness', text:'', x:0.7928, y:0.902, width:0.1367, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center'}
});
}
//loads available frames
loadFramePack();
4 changes: 2 additions & 2 deletions js/frames/packM15TransformBackNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var bounds = {x:0.7573, y:0.8848, width:0.188, height:0.0733};
//defines available frames
availableFrames = [
{name:'White Frame', src:'/img/frames/m15/transform/regular/new/backW.png', masks:masks},
{name:'Blue Frame', src:'/img/frames/m15/transform/regular//new/backU.png', masks:masks},
{name:'Blue Frame', src:'/img/frames/m15/transform/regular/new/backU.png', masks:masks},
{name:'Black Frame', src:'/img/frames/m15/transform/regular/new/backB.png', masks:masks},
{name:'Red Frame', src:'/img/frames/m15/transform/regular/new/backR.png', masks:masks},
{name:'Green Frame', src:'/img/frames/m15/transform/regular/new/backG.png', masks:masks},
Expand Down Expand Up @@ -49,4 +49,4 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
notify('If you intend to add the color identity pips, we recommend that you shift your Type text to the right with "{right88}".')
}
//loads available frames
loadFramePack();
loadFramePack();
2 changes: 1 addition & 1 deletion js/frames/versionSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function sagaEdited() {
sagaContext.fillText(romanNumeral(sagaCount), numeralTextX, numeralTextY - numeralTextSpread);
sagaContext.fillText(romanNumeral(sagaCount + 1), numeralTextX, numeralTextY + numeralTextSpread);
sagaCount += 2;
} else {
} else if (card.saga.abilities[i] > 2) {
var numeralSpread = 2 * scaleHeight(0.0358);
var numeralTextSpread = 2 * scaleHeight(0.0358);
sagaContext.drawImage(sagaChapter, numeralX, numeralY - numeralSpread, numeralWidth, numeralHeight);
Expand Down

0 comments on commit 1bd91d3

Please sign in to comment.