feat: redesign certificate verification page with new futuristic background asset
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 549 KiB |
@@ -38,77 +38,71 @@
|
|||||||
<div class="container max-w-6xl mx-auto px-4 pb-20 space-y-12">
|
<div class="container max-w-6xl mx-auto px-4 pb-20 space-y-12">
|
||||||
|
|
||||||
<!-- ================= PAGE 1: CERTIFICATE (LANDSCAPE A4) ================= -->
|
<!-- ================= PAGE 1: CERTIFICATE (LANDSCAPE A4) ================= -->
|
||||||
<div id="certificate-node" class="certificate-page bg-white rounded-[2rem] shadow-2xl p-12 relative overflow-hidden page-break mx-auto">
|
<div class="certificate-container-wrapper overflow-hidden w-full flex justify-center items-start">
|
||||||
|
<div id="certificate-node" class="certificate-page bg-white rounded-[2rem] shadow-2xl p-12 relative overflow-hidden page-break mx-auto">
|
||||||
|
|
||||||
<!-- Geometric Orange Swirl Circles (100% compatible with html2canvas) -->
|
<!-- Thin Minimal Orange/Slate Inner Border -->
|
||||||
<div class="absolute -top-32 -right-32 w-[350px] h-[350px] rounded-full bg-gradient-to-br from-orange-400/20 to-amber-500/5 pointer-events-none z-0"></div>
|
<div class="absolute inset-6 border border-slate-200/50 rounded-[1.5rem] pointer-events-none z-10"></div>
|
||||||
<div class="absolute -top-40 -right-40 w-[450px] h-[450px] rounded-full border-[20px] border-orange-500/10 pointer-events-none z-0"></div>
|
<div class="absolute inset-[28px] border-2 border-orange-500/15 rounded-[1.3rem] pointer-events-none z-10"></div>
|
||||||
<div class="absolute -top-48 -right-48 w-[550px] h-[550px] rounded-full border-[10px] border-orange-500/5 pointer-events-none z-0"></div>
|
|
||||||
|
|
||||||
<div class="absolute -bottom-32 -left-32 w-[350px] h-[350px] rounded-full bg-gradient-to-tr from-orange-500/20 to-red-500/5 pointer-events-none z-0"></div>
|
<div class="relative z-10 flex flex-col justify-between h-full min-h-[580px] md:min-h-[540px]">
|
||||||
<div class="absolute -bottom-40 -left-40 w-[450px] h-[450px] rounded-full border-[20px] border-orange-500/10 pointer-events-none z-0"></div>
|
|
||||||
|
|
||||||
<!-- Thin Minimal Orange/Slate Inner Border -->
|
<!-- Logo & Header -->
|
||||||
<div class="absolute inset-6 border border-slate-200 rounded-[1.5rem] pointer-events-none z-10"></div>
|
<div class="flex justify-between items-center w-full">
|
||||||
<div class="absolute inset-[28px] border-2 border-orange-500/20 rounded-[1.3rem] pointer-events-none z-10"></div>
|
<img src="{{ asset('logos/truncgil-yatay.svg') }}" alt="Trunçgil Teknoloji" class="h-12 object-contain">
|
||||||
|
<div class="text-right">
|
||||||
<div class="relative z-10 flex flex-col justify-between h-full min-h-[580px] md:min-h-[540px]">
|
<span class="text-[10px] font-bold text-slate-400 uppercase tracking-widest block">Verifikasyon No</span>
|
||||||
|
<span class="text-xs font-mono font-bold text-slate-800">{{ $application->certificate_code }}</span>
|
||||||
<!-- Logo & Header -->
|
|
||||||
<div class="flex justify-between items-center w-full">
|
|
||||||
<img src="{{ asset('logos/truncgil-yatay.svg') }}" alt="Trunçgil Teknoloji" class="h-12 object-contain">
|
|
||||||
<div class="text-right">
|
|
||||||
<span class="text-[10px] font-bold text-slate-400 uppercase tracking-widest block">Verifikasyon No</span>
|
|
||||||
<span class="text-xs font-mono font-bold text-slate-800">{{ $application->certificate_code }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<div class="text-center my-auto px-4">
|
|
||||||
<h1 class="font-serif text-3xl md:text-5xl font-bold tracking-[0.2em] text-slate-800 uppercase mb-2">Staj Bitirme Sertifikası</h1>
|
|
||||||
<div class="w-24 h-[3px] bg-orange-500 mx-auto mb-8"></div>
|
|
||||||
|
|
||||||
<p class="text-slate-400 text-xs md:text-sm uppercase tracking-wider mb-2">Sayın</p>
|
|
||||||
<h2 class="font-serif text-2xl md:text-4xl font-extrabold text-slate-900 tracking-wide mb-6">{{ $application->name }}</h2>
|
|
||||||
|
|
||||||
<div class="max-w-3xl mx-auto text-slate-700 leading-relaxed text-sm md:text-base space-y-4">
|
|
||||||
<p>
|
|
||||||
<strong>{{ \Carbon\Carbon::parse($application->internship_start_date)->format('d.m.Y') }}</strong> -
|
|
||||||
<strong>{{ \Carbon\Carbon::parse($application->internship_end_date)->format('d.m.Y') }}</strong> tarihleri arasında,
|
|
||||||
<strong>Trunçgil Teknoloji</strong> bünyesinde gerçekleştirdiği uzaktan staj programını başarıyla tamamlayarak bu belgeyi almaya hak kazanmıştır.
|
|
||||||
</p>
|
|
||||||
<p class="text-xs md:text-sm text-slate-500 max-w-2xl mx-auto italic font-serif">
|
|
||||||
Gösterdiği üstün gayret, sorumluluk bilinci, teknik beceriler ve ekip çalışmasına sağladığı değerli katkılardan dolayı teşekkür eder, profesyonel kariyerinde başarılar dileriz.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Footer Section (Signatures & Verification QR) -->
|
|
||||||
<div class="grid grid-cols-3 items-end pt-6 border-t border-slate-100/50">
|
|
||||||
<!-- Left: QR Code -->
|
|
||||||
<div class="flex items-center gap-4">
|
|
||||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ urlencode(route('internship.verify', $application->certificate_code)) }}" alt="QR Code" class="w-28 h-28 border border-slate-200 p-1 rounded-xl bg-white shadow-sm">
|
|
||||||
<div class="text-left hidden sm:block">
|
|
||||||
<span class="text-[8px] font-bold text-slate-400 uppercase tracking-wider block">Dijital Doğrulama</span>
|
|
||||||
<span class="text-[9px] text-slate-500 block">Karekod okutularak belgenin güncelliği e-Devlet stilinde doğrulanabilir.</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Middle: Date -->
|
<!-- Main Content -->
|
||||||
<div class="text-center">
|
<div class="text-center my-auto px-4">
|
||||||
<span class="text-[9px] text-slate-400 block uppercase tracking-wider">Düzenlenme Tarihi</span>
|
<h1 class="font-serif text-3xl md:text-5xl font-extrabold tracking-[0.2em] text-slate-900 uppercase mb-2">Staj Bitirme Sertifikası</h1>
|
||||||
<span class="text-xs font-bold text-slate-700">{{ \Carbon\Carbon::parse($application->internship_end_date)->format('d.m.Y') }}</span>
|
<div class="w-24 h-[3px] bg-orange-500 mx-auto mb-8"></div>
|
||||||
|
|
||||||
|
<p class="text-slate-400 text-xs md:text-sm uppercase tracking-wider mb-2">Sayın</p>
|
||||||
|
<h2 class="font-serif text-2xl md:text-4xl font-extrabold text-slate-900 tracking-wide mb-6">{{ $application->name }}</h2>
|
||||||
|
|
||||||
|
<div class="max-w-3xl mx-auto text-slate-700 leading-relaxed text-sm md:text-base space-y-4">
|
||||||
|
<p>
|
||||||
|
<strong>{{ \Carbon\Carbon::parse($application->internship_start_date)->format('d.m.Y') }}</strong> -
|
||||||
|
<strong>{{ \Carbon\Carbon::parse($application->internship_end_date)->format('d.m.Y') }}</strong> tarihleri arasında,
|
||||||
|
<strong>Trunçgil Teknoloji</strong> bünyesinde gerçekleştirdiği uzaktan staj programını başarıyla tamamlayarak bu belgeyi almaya hak kazanmıştır.
|
||||||
|
</p>
|
||||||
|
<p class="text-xs md:text-sm text-slate-500 max-w-2xl mx-auto italic font-serif">
|
||||||
|
Gösterdiği üstün gayret, sorumluluk bilinci, teknik beceriler ve ekip çalışmasına sağladığı değerli katkılardan dolayı teşekkür eder, profesyonel kariyerinde başarılar dileriz.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Right: Authorized Signature -->
|
<!-- Footer Section (Signatures & Verification QR) -->
|
||||||
<div class="text-right">
|
<div class="grid grid-cols-3 items-end pt-6 border-t border-slate-100/50">
|
||||||
<div class="inline-block text-center pr-2">
|
<!-- Left: QR Code -->
|
||||||
<!-- Digital Signature Stamp Concept -->
|
<div class="flex items-center gap-4">
|
||||||
<div class="h-10 flex items-center justify-center mb-1">
|
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ urlencode(route('internship.verify', $application->certificate_code)) }}" alt="QR Code" class="w-28 h-28 border border-slate-200 p-1 rounded-xl bg-white shadow-sm">
|
||||||
<span class="font-serif italic text-orange-600 font-bold text-sm tracking-wider">Trunçgil Teknoloji</span>
|
<div class="text-left hidden sm:block">
|
||||||
|
<span class="text-[8px] font-bold text-slate-400 uppercase tracking-wider block">Dijital Doğrulama</span>
|
||||||
|
<span class="text-[9px] text-slate-500 block">Karekod okutularak belgenin güncelliği e-Devlet stilinde doğrulanabilir.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Middle: Date -->
|
||||||
|
<div class="text-center">
|
||||||
|
<span class="text-[9px] text-slate-400 block uppercase tracking-wider">Düzenlenme Tarihi</span>
|
||||||
|
<span class="text-xs font-bold text-slate-700">{{ \Carbon\Carbon::parse($application->internship_end_date)->format('d.m.Y') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Right: Authorized Signature -->
|
||||||
|
<div class="text-right">
|
||||||
|
<div class="inline-block text-center pr-2">
|
||||||
|
<!-- Digital Signature Stamp Concept -->
|
||||||
|
<div class="h-10 flex items-center justify-center mb-1">
|
||||||
|
<span class="font-sans text-slate-800 font-bold text-sm tracking-wider">Trunçgil Teknoloji</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-bold text-slate-800 block text-xs">Onay Makamı</span>
|
||||||
|
<span class="text-[9px] text-slate-400 block">Staj Koordinatörlüğü</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="font-bold text-slate-800 block text-xs">Onay Makamı</span>
|
|
||||||
<span class="text-[9px] text-slate-400 block">Staj Koordinatörlüğü</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -116,63 +110,65 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ================= PAGE 2: TRANSCRIPT (PORTRAIT A4) ================= -->
|
<!-- ================= PAGE 2: TRANSCRIPT (PORTRAIT A4) ================= -->
|
||||||
<div id="transcript-node" class="transcript-page bg-white rounded-[2rem] shadow-2xl p-6 md:p-8 relative overflow-hidden mx-auto">
|
<div class="transcript-container-wrapper overflow-hidden w-full flex justify-center items-start">
|
||||||
|
<div id="transcript-node" class="transcript-page bg-white rounded-[2rem] shadow-2xl p-6 md:p-8 relative overflow-hidden mx-auto">
|
||||||
|
|
||||||
<!-- Thin border decor for transcript -->
|
<!-- Thin border decor for transcript -->
|
||||||
<div class="absolute inset-4 border border-slate-100 rounded-[1.5rem] pointer-events-none"></div>
|
<div class="absolute inset-4 border border-slate-100 rounded-[1.5rem] pointer-events-none"></div>
|
||||||
|
|
||||||
<div class="relative z-10 flex flex-col justify-between h-full text-slate-700">
|
<div class="relative z-10 flex flex-col justify-between h-full text-slate-700">
|
||||||
<div>
|
<div>
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="flex justify-between items-center pb-2 border-b border-slate-100 mb-3">
|
<div class="flex justify-between items-center pb-2 border-b border-slate-100 mb-3">
|
||||||
<div>
|
<div>
|
||||||
<h2 class="font-serif font-bold text-slate-900 uppercase transcript-header-title">Staj Akademik Transkripti</h2>
|
<h2 class="font-serif font-bold text-slate-900 uppercase transcript-header-title">Staj Akademik Transkripti</h2>
|
||||||
<p class="text-slate-400 tracking-wider uppercase mt-0.5 transcript-header-subtitle">Ve Performans Değerlendirme Raporu</p>
|
<p class="text-slate-400 tracking-wider uppercase mt-0.5 transcript-header-subtitle">Ve Performans Değerlendirme Raporu</p>
|
||||||
|
</div>
|
||||||
|
<img src="{{ asset('logos/truncgil-yatay.svg') }}" alt="Trunçgil Logo" class="h-6 object-contain">
|
||||||
</div>
|
</div>
|
||||||
<img src="{{ asset('logos/truncgil-yatay.svg') }}" alt="Trunçgil Logo" class="h-6 object-contain">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Student Info block -->
|
<!-- Student Info block -->
|
||||||
<div class="bg-slate-50 rounded-xl p-2.5 border border-slate-100 mb-3">
|
<div class="bg-slate-50 rounded-xl p-2.5 border border-slate-100 mb-3">
|
||||||
<h3 class="font-bold text-slate-400 uppercase tracking-widest mb-1.5 student-info-title">Öğrenci / Stajyer Bilgileri</h3>
|
<h3 class="font-bold text-slate-400 uppercase tracking-widest mb-1.5 student-info-title">Öğrenci / Stajyer Bilgileri</h3>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-y-1 gap-x-8 student-info-grid">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-y-1 gap-x-8 student-info-grid">
|
||||||
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
||||||
<span class="text-slate-500">Adı Soyadı:</span>
|
<span class="text-slate-500">Adı Soyadı:</span>
|
||||||
<strong class="text-slate-800">{{ $application->name }}</strong>
|
<strong class="text-slate-800">{{ $application->name }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
||||||
<span class="text-slate-500">E-Posta Adresi:</span>
|
<span class="text-slate-500">E-Posta Adresi:</span>
|
||||||
<strong class="text-slate-800">{{ $application->email }}</strong>
|
<strong class="text-slate-800">{{ $application->email }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
||||||
<span class="text-slate-500">Staj Dönemi:</span>
|
<span class="text-slate-500">Staj Dönemi:</span>
|
||||||
<strong class="text-slate-800">{{ \Carbon\Carbon::parse($application->internship_start_date)->format('d.m.Y') }} - {{ \Carbon\Carbon::parse($application->internship_end_date)->format('d.m.Y') }}</strong>
|
<strong class="text-slate-800">{{ \Carbon\Carbon::parse($application->internship_start_date)->format('d.m.Y') }} - {{ \Carbon\Carbon::parse($application->internship_end_date)->format('d.m.Y') }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
<div class="flex justify-between border-b border-slate-200/50 pb-1">
|
||||||
<span class="text-slate-500">Toplam Staj Süresi:</span>
|
<span class="text-slate-500">Toplam Staj Süresi:</span>
|
||||||
<strong class="text-slate-800">{{ $application->internship_total_days }} İş Günü</strong>
|
<strong class="text-slate-800">{{ $application->internship_total_days }} İş Günü</strong>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Dynamic Markdown Content (Transcript and marks) -->
|
||||||
|
<div class="prose max-w-none text-slate-700 leading-relaxed mb-3">
|
||||||
|
{!! new \Illuminate\Support\HtmlString(\Illuminate\Support\Str::markdown($application->transcript_markdown ?? '')) !!}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Dynamic Markdown Content (Transcript and marks) -->
|
<!-- Footer with verification details -->
|
||||||
<div class="prose max-w-none text-slate-700 leading-relaxed mb-3">
|
<div class="w-full flex justify-between items-center pt-2 border-t border-slate-100 gap-4 mt-auto">
|
||||||
{!! new \Illuminate\Support\HtmlString(\Illuminate\Support\Str::markdown($application->transcript_markdown ?? '')) !!}
|
<div class="flex items-center gap-3">
|
||||||
</div>
|
<img src="https://api.qrserver.com/v1/create-qr-code/?size=120x120&data={{ urlencode(route('internship.verify', $application->certificate_code)) }}" alt="QR Code" class="w-14 h-14 border border-slate-200 p-0.5 rounded-lg bg-white">
|
||||||
</div>
|
<div>
|
||||||
|
<span class="font-bold text-slate-400 uppercase tracking-wider block verify-code-label">Güvenli Doğrulama Kodu</span>
|
||||||
<!-- Footer with verification details -->
|
<span class="font-mono font-bold text-slate-800 block verify-code">{{ $application->certificate_code }}</span>
|
||||||
<div class="w-full flex justify-between items-center pt-2 border-t border-slate-100 gap-4 mt-auto">
|
</div>
|
||||||
<div class="flex items-center gap-3">
|
</div>
|
||||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=120x120&data={{ urlencode(route('internship.verify', $application->certificate_code)) }}" alt="QR Code" class="w-14 h-14 border border-slate-200 p-0.5 rounded-lg bg-white">
|
<div class="text-right text-slate-400 footer-address">
|
||||||
<div>
|
Trunçgil Teknoloji San. ve Tic. Ltd. Şti.<br>
|
||||||
<span class="font-bold text-slate-400 uppercase tracking-wider block verify-code-label">Güvenli Doğrulama Kodu</span>
|
Gaziantep Üniversitesi Teknopark No: 4A
|
||||||
<span class="font-mono font-bold text-slate-800 block verify-code">{{ $application->certificate_code }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="text-right text-slate-400 footer-address">
|
|
||||||
Trunçgil Teknoloji San. ve Tic. Ltd. Şti.<br>
|
|
||||||
Gaziantep Üniversitesi Teknopark No: 4A
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -223,20 +219,18 @@
|
|||||||
|
|
||||||
/* Screen display aspect styling */
|
/* Screen display aspect styling */
|
||||||
.certificate-page {
|
.certificate-page {
|
||||||
width: 100%;
|
width: 1122px;
|
||||||
max-width: 297mm;
|
min-height: 794px;
|
||||||
min-height: 210mm;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* Radial background for swirl effect */
|
background-image: url('{{ asset("assets/img/cert_bg_futuristic.png") }}');
|
||||||
background:
|
background-size: cover;
|
||||||
radial-gradient(circle at 100% 0%, rgba(249, 115, 22, 0.08) 0%, rgba(255, 255, 255, 0) 50%),
|
background-position: center;
|
||||||
radial-gradient(circle at 0% 100%, rgba(249, 115, 22, 0.08) 0%, rgba(255, 255, 255, 0) 50%),
|
background-repeat: no-repeat;
|
||||||
#ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
.transcript-page {
|
.transcript-page {
|
||||||
width: 100%;
|
width: 794px;
|
||||||
max-width: 210mm;
|
height: 1122px;
|
||||||
height: 297mm;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,8 +352,14 @@
|
|||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.certificate-container-wrapper, .transcript-container-wrapper {
|
||||||
|
height: auto !important;
|
||||||
|
overflow: visible !important;
|
||||||
|
}
|
||||||
|
|
||||||
.certificate-page {
|
.certificate-page {
|
||||||
page: landscape-page;
|
page: landscape-page;
|
||||||
|
transform: none !important;
|
||||||
width: 297mm !important;
|
width: 297mm !important;
|
||||||
height: 210mm !important;
|
height: 210mm !important;
|
||||||
min-height: 210mm !important;
|
min-height: 210mm !important;
|
||||||
@@ -370,16 +370,18 @@
|
|||||||
box-sizing: border-box !important;
|
box-sizing: border-box !important;
|
||||||
page-break-after: always !important;
|
page-break-after: always !important;
|
||||||
break-after: page !important;
|
break-after: page !important;
|
||||||
background:
|
background-image: url('{{ asset("assets/img/cert_bg_futuristic.png") }}') !important;
|
||||||
radial-gradient(circle at 100% 0%, rgba(249, 115, 22, 0.08) 0%, rgba(255, 255, 255, 0) 50%),
|
background-size: cover !important;
|
||||||
radial-gradient(circle at 0% 100%, rgba(249, 115, 22, 0.08) 0%, rgba(255, 255, 255, 0) 50%),
|
background-position: center !important;
|
||||||
#ffffff !important;
|
background-repeat: no-repeat !important;
|
||||||
|
background-color: #ffffff !important;
|
||||||
-webkit-print-color-adjust: exact;
|
-webkit-print-color-adjust: exact;
|
||||||
print-color-adjust: exact;
|
print-color-adjust: exact;
|
||||||
}
|
}
|
||||||
|
|
||||||
.transcript-page {
|
.transcript-page {
|
||||||
page: portrait-page;
|
page: portrait-page;
|
||||||
|
transform: none !important;
|
||||||
width: 210mm !important;
|
width: 210mm !important;
|
||||||
height: 297mm !important;
|
height: 297mm !important;
|
||||||
min-height: 297mm !important;
|
min-height: 297mm !important;
|
||||||
@@ -396,6 +398,47 @@
|
|||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
|
function scaleDocument(wrapperSelector, nodeSelector, baseWidth, baseHeight) {
|
||||||
|
const wrapper = document.querySelector(wrapperSelector);
|
||||||
|
const node = document.querySelector(nodeSelector);
|
||||||
|
if (!wrapper || !node) return;
|
||||||
|
|
||||||
|
const containerWidth = wrapper.offsetWidth;
|
||||||
|
if (containerWidth < baseWidth) {
|
||||||
|
const scale = containerWidth / baseWidth;
|
||||||
|
node.style.transform = `scale(${scale})`;
|
||||||
|
node.style.transformOrigin = 'top center';
|
||||||
|
node.style.width = `${baseWidth}px`;
|
||||||
|
node.style.minWidth = `${baseWidth}px`;
|
||||||
|
node.style.height = `${baseHeight}px`;
|
||||||
|
node.style.minHeight = `${baseHeight}px`;
|
||||||
|
wrapper.style.height = `${baseHeight * scale}px`;
|
||||||
|
} else {
|
||||||
|
node.style.transform = '';
|
||||||
|
node.style.transformOrigin = '';
|
||||||
|
node.style.width = '';
|
||||||
|
node.style.minWidth = '';
|
||||||
|
node.style.height = '';
|
||||||
|
node.style.minHeight = '';
|
||||||
|
wrapper.style.height = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function scaleAllDocuments() {
|
||||||
|
scaleDocument('.certificate-container-wrapper', '#certificate-node', 1122, 794);
|
||||||
|
scaleDocument('.transcript-container-wrapper', '#transcript-node', 794, 1122);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('resize', scaleAllDocuments);
|
||||||
|
window.addEventListener('DOMContentLoaded', scaleAllDocuments);
|
||||||
|
window.addEventListener('load', scaleAllDocuments);
|
||||||
|
|
||||||
|
// Immediate and delayed triggers to ensure correct measurement after image & stylesheet loading
|
||||||
|
scaleAllDocuments();
|
||||||
|
setTimeout(scaleAllDocuments, 100);
|
||||||
|
setTimeout(scaleAllDocuments, 500);
|
||||||
|
setTimeout(scaleAllDocuments, 1500);
|
||||||
|
|
||||||
async function downloadPDF() {
|
async function downloadPDF() {
|
||||||
const btn = document.getElementById('pdf-btn');
|
const btn = document.getElementById('pdf-btn');
|
||||||
const icon = document.getElementById('pdf-icon');
|
const icon = document.getElementById('pdf-icon');
|
||||||
@@ -414,6 +457,21 @@
|
|||||||
const certEl = document.getElementById('certificate-node');
|
const certEl = document.getElementById('certificate-node');
|
||||||
const transEl = document.getElementById('transcript-node');
|
const transEl = document.getElementById('transcript-node');
|
||||||
|
|
||||||
|
// Force elements to normal scale prior to capturing for PDF
|
||||||
|
const origCertTransform = certEl.style.transform;
|
||||||
|
const origCertWidth = certEl.style.width;
|
||||||
|
const origCertHeight = certEl.style.height;
|
||||||
|
const origTransTransform = transEl.style.transform;
|
||||||
|
const origTransWidth = transEl.style.width;
|
||||||
|
const origTransHeight = transEl.style.height;
|
||||||
|
|
||||||
|
certEl.style.transform = 'none';
|
||||||
|
certEl.style.width = '1122px';
|
||||||
|
certEl.style.height = '794px';
|
||||||
|
transEl.style.transform = 'none';
|
||||||
|
transEl.style.width = '794px';
|
||||||
|
transEl.style.height = '1122px';
|
||||||
|
|
||||||
// Render Page 1 (Landscape)
|
// Render Page 1 (Landscape)
|
||||||
const certCanvas = await html2canvas(certEl, {
|
const certCanvas = await html2canvas(certEl, {
|
||||||
scale: 2,
|
scale: 2,
|
||||||
@@ -446,9 +504,16 @@
|
|||||||
|
|
||||||
// Add portrait page to PDF
|
// Add portrait page to PDF
|
||||||
pdf.addPage('a4', 'portrait');
|
pdf.addPage('a4', 'portrait');
|
||||||
// Avoid vertical squishing by printing at its natural aspect ratio
|
|
||||||
pdf.addImage(transImgData, 'JPEG', 0, 0, transWidth, transHeight);
|
pdf.addImage(transImgData, 'JPEG', 0, 0, transWidth, transHeight);
|
||||||
|
|
||||||
|
// Restore styles
|
||||||
|
certEl.style.transform = origCertTransform;
|
||||||
|
certEl.style.width = origCertWidth;
|
||||||
|
certEl.style.height = origCertHeight;
|
||||||
|
transEl.style.transform = origTransTransform;
|
||||||
|
transEl.style.width = origTransWidth;
|
||||||
|
transEl.style.height = origTransHeight;
|
||||||
|
|
||||||
// Trigger Save File
|
// Trigger Save File
|
||||||
pdf.save('{{ str()->slug($application->name) }}-staj-belgesi.pdf');
|
pdf.save('{{ str()->slug($application->name) }}-staj-belgesi.pdf');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user