<section class="org-vacancy-hero flex flex-col md:grid md:grid-cols-2 md:gap-x-8 h-screen">
    <div class="vacancy-hero-left">
        <div class="md:pl-8 flex flex-col items-center justify-center h-full">
            <div class="lg:w-2/3 xl:w-2/3">
                <h1 class="atm-heading ">Schoonmaker ouderenzorg Gulpen Vloeren</h1>

                <div class="atm-paragraph text-md">Gulpen • Ouderenzorg • 30 uur • € 11,83 - € 13,50 per uur</div>

                <div class="vacancy-hero-content-buttons">
                    <a class="atm-button atm-button-primary  button-md no-icon  ">
                        <div class="button-content-wrapper">
                            <span class="button-content">
                                <span>Solliciteer direct</span>
                                <i class="atm-icon  fal fa-arrow-right   "></i>

                            </span>
                        </div>
                        <span class="button-triangle"></span>
                    </a>

                </div>
            </div>
        </div>
    </div>
    <div class="vacancy-right">
        <svg class="block md:hidden absolute top-0 left-0 w-full" viewBox="0 0 1416 242" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M124 241.5L0 121.748V0H1415.5C870.7 151.786 327.5 224.203 124 242Z" fill="white" />
        </svg>
        <picture class="atm-image ">
            <img class="" src="https://picsum.photos/id/250/768/432" alt="">
        </picture>
        <svg class="absolute bottom-0" viewBox="0 0 400 184" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M400 75.5C234.707 101.9 64.753 36.1667 0 0V184H400.5V75.5Z" fill="white" />
        </svg>
    </div>
