File size: 1,063 Bytes
97bda00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Component, createElement, render } from "https://esm.sh/[email protected]"
import { ref } from "https://esm.sh/[email protected]/dist/alpinejs.global.js"
import { init } from "https://esm.sh/[email protected]/dist/full.css"
import { html } from "https://esm.sh/lit-html"

const pdf = ref()
const ctx = ref()

const app = {
 setup() {
    const { state, effect, watch } = this
    state = { count: 0 }
    effect({
      message: "Started"
    })
    return { count: state.count }
 },
 html() {
    const { count } = this.effect()
    return html`
      <div class="flex">
        <button class="bg-[#0082c9] hover:bg-[#00e1d9] text-white font-bold py-2 px-4 rounded"> Read PDFs </button>
        <button class="bg-[#00e1d9] hover:bg-[#0082c9] text-white font-bold py-2 px-4 rounded">Stop</button>
      </div>
      <div class="flex">
        <iframe id="pdf" src="" width="100%" height="600px" frameborder="0"></iframe>
      </div>
    `
 },
 async mounted() {
    this.pdf = this.el.querySelector("#pdf")
    this.ctx = this.pdf.getContext("2d")
 }
}

init(app)