# Görsel Modal

Sitenizde bir banner'a veya bir buton'a tıklandığında popup'ta görsel gösterilmesini sağlayan komponent

## Görünüm

![Görsel Modal](/img/tema/856974698.png)

## Kod Yapısı

Html, Scss ve Json kodlarını kopyalayıp siteniz üzerinde ilgili alana eklediğinizde çalışmasını sağlayabilirsiniz. Kodların kullanımı ile ilgili bilgileri okuyarak nasıl eklemeniz gerektiğini öğrenebilirsiniz.

Test sitemizde Görsel Modal komponenti kullanılmıştır. [Örneği demo sitede görüntüleyin](https://tema.myideasoft.com/).

### HTML

```twig title="index.html"
{% if theme.settings.image_modal_check %}
    <div class="image-modal">
        <a data-fancybox href="{{ themeAsset(theme.settings.image_modal_image) }}">
            <span>{{ theme.settings.image_modal_title }}</span>
            <svg width="24" height="24" viewBox="0 0 24 24" fill="none">
                <path d="M11 19C15.4183 19 19 15.4183 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19Z" stroke="#777777" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 20.9999L16.65 16.6499" stroke="#777777" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M11 8V14" stroke="#777777" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 11H14" stroke="#777777" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
            </svg>
        </a>
    </div>
{% endif %}
```

### SCSS

```scss title="style.css"
/* Image Modal */
.image-modal {
    margin-bottom: var(--spacer-9);
    > a {
        display: flex;
        justify-content: space-between;
        color: $color-text;
        font-size: var(--font-size-18);
        padding: var(--spacer-6);
        background-color: #fff;
        border: 1px solid $color-border;
        border-radius: $border-radius;
        &:hover {
            color: $color-primary-lighten;
        }
    }
}
```

### JSON

```json title="index.js"
"image_modal_check": {
    "type": "checkbox",
    "default_value": "1",
    "label": "Görsel Modal Durumu"
},
"image_modal_title": {
    "type": "text",
    "default_value": "Görsel Modal",
    "label": "Görsel Modal Metni"
},
"image_modal_image": {
    "type": "image",
    "default_value": "",
    "filename": "image_modal_image",
    "label": "Görsel Modal Resmi"
}
```
