Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
<div class ="container">
  <div></div>
  <h1>Acceptance Letter Generator</h1>
  <p>Dear Candidate,
  <div id="random-adjectives"></div></p>
  <p>Sincerely,</p>
  <p>The people in charge of these types of things</p>
  <button class="btn btn-primary" id="generate"> Generate Acceptance! </button>
</div>
</body>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,400;0,800;1,900&display=swap');

body {
  text-align: center;
  margin: auto;
  font-family: 'Poppins', sans-serif;
  max-width: 960px;
  line-height: 1.65em;
  padding: 3em;
  background:	#ede0bb;
  font-size: 20px;
}

h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 3em;
  color: #2d1d2b;
  font-weight: 1,900;
  font-style: italic;
  line-height: 1.1;
}

p {
  text-align: left;
}

#random-adjectives{
  text-align: left;
}

.btn-primary{
  display: inline-block;
  border-radius: 10px;
  background-color: #f4511e;
  font-family: 'Poppins', sans-serif;
  border: none;
  color: #FFFFFF;
  text-align: center;
  font-size: 18px;
  padding: 20px;
  width: 200px;
  transition: all 0.5s;
  cursor: pointer;
  margin: 5px;
  box-shadow: 7px 7px orange;
}

@media screen and (min-width: 320px) and (max-width: 480px) {
  h1 {
    font-size: 2em;
      }
}

/*This is what folks in the CSS industry call... a mess*/
              
            
!

JS

              
                
const adj = [ "exciting", "extraordinary", "important", "massive", "monumental", "notable", "profound", "remarkable", "splendid", "superb", "thrilling", "absorbing", "affecting", "arresting", "consequential", "cool", "deep", "effective", "eloquent", "grand", "inspiring", "majestic", "momentous", "moving", "noble", "prime", "striking", "unique", "special", "impressive", "classy"];

const noun1 = [ "presentation", "application", "work samples", "interview", "portfolio", "years of experience", "speaking voice", "presence", "fashion choices", "demeanor", "thought process", "body of work", "academic achievements", "commitment to doing good", "creative output", "attitude", "personality", "scrupulousness", "sense of humor", "team playersmanshiphood", "neighborliness", "fiscal responsibility", "editorial choices"];

const noun2 = [ "a really great job with really great benefits", "a huge pile of money", "position in a highly competitive field", "a quiet and comfortable space where you will do deeply meaningful work", "a job that you will love", "a fellowship in a field that you adore"];

const noun3 = [ "an enormous scholarship to further your education in whatever fields fascinate you", "a team that you love and that supports you when you need them", "a lavishly decorated corner office", "an extremely generous retirement plan", "world-class dental care", "free and reliable childcare", "a puppy", "a lifetime supply of chocolate croissaints"]

const getRandomNumber = (max) => Math.floor(Math.random() * max);

const getRandomName1 = () => 
`${"Our team was so impressed by your " + adj [getRandomNumber(adj.length)]} ${noun1 [getRandomNumber(noun1.length)]} ${"that we would like to offer you " + noun2[getRandomNumber(noun2.length)]}  ${"— which of course comes with " + noun3[getRandomNumber(noun3.length)] + "."} ${"You deserve it!"}`;

const setRandomName1 = () => {
document.getElementById('random-adjectives').innerText = getRandomName1 ();
}

document.getElementById('generate').addEventListener ('click', setRandomName1);

//console.log(getRandomName());

setRandomName1();


              
            
!
999px

Console