You are on page 1of 39

Topalian

Cipher
Generator
by
Christopher Topalian
All Rights Reserved
Copyright 2000-2023
Dedicated
to
God the Father
<!-- Dedicated to God the Father -->

<!-- All Rights Reserved Christopher Topalian Copyright


2000-2023 -->

<!-- https://github.com/ChristopherTopalian -->

<!-- Topalian_Cipher_Generator.html -->

<!-- Version 001 -->

<html>
<head>
<title> Topalian Cipher Generator </title>

<link rel = "stylesheet" href = "css/style001.css">

<script>
let convertedTextArray = [];

function createCipherGenerator()
{
let mainDiv = document.createElement("div");
mainDiv.className = "mainDivStyle";
document.body.append(mainDiv);

//----//

let titleText = document.createElement("div");


titleText.className = "titleTextStyle";
titleText.innerHTML = "Topalian Cipher Generator";
mainDiv.append(titleText);

//----//

let lineAfterTitleText =
document.createElement("hr");
lineAfterTitleText.style.margin = 3 + "px";
mainDiv.append(lineAfterTitleText);

//----//

let line2AfterTitleText =
document.createElement("hr");
line2AfterTitleText.style.margin = 7 + "px";
mainDiv.append(line2AfterTitleText);

//----//

let enterText = document.createElement("textarea");


enterText.id = "enterText";
enterText.className = "enterTextStyle";
enterText.placeholder = "Enter Text Here";
enterText.title = "Enter Text Here";

enterText.onchange = function()
{
// clear unscrambledArray
unscrambledArray = [];

// clear the unscrambled text box


document.getElementById("unscrambledResult").value
= "";

//----//

let originalTextArray =
enterText.value.toLowerCase().split("");

console.log(originalTextArray);

for (let x = 0; x < originalTextArray.length; x++)


{
if (originalTextArray[x] == "a")
{
convertedTextArray.push(originalTextArray[x]
= 1);
}

if (originalTextArray[x] == "b")
{
convertedTextArray.push(originalTextArray[x]
= 2);
}

if (originalTextArray[x] == "c")
{
convertedTextArray.push(originalTextArray[x]
= 3);
}

if (originalTextArray[x] == "d")
{
convertedTextArray.push(originalTextArray[x]
= 4);
}

if (originalTextArray[x] == "e")
{
convertedTextArray.push(originalTextArray[x]
= 5);
}

if (originalTextArray[x] == "f")
{
convertedTextArray.push(originalTextArray[x]
= 6);
}

if (originalTextArray[x] == "g")
{
convertedTextArray.push(originalTextArray[x]
= 7);
}

if (originalTextArray[x] == "h")
{
convertedTextArray.push(originalTextArray[x]
= 8);
}

if (originalTextArray[x] == "i")
{
convertedTextArray.push(originalTextArray[x]
= 9);
}

if (originalTextArray[x] == "j")
{
convertedTextArray.push(originalTextArray[x]
= 10);
}

if (originalTextArray[x] == "k")
{
convertedTextArray.push(originalTextArray[x]
= 11);
}

if (originalTextArray[x] == "l")
{
convertedTextArray.push(originalTextArray[x]
= 12);
}

if (originalTextArray[x] == "m")
{
convertedTextArray.push(originalTextArray[x]
= 13);
}

if (originalTextArray[x] == "n")
{
convertedTextArray.push(originalTextArray[x]
= 14);
}

if (originalTextArray[x] == "o")
{
convertedTextArray.push(originalTextArray[x]
= 15);
}

if (originalTextArray[x] == "p")
{
convertedTextArray.push(originalTextArray[x]
= 16);
}

if (originalTextArray[x] == "q")
{
convertedTextArray.push(originalTextArray[x]
= 17);
}

if (originalTextArray[x] == "r")
{
convertedTextArray.push(originalTextArray[x]
= 18);
}

if (originalTextArray[x] == "s")
{
convertedTextArray.push(originalTextArray[x]
= 19);
}

if (originalTextArray[x] == "t")
{
convertedTextArray.push(originalTextArray[x]
= 20);
}

if (originalTextArray[x] == "u")
{
convertedTextArray.push(originalTextArray[x]
= 21);
}

if (originalTextArray[x] == "v")
{
convertedTextArray.push(originalTextArray[x]
= 22);
}

if (originalTextArray[x] == "w")
{
convertedTextArray.push(originalTextArray[x]
= 23);
}

if (originalTextArray[x] == "x")
{
convertedTextArray.push(originalTextArray[x]
= 24);
}

if (originalTextArray[x] == "y")
{
convertedTextArray.push(originalTextArray[x]
= 25);
}

if (originalTextArray[x] == "z")
{
convertedTextArray.push(originalTextArray[x]
= 26);
}

document.getElementById("conversionResult").value
= convertedTextArray;
}

//----//

// we add the values together to calculate their sum


convertedTextArray.reduce(function()
{
let result =
convertedTextArray.reduce(function(a, b)
{
return a + b;
}, 0);

document.getElementById("sumResult").value =
result;

console.log(result);
});

convertedTextArray = [];

};

mainDiv.append(enterText);

//----//
let lineAfterEnterText =
document.createElement("hr");
mainDiv.append(lineAfterEnterText);

//----//

let conversionResult =
document.createElement("textarea");
conversionResult.id = "conversionResult";
conversionResult.className =
"conversionResultStyle";
conversionResult.placeholder = "The Converted
Values";
conversionResult.setAttribute("readonly", "true");
mainDiv.append(conversionResult);

//----//
let lineAfterConversionResult =
document.createElement("hr");
mainDiv.append(lineAfterConversionResult);

//----//

let sumResult = document.createElement("textarea");


sumResult.id = "sumResult";
sumResult.className = "sumResultStyle";
sumResult.placeholder = "The Sum";
sumResult.setAttribute("readonly", "true");
mainDiv.append(sumResult);

//----//

let lineAfterSumResult =
document.createElement("hr");
mainDiv.append(lineAfterSumResult);
//----//

let unscrambledResult =
document.createElement("textarea");
unscrambledResult.id = "unscrambledResult";
unscrambledResult.className =
"unscrambledResultStyle";
unscrambledResult.setAttribute("readonly", "true");
mainDiv.append(unscrambledResult);

//----//

let unscrambleButton =
document.createElement("button");
unscrambleButton.className =
"unscrambleButtonStyle";
unscrambleButton.innerHTML = "Unscramble";

// when left clicked


unscrambleButton.onclick = function()
{
unscrambleText()
};

mainDiv.append(unscrambleButton);
}