</section>
<section class="org-vacancy-hero flex flex-col md:grid md:grid-cols-2 md:gap-x-8 h-screen">
  <div class="vacancy-hero-left">
    <div class="md:pl-8 flex flex-col items-center justify-center h-full">
      <div class="lg:w-2/3 xl:w-2/3">
        {{#if heading}}
        {{ render '@heading' heading }}
        {{/if}}
        {{#if paragraph}}
        {{render '@paragraph' paragraph merge=true}}
        {{/if}}
        <div class="vacancy-hero-content-buttons">
          {{#each buttonsPrimary}}
          {{render '@button-primary' this merge=true}}
          {{/each}}
          {{#each buttonsSecondary}}
          <div class="py-4">
            {{render '@button-secondary' this merge=true}}
          </div>
          {{/each}}
        </div>
      </div>
    </div>
  </div>
  <div class="vacancy-right">
    <svg class="block md:hidden absolute top-0 left-0 w-full" viewBox="0 0 1416 242" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M124 241.5L0 121.748V0H1415.5C870.7 151.786 327.5 224.203 124 242Z" fill="white" />
    </svg>
    {{ render "@image" image }}
    <svg class="absolute bottom-0" viewBox="0 0 400 184" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M400 75.5C234.707 101.9 64.753 36.1667 0 0V184H400.5V75.5Z" fill="white" />
    </svg>
  </div>
</section>
{
  "heading": {
    "text": "Schoonmaker ouderenzorg Gulpen Vloeren",
    "tag": "h1"
  },
  "paragraph": {
    "text": "Gulpen • Ouderenzorg • 30 uur • € 11,83 - € 13,50 per uur"
  },
  "buttonsPrimary": [
    {
      "text": "Solliciteer direct"
    }
  ],
  "buttonsSecondary": [],
  "image": {
    "src": "https://picsum.photos/id/250/768/432"
  }
}
  • Content:
    .org-vacancy-hero {
        .vacancy-hero-left {
            @apply pt-12 max-md:vebego-container;
    
            /* Add padding to the column so it aligns with .vebego-container */
            @variant md {
                padding-left: calc((100vw - var(--breakpoint-md)) / 2);
            }
    
            @variant lg {
                padding-left: calc((100vw - var(--breakpoint-lg)) / 2);
            }
    
            @variant xl {
                padding-left: calc((100vw - var(--breakpoint-xl)) / 2);
            }
    
            @variant 2xl {
                padding-left: calc((100vw - var(--breakpoint-2xl)) / 2);
            }
    
            .atm-heading {
                @apply text-h2;
            }
    
            .atm-paragraph {
                @apply text-secondary-col-1;
            }
    
            .vacancy-hero-content-buttons {
                @apply flex items-center mt-6 flex-wrap;
            }
        }
    
        .vacancy-right {
            @apply relative flex-grow;
    
            .atm-image {
                @apply h-full;
    
                img {
                    @apply h-full w-full object-cover;
                }
            }
        }
    }
    
    .autocomplete-dropdown {
        @apply absolute top-full right-0 md:left-0 w-full text-left;
        @apply bg-white rounded-3xl shadow-[0_4px_6px_-2px_rgba(0,0,0,0.1)] text-black;
        @apply z-50 max-h-64 overflow-y-auto;
        transition: all 0.2s ease-in-out;
        list-style: none;
        padding: 0;
    
        .autocomplete-item {
            @apply px-6 py-4 cursor-pointer;
            @apply transition-colors duration-150;
    
            &:hover {
                @apply bg-gray-100;
            }
        }
    }
    
  • URL: /components/raw/vacancy-hero/vacancy-hero.css
  • Filesystem Path: src/components/04-organisms/vacancy-hero/vacancy-hero.css
  • Size: 1.5 KB
  • Content:
    document.addEventListener('DOMContentLoaded', function () {
        const nameInputs = [
            document.getElementById('vacancy-homepage-search-name'),
            ...document.querySelectorAll('.vn input'),
        ].filter(Boolean);
    
        const locationInputs = [
            document.getElementById('vacancy-homepage-search-location'),
            ...document.querySelectorAll('.vl input'),
            document.querySelector('.location-input-wrapper input'),
        ].filter(Boolean);
    
        const websiteId = document.body.dataset.websiteId;
    
        if (nameInputs.length === 0 && locationInputs.length === 0) {
            return;
        }
    
        function debounce(func, wait) {
            let timeout;
            return function executedFunction(...args) {
                const later = () => {
                    clearTimeout(timeout);
                    func(...args);
                };
                clearTimeout(timeout);
                timeout = setTimeout(later, wait);
            };
        }
    
        function createAutocompleteDropdown(inputElement) {
            const dropdown = document.createElement('div');
            dropdown.className = 'autocomplete-dropdown hidden';
    
            const parent = inputElement.closest('.atm-form-input');
            if (parent) {
                parent.style.position = 'relative';
                parent.appendChild(dropdown);
            }
    
            return dropdown;
        }
    
        function showSuggestions(inputElement, dropdown, suggestions) {
            if (!suggestions || suggestions.length === 0) {
                dropdown.classList.add('hidden');
                return;
            }
    
            dropdown.innerHTML = '';
            suggestions.forEach((suggestion) => {
                const item = document.createElement('div');
                item.className = 'autocomplete-item';
                item.tabIndex = 0;
                item.textContent = suggestion;
    
                item.addEventListener('click', () => {
                    inputElement.value = suggestion;
                    inputElement.classList.add('filled');
                    dropdown.classList.add('hidden');
                });
    
                item.addEventListener('keydown', (e) => {
                    if (e.key === 'Enter') {
                        inputElement.value = suggestion;
                        inputElement.classList.add('filled');
                        dropdown.classList.add('hidden');
                    }
                });
    
                dropdown.appendChild(item);
            });
    
            dropdown.classList.remove('hidden');
        }
    
        nameInputs.forEach((nameInput) => {
            const nameDropdown = createAutocompleteDropdown(nameInput);
    
            const fetchVacancies = debounce(async (query) => {
                if (query.length < 2) {
                    nameDropdown.classList.add('hidden');
                    return;
                }
    
                try {
                    const url = `/umbraco/surface/AutocompleteSurface/GetVacancies?query=${encodeURIComponent(
                        query
                    )}&websiteId=${websiteId}`;
    
                    const response = await fetch(url);
    
                    if (!response.ok) {
                        nameDropdown.classList.add('hidden');
                        return;
                    }
    
                    const suggestions = await response.json();
                    showSuggestions(nameInput, nameDropdown, suggestions);
                } catch (error) {
                    nameDropdown.classList.add('hidden');
                }
            }, 1000);
    
            nameInput.addEventListener('input', (e) => {
                fetchVacancies(e.target.value);
            });
    
            nameInput.addEventListener('focus', (e) => {
                if (e.target.value.length >= 2) {
                    fetchVacancies(e.target.value);
                }
            });
    
            document.addEventListener('click', (e) => {
                if (
                    !nameInput.contains(e.target) &&
                    !nameDropdown.contains(e.target)
                ) {
                    nameDropdown.classList.add('hidden');
                }
            });
        });
    
        locationInputs.forEach((locationInput) => {
            const locationDropdown = createAutocompleteDropdown(locationInput);
    
            const fetchPlaces = debounce(async (query) => {
                if (query.length < 2) {
                    locationDropdown.classList.add('hidden');
                    return;
                }
    
                try {
                    const url = `/umbraco/surface/AutocompleteSurface/GetPlaces?textInput=${encodeURIComponent(
                        query
                    )}`;
    
                    const response = await fetch(url);
    
                    if (!response.ok) {
                        locationDropdown.classList.add('hidden');
                        return;
                    }
    
                    const suggestions = await response.json();
    
                    if (Array.isArray(suggestions) && suggestions.length > 0) {
                        showSuggestions(
                            locationInput,
                            locationDropdown,
                            suggestions
                        );
                    } else {
                        locationDropdown.classList.add('hidden');
                    }
                } catch (error) {
                    locationDropdown.classList.add('hidden');
                }
            }, 1000);
    
            locationInput.addEventListener('input', (e) => {
                fetchPlaces(e.target.value);
            });
    
            locationInput.addEventListener('focus', (e) => {
                if (e.target.value.length >= 2) {
                    fetchPlaces(e.target.value);
                }
            });
    
            document.addEventListener('click', (e) => {
                if (
                    !locationInput.contains(e.target) &&
                    !locationDropdown.contains(e.target)
                ) {
                    locationDropdown.classList.add('hidden');
                }
            });
        });
    
        // Location button functionality
        const locationButtons = document.querySelectorAll(
            '.location-btn .atm-button-primary, .location-btn button'
        );
        locationButtons.forEach((btn) => {
            btn.addEventListener('click', function (e) {
                e.preventDefault();
    
                if (!navigator.geolocation) {
                    alert('Geolocation wordt niet ondersteund door uw browser');
                    return;
                }
    
                // Find the location input - look for the closest location input in the form
                const form = btn.closest('form');
                const locationInput = form
                    ? form.querySelector(
                          '#vacancy-homepage-search-location, .vl input, .location-input-wrapper input'
                      )
                    : null;
    
                if (!locationInput) {
                    console.error('Location input not found');
                    return;
                }
    
                btn.disabled = true;
    
                navigator.geolocation.getCurrentPosition(
                    function (position) {
                        const lat = position.coords.latitude;
                        const lon = position.coords.longitude;
    
                        // Gebruik reverse geocoding API (Nominatim) om adres te krijgen
                        fetch(
                            `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lon}`
                        )
                            .then((response) => response.json())
                            .then((data) => {
                                const address = data.address;
                                let locationParts = [];
    
                                // Straat en huisnummer
                                if (address.road) {
                                    let street = address.road;
                                    if (address.house_number) {
                                        street += ' ' + address.house_number;
                                    }
                                    locationParts.push(street);
                                }
    
                                // Postcode en plaats
                                let cityPart = '';
                                if (address.postcode) {
                                    cityPart = address.postcode;
                                }
                                if (
                                    address.city ||
                                    address.town ||
                                    address.village
                                ) {
                                    const city =
                                        address.city ||
                                        address.town ||
                                        address.village;
                                    cityPart = cityPart
                                        ? cityPart + ' ' + city
                                        : city;
                                }
                                if (cityPart) {
                                    locationParts.push(cityPart);
                                }
    
                                const locationString = locationParts.join(', ');
    
                                locationInput.value = locationString;
                                locationInput.classList.add('filled');
                                locationInput.dispatchEvent(
                                    new Event('input', { bubbles: true })
                                );
    
                                btn.disabled = false;
                            })
                            .catch(function (error) {
                                console.error('Fout bij ophalen adres:', error);
                                locationInput.value =
                                    lat.toFixed(6) + ', ' + lon.toFixed(6);
                                locationInput.classList.add('filled');
                                btn.disabled = false;
                            });
                    },
                    function (error) {
                        let errorMsg = 'Kon locatie niet ophalen';
                        switch (error.code) {
                            case error.PERMISSION_DENIED:
                                errorMsg = 'Toegang tot locatie geweigerd';
                                break;
                            case error.POSITION_UNAVAILABLE:
                                errorMsg = 'Locatie informatie niet beschikbaar';
                                break;
                            case error.TIMEOUT:
                                errorMsg = 'Timeout bij ophalen locatie';
                                break;
                        }
                        alert(errorMsg);
                        btn.disabled = false;
                    }
                );
            });
        });
    });
    
  • URL: /components/raw/vacancy-hero/vacancy-hero.js
  • Filesystem Path: src/components/04-organisms/vacancy-hero/vacancy-hero.js
  • Size: 10.4 KB

No notes defined.