Skip to content

Commit

Permalink
Starting to set up first API
Browse files Browse the repository at this point in the history
  • Loading branch information
phrostbyte21 authored and phrostbyte21 committed Jul 31, 2020
1 parent 0614524 commit ef27c84
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@ <h1>The thinktank of the future!</h1>
<div class="testimonials">
<img src="https://randomuser.me/api/portraits/women/24.jpg" alt="userPicture">
<h1>Lesa Stevens</h1>
<q>
Ever since I was very young I wanted to open up a bakery. I've always enjoyed baking, and friends and family have told
me for a long time they and others would be happy to pay for a batch of my fresh cookies. But being a baker doesn't
suddenly make you a good business person. Thankfully, I brought the few ideas I had to BIGbigger, and they helped fill
in the blanks. I am now living my dream of doing what I love and supporting myself and family with it.
</q>
<ul id="testimonial"></ul>
</div>

<a name="about"></a>
<h1 class="sectionHeader">About Section</h1>

<a name="contactUs"></a>
<h1 class="sectionHeader">Contact Us</h1>
<script type="module" src="main.js"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//Import Testimonials API
import { testimonials } from './testimonials.js'

function createNode(element) {
return document.createElement(element);
}

function append(parent, el) {
return parent.appendChild(el);
}

const testimonial = document.getElementById('testimonial');

first(testimonials).map(testimonial => {
let li = createNode('li'),
span = createNode('span');

span.innerText = `${testimonial.testimonial}`;

append(li, span);
append(testimonial, li);
})
8 changes: 8 additions & 0 deletions testimonials.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ef27c84

Please sign in to comment.