%PDF- %PDF-
| Direktori : /home2/rezakur1/kurniadev.rezakurnia.com/kurniadev/resources/views/landingpage/ |
| Current File : //home2/rezakur1/kurniadev.rezakurnia.com/kurniadev/resources/views/landingpage/index.blade.php |
@include('landingpage.layouts.header')
<div class="modal fade" id="guestNameModal" tabindex="-1" aria-labelledby="guestNameModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
{{-- <div class="modal-header"> --}}
{{-- <img src="{{ asset('images/logo-kurniadev2.png') }}"
style="width: 70%; display: block; margin: 0 auto; padding-top: 50px; padding-bottom: 50px;"
alt="Logo Light" /> --}}
{{-- <img class="xc nm" src="images/logo-dark.svg" alt="Logo Dark" /> --}}
{{-- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> --}}
{{-- </div> --}}
{{-- <div class="modal-body">
<form id="guestNameForm">
<div class="mb-3">
<label for="guestName" class="form-label"><b>Guest</b> - Please enter your name</label>
<input type="text" class="form-control" id="guestName" required>
</div>
<div class="d-flex justify-content-end">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div> --}}
</div>
</div>
</div>
<!-- Loading Spinner -->
<div id="loadingSpinner"
style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1050;">
<div class="spinner-border text-primary" role="status">
{{-- <span class="visually-hidden">Loading...</span> --}}
</div>
</div>
<main id="mainContent">
@include('landingpage.layouts.navbar')
<!-- ===== Hero Start ===== -->
@include('landingpage.sections.hero')
<!-- ===== Small Features Start ===== -->
@include('landingpage.sections.features')
<!-- ===== About Start ===== -->
@include('landingpage.sections.about')
<!-- ===== Team Start ===== -->
@include('landingpage.sections.team')
<!-- ===== Services Start ===== -->
@include('landingpage.sections.services')
<!-- ===== Counter Start ===== -->
@include('landingpage.sections.counter')
<!-- ===== Projects Start ===== -->
@include('landingpage.sections.projects')
<!-- ===== Clients Start ===== -->
@include('landingpage.sections.clients')
</main>
@include('landingpage.layouts.footer')
<style>
.blur {
filter: blur(5px);
background: rgba(255, 255, 255, 0.5);
transition: filter 0.5s ease;
}
.unblur {
filter: blur(0);
}
</style>
{{-- <script>
document.addEventListener('DOMContentLoaded', function() {
class Guest {
constructor() {
this.name = localStorage.getItem('guestName');
this.date = localStorage.getItem('guestDate') ? new Date(localStorage.getItem(
'guestDate')) : null;
this.ip = localStorage.getItem('guestIP');
this.location = localStorage.getItem('guestLocation');
this.isp = localStorage.getItem('guestISP');
this.services = localStorage.getItem('guestServices');
this.hostname = localStorage.getItem('guestHostname');
this.latitude = localStorage.getItem('guestLatitude');
this.longitude = localStorage.getItem('guestLongitude');
}
save() {
localStorage.setItem('guestName', this.name);
localStorage.setItem('guestDate', this.date ? this.date.toISOString() : '');
localStorage.setItem('guestIP', this.ip);
localStorage.setItem('guestLocation', this.location);
localStorage.setItem('guestISP', this.isp);
localStorage.setItem('guestServices', this.services);
localStorage.setItem('guestHostname', this.hostname);
localStorage.setItem('guestLatitude', this.latitude);
localStorage.setItem('guestLongitude', this.longitude);
}
clear() {
localStorage.clear();
}
}
var guest = new Guest();
var today = new Date();
var guestNameModal = new bootstrap.Modal(document.getElementById('guestNameModal'), {
backdrop: 'static',
keyboard: false
});
console.log('guest:', guest);
if (!guest.date || guest.date.toDateString() !== today.toDateString()) {
guest.clear();
guestNameModal.show();
var mainContent = document.getElementById('mainContent');
mainContent.classList.add('blur');
console.log('Local storage cleared');
} else if (!guest.name) {
guest.clear();
console.log('Local storage cleared, guestNameModal shown');
} else {
var mainContent = document.getElementById('mainContent');
mainContent.classList.remove('blur');
var guestModal = document.getElementById('guestNameModal');
guestModal.remove();
removeModalCSS();
}
document.getElementById('guestNameForm').addEventListener('submit', function(event) {
event.preventDefault();
document.getElementById('loadingSpinner').style.display = 'block';
var guestName = document.getElementById('guestName').value;
var namePattern = /^[a-zA-Z\s]+$/;
if (guestName && namePattern.test(guestName)) {
fetch('https://api.ipify.org?format=json')
.then(response => response.json())
.then(data => {
var ip = data.ip;
fetch(`https://ipapi.co/${ip}/json/`)
.then(response => response.json())
.then(locationData => {
guest.name = guestName;
guest.date = today;
guest.ip = ip;
guest.location = locationData.city + ', ' + locationData
.country_name;
guest.isp = locationData.org;
guest.services = locationData.services;
guest.hostname = locationData.hostname;
guest.latitude = locationData.latitude;
guest.longitude = locationData.longitude;
guest.save();
// Send data to createUserGuest API
fetch('/api/createUserGuest', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: guest.name,
date: guest.date,
ip: guest.ip,
location: guest.location,
isp: guest.isp,
services: guest.services,
hostname: guest.hostname,
latitude: guest.latitude,
longitude: guest.longitude
})
})
.then(response => response.json())
.then(apiResponse => {
console.log('API Response:', apiResponse);
guestNameModal.hide();
document.getElementById('loadingSpinner').style
.display = 'none';
mainContent.classList.add('unblur');
setTimeout(function() {
mainContent.classList.remove('blur');
mainContent.classList.remove('unblur');
removeModalCSS();
}, 500);
})
.catch(error => {
console.error('Error sending data to API:', error);
alert('Failed to send data to server.');
// remove local storage
guest.clear();
document.getElementById('loadingSpinner').style
.display = 'none';
});
})
.catch(error => {
console.error('Error fetching location:', error);
alert('Failed to retrieve location.');
guest.clear();
document.getElementById('loadingSpinner').style.display =
'none';
});
})
.catch(error => {
console.error('Error fetching IP address:', error);
alert('Failed to retrieve IP address.');
guest.clear();
document.getElementById('loadingSpinner').style.display = 'none';
});
} else {
alert('Please enter a valid name.');
guest.clear();
document.getElementById('loadingSpinner').style.display = 'none';
}
});
function removeModalCSS() {
var modalCSS = document.querySelector('style[scoped]');
if (modalCSS) {
modalCSS.remove();
}
}
});
</script> --}}
<!-- Modal specific CSS and JS -->
<style scoped>
@import url('https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');
</style>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>