API Kullanımı
Temel Kullanım
Placeholder görsellerinizi URL parametreleri ile oluşturun:
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400
Renk Parametreleri
GET https://placeholder.mehmetalisezer.com.tr/api/?width=800&height=600&bg=e5e7eb&color=374151
• bg: Arkaplan rengi (hex, # olmadan)
• color: Yazı rengi (hex, # olmadan)
Özel Yazı
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&text=Logo+Buraya+Gelecek
İkon/Emoji & Bayrak Ekleme
GET https://placeholder.mehmetalisezer.com.tr/api/?width=400&height=400&icon=🚀
GET https://placeholder.mehmetalisezer.com.tr/api/?width=400&height=400&flag=🇹🇷
Yazı Pozisyonu
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&position=top
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&position=center
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&position=bottom
Font Boyutu
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&fontSize=48
Format Seçimi
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&format=png
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&format=jpeg
GET https://placeholder.mehmetalisezer.com.tr/api/?width=600&height=400&format=webp
Not: Tüm parametreler opsiyoneldir. Belirtilmezse varsayılan değerler kullanılır.
Web Sitenize Entegre Edin
HTML'de Kullanım
Doğrudan img etiketi ile kullanın:
React'te Kullanım
const PlaceholderImage = ({ width, height, text }) => {
const url = `https://placeholder.mehmetalisezer.com.tr/api/?width=${width}&height=${height}&text=${encodeURIComponent(text)}`;
return

;
};
// Kullanım
CSS Background Olarak
.hero-section {
background-image: url('https://placeholder.mehmetalisezer.com.tr/api/?width=1920&height=1080');
background-size: cover;
background-position: center;
}
JavaScript ile Dinamik Oluşturma
function createPlaceholder(width, height, options = {}) {
const params = new URLSearchParams({
width,
height,
...options
});
return `https://placeholder.mehmetalisezer.com.tr/api/?${params.toString()}`;
}
// Kullanım
const imageUrl = createPlaceholder(600, 400, {
text: 'Ürün Görseli',
bg: 'e5e7eb',
color: '374151',
flag: '🇹🇷'
});
İpucu: Geliştirme aşamasında gerçek görseller yerine placeholder kullanarak hızlı prototip oluşturabilirsiniz!