Personal Website Assignment

This commit is contained in:
Zagar Nashrullah
2026-11-06 12:34:00 +07:00
parent 7604223f74
commit 1472589b5c
14 changed files with 562 additions and 109 deletions
+17 -30
View File
@@ -1,36 +1,23 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). # Personal Website - Zagar Nashrullah
## Getting Started Tugas Assignment 1 mata kuliah Pemrograman Web Lanjut
First, run the development server: ## Halaman
- `/` Home (inline CSS)
- `/about` About (internal, inline, dan external CSS)
- `/hobbies` Hobbies (external CSS)
- `/gallery` Gallery (Tailwind CSS)
- `/contact` Contact (external CSS)
## Cara menjalankan
```bash ```bash
npm run dev npm install
# or npm dev
yarn dev
# or
pnpm dev
# or
bun dev
``` ```
Lalu buka - Local: http://localhost:3000
Juga bisa pakek - Network: http://192.168.1.3:3000
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. ## Struktur
- `app/` berisi kode tiap halaman
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - `public/images/` berisi foto
- `public/styles.css` berisi external CSS
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
+100
View File
@@ -0,0 +1,100 @@
import Link from "next/link";
export default function About() {
return (
<div className="about-page page">
{/* internal CSS: satu blok style yang mengatur background dan font halaman, judul, dan badge, memakai selector class dan id */}
<style>{`
.about-page {
background-color: #f5f5f5;
color: #222222;
font-family: Arial, sans-serif;
}
#judul-bio {
font-size: 28px;
font-weight: bold;
margin: 0 0 8px;
}
.about-page h2 {
font-size: 20px;
font-weight: bold;
margin: 0 0 12px;
}
.badge-prodi {
display: inline-block;
background-color: #1f3a5f;
color: #ffffff;
padding: 2px 10px;
font-size: 14px;
}
`}</style>
{/* external CSS: file styles.css mengatur navbar, wrapper layout (main), kotak, tabel, dan footer */}
<link rel="stylesheet" href="/styles.css" />
<header>
<nav className="nav-bar">
<Link href="/">Home</Link>
<Link href="/about">About</Link>
<Link href="/hobbies">Hobbies</Link>
<Link href="/gallery">Gallery</Link>
<Link href="/contact">Contact</Link>
</nav>
</header>
<main className="main-wrapper">
<section className="box">
<h1 id="judul-bio">Haloo👋</h1>
<h2>Bio</h2>
<p>Saya Zagar, mahasiswa Informatika semester 3. Saya suka bermain game,menonton film, dan mendengarkan musik pop rock.</p>
{/* badge program studi, tampilannya diatur oleh internal CSS (class badge-prodi) */}
<span className="badge-prodi">Mahasiswa Informatika</span>
</section>
<section className="box">
<h2>Pendidikan</h2>
{/* tabel pendidikan, tampilannya diatur oleh external CSS (class edu-table) */}
<table className="edu-table">
<thead>
<tr>
<th>Institusi</th>
<th>Program Studi</th>
<th>Semester</th>
</tr>
</thead>
<tbody>
<tr>
<td>Universitas Katolik Widya Mandala Surabaya</td>
<td>Informatika</td>
<td>3</td>
</tr>
</tbody>
</table>
</section>
<section className="box">
<h2>Kutipan Favorit</h2>
{/* inline CSS: atribut style langsung pada elemen kutipan */}
<blockquote
style={{
margin: 0,
paddingLeft: "12px",
borderLeft: "4px solid #1f3a5f",
fontStyle: "italic",
color: "#444444",
}}
>
HAII HALOO👋
</blockquote>
</section>
</main>
<footer className="footer-bar">
<p>&copy; 2026 Zagar</p>
</footer>
</div>
);
}
+59
View File
@@ -0,0 +1,59 @@
import Link from "next/link";
export default function Contact() {
return (
<div className="page">
{/* external CSS: dipilih karena styles.css sudah berisi gaya navbar, kotak, dan footer yang sama dengan halaman lain, jadi tampilan seragam dan mudah diubah dari satu file */}
<link rel="stylesheet" href="/styles.css" />
<header>
<nav className="nav-bar">
<Link href="/">Home</Link>
<Link href="/about">About</Link>
<Link href="/hobbies">Hobbies</Link>
<Link href="/gallery">Gallery</Link>
<Link href="/contact">Contact</Link>
</nav>
</header>
<main className="main-wrapper">
<section className="box">
<h1 className="contact-title">Hubungi Saya</h1>
<p>Kamu bisa menghubungi saya lewat kontak berikut.</p>
</section>
<section className="box">
<h2 className="contact-subtitle">Kontak</h2>
<ul className="contact-list">
<li>
<span className="contact-label">Email</span>
<a className="contact-link" href="mailto:zagar-n.inf25@ukwms.ac.id">
zagar-n.inf25@ukwms.ac.id
</a>
</li>
<li>
<span className="contact-label">Instagram</span>
{/* link eksternal: membuka situs di luar halaman sendiri pada tab baru */}
<a
className="contact-link"
href="https://www.instagram.com/jmn_zn14"
target="_blank"
rel="noopener noreferrer"
>
@jmn_zn14
</a>
</li>
<li>
<span className="contact-label">Domisili</span>
<span>Surabaya, Jawa Timur</span>
</li>
</ul>
</section>
</main>
<footer className="footer-bar">
<p>&copy; 2026 Zagar</p>
</footer>
</div>
);
}
+68
View File
@@ -0,0 +1,68 @@
import Link from "next/link";
export default function Gallery() {
return (
<div className="flex min-h-screen flex-col bg-gray-100 font-sans text-gray-800">
{/* Tailwind CSS: seluruh tampilan halaman ini hanya memakai utility class Tailwind */}
<header>
<nav className="bg-[#1f3a5f] px-5 py-3">
<Link href="/" className="mr-5 text-white hover:underline">Home</Link>
<Link href="/about" className="mr-5 text-white hover:underline">About</Link>
<Link href="/hobbies" className="mr-5 text-white hover:underline">Hobbies</Link>
<Link href="/gallery" className="mr-5 text-white hover:underline">Gallery</Link>
<Link href="/contact" className="text-white hover:underline">Contact</Link>
</nav>
</header>
<main className="mx-auto w-full max-w-3xl flex-1 px-4 py-6">
<section>
<h1 className="mb-2 text-3xl font-bold">Galeri Foto</h1>
<p className="mb-6">Beberapa foto dari kegiatan dan momen saya.</p>
{/* grid foto: 1 kolom di layar kecil, 2 kolom di layar sedang ke atas */}
<div className="grid grid-cols-1 gap-5 sm:grid-cols-2">
<figure className="border border-gray-300 bg-white p-3">
<img
className="h-64 w-full object-cover"
src="/images/fotoprofile.jpg"
alt="Foto Zagar tersenyum di pantai pada malam hari"
/>
<figcaption className="mt-2 text-sm text-gray-600">Haii ini saya.</figcaption>
</figure>
<figure className="border border-gray-300 bg-white p-3">
<img
className="h-64 w-full object-cover"
src="/images/fotokegiatanharian.jpg"
alt="Suasana ruang kelas saat dosen mengajar di depan papan tulis"
/>
<figcaption className="mt-2 text-sm text-gray-600">foto kelas.</figcaption>
</figure>
<figure className="border border-gray-300 bg-white p-3">
<img
className="h-64 w-full object-cover"
src="/images/fotorandom.jpg"
alt="Acara turnamen game di sebuah pusat perbelanjaan dengan layar besar dan kursi penonton"
/>
<figcaption className="mt-2 text-sm text-gray-600">foto random gallery.</figcaption>
</figure>
<figure className="border border-gray-300 bg-white p-3">
<img
className="h-64 w-full object-cover"
src="/images/hobimendengarkanmusik.jpg"
alt="Tangkapan layar aplikasi pemutar musik yang sedang memutar sebuah lagu"
/>
<figcaption className="mt-2 text-sm text-gray-600">Musik yang aku suka</figcaption>
</figure>
</div>
</section>
</main>
<footer className="border-t border-gray-300 p-4 text-center text-sm text-gray-600">
<p>&copy; 2026 Zagar</p>
</footer>
</div>
);
}
+77
View File
@@ -0,0 +1,77 @@
import Link from "next/link";
export default function Hobbies() {
return (
<div className="page">
{/* external CSS: seluruh tampilan halaman ini hanya memakai file styles.css */}
<link rel="stylesheet" href="/styles.css" />
<header>
<nav className="nav-bar">
<Link href="/">Home</Link>
<Link href="/about">About</Link>
<Link href="/hobbies">Hobbies</Link>
<Link href="/gallery">Gallery</Link>
<Link href="/contact">Contact</Link>
</nav>
</header>
<main className="main-wrapper">
<section className="box">
<h1 className="hobby-title">Hobi Saya</h1>
<p>Ini beberapa hal yang biasa saya lakukan di waktu luang.</p>
{/* daftar tidak berurutan (ul): ringkasan hobi */}
<ul className="hobby-list">
<li>Bermain game</li>
<li>Menonton film</li>
<li>Mendengarkan musik</li>
</ul>
</section>
<section className="box">
<h2 className="hobby-subtitle">Bermain Game</h2>
<img
className="hobby-img"
src="/images/hobibermaingame.jpg"
alt="Tangkapan layar profil pemain di game mobile yang menampilkan peringkat dan statistik"
/>
<p>Saya suka bermain game Mobile Legends</p>
</section>
<section className="box">
<h2 className="hobby-subtitle">Menonton Film</h2>
<img
className="hobby-img"
src="/images/hobimenontonfilm.jpg"
alt="Adegan film seorang pria duduk di pantai berbatu dengan tebing di belakangnya"
/>
<p>Saya juga suka menonton film</p>
</section>
<section className="box">
<h2 className="hobby-subtitle">Mendengarkan Musik</h2>
<img
className="hobby-img"
src="/images/hobimendengarkanmusik.jpg"
alt="Tangkapan layar aplikasi pemutar musik yang sedang memutar sebuah lagu"
/>
<p>Saya juga suka mendengarkan musik, terutama genre pop rock</p>
</section>
<section className="box">
<h2 className="hobby-subtitle">Urutan Hobi Favorit</h2>
{/* daftar berurutan (ol): peringkat hobi dari yang paling disukai */}
<ol className="hobby-list">
<li>Mendengarkan musik</li>
<li>Menonton film</li>
<li>Bermain game</li>
</ol>
</section>
</main>
<footer className="footer-bar">
<p>&copy; 2026 Zagar</p>
</footer>
</div>
);
}
+3 -17
View File
@@ -1,28 +1,14 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css"; import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Create Next App", title: "Zagar - Personal Website",
description: "Generated by create next app", description: "Personal website Zagar Nashrullah",
}; };
export default function RootLayout({ children }: LayoutProps<"/">) { export default function RootLayout({ children }: LayoutProps<"/">) {
return ( return (
<html <html lang="id" className="h-full antialiased">
lang="en"
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col">{children}</body> <body className="min-h-full flex flex-col">{children}</body>
</html> </html>
); );
+93 -62
View File
@@ -1,69 +1,100 @@
import Image from "next/image"; "use client";
import { useState } from "react";
import Link from "next/link";
export default function Home() { export default function Home() {
// state hover untuk link "Kenali saya lebih jauh"
const [hover, setHover] = useState(false);
return ( return (
<div className="flex flex-col flex-1 items-center justify-center bg-zinc-50 font-sans dark:bg-black"> // inline CSS: semua gaya halaman ini ditulis langsung lewat atribut style pada tiap elemen
<main className="flex flex-1 w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start"> <div
<Image style={{
className="dark:invert h-5 w-[100px]" minHeight: "100vh",
src="/next.svg" display: "flex",
alt="Next.js logo" flexDirection: "column",
width={100} backgroundColor: "#f5f5f5",
height={20} color: "#222222",
priority fontFamily: "Arial, sans-serif",
/> lineHeight: 1.5,
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left"> }}
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50"> >
To get started, edit the{" "} <header style={{ backgroundColor: "#1f3a5f", padding: "12px 20px" }}>
<code className="rounded bg-black/[.06] px-1.5 py-0.5 font-mono text-[0.9em] dark:bg-white/[.08]"> <nav>
page.tsx <Link href="/" style={{ color: "#ffffff", marginRight: "20px", textDecoration: "none" }}>Home</Link>
</code>{" "} <Link href="/about" style={{ color: "#ffffff", marginRight: "20px", textDecoration: "none" }}>About</Link>
file. <Link href="/hobbies" style={{ color: "#ffffff", marginRight: "20px", textDecoration: "none" }}>Hobbies</Link>
</h1> <Link href="/gallery" style={{ color: "#ffffff", marginRight: "20px", textDecoration: "none" }}>Gallery</Link>
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400"> <Link href="/contact" style={{ color: "#ffffff", textDecoration: "none" }}>Contact</Link>
Looking for a starting point or more instructions? Head over to{" "} </nav>
<a </header>
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="font-medium text-zinc-950 dark:text-zinc-50" <main
> style={{
Templates flex: 1,
</a>{" "} width: "100%",
or the{" "} maxWidth: "560px",
<a margin: "0 auto",
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app" padding: "40px 16px",
className="font-medium text-zinc-950 dark:text-zinc-50" boxSizing: "border-box",
> }}
Learning >
</a>{" "} <section
center. style={{
</p> textAlign: "center",
</div> backgroundColor: "#ffffff",
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row"> border: "1px solid #cccccc",
<a padding: "32px 20px",
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]" }}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app" >
target="_blank" <img
rel="noopener noreferrer" src="/images/fotoprofile.jpg"
alt="Foto Zagar tersenyum di pantai pada malam hari"
width={150}
height={150}
style={{
display: "block",
margin: "0 auto 16px",
width: "150px",
height: "150px",
objectFit: "cover",
border: "1px solid #cccccc",
}}
/>
<h1 style={{ fontSize: "28px", fontWeight: "bold", margin: "0 0 4px" }}>Zagar Nashrullah</h1>
<p style={{ margin: "0 0 12px", color: "#555555" }}>Mahasiswa Informatika</p>
<p style={{ margin: "0 0 20px" }}>HAAAAIII!!!</p>
<Link
href="/about"
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
style={{
display: "inline-block",
padding: "8px 20px",
border: "1px solid #1f3a5f",
borderRadius: "8px",
color: hover ? "#ffffff" : "#1f3a5f",
backgroundColor: hover ? "#1f3a5f" : "transparent",
textDecoration: "none",
}}
> >
<Image Kenali saya lebih jauh
className="dark:invert h-[14px] w-4" </Link>
src="/vercel.svg" </section>
alt="Vercel logomark"
width={16}
height={14}
/>
Deploy Now
</a>
<a
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Documentation
</a>
</div>
</main> </main>
<footer
style={{
textAlign: "center",
padding: "16px",
borderTop: "1px solid #cccccc",
color: "#555555",
fontSize: "14px",
}}
>
<p style={{ margin: 0 }}>&copy; 2026 Zagar</p>
</footer>
</div> </div>
); );
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 KiB

+145
View File
@@ -0,0 +1,145 @@
.page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: #f5f5f5;
color: #222222;
font-family: Arial, sans-serif;
line-height: 1.5;
}
.page p {
margin: 0 0 12px;
}
.nav-bar {
background-color: #1f3a5f;
padding: 12px 20px;
}
.nav-bar a {
color: #ffffff;
margin-right: 20px;
text-decoration: none;
}
.nav-bar a:hover {
text-decoration: underline;
}
.main-wrapper {
flex: 1;
width: 100%;
max-width: 760px;
margin: 0 auto;
padding: 24px 16px;
box-sizing: border-box;
}
.box {
background-color: #ffffff;
border: 1px solid #cccccc;
padding: 20px;
margin-bottom: 20px;
}
.edu-table {
width: 100%;
border-collapse: collapse;
}
.edu-table th,
.edu-table td {
border: 1px solid #999999;
padding: 8px;
text-align: left;
}
.edu-table th {
background-color: #e6e6e6;
font-weight: bold;
}
.footer-bar {
text-align: center;
padding: 16px;
border-top: 1px solid #cccccc;
color: #555555;
font-size: 14px;
}
.footer-bar p {
margin: 0;
}
/* ---------- halaman hobbies ---------- */
.hobby-title {
font-size: 28px;
font-weight: bold;
margin: 0 0 8px;
}
.hobby-subtitle {
font-size: 20px;
font-weight: bold;
margin: 0 0 12px;
}
.hobby-img {
display: block;
width: 100%;
height: 260px;
object-fit: cover;
border: 1px solid #cccccc;
margin-bottom: 12px;
}
.hobby-list {
margin: 8px 0 0;
padding-left: 24px;
list-style-type: disc;
}
ol.hobby-list {
list-style-type: decimal;
}
/* ---------- halaman contact ---------- */
.contact-title {
font-size: 28px;
font-weight: bold;
margin: 0 0 8px;
}
.contact-subtitle {
font-size: 20px;
font-weight: bold;
margin: 0 0 12px;
}
.contact-list {
list-style: none;
margin: 0;
padding: 0;
}
.contact-list li {
padding: 8px 0;
border-bottom: 1px solid #dddddd;
}
.contact-list li:last-child {
border-bottom: none;
}
.contact-label {
display: inline-block;
width: 100px;
color: #555555;
}
.contact-link {
color: #1a56a0;
}