forked from GithubMirrors/cardconjurer
		
	nifty
This commit is contained in:
		
							
								
								
									
										28
									
								
								data/main.js
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								data/main.js
									
									
									
									
									
								
							@@ -877,6 +877,32 @@ function loadImage(event, destination, arg) {
 | 
				
			|||||||
		reader.readAsDataURL(input.files[0])
 | 
							reader.readAsDataURL(input.files[0])
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					//Loads card art from Scryfall via their api!
 | 
				
			||||||
 | 
					var savedArtistName
 | 
				
			||||||
 | 
					function inputCardArtName(cardArtNameInput) {
 | 
				
			||||||
 | 
						var xhttp = new XMLHttpRequest()
 | 
				
			||||||
 | 
						xhttp.onreadystatechange = function() {
 | 
				
			||||||
 | 
							if (this.readyState == 4 && this.status == 200) {
 | 
				
			||||||
 | 
								var originalResponse = this.responseText
 | 
				
			||||||
 | 
								var editedResponse = originalResponse.slice(originalResponse.indexOf('"art_crop":"') + 12, originalResponse.indexOf('","border_crop"'))
 | 
				
			||||||
 | 
								// alert(editedResponse)
 | 
				
			||||||
 | 
								imgArt.src = editedResponse
 | 
				
			||||||
 | 
								if (document.getElementById("inputArtist").value == "" || document.getElementById("inputArtist").value == savedArtistName) {
 | 
				
			||||||
 | 
									savedArtistName = originalResponse.slice(originalResponse.indexOf('"artist":"') + 10, originalResponse.indexOf('","border_color":'))
 | 
				
			||||||
 | 
									document.getElementById("inputArtist").value = savedArtistName
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (document.getElementById("imageSize").value == 100) {
 | 
				
			||||||
 | 
									document.getElementById("imageSize").value = 100.8
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								if (this.readyState == 4 && this.status == 404) {
 | 
				
			||||||
 | 
									alert("Sorry, but we can't seem to find any art for '" + cardArtNameInput + "'")
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						xhttp.open("GET", "https://api.scryfall.com/cards/named?fuzzy=" + cardArtNameInput.replace(/ /g, "+"), true)
 | 
				
			||||||
 | 
						xhttp.send()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//============================================//
 | 
					//============================================//
 | 
				
			||||||
@@ -1087,4 +1113,4 @@ function checkCookies() {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
checkCookies()
 | 
					checkCookies()
 | 
				
			||||||
@@ -283,6 +283,8 @@
 | 
				
			|||||||
					<br>
 | 
										<br>
 | 
				
			||||||
					<input type="text" class="input" placeholder="Or use a URL" onchange="imageURL(this, imgArt)">
 | 
										<input type="text" class="input" placeholder="Or use a URL" onchange="imageURL(this, imgArt)">
 | 
				
			||||||
					<br>
 | 
										<br>
 | 
				
			||||||
 | 
										<input id="inputCardArtName" onchange="inputCardArtName(this.value)" class="input" type="text" placeholder="Or try using a card name"></input>
 | 
				
			||||||
 | 
										<br>
 | 
				
			||||||
					Image Zoom
 | 
										Image Zoom
 | 
				
			||||||
					<input id="imageSize" type="number" class="input" value="100" step="0.1">
 | 
										<input id="imageSize" type="number" class="input" value="100" step="0.1">
 | 
				
			||||||
					<br>
 | 
										<br>
 | 
				
			||||||
@@ -453,9 +455,6 @@
 | 
				
			|||||||
						<div onclick="window.open('https://twitter.com/ImKyle4815', '_blank');" style="color:rgb(0,174,239);">Twitter<img src="images/twitter.png"></img></div>
 | 
											<div onclick="window.open('https://twitter.com/ImKyle4815', '_blank');" style="color:rgb(0,174,239);">Twitter<img src="images/twitter.png"></img></div>
 | 
				
			||||||
						<div onclick="window.open('https://www.massdrop.com/?referer=LNWNLL', '_blank');" style="color:rgb(255,255,255);">Massdrop<img src="images/massdrop.png"></img></div>
 | 
											<div onclick="window.open('https://www.massdrop.com/?referer=LNWNLL', '_blank');" style="color:rgb(255,255,255);">Massdrop<img src="images/massdrop.png"></img></div>
 | 
				
			||||||
						<div onclick="window.open('https://www.youtube.com/channel/UC95Pd8lc8UWEkI96Nq_THvw', '_blank');" style="color:rgb(255,0,0);">Izzet Right?<img src="images/izzetright.png"></img></div>
 | 
											<div onclick="window.open('https://www.youtube.com/channel/UC95Pd8lc8UWEkI96Nq_THvw', '_blank');" style="color:rgb(255,0,0);">Izzet Right?<img src="images/izzetright.png"></img></div>
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						
 | 
					 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
				<div class="extras" id="extras-symbolList">
 | 
									<div class="extras" id="extras-symbolList">
 | 
				
			||||||
@@ -580,7 +579,7 @@ body {
 | 
				
			|||||||
.canvasContainer {
 | 
					.canvasContainer {
 | 
				
			||||||
	text-align: center;
 | 
						text-align: center;
 | 
				
			||||||
	background-color: none !important;
 | 
						background-color: none !important;
 | 
				
			||||||
	width: calc(100% - 18px);
 | 
						width: calc(100% - 14px);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.selectionGrid {
 | 
					.selectionGrid {
 | 
				
			||||||
	grid-template-columns: repeat(auto-fit, minmax(6em, 1fr));
 | 
						grid-template-columns: repeat(auto-fit, minmax(6em, 1fr));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user