phyrexian

This commit is contained in:
Kyle
2021-01-15 19:09:04 -08:00
parent 03c9029c9c
commit 6ce46343cb
2 changed files with 59 additions and 0 deletions

38
phyrexian/index.php Normal file
View File

@@ -0,0 +1,38 @@
<?php include('../globalHTML/header.php'); ?>
<title>Ask Urza 2.0</title>
<h2 class='readable-background header-extension title center margin-bottom-large'>Phyrexian Text Generator</h2>
<style>
textarea.input.phyrexian-textarea {
resize: none;
max-height: 66vh;
height: 30rem;
}
textarea.input.phyrexian-textarea:disabled {
opacity: 1;
}
</style>
<div class="layer margin-bottom-large">
<div class='input-grid padding margin-bottom readable-background'>
<div>
<h5 class='margin-bottom padding input-description'>Input the text you would like to be "translated"</h5>
<textarea class='input phyrexian-textarea' id='inputText' oninput='generatePhyrexianText()'></textarea>
</div>
<div>
<h5 class='margin-bottom padding input-description'>Then copy the "translated" text from here</h5>
<textarea class='input phyrexian-textarea' id='outputText' style='font-family: "phyrexian";' disabled></textarea>
</div>
</div>
</div>
<div class="readable-background layer margin-bottom-large">
<h3 class='padding margin-bottom center'>
This is not a translator
</h3>
<h4 class='padding margin-bottom'>
Phyrexian Text Generator simply takes the number of characters that you input and randomizes them into characters that are compatible with Phyrexian fonts.
</h4>
<h4 class='padding margin-bottom'>
To use the generated text in Card Conjurer, simply copy and paste the output text, but remember to add {fontphyrexian} before it so that the correct font is used!
</h4>
</div>
<script defer src="/phyrexian/phyrexian.js"></script>
<?php include('../globalHTML/footer.php'); ?>

21
phyrexian/phyrexian.js Normal file
View File

@@ -0,0 +1,21 @@
var randomCharacters = [/*'*',*/ 'N', 'V', 'O', 'A', 'I', 'T', '^', '>', 'M', '<', 'E', 'Q', 'G', 'J', 'L', 'K', 'F', 'H', '"', 'Z', /*'X',*/ '`', 'r', 't', /*'_',*/ 'v', 'x', 'j']
function generatePhyrexianText() {
var inputText = document.getElementById('inputText').value
var outputText = ''
var paragraphs = inputText.split('\n')
for (var i = 0; i < paragraphs.length; i ++) {
var sentences = paragraphs[i].split('. ')
for (var j = 0; j < sentences.length; j ++) {
outputText += '['
for (var k = 0; k < sentences[j].length - 2; k ++) {
outputText += randomCharacters[Math.floor(Math.random() * randomCharacters.length)]
}
outputText += '] '
}
if (i != paragraphs.length - 1) {
outputText += '\n'
}
}
document.getElementById('outputText').value = outputText
}