Sahanabg commited on
Commit
03c5873
·
verified ·
1 Parent(s): f7af5bf

Create index.html

Browse files
Files changed (1) hide show
  1. index.html +153 -0
index.html ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>PDF Upload</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+
8
+ <style>
9
+ body {
10
+ margin: 0;
11
+ height: 100vh;
12
+ font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
13
+ background: linear-gradient(135deg, #f5f7fa, #e4e7eb);
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ }
18
+
19
+ .card {
20
+ background: #ffffff;
21
+ padding: 40px;
22
+ border-radius: 12px;
23
+ width: 100%;
24
+ max-width: 420px;
25
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
26
+ text-align: center;
27
+ }
28
+
29
+ h1 {
30
+ font-size: 22px;
31
+ margin-bottom: 10px;
32
+ color: #1f2933;
33
+ }
34
+
35
+ p {
36
+ font-size: 14px;
37
+ color: #616e7c;
38
+ margin-bottom: 30px;
39
+ }
40
+
41
+ input[type="file"] {
42
+ display: none;
43
+ }
44
+
45
+ .file-label {
46
+ display: block;
47
+ padding: 14px;
48
+ border: 2px dashed #cbd2d9;
49
+ border-radius: 8px;
50
+ cursor: pointer;
51
+ color: #52606d;
52
+ margin-bottom: 20px;
53
+ transition: border-color 0.2s ease;
54
+ }
55
+
56
+ .file-label:hover {
57
+ border-color: #7b8794;
58
+ }
59
+
60
+ button {
61
+ width: 100%;
62
+ padding: 12px;
63
+ background: #2563eb;
64
+ color: #ffffff;
65
+ border: none;
66
+ border-radius: 8px;
67
+ font-size: 15px;
68
+ cursor: pointer;
69
+ transition: background 0.2s ease;
70
+ }
71
+
72
+ button:hover {
73
+ background: #1d4ed8;
74
+ }
75
+
76
+ .status {
77
+ margin-top: 15px;
78
+ font-size: 14px;
79
+ }
80
+
81
+ .success {
82
+ color: #16a34a;
83
+ }
84
+
85
+ .error {
86
+ color: #dc2626;
87
+ }
88
+ </style>
89
+ </head>
90
+ <body>
91
+
92
+ <div class="card">
93
+ <h1>Upload PDF</h1>
94
+ <p>Select a PDF file to send to the automation</p>
95
+
96
+ <label class="file-label">
97
+ Choose PDF
98
+ <input type="file" id="pdfInput" accept="application/pdf" />
99
+ </label>
100
+
101
+ <button onclick="uploadPDF()">Send File</button>
102
+
103
+ <div id="status" class="status"></div>
104
+ </div>
105
+
106
+ <script>
107
+ const webhookUrl = "https://hook.make.com/YOUR_WEBHOOK_URL";
108
+
109
+ function uploadPDF() {
110
+ const input = document.getElementById("pdfInput");
111
+ const status = document.getElementById("status");
112
+
113
+ status.textContent = "";
114
+ status.className = "status";
115
+
116
+ if (!input.files.length) {
117
+ status.textContent = "Please select a PDF file.";
118
+ status.classList.add("error");
119
+ return;
120
+ }
121
+
122
+ const file = input.files[0];
123
+
124
+ if (file.type !== "application/pdf") {
125
+ status.textContent = "Only PDF files are allowed.";
126
+ status.classList.add("error");
127
+ return;
128
+ }
129
+
130
+ const formData = new FormData();
131
+ formData.append("file", file);
132
+
133
+ fetch(webhookUrl, {
134
+ method: "POST",
135
+ body: formData
136
+ })
137
+ .then(response => {
138
+ if (!response.ok) {
139
+ throw new Error("Upload failed");
140
+ }
141
+ status.textContent = "PDF sent successfully.";
142
+ status.classList.add("success");
143
+ input.value = "";
144
+ })
145
+ .catch(() => {
146
+ status.textContent = "Error sending the file. Please try again.";
147
+ status.classList.add("error");
148
+ });
149
+ }
150
+ </script>
151
+
152
+ </body>
153
+ </html>