|
6 | 6 | name="description" |
7 | 7 | content="Certificate by JobsDoor360: Learn Full Stack, Java, and Web Development. Advance Your Career with Industry Professionals. Gain In-Demand Skills for Software Jobs. Practice Interviews and Perfect Your CV" |
8 | 8 | /> |
9 | | - <link rel="stylesheet" href="style.css" /> |
| 9 | + <link rel="stylesheet" href="/style.css" /> |
10 | 10 | <!--<link rel="stylesheet" href="/staticfiles/mainfiles/myaccount/certificate/style.css" />--> |
11 | 11 | <link |
12 | 12 | href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" |
13 | 13 | rel="stylesheet" |
14 | 14 | /> |
15 | 15 | <%- include('../../../partials/head.ejs') %> |
| 16 | + <style> |
| 17 | + #certificate { |
| 18 | + width: 1100px; /* good width for A4 landscape cropping */ |
| 19 | + max-width: 95%; |
| 20 | + background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%); |
| 21 | + border-radius: 12px; |
| 22 | + padding: 40px 60px; |
| 23 | + box-shadow: 0 10px 30px rgba(20,20,40,0.08); |
| 24 | + border: 6px solid #f1e7d6; /* subtle frame */ |
| 25 | + position: relative; |
| 26 | + margin: 10px auto; |
| 27 | + } |
| 28 | +
|
| 29 | + /* decorative ribbon / badge */ |
| 30 | + .badge { |
| 31 | + position: absolute; |
| 32 | + right: 48px; |
| 33 | + top: -26px; |
| 34 | + background: linear-gradient(180deg,#ffd57a,#ffb84d); |
| 35 | + color: #4a2b00; |
| 36 | + padding: 12px 18px; |
| 37 | + border-radius: 8px; |
| 38 | + font-weight: 700; |
| 39 | + box-shadow: 0 6px 18px rgba(0,0,0,0.12); |
| 40 | + } |
| 41 | +
|
| 42 | + .title { |
| 43 | + text-align: center; |
| 44 | + color: #2b2b2b; |
| 45 | + margin-bottom: 12px; |
| 46 | + } |
| 47 | + .title h1 { |
| 48 | + margin: 0; |
| 49 | + font-size: 34px; |
| 50 | + letter-spacing: 0.6px; |
| 51 | + } |
| 52 | + .title p { |
| 53 | + margin: 6px 0 0; |
| 54 | + color: #6b6b6b; |
| 55 | + font-size: 14px; |
| 56 | + } |
| 57 | +
|
| 58 | + .content { |
| 59 | + margin-top: 28px; |
| 60 | + text-align: center; |
| 61 | + } |
| 62 | + .recipient { |
| 63 | + font-size: 44px; |
| 64 | + margin: 10px 0; |
| 65 | + font-weight: 700; |
| 66 | + color: #0f1724; |
| 67 | + letter-spacing: 0.4px; |
| 68 | + } |
| 69 | + .desc { |
| 70 | + font-size: 18px; |
| 71 | + color: #3b3b3b; |
| 72 | + margin-bottom: 28px; |
| 73 | + } |
| 74 | +
|
| 75 | + .meta { |
| 76 | + display:flex; |
| 77 | + justify-content: center; |
| 78 | + gap: 28px; |
| 79 | + margin-bottom: 28px; |
| 80 | + flex-wrap:wrap; |
| 81 | + } |
| 82 | + .meta .box { |
| 83 | + background: rgba(15,23,36,0.03); |
| 84 | + border-radius: 8px; |
| 85 | + padding: 12px 16px; |
| 86 | + min-width: 180px; |
| 87 | + text-align: left; |
| 88 | + } |
| 89 | + .meta .box label { |
| 90 | + display:block; |
| 91 | + font-size: 12px; |
| 92 | + color: #6b6b6b; |
| 93 | + } |
| 94 | + .meta .box .value { |
| 95 | + font-weight: 700; |
| 96 | + font-size: 16px; |
| 97 | + color: #111827; |
| 98 | + } |
| 99 | +
|
| 100 | + .footer { |
| 101 | + display: flex; |
| 102 | + justify-content: center; /* center horizontally */ |
| 103 | + align-items: center; /* align vertically */ |
| 104 | + gap: 40px; /* space between issuer and signature */ |
| 105 | + margin-top: 30px; |
| 106 | + flex-wrap: wrap; /* allows stacking on small screens */ |
| 107 | + } |
| 108 | +
|
| 109 | + .issuer { |
| 110 | + display: flex; |
| 111 | + align-items: center; |
| 112 | + gap: 12px; |
| 113 | + } |
| 114 | +
|
| 115 | + .signatures { |
| 116 | + display: flex; |
| 117 | + gap: 20px; |
| 118 | + } |
| 119 | +
|
| 120 | + .sign { |
| 121 | + text-align: center; |
| 122 | + } |
| 123 | +
|
| 124 | + .sign .name { |
| 125 | + font-weight: 700; |
| 126 | + font-size: 16px; |
| 127 | + } |
| 128 | +
|
| 129 | + .sign .role { |
| 130 | + font-size: 12px; |
| 131 | + color: #666; |
| 132 | + } |
| 133 | +
|
| 134 | +
|
| 135 | + /* small screens */ |
| 136 | + @media (max-width:720px) { |
| 137 | + #certificate { padding: 24px; } |
| 138 | + .recipient { font-size:28px; } |
| 139 | + .title h1 { font-size:22px; } |
| 140 | + .meta { gap:12px; justify-content:center; } |
| 141 | + } |
| 142 | +
|
| 143 | + #btn { |
| 144 | + display: block; |
| 145 | + margin: 2px auto; |
| 146 | + background-color: #e0e0e0; |
| 147 | + } |
| 148 | +
|
| 149 | + </style> |
16 | 150 | </head> |
17 | 151 |
|
18 | 152 | <body> |
|
21 | 155 | <button id="btn" class="btn">Download Certificate</button> |
22 | 156 | <br> |
23 | 157 |
|
24 | | - <div id="pdfContent"> |
| 158 | + <div id="pdfContent" style="padding-top:50px"> |
25 | 159 | <div id="certificate" role="document" aria-label="Certificate of Completion"> |
26 | | - <div class="badge">DSA QUIZ</div> |
| 160 | + <div class="badge">JobsDoor360</div> |
27 | 161 |
|
28 | 162 | <div class="title"> |
29 | 163 | <h1>Certificate of Completion</h1> |
30 | 164 | <p>This certificate is proudly presented to</p> |
31 | 165 | </div> |
32 | 166 |
|
33 | 167 | <div class="content"> |
34 | | - <div class="recipient" id="cert-name">[Participant Name]</div> |
| 168 | + <div class="recipient" id="cert-name"></div> |
35 | 169 | <div class="desc" id="cert-desc"> |
36 | | - For successfully passing the <strong>Data Structures & Algorithms (DSA)</strong> quiz with outstanding performance. |
| 170 | + For successfully passing the <strong><span id="course"></span></strong> quiz with outstanding performance. |
37 | 171 | </div> |
38 | 172 |
|
39 | 173 | <div class="meta" aria-hidden="false"> |
40 | 174 | <div class="box"> |
41 | 175 | <label>Score</label> |
42 | | - <div class="value" id="cert-score">95%</div> |
| 176 | + <div class="value" id="cert-score"></div> |
43 | 177 | </div> |
44 | 178 |
|
45 | 179 | <div class="box"> |
46 | 180 | <label>Quiz</label> |
47 | | - <div class="value" id="cert-quiz">DSA Fundamentals — Quiz #3</div> |
| 181 | + <div class="value" id="cert-quiz"></div> |
48 | 182 | </div> |
49 | 183 |
|
50 | 184 | <div class="box"> |
51 | 185 | <label>Date</label> |
52 | | - <div class="value" id="cert-date">Nov 20, 2025</div> |
| 186 | + <div class="value" id="cert-date"></div> |
53 | 187 | </div> |
54 | 188 |
|
55 | 189 | <div class="box"> |
56 | 190 | <label>Duration</label> |
57 | | - <div class="value" id="cert-duration">30 minutes</div> |
| 191 | + <div class="value" id="cert-duration"></div> |
58 | 192 | </div> |
59 | 193 | </div> |
60 | 194 |
|
61 | 195 | <div class="footer"> |
62 | 196 | <div class="issuer"> |
63 | | - <img src="https://via.placeholder.com/56x56.png?text=Logo" alt="Issuer logo" /> |
| 197 | + <img src="/assets/Jobsdoor360%20-logos__black.png" alt="Jobsdoor360 logo" /> |
64 | 198 | <div class="info"> |
65 | | - <div class="org">Jobsdoor360 Academy</div> |
66 | | - <div class="small">Verified by the DSA assessment team</div> |
| 199 | + <div class="org" style="visibility: hidden;">Jobsdoor360</div> |
67 | 200 | </div> |
68 | 201 | </div> |
69 | 202 |
|
70 | 203 | <div class="signatures" aria-hidden="true"> |
71 | 204 | <div class="sign"> |
72 | | - <div class="line"></div> |
73 | | - <div class="name">Shivpriya Gaur</div> |
74 | | - <div class="role">Course Lead</div> |
75 | | - </div> |
76 | | - |
77 | | - <div class="sign"> |
78 | | - <div class="line"></div> |
79 | 205 | <div class="name">Vinod Gaur</div> |
80 | | - <div class="role">Head — Assessments</div> |
| 206 | + <div class="role">Course Lead</div> |
81 | 207 | </div> |
82 | 208 | </div> |
83 | 209 | </div> |
| 210 | + |
| 211 | + |
| 212 | + |
84 | 213 | </div> |
85 | 214 | </div> |
86 | 215 | </div> |
|
101 | 230 | getData().then(data => { |
102 | 231 | let name = getLoggedInUserName(); |
103 | 232 |
|
104 | | - console.log(data, name); |
| 233 | + fillCertificate(name, data.percentage, data.course) |
105 | 234 | }); |
106 | 235 |
|
| 236 | + function fillCertificate(name, percentage, course) { |
| 237 | + // sample data — replace with your real data or get from query params |
| 238 | + const sample = { |
| 239 | + name: name, |
| 240 | + score: percentage+" %", |
| 241 | + quiz: course, |
| 242 | + date: new Date().toLocaleDateString(), |
| 243 | + duration: "25 minutes" |
| 244 | + }; |
| 245 | +
|
| 246 | + document.getElementById('course').textContent = sample.quiz.toUpperCase(); |
| 247 | +
|
| 248 | + document.getElementById('cert-name').textContent = sample.name; |
| 249 | + document.getElementById('cert-score').textContent = sample.score; |
| 250 | + document.getElementById('cert-quiz').textContent = sample.quiz.toUpperCase(); |
| 251 | + document.getElementById('cert-date').textContent = sample.date; |
| 252 | + document.getElementById('cert-duration').textContent = sample.duration; |
| 253 | + } |
| 254 | +
|
107 | 255 | |
108 | 256 | document.getElementById('btn').addEventListener('click', async () => { |
109 | 257 | const { jsPDF } = window.jspdf; |
|
0 commit comments