Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.77 KB | None | 0 0
  1. // Central render function. Resets state and renders the appropriate background.
  2. export function render(bg?: BackgroundStore) {
  3.     container.innerHTML = ''
  4.     style.innerHTML = ''
  5.  
  6.     let showOPBG = false
  7.     if (options.illyaDance) {
  8.         renderIllya()
  9.         showOPBG = true
  10.     } else if (options.Happening) {
  11.         renderHappening()
  12.         showOPBG = true
  13.    
  14.     } else if (options.userBG && !options.workModeToggle) {
  15.         renderBackground(bg)
  16.         showOPBG = true
  17.     }
  18.     toggleOPBackground(showOPBG)
  19. }
  20.  
  21. // Attach Illya Dance to the background
  22. function renderHappening() {
  23.     let args = 'autoplay loop'
  24.     if (options.HappeningMute) {
  25.         args += ' muted'
  26.     }
  27.     const html = HTML
  28.         `<video ${args}>
  29.             <source src="/assets/happening.gif" type="image/gif">
  30.         </video>`
  31.     container.innerHTML = html
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement