Create Design And Discussion
محتوى الدرس
src/App.jsx
import "./App.css";
import CourseCard from "./components/CourseCard";
import Header from "./components/layout/Header";
import Footer from "./components/layout/Footer";
function App() {
return (
<>
<Header />
<main>
<div className="courses" id="courses">
<CourseCard title="HTML" lessons={30} price={15} />
<CourseCard title="CSS" lessons={60} price={35} />
<CourseCard title="JS" lessons={80} price={50} />
<CourseCard title="Reactjs" lessons={70} price={40} />
<CourseCard title="Git" lessons={20} price={15} />
<CourseCard title="Github" lessons={25} price={20} />
<CourseCard title="TypeScript" lessons={40} price={30} />
<CourseCard title="Gulpjs" lessons={20} price={15} />
</div>
</main>
<Footer />
</>
);
}
export default App;
src/app.css
.courses {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
gap: 24px;
}src/components/CourseCard.jsx
import "./course-card.css";
function CourseCard(courseDetails) {
return (
<div className="course-card">
<p>Course Name Is: {courseDetails.title}</p>
<p>Course Lesssons Number Is: {courseDetails.lessons}</p>
<p>Price Is: {courseDetails.price}</p>
</div>
);
}
export default CourseCard;src/components/course-card.css
.course-card {
min-width: 0;
padding: 28px;
background-color: white;
border: 1px solid #e2e8f0;
border-top: 4px solid #2563eb;
border-radius: 16px;
box-shadow: 0 8px 24px rgb(15 23 42 / 5%);
transition: box-shadow 0.2s;
}
.course-card:hover {
box-shadow: 0 12px 32px rgb(15 23 42 / 12%);
}
.course-card p {
margin: 0;
line-height: 1.6;
overflow-wrap: anywhere;
}
.course-card p:first-child {
margin-bottom: 20px;
color: #0f172a;
font-size: 22px;
font-weight: bold;
}
.course-card p:nth-child(2) {
padding-bottom: 20px;
color: #64748b;
border-bottom: 1px solid #e2e8f0;
}
.course-card p:last-child {
padding-top: 20px;
color: #1d4ed8;
font-size: 20px;
font-weight: bold;
}src/index.css
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
main {
width: 100%;
max-width: 1200px;
margin-inline: auto;
padding: 40px 24px;
flex: 1;
}src/components/layout/header.css
.site-header {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 24px;
padding: 24px max(24px, calc((100% - 1152px) / 2));
background-color: #0f172a;
border-bottom: 3px solid #2563eb;
}
.site-logo {
color: #f8fafc;
font-size: 24px;
font-weight: bold;
letter-spacing: -1px;
text-decoration: none;
}
.site-nav {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.site-nav a {
padding: 10px 16px;
color: #cbd5e1;
border-radius: 8px;
transition: background-color 0.2s, color 0.2s;
text-decoration: none;
}
.site-nav a:hover {
color: white;
background-color: #1e3a5f;
}
@media (max-width: 600px) {
.site-header {
flex-direction: column;
text-align: center;
}
.site-nav {
justify-content: center;
}
}src/components/layout/Footer.jsx
import "./footer.css";
function Footer() {
const year = new Date().getFullYear();
return (
<footer className="site-footer">
<strong>Elzero Web School</strong>
<p>Learn. Practice. Build.</p>
<small>© {year} — All Rights Reserved</small>
</footer>
);
}
export default Footer;src/components/layout/footer.css
.site-footer {
padding: 32px 24px;
color: #cbd5e1;
background-color: #0f172a;
text-align: center;
}
.site-footer strong {
color: #f8fafc;
font-size: 20px;
}
.site-footer p {
margin: 12px 0 20px;
color: #94a3b8;
font-size: 14px;
letter-spacing: 1px;
}
.site-footer small {
color: #94a3b8;
}