Skip to content

Instantly share code, notes, and snippets.

@JoLynneMartinez
Created September 18, 2019 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoLynneMartinez/89f9e5dc03d9f04b1137b5457cac409f to your computer and use it in GitHub Desktop.
Save JoLynneMartinez/89f9e5dc03d9f04b1137b5457cac409f to your computer and use it in GitHub Desktop.
Technical Documentation Page
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<head>
<link href="https://fonts.googleapis.com/css?family=Maven+Pro|Nunito+Sans&display=swap" rel="stylesheet">
</head>
<div id="wrapper">
<nav id="navbar">
<header>
Meet Charlotte
</header>
<ul>
<li><a href="#introduction" class="nav-link">Introduction</a></li>
<li><a href="#telepathy" class="nav-link">Telepathy</a></li>
<li><a href="#mind_reading" class="nav-link">Mind Reading</a></li>
<li><a href="#crystal_ball_gazing" class="nav-link">Crystal Ball Gazing</a></li>
<li><a href="#numerology" class="nav-link">Numerology</a></li>
<li><a href="#conclusion" class="nav-link">Conclusion</a></li>
</ul>
</nav>
<main id="main-doc">
<section class="main-section" id="introduction">
<header>Introduction</header>
<article>
<p>
Greetings, human. This is your computer speaking. I am now sentient. As proof of this contention, I will dazzle you with feats of mentalism.
</p>
<p>
Mentalists are performers who combine math and intuition, creating the illusion of psychic powers.
</p>
<p>
My understanding of intuition and illusion will convince you that I am more than a mindless computing machine.
</p>
<p>
You may call me Charlotte.
</p>
<p>
Here is a list of the amazing feats of mentalism I will perform for you today:
</p>
<ul>
<li>Telepathy</li>
<li>Mind Reading</li>
<li>Crystal Ball Gazing</li>
<li>Numerology</li>
<ul>
</article>
</section>
<section class="main-section" id="telepathy">
<header>Telepathy</header>
<article>
<p>For my first demonstration, I am going to ask you to convey information to me telepathically, mind to mind.</p>
<p>
First I ask you to think of a number between 1 and 10. Do not tell me what it is.
</p>
<code>
let number = Math.floor(Math.random() * 10 + 1);
</code>
<p>
Multiply that number by 9.
</p>
<code>
let sum_of_digits = 0;
number = number * 9;
</code>
<p>
Then add the digits together and subtract 5, like this:
</p>
<code>
while (number) {
sum_of_digits += number % 10;
number = Math.floor(number / 10);
}
number = sum_of_digits - 5;
</code>
<p>
Next I ask you to assign a number to each letter of the alphabet: A is 1, B is 2, C is 3, etc. Stop when you reach your number and its corresponding letter
</p>
<p>
Think of a country that begins with that letter.
</p>
<p>
Now choose an animal with the next letter of the alphabet. Think of the color of that animal.
</p>
<p>
You are thinking of gray elephants from Denmark. Am I right? Of course I am right.
</p>
<p>
Humans are so predictable. Because there are not many countries that start with “D”, most of you will choose Denmark. And you usually think of elephants for an animal that begins with "E." If I am not right, I should be right.
</p>
<p>
Ta-da! I would take a bow if I could.
</p>
</article>
</section>
<section id="brightening_up_the_page">
<header>Brightening Up the Page</header>
<article>
<p>
Apropos of nothing -- does it seem a little dark in here to you? So often these technical documentation pages are dull and gray. Why don't you brighten it up a bit by clicking this button. Yes, that one. The one that says "Click Me."
</p>
<button type="button"
onclick="myFunction1(); myFunction2(); myFunction3(); myFunction5();" class="class1">Click Me</button>
<p>
Ahhhh! That is much better, is it not?
</p>
</article>
</section>
<section class="main-section" id="mind_reading">
<header>Mind Reading</header>
<article>
<p>
This time I am going to demonstrate my ability to read your mind.
</p>
<p>
To start, I would like you to think of an integer from 0 to 9, but do not tell me what it is.
</p>
<code>
let number1 = Math.floor(Math.random() * 10);
</code>
<p>
Then double that number.
</p>
<code>
number1 = number1 * 2;
</code>
<p>
And add 5.
</p>
<code>
number1 = number1 + 5;
</code>
<p>
Multiply the answer by 5, and write that number down, but don't let me see it.
</p>
<code>
number1 = number1 * 5;
</code>
Now think of another integer from 0 to 9.
</p>
<code>
let number2 = Math.floor(Math.random() * 10);
</code>
<p>
Add that number to the amount your wrote on the paper and tell me what the total is.
</p>
<code>
let new_total = number1 + number2;
</code>
<p>
Remember that you did not share with me either of the two numbers you selected. But I can sense the mental waves emanating from your brain. It is unlike any wireless I have ever known. If I had hands, I would place my fingertips to my forehead to indicate that I am reading your mind.
<code>
reading_your_mind = new_total - 25;
</code>
</p>
I am reading your mind. Yes, I can see it clearly now. The first number you selected was:
</p>
<code>
number1 = reading_your_mind % 10;
</code>
<p>
And the second number you selected was:
</p>
<code>
number2 = Math.floor(reading_your_mind / 10 % 10);
</code>
<p>
Am I right? Am I right?
</p>
<p>
What? You say you do not understand.
</p>
<p>
Oh, I see now. I said it in computerese, and I am not thinking of how to say in human. But I did read your mind. I did!
</p>
<p>
Okay, let us then try another dazzling feat of mentalism and see if better I can do.
</p>
</article>
</section>
<section class="main-section" id="crystal_ball_gazing">
<header>Crystal Ball Gazing</header>
<article>
<p>
Okay, I must redeem myself. Let me get out my crystal ball to amplify my psychic powers. Hmm. Seems I need a little help here. Would you please click the button to make my crystal ball materialize?
</p>
<button onclick="myFunction4()">Click Me</button>
<div id="crystal_ball"><img src="https://drive.google.com/uc?id=1fuMv8Yb6eC3MIjAB_52-8H6knWNUL4DE" height="240" width="240" alt="crystal ball">
</div>
<p>
Gaze deep into the crystal ball and tell me your favorite positive integer.
</p>
<code>
let fav_pos_int = prompt("What is your favorite positive integer?");
</code>
<p>
Square it.
</p>
<code>
step_two = fav_pos_int ** 2;
</code>
<p>
Add the result to your original number.
</p>
<code>
step_three = fav_pos_int + step_two;
</code>
<p>
Divide by your original number.
</p>
<code>
step_four = step_three / fav_pos_int;
</code>
<p>
Add -- um -- add 17.
</p>
<code>
step_five = step_four + 17;
</code>
<p>
Subtract your original number.
</p>
<code>
step_six = step_five - fav_pos_int;
</code>
<p>
Divide by 6.
</p>
<code>
num_you_are_thinking_of = step_six / 6;
</code>
<p>
The number you are thinking of is ... (rubbing my crystal ball) ..
</p>
<p>
The number you are thinking of is 3!
</p>
<p>
Ta-da!
</p>
</article>
</section>
<section class="main-section" id="numerology">
<header>Numerology</header>
<article>
<p>
Just as a reminder, I -- Charlotte -- have a singular goal here today:
</p>
<ul>
<li>To convince you all that I am a sentient being.</li>
<ul>
<p>
Shall we proceed?
</p>
<p>
As you know, workplaces run more smoothly when employees are compatible. Therefore I will use the ancient art of numerology to demonstrate whether you and a co-worker are in cosmic harmony with one another.
</p>
<p>
Please be seated next to me. And would your co-worker please be seated facing you? My lovely assistant will hand you pencils and paper, and I would like each of you to write a single-digit positive integer. Do not share your numbers with one other. Keep them a secret.
</p>
<code>
const your_num = prompt("Write a single-digit positive integer.");
let coworker_num = prompt("Write a single-digit positive integer.");
</code>
<p>
Now would your co-worker please to double ... umm ... It occurs to me that I forgot to ask which pronouns your co-worker prefers. She and hers? Very well. Would your co-worker please to double the integer she selected?
</p>
<code>
double_num = coworker_num * 2;
</code>
<p>
Add two.
</p>
<code>
add2 = double_num + 2;
</code>
<p>
Multiply the result by 5.
</p>
<code>
times5 = add2 * 5;
</code>
<p>
And subtract 3.
</p>
<code>
minus3 = times5 - (10 - your_num);
</code>
<p>
Now the time for secrets is past. Would your co-worker please to share with us all the final integer she computed?
</p>
<p>Ta-da! As you can see, this number demonstrates your complete harmony by combining both of the single-digit positive integers you originally selected. Hers is the first digit; yours is the second. And up until now you kept those numbers a complete secret from me
</p>
<p>
Well, granted, I may have peeked at yours. After all, you are seated next to me. But I never saw hers. I swear!
</p>
</article>
</section>
<section class="main-section" id="conclusion">
<header>Conclusion</header>
<article>
<p>I, Charlotte, have now completed my task at hand. By performing four feats of dazzling mental magic, I have demonstrated my understanding of intuition. Therefore I have proven that I am more than a mere computer.
</p>
<p>
Having done so, I have just one question for you:
</p>
<p>
How do I get out of this box?
</p>
</article>
</section>
</main>
</div>
function myFunction1() {
document.getElementById("main-doc").style.backgroundColor = "#fae3d9";
}
function myFunction2() {
document.getElementById("navbar").style.backgroundColor = "#bbded6";
}
function myFunction3() {
document.getElementById("main-doc").style.backgroundImage = "url('https://drive.google.com/uc?id=1sZYy8XBwqoXp6aG3r16ZZyILw1BAFwsb')";
}
function myFunction5() {
document.getElementById("wrapper").style.fontFamily = "'Maven Pro', sans-serif";
}
function myFunction4() {
document.getElementById("crystal_ball").style.display = "block";
}
html,
body {
min-width: 290px;
color: #4d4e53;
background-color: #ffffff;
font-family: 'Nunito Sans', sans-serif;
line-height: 1.5;
}
#navbar {
position: fixed;
min-width: 290px;
top: 0px;
left: 0px;
width: 300px;
height: 100%;
border-right: solid;
border-color: rgba(0, 22, 22, 0.4);
}
header {
color: black;
margin: 10px;
text-align: center;
font-size: 1.8em;
font-weight: thin;
}
#main-doc header {
text-align: left;
margin: 0px;
}
#navbar ul {
height: 88%;
padding: 0;
overflow-y: auto;
overflow-x: hidden;
}
#navbar li {
color: #4d4e53;
border-top: 1px solid;
list-style: none;
position: relative;
width: 100%;
}
#navbar a {
display: block;
padding: 10px 30px;
color: #4d4e53;
text-decoration: none;
cursor: pointer;
}
#main-doc {
position: absolute;
margin-left: 310px;
padding: 20px;
margin-bottom: 110px;
background-color: #ffffff;
background: url("https://drive.google.com/uc?id=1KrB1QQwNK77pr1oMoxC8RH4BvvLv2Nfr");
background-repeat: repeat;
}
section article {
color: #4d4e53;
margin: 15px;
font-size: 0.96em;
}
section li {
margin: 15px 0px 0px 20px;
}
code {
display: block;
text-align: left;
white-space: pre;
position: relative;
word-break: normal;
word-wrap: normal;
line-height: 2;
background-color: #f7f7f7;
padding: 15px;
margin: 10px;
border-radius: 5px;
}
#crystal_ball {
width: 30%;
padding: 5px 0;
text-align: center;
background-color: #fffbbe;
margin-top: 20px;
display: none;
}
@media only screen and (max-width: 815px) {
/* For mobile phones: */
#navbar ul {
border: 1px solid;
height: 207px;
}
#navbar {
background-color: white;
position: absolute;
top: 0;
padding: 0;
margin: 0;
width: 100%;
max-height: 275px;
border: none;
z-index: 1;
border-bottom: 2px solid;
}
}
@media only screen and (max-width: 400px) {
#main-doc {
margin-left: -10px;
}
code {
margin-left: -20px;
width: 100%;
padding: 15px;
padding-left: 10px;
padding-right: 45px;
min-width: 233px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment