-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
140 lines (125 loc) · 3.69 KB
/
index.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>pdf render</title>
<style>
html, body {
font-family: Helvetica, Arial, sans-serif;
background: #525659;
}
.pdf-page {
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
display: flex;
margin-bottom: 20px;
max-width: 100%;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
transition: 0.5s ease;
}
.container-loading {
display: flex;
top: 0;
bottom: 0;
position: absolute;
align-content: center;
justify-content: center;
flex-direction: column;
flex: 1;
width: 100%;
transition: 0.2s ease;
}
.loading {
align-self: center;
}
span.icon-left {
height: 130px;
width: 130px;
border: 5px solid #2d2f31;
border-radius: 100%;
position: relative;
display: inline-block;
transition: all 1s linear;
border-left-color: transparent;
border-right-color: transparent;
animation: rotate-left 1s linear infinite;
}
span.icon-right {
height: 100px;
width: 100px;
border: 5px solid #2d2f31;
border-radius: 100%;
position: absolute;
display: inline-block;
transition: all 0.2s linear;
border-left-color: transparent;
border-right-color: transparent;
animation: rotate-right 0.5s linear infinite;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.loading-text {
text-align: center;
color: #2d2f31;
font-size: 30px;
}
.hide {
opacity: 0;
visibility: hidden;
z-index: 0;
transform: translateY(10px);
}
@keyframes rotate-left {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes rotate-right {
from {
transform: rotate(0deg);
}
to {
transform: rotate(-360deg);
}
}
</style>
</head>
<body>
<header class="title" style="text-align: center;">
<h1 style="color: white">Renderizando PDF com canvas</h1>
<span style="color: rgb(218, 218, 218);">by Anderson Carlos</span>
</header>
<div class="container-loading">
<div class="loading">
<span class="icon-left">
<span class="icon-right"></span>
</span>
</div>
<span class="loading-text">Carregando documento</span>
</div>
<!-- required -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.min.js"></script>
<script type="module">
import start from "./index.js"
(async () => {
// the magic is here
const pdfInfo = await start({
appendOn: document.body, //optional param
scale: 1.5, //optional param
});
document.querySelector(".title").classList.add("hide");
document.querySelector(".container-loading").classList.add("hide");
})();
</script>
</body>
</html>