Advertisement
hmawla

Owlchanted Code

Dec 18th, 2021 (edited)
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const getOwl = async () =>
  2.     return await fetch(`https://owl.dekmak.co`).json();
  3.  
  4. const drawMeAnOwl = (owl) => {
  5.       const owlHolder = document.getElementById('area');
  6.      
  7.       const owlDressing = `
  8.         <div class="logo">
  9.           <img src="${owl.image}" />
  10.           <p style="font-weight:bold">DEKMAK</p>
  11.           <p>${owl.tagline}</p>
  12.         </div>
  13.         <div class="slogan">
  14.           <p>${owl.slogan}</p>
  15.         </div>
  16.       `;
  17.       owlHolder.innerHTML = owlDressing;
  18. }
  19.  
  20. getOwl()
  21.     .then(owl => drawMeAnOwl(owl))
  22.     .catch(err => throw new Error(`No Owls found :(`));
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement