📁 File Manager
Editing:
/home/wedigitalindia/public_html/mvskpowdercoating.com/blog-details.php
<?php // ini_set('display_errors', '1'); // ini_set('display_startup_errors', '1'); // error_reporting(E_ALL); require_once 'admin/inc/config.php'; require_once __DIR__ . '/data/site.php'; require_once __DIR__ . '/data/contact.php'; function e($value): string { return htmlspecialchars( (string)($value ?? ''), ENT_QUOTES, 'UTF-8' ); } $slug = trim($_GET['slug'] ?? ''); $statement = $pdo->prepare(" SELECT id, slug, title, excerpt, content, image, author, date, category FROM blogs WHERE slug = '$slug' ORDER BY date DESC, id DESC "); $statement->execute(); $blogs = $statement->fetchAll(PDO::FETCH_ASSOC); $blog = null; foreach ($blogs as $item) { if (($item['slug'] ?? '') === $slug) { $blog = $item; break; } } $pageTitle = $blog ? ($blog['title'] ?? 'Blog Details') : 'Blog Not Found'; ?> <?php require_once __DIR__ . '/includes/header.php'; ?> <style> .blog-details-section{ width:100%; padding:50px 0 100px; background:#f5f7fa; overflow:hidden; } .blog-details-top{ width:100%; background:#fff; } .blog-details-top-wrapper{ width:100%; max-width:1500px; margin:0 auto; display:grid; padding:60px; grid-template-columns:50% 50%; align-items:center; min-height:560px; } .blog-details-image{ width:100%; height:560px; overflow:hidden; border-radius:0 0 25px 25px; background:#f4f4f4; grid-column:1; grid-row:1; } .blog-details-image img{ display:block; width:100%; height:100%; object-fit:cover; } .blog-details-intro{ padding:60px 8%; grid-column:2; grid-row:1; } .blog-details-category{ display:inline-flex; align-items:center; justify-content:center; margin-bottom:22px; padding:14px 28px; border-radius:50px; background:var(--brand); color:#fff; font-size:15px; font-weight:700; line-height:1.3; } .blog-details-title{ margin:0 0 25px; color:black; font-size:32px; font-weight:600; line-height:1.12; overflow-wrap:anywhere; } .blog-details-excerpt{ margin:0; color:#141414; font-size:16px; line-height:1.7; overflow-wrap:anywhere; } .blog-details-content-wrapper{ width:100%; max-width:1250px; margin:-5px auto 0; position:relative; z-index:2; } .blog-details-content-card{ width:100%; padding:50px 75px 80px; background:#fff; border-radius:5px; box-shadow:0 10px 40px rgba(20,40,70,.06); } .blog-details-content{ width:100%; color:#222; font-size:19px; line-height:1.9; overflow-wrap:anywhere; } .blog-details-content p{ margin:0 0 28px; } .blog-details-content h2{ margin:22px 0 13px; color:black; font-size:32px; font-weight:600; line-height:1.3; } .blog-details-content h3{ margin:40px 0 18px; color:#092f6b; font-size:28px; font-weight:800; line-height:1.35; } .blog-details-content h4{ margin:35px 0 15px; color:#092f6b; font-size:24px; font-weight:700; } .blog-details-content ul, .blog-details-content ol{ margin:0 0 30px; padding-left:28px; } .blog-details-content li{ margin-bottom:5px; padding-left:5px; } .blog-details-content a{ color:var(--brand,#0d55a8); overflow-wrap:anywhere; } .blog-details-content img{ display:block; width:auto; max-width:100%; height:auto; margin:30px 0; border-radius:12px; } .blog-details-content iframe, .blog-details-content video{ display:block; max-width:100%; } .blog-details-footer{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; margin-top:55px; padding-top:30px; border-top:1px solid #e5e8ed; } .blog-back-link{ display:inline-flex; align-items:center; gap:9px; color:var(--brand); font-size:15px; font-weight:700; text-decoration:none; } .blog-back-link:hover{ color:#092f6b; } .blog-not-found{ width:100%; padding:100px 0; text-align:center; } .blog-not-found h1{ margin-bottom:15px; color:#222; font-size:clamp(28px,4vw,40px); } .blog-not-found p{ margin-bottom:25px; color:#666; } @media(max-width:1199px){ .blog-details-top-wrapper{ grid-template-columns:48% 52%; } .blog-details-image{ height:500px; } .blog-details-intro{ padding:50px 7%; } .blog-details-title{ font-size:48px; } .blog-details-excerpt{ font-size:19px; } .blog-details-content-card{ padding:60px; } } @media(max-width:991px){ .blog-details-section{ padding:65px 0 80px; } .blog-details-top{ padding-bottom:70px; } .blog-details-top-wrapper{ display:flex; flex-direction:column; align-items:stretch; min-height:auto; padding:15px; } .blog-details-image{ order:2; width:100%; height:400px; border-radius:0; } .blog-details-intro{ order:1; padding:45px 30px 35px; } .blog-details-title{ font-size:44px; } .blog-details-content-card{ padding:50px; border-radius:25px; } .blog-details-content{ font-size:18px; } } @media(max-width:767px){ .blog-details-section{ padding:50px 0 70px; } .blog-details-top{ padding-bottom:55px; } .blog-details-image{ order:2; height:280px; border-radius:12px; margin:0 20px; width:calc(100% - 40px); } .blog-details-intro{ order:1; padding:35px 20px 30px; } .blog-details-category{ margin-bottom:18px; padding:11px 20px; font-size:13px; } .blog-details-title{ margin-bottom:18px; font-size:34px; } .blog-details-excerpt{ font-size:17px; line-height:1.7; } .blog-details-content-wrapper{ width:calc(100% - 30px); } .blog-details-content-card{ padding:35px 25px 40px; border-radius:20px; } .blog-details-content{ font-size:16px; line-height:1.8; } .blog-details-content h2{ margin-top:35px; font-size:27px; } .blog-details-content h3{ margin-top:30px; font-size:23px; } .blog-details-content ul, .blog-details-content ol{ padding-left:22px; } .blog-details-footer{ align-items:flex-start; flex-direction:column; margin-top:40px; gap:15px; } } @media(max-width:480px){ .blog-details-image{ height:300px; } .blog-details-title{ font-size:19px; } .blog-details-excerpt{ font-size:16px; } .blog-details-content-wrapper{ width:calc(100% - 20px); } .blog-details-content-card{ padding:30px 20px 35px; } .blog-details-content{ font-size:15px; } .blog-details-content h2{ font-size:19px; } } /* ========================================================= EXTRA LEVEL BLOG DETAILS UI CSS ONLY - NO HTML / PHP CHANGES ========================================================= */ /* ========================================================= HERO / TOP BLOG AREA ========================================================= */ .blog-details-top { position: relative; overflow: hidden; } .blog-details-top::before { content: ""; position: absolute; width: 520px; height: 520px; top: -260px; right: -180px; border-radius: 50%; background: radial-gradient( circle, rgba(227, 6, 19, .08) 0%, rgba(227, 6, 19, .035) 35%, transparent 70% ); pointer-events: none; animation: blogGlowOne 9s ease-in-out infinite alternate; } .blog-details-top::after { content: ""; position: absolute; width: 400px; height: 400px; bottom: -250px; left: -170px; border-radius: 50%; background: radial-gradient( circle, rgba(11, 78, 162, .07) 0%, rgba(11, 78, 162, .025) 40%, transparent 70% ); pointer-events: none; animation: blogGlowTwo 11s ease-in-out infinite alternate; } @keyframes blogGlowOne { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-35px, 25px) scale(1.08); } 100% { transform: translate(-10px, 55px) scale(.95); } } @keyframes blogGlowTwo { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(35px, -25px) scale(1.08); } 100% { transform: translate(15px, -45px) scale(.96); } } /* ========================================================= BLOG TOP WRAPPER ========================================================= */ .blog-details-top-wrapper { position: relative; z-index: 2; } /* ========================================================= BLOG IMAGE - PREMIUM FRAME ========================================================= */ .blog-details-image { position: relative; isolation: isolate; border-radius: 0 0 25px 25px; box-shadow: 0 20px 55px rgba(0, 0, 0, .13), 0 4px 15px rgba(0, 0, 0, .06); transform: translateY(0); transition: transform .6s cubic-bezier(.22, .61, .36, 1), box-shadow .6s ease; } .blog-details-image::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(255, 255, 255, .38); border-radius: 0 0 17px 17px; z-index: 2; pointer-events: none; } .blog-details-image::after { content: ""; position: absolute; top: 0; left: -130%; width: 70%; height: 100%; background: linear-gradient( 100deg, transparent 15%, rgba(255,255,255,.05) 35%, rgba(255,255,255,.35) 50%, rgba(255,255,255,.05) 65%, transparent 85% ); transform: skewX(-18deg); z-index: 3; pointer-events: none; } .blog-details-image:hover { transform: translateY(-8px); box-shadow: 0 30px 70px rgba(0, 0, 0, .18), 0 8px 20px rgba(0, 0, 0, .08); } .blog-details-image:hover::after { animation: blogImageLight 1s ease forwards; } @keyframes blogImageLight { 0% { left: -130%; } 100% { left: 150%; } } .blog-details-image img { transform: scale(1); transition: transform 1s cubic-bezier(.22, .61, .36, 1), filter .6s ease; } .blog-details-image:hover img { transform: scale(1.055); filter: saturate(1.08) contrast(1.02); } /* ========================================================= INTRO AREA ========================================================= */ .blog-details-intro { position: relative; z-index: 3; animation: blogIntroReveal .9s cubic-bezier(.22, .61, .36, 1) both; } @keyframes blogIntroReveal { 0% { opacity: 0; transform: translateX(45px); } 100% { opacity: 1; transform: translateX(0); } } /* ========================================================= CATEGORY / EYEBROW ========================================================= */ .blog-details-intro .eyebrow { position: relative; display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px; padding: 10px 20px; border-radius: 50px; background: rgba(227, 6, 19, .07); color: var(--brand); font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; overflow: hidden; animation: blogCategoryIn 1s ease both; } .blog-details-intro .eyebrow::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(227, 6, 19, .45); animation: blogDotPulse 1.8s infinite; } .blog-details-intro .eyebrow::after { content: ""; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient( 90deg, transparent, rgba(255,255,255,.75), transparent ); transform: skewX(-20deg); } .blog-details-intro .eyebrow:hover::after { animation: blogEyebrowShine .7s ease; } @keyframes blogCategoryIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } } @keyframes blogDotPulse { 0% { box-shadow: 0 0 0 0 rgba(227, 6, 19, .4); } 70% { box-shadow: 0 0 0 8px rgba(227, 6, 19, 0); } 100% { box-shadow: 0 0 0 0 rgba(227, 6, 19, 0); } } @keyframes blogEyebrowShine { 0% { left: -100%; } 100% { left: 150%; } } /* ========================================================= TITLE ========================================================= */ .blog-details-title { position: relative; max-width: 850px; animation: blogTitleReveal 1s .12s cubic-bezier(.22, .61, .36, 1) both; } @keyframes blogTitleReveal { 0% { opacity: 0; transform: translateY(25px); filter: blur(5px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0); } } .blog-details-title::after { content: ""; display: block; width: 65px; height: 3px; margin-top: 22px; background: var(--brand); transform-origin: left center; animation: blogTitleLine 2.5s ease-in-out infinite; } @keyframes blogTitleLine { 0% { transform: scaleX(.35); opacity: .5; } 50% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(.35); opacity: .5; } } /* ========================================================= EXCERPT ========================================================= */ .blog-details-excerpt { position: relative; animation: blogExcerptReveal 1s .25s cubic-bezier(.22, .61, .36, 1) both; } @keyframes blogExcerptReveal { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } } /* ========================================================= CONTENT SECTION BACKGROUND ========================================================= */ .blog-details-section { position: relative; isolation: isolate; } .blog-details-section::before { content: ""; position: absolute; top: 8%; left: -180px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient( circle, rgba(227, 6, 19, .035), transparent 70% ); pointer-events: none; z-index: -1; animation: contentGlow 10s ease-in-out infinite alternate; } @keyframes contentGlow { 0% { transform: translateY(0); } 100% { transform: translateY(80px); } } /* ========================================================= ARTICLE CARD - FLOATING PREMIUM EFFECT ========================================================= */ .blog-details-content-card { position: relative; overflow: hidden; border: 1px solid rgba(10, 30, 60, .06); box-shadow: 0 15px 50px rgba(20, 40, 70, .07), 0 2px 10px rgba(20, 40, 70, .03); transition: transform .5s ease, box-shadow .5s ease; } .blog-details-content-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient( 90deg, var(--brand), #092f6b, var(--brand) ); background-size: 200% 100%; animation: articleTopLine 4s linear infinite; } @keyframes articleTopLine { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } } /* ========================================================= ARTICLE TYPOGRAPHY ========================================================= */ .blog-details-content p { transition: transform .35s ease; font-size: 16px; } .blog-details-content p:hover { transform: translateX(3px); } .blog-details-content h2, .blog-details-content h3, .blog-details-content h4 { position: relative; } .blog-details-content h3::after, .blog-details-content h4::after { content: ""; display: block; width: 45px; height: 2px; margin-top: 10px; background: var(--brand); transform-origin: left; transition: width .4s ease; } .blog-details-content h3:hover::after, .blog-details-content h4:hover::after { width: 80px; } /* ========================================================= LIST ITEMS ========================================================= */ .blog-details-content li { position: relative; transition: transform .3s ease, color .3s ease; font-size: 16px; } .blog-details-content li::marker { color: var(--brand); } .blog-details-content li:hover { transform: translateX(5px); } /* ========================================================= CONTENT IMAGES ========================================================= */ .blog-details-content img { box-shadow: 0 15px 40px rgba(0, 0, 0, .10); transition: transform .5s ease, box-shadow .5s ease; } .blog-details-content img:hover { transform: translateY(-5px); box-shadow: 0 25px 55px rgba(0, 0, 0, .15); } /* ========================================================= CONTENT LINKS ========================================================= */ .blog-details-content a { position: relative; text-decoration: none; } .blog-details-content a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s ease; } .blog-details-content a:hover::after { transform: scaleX(1); } /* ========================================================= FOOTER NAVIGATION ========================================================= */ .blog-details-footer { position: relative; } .blog-details-footer::before { content: ""; position: absolute; top: -1px; left: 0; width: 65px; height: 2px; background: var(--brand); } .blog-back-link { position: relative; padding: 11px 18px; border: 1px solid #e4e7eb; border-radius: 50px; background: #fff; transition: color .35s ease, background .35s ease, border-color .35s ease, transform .35s ease, box-shadow .35s ease; } .blog-back-link:hover { color: #fff; background: var(--brand); border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 10px 25px rgba(227, 6, 19, .18); } .blog-back-link i { transition: transform .35s ease; } .blog-back-link:hover i.bi-arrow-left { transform: translateX(-4px); } .blog-back-link:hover i.bi-arrow-up-right { transform: translate(3px, -3px); } /* ========================================================= NOT FOUND PAGE ========================================================= */ .blog-not-found { position: relative; overflow: hidden; } .blog-not-found::before, .blog-not-found::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; pointer-events: none; } .blog-not-found::before { top: -150px; left: -100px; background: rgba(227, 6, 19, .05); } .blog-not-found::after { right: -100px; bottom: -150px; background: rgba(11, 78, 162, .05); } /* ========================================================= DESKTOP CARD FLOAT ========================================================= */ @media (min-width: 992px) { .blog-details-content-card { transform: translateY(0); } .blog-details-content-card:hover { transform: translateY(-4px); box-shadow: 0 22px 65px rgba(20, 40, 70, .10), 0 5px 18px rgba(20, 40, 70, .04); } } /* ========================================================= TABLET ========================================================= */ @media (max-width: 991px) { .blog-details-intro { animation-name: blogMobileIntro; } .blog-details-image { box-shadow: 0 15px 40px rgba(0, 0, 0, .12); } @keyframes blogMobileIntro { 0% { opacity: 0; transform: translateY(-25px); } 100% { opacity: 1; transform: translateY(0); } } } /* ========================================================= MOBILE ========================================================= */ @media (max-width: 767px) { .blog-details-top::before { width: 320px; height: 320px; right: -170px; } .blog-details-top::after { width: 280px; height: 280px; left: -170px; } .blog-details-image { box-shadow: 0 12px 35px rgba(0, 0, 0, .12); } .blog-details-image::before { inset: 8px; border-radius: 8px; } .blog-details-title::after { width: 50px; margin-top: 16px; } .blog-details-content-card { box-shadow: 0 12px 35px rgba(20, 40, 70, .07); } .blog-details-content p:hover { transform: none; } .blog-details-content li:hover { transform: none; } } /* ========================================================= SMALL MOBILE ========================================================= */ @media (max-width: 480px) { .blog-details-intro .eyebrow { padding: 8px 15px; font-size: 11px; letter-spacing: 1px; } .blog-details-image:hover { transform: none; } .blog-details-image:hover img { transform: scale(1.025); } .blog-details-content-card:hover { transform: none; } .blog-back-link { padding: 9px 15px; font-size: 13px; } } /* ========================================================= REDUCED MOTION ========================================================= */ @media (prefers-reduced-motion: reduce) { .blog-details-top::before, .blog-details-top::after, .blog-details-section::before, .blog-details-image::after, .blog-details-intro, .blog-details-intro .eyebrow, .blog-details-intro .eyebrow::before, .blog-details-title, .blog-details-title::after, .blog-details-excerpt, .blog-details-content-card, .blog-details-content-card::before { animation: none !important; transition: none !important; } } </style> <!-- BLOG DETAILS HERO BANNER --> <section class="contact-hero" style="background-image:url('<?= $site['base_url'] ?><?= e( $contact_page['banner_image'] ?? '' ) ?>');"> <div class="contact-hero-overlay"></div> <div class="container-fluid px-lg-5"> <div class="contact-hero-content"> <span class="contact-hero-eyebrow"> <?= e( $contact_page['eyebrow'] ?? 'Insights & Updates' ) ?> </span> <h1> Blog Details </h1> <div class="contact-breadcrumb"> <a href="<?= $site['base_url'] ?>index.php"> Home </a> <i class="bi bi-chevron-right"></i> <a href="<?= $site['base_url'] ?>blog.php"> Blog </a> <i class="bi bi-chevron-right"></i> <strong> Blog Details </strong> </div> </div> </div> </section> <?php if (!$blog): ?> <!-- BLOG NOT FOUND --> <main class="blog-not-found"> <div class="container"> <h1> Blog Post Not Found </h1> <p> Sorry, the blog post you are looking for does not exist. </p> <a href="blog.php" class="btn btn-brand"> Back to Blog </a> </div> </main> <?php else: ?> <!-- BLOG TOP SECTION --> <section class="blog-details-top"> <div class="blog-details-top-wrapper"> <!-- BLOG IMAGE --> <div class="blog-details-image"> <?php /* * Database stores: * * assets/images/blog/filename.webp * * Site URL comes from: * * $site['base_url'] */ $blogImage = $blog['image'] ?? ''; if (!empty($blogImage)) { $blogImageUrl = $site['base_url'] . 'assets/images/blog/' . ltrim($blogImage, '/'); } else { $blogImageUrl = $site['base_url'] . 'assets/images/blog/default.webp'; } ?> <img src="<?= htmlspecialchars($blogImageUrl, ENT_QUOTES, 'UTF-8') ?>" alt="<?= htmlspecialchars($blog['title'] ?? 'Blog Image', ENT_QUOTES, 'UTF-8') ?>" loading="lazy"> </div> <!-- BLOG INTRO --> <div class="blog-details-intro"> <div class="eyebrow"> <?= e( $blog['category'] ?? 'Industry Insights' ) ?> </div> <h1 class="blog-details-title"> <?= e( $blog['title'] ?? '' ) ?> </h1> <?php if (!empty($blog['excerpt'])): ?> <p class="blog-details-excerpt"> <?= e( $blog['excerpt'] ) ?> </p> <?php endif; ?> </div> </div> </section> <!-- BLOG CONTENT --> <main class="blog-details-section"> <div class="container"> <div class="blog-details-content-wrapper"> <article class="blog-details-content-card"> <div class="blog-details-content"> <?= $blog['content'] ?? '' ?> </div> <!-- FOOTER LINKS --> <div class="blog-details-footer"> <a href="blog.php" class="blog-back-link"> <i class="bi bi-arrow-left"></i> Back to Blog </a> <a href="index.php" class="blog-back-link"> Back to Home <i class="bi bi-arrow-up-right"></i> </a> </div> </article> </div> </div> </main> <?php endif; ?> <?php require_once __DIR__ . '/includes/footer.php'; ?>
Save
Cancel