mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 13:21:41 -05:00
phyrexian
This commit is contained in:
38
phyrexian/index.php
Normal file
38
phyrexian/index.php
Normal 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
21
phyrexian/phyrexian.js
Normal 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
|
||||
}
|
Reference in New Issue
Block a user