//----//

let unscrambledArray = [];

function unscrambleText()
{
let originalTextArray =
document.getElementById("conversionResult").value.t
oLowerCase().split(",");

for (let x = 0; x < originalTextArray.length; x++)


{
if (originalTextArray[x] == "1")
{
unscrambledArray.push(originalTextArray[x] =
"a");
}

if (originalTextArray[x] == "2")
{
unscrambledArray.push(originalTextArray[x] =
"b");
}

if (originalTextArray[x] == "3")
{
unscrambledArray.push(originalTextArray[x] =
"c");
}
if (originalTextArray[x] == "4")
{
unscrambledArray.push(originalTextArray[x] =
"d");
}

if (originalTextArray[x] == "5")
{
unscrambledArray.push(originalTextArray[x] =
"e");
}

if (originalTextArray[x] == "6")
{
unscrambledArray.push(originalTextArray[x] =
"f");
}

if (originalTextArray[x] == "7")
{
unscrambledArray.push(originalTextArray[x] =
"g");
}

if (originalTextArray[x] == "8")
{
unscrambledArray.push(originalTextArray[x] =
"h");
}

if (originalTextArray[x] == "9")
{
unscrambledArray.push(originalTextArray[x] =
"i");
}

if (originalTextArray[x] == "10")
{
unscrambledArray.push(originalTextArray[x] =
"j");
}

if (originalTextArray[x] == "11")
{
unscrambledArray.push(originalTextArray[x] =
"k");
}

if (originalTextArray[x] == "12")
{
unscrambledArray.push(originalTextArray[x] =
"l");
}

if (originalTextArray[x] == "13")
{
unscrambledArray.push(originalTextArray[x] =
"m");
}

if (originalTextArray[x] == "14")
{
unscrambledArray.push(originalTextArray[x] =
"n");
}

if (originalTextArray[x] == "15")
{
unscrambledArray.push(originalTextArray[x] =
"o");
}

if (originalTextArray[x] == "16")
{
unscrambledArray.push(originalTextArray[x] =
"p");
}

if (originalTextArray[x] == "17")
{
unscrambledArray.push(originalTextArray[x] =
"q");
}

if (originalTextArray[x] == "18")
{
unscrambledArray.push(originalTextArray[x] =
"r");
}

if (originalTextArray[x] == "19")
{
unscrambledArray.push(originalTextArray[x] =
"s");
}

if (originalTextArray[x] == "20")
{
unscrambledArray.push(originalTextArray[x] =
"t");
}

if (originalTextArray[x] == "21")
{
unscrambledArray.push(originalTextArray[x] =
"u");
}

if (originalTextArray[x] == "22")
{
unscrambledArray.push(originalTextArray[x] =
"v");
}

if (originalTextArray[x] == "23")
{
unscrambledArray.push(originalTextArray[x] =
"w");
}

if (originalTextArray[x] == "24")
{
unscrambledArray.push(originalTextArray[x] =
"x");
}

if (originalTextArray[x] == "25")
{
unscrambledArray.push(originalTextArray[x] =
"y");
}

if (originalTextArray[x] == "26")
{
unscrambledArray.push(originalTextArray[x] =
"z");
}

document.getElementById("unscrambledResult").value
= unscrambledArray;
}

unscrambledArray = [];

</script>
</head>

<body onload = "createCipherGenerator();">

</body>

</html>
/* Dedicated to God the Father */

/* All Rights Reserved Christopher Topalian Copyright


2000-2023 */

/* https://github.com/ChristopherTopalian */

/* style001.css */

body
{
background-color: rgb(70, 70, 70);
color: rgb(200, 200, 200);
}

textarea
{
width: 500px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
background-color: rgb(30, 30, 30);
font-family: arial;
font-size: 30px;
font-weight: bold;
color: rgb(255, 255, 255);
}

hr
{
width: 100%;
}

.mainDivStyle
{
position: relative;
left: 20px;
top: 100px;
width: 500px;
border-style: solid;
border-width: 2px;
border-radius: 5px;
display: flex;
flex-direction: column;
align-items: center;
margin: auto;
}

.titleTextStyle
{
padding: 5px;
margin: auto;
font-family: arial;
font-size: 30px;
font-weight: bold;
display: flex;
flex-direction: column;
align-items: center;
}

.enterTextStyle
{
padding-top: 2px;
padding-bottom: 2px;
}

.conversionResultStyle
{
padding-top: 4px;
padding-bottom: 4px;
color: rgb(0, 275, 275);
}

.sumResultStyle
{
padding-top: 4px;
padding-bottom: 4px;
color: rgb(0, 275, 275);
}

.unscrambledResultStyle
{
padding-top: 2px;
padding-bottom: 2px;
}

.unscrambleButtonStyle
{
padding-left: 10px;
padding-right: 10px;
padding-top: 3px;
padding-bottom: 3px;
margin-top: 4px;
margin-bottom: 6px;
border-radius: 8px;
background-color: rgb(0, 0, 0);
font-family: arial;
font-size: 20px;
font-weight: bold;
color: rgb(255, 255, 255);
display: flex;
flex-direction: column;
align-items: center;
}

.unscrambleButtonStyle:hover
{
border-color: rgb(0, 255, 255);
}

.unscrambleButtonStyle:active
{
color: rgb(0, 255, 255);
}
For More Tutorials:
CollegeOfScripting.weebly.com

CollegeOfScripting.wordpress.com

GitHub.com/ChristopherTopalian

Youtube.com/ScriptingCollege

Twitter.com/CollegeOfScript

Sites.google.com/view/
CollegeOfScripting
Dedicated to God the Father
This book is created by the
College of Scripting Music & Science.
Always remember, that each time you write a script with
a pencil and paper, it becomes imprinted so deeply in
memory that the material and methods are learned
extremely well.

When you Type the scripts, the same is true. The more
you type and write out the scripts by keyboard or pencil
and paper, the more you will learn programming!

Write and Type EVERY example that you find.


Keep all of your scripts organized.
Every script that you create increases your
programming abilities.
SEEING CODE, is one thing,
but WRITING CODE is another.
Write it, Type it, Speak It, See It, Dream It.
www.CollegeOfScripting.weebly.com

You might also like