|
| 1 | +import React from "react"; |
| 2 | +import Link from "next/link"; |
| 3 | +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; |
| 4 | +import { |
| 5 | + faBookOpen, |
| 6 | + faLightbulb, |
| 7 | + faPenNib, |
| 8 | + faChartLine, |
| 9 | + faArrowTrendUp, |
| 10 | +} from "@fortawesome/free-solid-svg-icons"; |
| 11 | + |
| 12 | +const highlights = [ |
| 13 | + { |
| 14 | + icon: faBookOpen, |
| 15 | + title: "Explore DevOps Blogs", |
| 16 | + description: |
| 17 | + "Read high-quality blogs on Docker, Kubernetes, CI/CD, Cloud, and more.", |
| 18 | + }, |
| 19 | + { |
| 20 | + icon: faLightbulb, |
| 21 | + title: "Learn from Real Experiences", |
| 22 | + description: |
| 23 | + "Gain insights from real-world problems and practical solutions shared by developers.", |
| 24 | + }, |
| 25 | + { |
| 26 | + icon: faPenNib, |
| 27 | + title: "Create & Share Your Knowledge", |
| 28 | + description: |
| 29 | + "Write and publish your own blogs to help others and build your personal brand.", |
| 30 | + }, |
| 31 | + { |
| 32 | + icon: faChartLine, |
| 33 | + title: "Stay Updated", |
| 34 | + description: |
| 35 | + "Keep up with the latest DevOps trends, tools, and best practices.", |
| 36 | + }, |
| 37 | +]; |
| 38 | + |
| 39 | +const blogPreviews = [ |
| 40 | + { |
| 41 | + title: "Kubernetes CrashLoopBackOff: Practical Fix Guide", |
| 42 | + author: "By Aisha Khan", |
| 43 | + snippet: "A quick diagnostic checklist to identify and resolve recurring pod restarts.", |
| 44 | + tag: "Kubernetes", |
| 45 | + }, |
| 46 | + { |
| 47 | + title: "CI/CD Pipeline Failures: 7 Root Causes", |
| 48 | + author: "By Aryan DevOps", |
| 49 | + snippet: "Learn the most common deployment blockers and how teams fix them fast.", |
| 50 | + tag: "CI/CD", |
| 51 | + }, |
| 52 | + { |
| 53 | + title: "From Docker Errors to Stable Builds", |
| 54 | + author: "By Meera S.", |
| 55 | + snippet: "A field-tested method to reduce image build breaks and speed up feedback loops.", |
| 56 | + tag: "Docker", |
| 57 | + }, |
| 58 | +]; |
| 59 | + |
| 60 | +function DiscoverSection({ theme, startNowHref = "/blogs", writeBlogHref }) { |
| 61 | + return ( |
| 62 | + <section |
| 63 | + className={`relative px-6 sm:px-10 lg:px-16 py-20 overflow-hidden ${ |
| 64 | + theme |
| 65 | + ? "bg-gradient-to-b from-[#f4f8ff] via-[#f5fbff] to-[#f3fbf7]" |
| 66 | + : "bg-gradient-to-b from-[#10172a] via-[#111827] to-[#0f1f22]" |
| 67 | + }`} |
| 68 | + > |
| 69 | + <div |
| 70 | + className="absolute inset-0 opacity-30 pointer-events-none" |
| 71 | + style={{ |
| 72 | + backgroundImage: |
| 73 | + "radial-gradient(circle at 20% 15%, rgba(59,130,246,0.18), transparent 40%), radial-gradient(circle at 78% 85%, rgba(16,185,129,0.14), transparent 38%)", |
| 74 | + }} |
| 75 | + ></div> |
| 76 | + |
| 77 | + <div className="relative z-10 mx-auto max-w-7xl grid grid-cols-1 xl:grid-cols-2 gap-10 xl:gap-14 items-start"> |
| 78 | + <div data-aos="fade-up"> |
| 79 | + <h2 |
| 80 | + className={`text-4xl md:text-5xl font-extrabold leading-tight ${ |
| 81 | + theme ? "text-[#122336]" : "text-white" |
| 82 | + }`} |
| 83 | + > |
| 84 | + <span className="text-sky-500">Discover</span>, <span className="text-violet-500">Learn</span> & <span className="text-emerald-500">Grow</span> |
| 85 | + </h2> |
| 86 | + |
| 87 | + <p |
| 88 | + className={`mt-5 text-lg md:text-xl leading-relaxed ${ |
| 89 | + theme ? "text-slate-600" : "text-slate-300" |
| 90 | + }`} |
| 91 | + > |
| 92 | + Explore insightful DevOps blogs, learn from real-world experiences, and share your knowledge with the community. |
| 93 | + </p> |
| 94 | + |
| 95 | + <div className="mt-8 grid sm:grid-cols-2 gap-4"> |
| 96 | + {highlights.map((item, index) => ( |
| 97 | + <div |
| 98 | + key={item.title} |
| 99 | + data-aos="fade-up" |
| 100 | + data-aos-delay={110 + index * 70} |
| 101 | + className={`group rounded-2xl border p-4 transition-all duration-300 hover:-translate-y-1 hover:scale-[1.01] ${ |
| 102 | + theme |
| 103 | + ? "bg-white/90 border-slate-200 hover:border-sky-300/80 hover:shadow-[0_0_24px_rgba(59,130,246,0.20)]" |
| 104 | + : "bg-white/5 border-white/10 hover:border-sky-300/70 hover:shadow-[0_0_24px_rgba(59,130,246,0.18)]" |
| 105 | + }`} |
| 106 | + > |
| 107 | + <div className="flex items-start gap-3"> |
| 108 | + <span |
| 109 | + className={`h-10 w-10 rounded-xl flex items-center justify-center transition-all duration-300 group-hover:scale-110 ${ |
| 110 | + theme |
| 111 | + ? "bg-sky-50 text-sky-600" |
| 112 | + : "bg-sky-500/20 text-sky-200" |
| 113 | + }`} |
| 114 | + > |
| 115 | + <FontAwesomeIcon icon={item.icon} width={17} /> |
| 116 | + </span> |
| 117 | + <div> |
| 118 | + <h3 className={`font-semibold ${theme ? "text-slate-800" : "text-slate-100"}`}> |
| 119 | + {item.title} |
| 120 | + </h3> |
| 121 | + <p className={`text-sm mt-1 leading-relaxed ${theme ? "text-slate-600" : "text-slate-300"}`}> |
| 122 | + {item.description} |
| 123 | + </p> |
| 124 | + </div> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + ))} |
| 128 | + </div> |
| 129 | + |
| 130 | + <div className="mt-8 flex flex-wrap gap-3"> |
| 131 | + <Link |
| 132 | + href={startNowHref} |
| 133 | + className="inline-flex items-center gap-2 px-7 py-3.5 rounded-xl text-white font-semibold bg-gradient-to-r from-sky-500 via-violet-500 to-emerald-500 shadow-lg shadow-sky-500/25 transition-all duration-300 hover:scale-105 hover:shadow-xl hover:shadow-sky-500/30 active:scale-95" |
| 134 | + > |
| 135 | + Start Now |
| 136 | + <FontAwesomeIcon icon={faArrowTrendUp} width={14} /> |
| 137 | + </Link> |
| 138 | + |
| 139 | + {writeBlogHref && ( |
| 140 | + <Link |
| 141 | + href={writeBlogHref} |
| 142 | + className={`inline-flex items-center gap-2 px-6 py-3.5 rounded-xl font-semibold border transition-all duration-300 hover:scale-105 active:scale-95 ${ |
| 143 | + theme |
| 144 | + ? "bg-white text-slate-700 border-slate-300 hover:border-violet-400 hover:text-violet-600" |
| 145 | + : "bg-white/5 text-slate-200 border-white/15 hover:border-violet-300/70 hover:text-violet-200" |
| 146 | + }`} |
| 147 | + > |
| 148 | + Write a Blog |
| 149 | + </Link> |
| 150 | + )} |
| 151 | + </div> |
| 152 | + </div> |
| 153 | + |
| 154 | + <div className="relative" data-aos="fade-left" data-aos-delay="200"> |
| 155 | + <div className="grid gap-4"> |
| 156 | + {blogPreviews.map((blog, index) => ( |
| 157 | + <article |
| 158 | + key={blog.title} |
| 159 | + data-aos="fade-up" |
| 160 | + data-aos-delay={160 + index * 90} |
| 161 | + className={`group rounded-2xl border p-5 transition-all duration-300 hover:-translate-y-1 hover:scale-[1.01] ${ |
| 162 | + theme |
| 163 | + ? "bg-white/90 border-slate-200 shadow-sm hover:shadow-xl hover:border-emerald-300/70" |
| 164 | + : "bg-white/5 border-white/10 shadow-sm hover:shadow-xl hover:border-emerald-300/60" |
| 165 | + }`} |
| 166 | + > |
| 167 | + <div className="flex items-center justify-between gap-3"> |
| 168 | + <span className={`text-xs px-2.5 py-1 rounded-full font-medium ${theme ? "bg-sky-100 text-sky-700" : "bg-sky-500/20 text-sky-200"}`}> |
| 169 | + {blog.tag} |
| 170 | + </span> |
| 171 | + <span className={`text-xs ${theme ? "text-slate-500" : "text-slate-400"}`}>{blog.author}</span> |
| 172 | + </div> |
| 173 | + |
| 174 | + <h3 className={`mt-3 text-lg font-semibold leading-snug ${theme ? "text-slate-800" : "text-slate-100"}`}> |
| 175 | + {blog.title} |
| 176 | + </h3> |
| 177 | + <p className={`mt-2 text-sm leading-relaxed ${theme ? "text-slate-600" : "text-slate-300"}`}> |
| 178 | + {blog.snippet} |
| 179 | + </p> |
| 180 | + |
| 181 | + <div className="mt-4 h-1.5 rounded-full bg-slate-200/60 overflow-hidden"> |
| 182 | + <div |
| 183 | + className="h-full bg-gradient-to-r from-sky-500 to-emerald-500" |
| 184 | + style={{ width: `${70 + index * 10}%` }} |
| 185 | + ></div> |
| 186 | + </div> |
| 187 | + </article> |
| 188 | + ))} |
| 189 | + </div> |
| 190 | + </div> |
| 191 | + </div> |
| 192 | + </section> |
| 193 | + ); |
| 194 | +} |
| 195 | + |
| 196 | +export default DiscoverSection; |
0 commit comments