Level 6
Pertemuan 8

Cover

Melanjutkan pembelajaran tentang teknologi web dan pengembangan website.

Gallery

Why Responsive?

๐Ÿ“ฑ Mengapa Responsive Design?

  • 70% orang access website via smartphone
  • Website harus terlihat baik di semua ukuran (mobile, tablet, desktop)
  • Responsive = adaptif layout mengikuti screen size
  • Better UX = lebih banyak visitors!
Pro Tip: Mobile-first design: design untuk mobile dulu, kemudian expand ke desktop

Media Query

๐Ÿ” Media Query

Technique untuk apply different CSS berdasarkan screen size:

@media (max-width: 768px) {
   .gallery {
     grid-template-columns : repeat(2, 1fr) ;
  }
}
Artinya:"Jika layar โ‰ค768px (tablet/mobile), ubah gallery jadi 2 kolom"

Breakpoints

๐Ÿ“Š Standard Breakpoints

๐Ÿ“ฑ Mobile: <768px
Phones seperti iPhone, Android โ†’ 1 atau 2 kolom gallery
๐Ÿ“ฒ Tablet: 768px - 1024px
iPad, Samsung Tab โ†’ 2 atau 3 kolom gallery
๐Ÿ–ฅ๏ธ Desktop: >1024px
Laptop, desktop โ†’ full 3-4 kolom gallery
๐Ÿ’ก Tip: Set 2-3 media queries untuk cover semua cases

Test It

๐Ÿงช Test Responsiveness

  1. Buka website di browser
  2. Tekan F12 untuk buka Developer Tools
  3. Klik device toolbar icon (atau Ctrl+Shift+M)
  4. Pilih device (iPhone, iPad, atau drag resize)
  5. Lihat perubahan layout sesuai media query
Pro Tip: Resize window secara perlahan untuk lihat smooth transition antar breakpoints

Activity

๐ŸŽฏ Your Activity

  1. Tambah 2 media queries
    Untuk tablet (768px) dan mobile (<768px)
  2. Adjust gallery columns
    Desktop: 3-4 kolom | Tablet: 2 kolom | Mobile: 1-2 kolom
  3. Test semua ukuran
    Gunakan DevTools โ†’ toggle device toolbar
  4. Ensure readability
    Text harus readable di semua ukuran, tidak ada overflow
  5. Test on real phone!
    Kalau bisa, test di actual smartphone/tablet