File size: 2,359 Bytes
ea59388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import streamlit as st

def display_home_listings(listings):
    st.markdown("""

        <style>

        .listing-card {

            background: #2D2D2D;

            border-radius: 10px;

            padding: 1rem;

            margin: 1rem 0;

            border: 1px solid rgba(255,255,255,0.1);

            transition: transform 0.2s;

        }

        .listing-card:hover {

            transform: translateY(-2px);

            box-shadow: 0 4px 15px rgba(0,0,0,0.2);

        }

        .price-tag {

            color: #00C0A3;

            font-size: 1.4rem;

            font-weight: bold;

            margin: 0.5rem 0;

        }

        .property-info {

            color: rgba(255,255,255,0.8);

            font-size: 0.9rem;

            margin: 0.3rem 0;

        }

        .listing-link {

            display: inline-block;

            background: #2A3950;

            color: white;

            padding: 0.5rem 1rem;

            border-radius: 5px;

            text-decoration: none;

            margin-top: 0.5rem;

            transition: background 0.2s;

        }

        .listing-link:hover {

            background: #374863;

        }

        </style>

    """, unsafe_allow_html=True)

    st.markdown("### 🏠 Benzer Fiyatlı İlanlar", unsafe_allow_html=True)
    
    col1, col2 = st.columns(2)
    
    for idx, listing in enumerate(listings):
        with col1 if idx % 2 == 0 else col2:
            st.markdown(f"""

                <div class="listing-card">

                    <img src="{listing['resim_url']}" style="width: 100%; height: 200px; object-fit: cover; object-position: center; border-radius: 5px; margin-bottom: 0.5rem;">

                    <div style="font-size:1.2rem; font-weight:bold">{listing['title']}</div>

                    <div class="price-tag">{listing['price']:,} TL</div>

                    <div class="property-info">📏 {listing['Brüt Metrekare']}</div>

                    <div class="property-info">🏘️ {listing.get('Oda Sayısı', 'Belirtilmemiş')}</div>

                    <div class="property-info">♨️ {listing.get('Isıtma Tipi', 'Belirtilmemiş')}</div>

                    <a href="{listing['url']}" target="_blank" class="listing-link">İlanı Görüntüle →</a>

                </div>

            """, unsafe_allow_html=True)