Skip to content

Commit

Permalink
updated things
Browse files Browse the repository at this point in the history
  • Loading branch information
Apearson75 committed Feb 16, 2022
1 parent 13a03c3 commit 43614b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Empty file added readme.md
Empty file.
10 changes: 7 additions & 3 deletions src/preload.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
const list = ['memes', 'woooosh']


// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
window.addEventListener('DOMContentLoaded', () => {
const list = ['memes', 'woooosh']
const randomReddit = list[Math.floor(Math.random() * 2)]
console.log(randomReddit)

const replaceText = (selector, text) => {
const element = document.getElementById(selector)
if (element) element.innerText = text
}

fetch("https://meme-api.herokuapp.com/gimme/memes")
fetch(`https://meme-api.herokuapp.com/gimme/${randomReddit}`)
.then(res => res.json())
.then(data => {
console.log(data);
Expand Down

0 comments on commit 43614b5

Please # to comment.