chore(adventure-rental-app): strip down application and remove obsolete files
This commit performs a major cleanup of the `adventure-rental-app` by removing all existing components, pages, layouts, and project brief documents. The application is reduced to a minimal Vite shell. - Deleted all authentication, chatbot, and dashboard components and pages. - Removed outdated project brief and PRD markdown files. - Updated Vite and `@vitejs/plugin-react` dependencies. Additionally, the `framer-motion` dependency was added to the `bookoomoo-app`.
This commit is contained in:
82
kloowear-app/old file/assets/js/chat.js
Executable file
82
kloowear-app/old file/assets/js/chat.js
Executable file
@@ -0,0 +1,82 @@
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const chatMessages = document.getElementById('chat-messages');
|
||||
const userInput = document.getElementById('user-message');
|
||||
const sendBtn = document.getElementById('send-btn');
|
||||
|
||||
// Webhook Configuration
|
||||
const WEBHOOK_URL = 'https://your-api-endpoint.com/webhook';
|
||||
const SESSION_ID = generateSessionId(); // Generate unique session ID
|
||||
|
||||
// Send Message via Webhook
|
||||
async function sendToWebhook(message) {
|
||||
try {
|
||||
const response = await fetch(WEBHOOK_URL, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
session_id: SESSION_ID,
|
||||
message: message,
|
||||
timestamp: new Date().toISOString()
|
||||
})
|
||||
});
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error('Webhook error:', error);
|
||||
return { error: true };
|
||||
}
|
||||
}
|
||||
|
||||
// Receive Message from Webhook
|
||||
async function receiveFromWebhook() {
|
||||
// Implement webhook listener (via WebSocket or polling)
|
||||
// Example using polling (simplified):
|
||||
setInterval(async () => {
|
||||
const response = await fetch(`${WEBHOOK_URL}/get?session_id=${SESSION_ID}`);
|
||||
const data = await response.json();
|
||||
if (data.new_messages) {
|
||||
data.new_messages.forEach(msg => {
|
||||
addMessage(msg.content, 'ai');
|
||||
});
|
||||
}
|
||||
}, 3000); // Poll every 3 seconds
|
||||
}
|
||||
|
||||
// UI Functions
|
||||
function addMessage(content, sender) {
|
||||
const messageDiv = document.createElement('div');
|
||||
messageDiv.className = `message ${sender}-message mb-3`;
|
||||
messageDiv.innerHTML = `
|
||||
<div class="message-content ${sender === 'ai' ? 'bg-dark text-white' : 'bg-light'} p-3 rounded">
|
||||
${content}
|
||||
</div>
|
||||
<small class="text-muted">Baru saja</small>
|
||||
`;
|
||||
chatMessages.appendChild(messageDiv);
|
||||
chatMessages.scrollTop = chatMessages.scrollHeight;
|
||||
}
|
||||
|
||||
// Event Listeners
|
||||
sendBtn.addEventListener('click', async () => {
|
||||
const message = userInput.value.trim();
|
||||
if (message) {
|
||||
addMessage(message, 'user');
|
||||
userInput.value = '';
|
||||
|
||||
// Send to webhook
|
||||
const response = await sendToWebhook(message);
|
||||
if (response.error) {
|
||||
addMessage("Maaf, Bakul Tali sedang sibuk. Coba lagi nanti.", 'ai');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Start listening for responses
|
||||
receiveFromWebhook();
|
||||
|
||||
// Helper function
|
||||
function generateSessionId() {
|
||||
return 'session_' + Math.random().toString(36).substr(2, 9);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
210
kloowear-app/old file/assets/js/main.js
Executable file
210
kloowear-app/old file/assets/js/main.js
Executable file
@@ -0,0 +1,210 @@
|
||||
/**
|
||||
* Template Name: Bethany
|
||||
* Template URL: https://bootstrapmade.com/bethany-free-onepage-bootstrap-theme/
|
||||
* Updated: Aug 07 2024 with Bootstrap v5.3.3
|
||||
* Author: BootstrapMade.com
|
||||
* License: https://bootstrapmade.com/license/
|
||||
*/
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
"use strict";
|
||||
/**
|
||||
* Apply .scrolled class to the body as the page is scrolled down
|
||||
*/
|
||||
function toggleScrolled() {
|
||||
const selectBody = document.querySelector('body');
|
||||
const selectHeader = document.querySelector('#header');
|
||||
if (!selectHeader.classList.contains('scroll-up-sticky') && !selectHeader.classList.contains('sticky-top') && !selectHeader.classList.contains('fixed-top')) return;
|
||||
window.scrollY > 100 ? selectBody.classList.add('scrolled') : selectBody.classList.remove('scrolled');
|
||||
}
|
||||
|
||||
document.addEventListener('scroll', toggleScrolled);
|
||||
window.addEventListener('load', toggleScrolled);
|
||||
|
||||
/**
|
||||
* Mobile nav toggle
|
||||
*/
|
||||
const mobileNavToggleBtn = document.querySelector('.mobile-nav-toggle');
|
||||
|
||||
function mobileNavToogle() {
|
||||
document.querySelector('body').classList.toggle('mobile-nav-active');
|
||||
mobileNavToggleBtn.classList.toggle('bi-list');
|
||||
mobileNavToggleBtn.classList.toggle('bi-x');
|
||||
}
|
||||
mobileNavToggleBtn.addEventListener('click', mobileNavToogle);
|
||||
|
||||
/**
|
||||
* Hide mobile nav on same-page/hash links
|
||||
*/
|
||||
document.querySelectorAll('#navmenu a').forEach(navmenu => {
|
||||
navmenu.addEventListener('click', () => {
|
||||
if (document.querySelector('.mobile-nav-active')) {
|
||||
mobileNavToogle();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggle mobile nav dropdowns
|
||||
*/
|
||||
document.querySelectorAll('.navmenu .toggle-dropdown').forEach(navmenu => {
|
||||
navmenu.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
this.parentNode.classList.toggle('active');
|
||||
this.parentNode.nextElementSibling.classList.toggle('dropdown-active');
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Preloader
|
||||
*/
|
||||
const preloader = document.querySelector('#preloader');
|
||||
if (preloader) {
|
||||
window.addEventListener('load', () => {
|
||||
preloader.remove();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll top button
|
||||
*/
|
||||
let scrollTop = document.querySelector('.scroll-top');
|
||||
|
||||
function toggleScrollTop() {
|
||||
if (scrollTop) {
|
||||
window.scrollY > 100 ? scrollTop.classList.add('active') : scrollTop.classList.remove('active');
|
||||
}
|
||||
}
|
||||
scrollTop.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
|
||||
window.addEventListener('load', toggleScrollTop);
|
||||
document.addEventListener('scroll', toggleScrollTop);
|
||||
|
||||
/**
|
||||
* Animation on scroll function and init
|
||||
*/
|
||||
function aosInit() {
|
||||
AOS.init({
|
||||
duration: 600,
|
||||
easing: 'ease-in-out',
|
||||
once: true,
|
||||
mirror: false
|
||||
});
|
||||
}
|
||||
window.addEventListener('load', aosInit);
|
||||
|
||||
/**
|
||||
* Initiate glightbox
|
||||
*/
|
||||
const glightbox = GLightbox({
|
||||
selector: '.glightbox'
|
||||
});
|
||||
|
||||
/**
|
||||
* Initiate Pure Counter
|
||||
*/
|
||||
new PureCounter();
|
||||
|
||||
/**
|
||||
* Init isotope layout and filters
|
||||
*/
|
||||
document.querySelectorAll('.isotope-layout').forEach(function(isotopeItem) {
|
||||
let layout = isotopeItem.getAttribute('data-layout') ?? 'masonry';
|
||||
let filter = isotopeItem.getAttribute('data-default-filter') ?? '*';
|
||||
let sort = isotopeItem.getAttribute('data-sort') ?? 'original-order';
|
||||
|
||||
let initIsotope;
|
||||
imagesLoaded(isotopeItem.querySelector('.isotope-container'), function() {
|
||||
initIsotope = new Isotope(isotopeItem.querySelector('.isotope-container'), {
|
||||
itemSelector: '.isotope-item',
|
||||
layoutMode: layout,
|
||||
filter: filter,
|
||||
sortBy: sort
|
||||
});
|
||||
});
|
||||
|
||||
isotopeItem.querySelectorAll('.isotope-filters li').forEach(function(filters) {
|
||||
filters.addEventListener('click', function() {
|
||||
isotopeItem.querySelector('.isotope-filters .filter-active').classList.remove('filter-active');
|
||||
this.classList.add('filter-active');
|
||||
initIsotope.arrange({
|
||||
filter: this.getAttribute('data-filter')
|
||||
});
|
||||
if (typeof aosInit === 'function') {
|
||||
aosInit();
|
||||
}
|
||||
}, false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Init swiper sliders
|
||||
*/
|
||||
function initSwiper() {
|
||||
document.querySelectorAll(".init-swiper").forEach(function(swiperElement) {
|
||||
let config = JSON.parse(
|
||||
swiperElement.querySelector(".swiper-config").innerHTML.trim()
|
||||
);
|
||||
|
||||
if (swiperElement.classList.contains("swiper-tab")) {
|
||||
initSwiperWithCustomPagination(swiperElement, config);
|
||||
} else {
|
||||
new Swiper(swiperElement, config);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("load", initSwiper);
|
||||
|
||||
/**
|
||||
* Correct scrolling position upon page load for URLs containing hash links.
|
||||
*/
|
||||
window.addEventListener('load', function(e) {
|
||||
if (window.location.hash) {
|
||||
if (document.querySelector(window.location.hash)) {
|
||||
setTimeout(() => {
|
||||
let section = document.querySelector(window.location.hash);
|
||||
let scrollMarginTop = getComputedStyle(section).scrollMarginTop;
|
||||
window.scrollTo({
|
||||
top: section.offsetTop - parseInt(scrollMarginTop),
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Navmenu Scrollspy
|
||||
*/
|
||||
let navmenulinks = document.querySelectorAll('.navmenu a');
|
||||
|
||||
function navmenuScrollspy() {
|
||||
navmenulinks.forEach(navmenulink => {
|
||||
if (!navmenulink.hash) return;
|
||||
let section = document.querySelector(navmenulink.hash);
|
||||
if (!section) return;
|
||||
let position = window.scrollY + 200;
|
||||
if (position >= section.offsetTop && position <= (section.offsetTop + section.offsetHeight)) {
|
||||
document.querySelectorAll('.navmenu a.active').forEach(link => link.classList.remove('active'));
|
||||
navmenulink.classList.add('active');
|
||||
} else {
|
||||
navmenulink.classList.remove('active');
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', navmenuScrollspy);
|
||||
document.addEventListener('scroll', navmenuScrollspy);
|
||||
|
||||
})();
|
||||
37
kloowear-app/old file/assets/js/swipper.js
Executable file
37
kloowear-app/old file/assets/js/swipper.js
Executable file
@@ -0,0 +1,37 @@
|
||||
// Logos Slider Swiper
|
||||
new Swiper("#clients-swiper", {
|
||||
loop: true,
|
||||
speed: 800,
|
||||
slidesPerView: 4,
|
||||
spaceBetween: 20,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
breakpoints: {
|
||||
320: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Logos Slider Swiper
|
||||
new Swiper("#testimonial-swiper", {
|
||||
loop: true,
|
||||
speed: 600,
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
},
|
||||
slidesPerView: "auto",
|
||||
pagination: {
|
||||
el: ".testimonial-swiper-pagination",
|
||||
type: "bullets",
|
||||
clickable: true,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user