README hinzugefuegt, Lint-Fehler behoben, Code formatiert

This commit is contained in:
2026-05-10 02:15:40 +02:00
parent 5d1a048624
commit d25525946d
13 changed files with 1536 additions and 592 deletions

View File

@@ -1,70 +1,76 @@
$(function() {
$(function () {
// Navbar scroll
$(window).on('scroll', function() {
if ($(this).scrollTop() > 60) $('#navbar').addClass('scrolled');
else $('#navbar').removeClass('scrolled');
$(window).on("scroll", function () {
if ($(this).scrollTop() > 60) $("#navbar").addClass("scrolled");
else $("#navbar").removeClass("scrolled");
});
// Hero animation on load
setTimeout(function() {
$('#heroContent').addClass('visible');
$('#heroBg').addClass('loaded');
setTimeout(function () {
$("#heroContent").addClass("visible");
$("#heroBg").addClass("loaded");
}, 200);
// Scroll animations
function checkVisible() {
$('.fact, [data-animate]').each(function() {
$(".fact, [data-animate]").each(function () {
var el = $(this);
var top = el.offset().top;
var windowBottom = $(window).scrollTop() + $(window).height();
if (windowBottom > top + 60) {
el.addClass('visible');
el.css({opacity: 1, transform: 'translateY(0)'});
el.addClass("visible");
el.css({ opacity: 1, transform: "translateY(0)" });
}
});
}
$('[data-animate]').css({opacity: 0, transform: 'translateY(30px)', transition: 'opacity 0.8s ease, transform 0.8s ease'});
$(window).on('scroll', checkVisible);
$("[data-animate]").css({
opacity: 0,
transform: "translateY(30px)",
transition: "opacity 0.8s ease, transform 0.8s ease",
});
$(window).on("scroll", checkVisible);
checkVisible();
// Floor accordion
$('.floor-header').on('click', function() {
var item = $(this).closest('.floor-item');
var isOpen = item.hasClass('open');
$('.floor-item').removeClass('open');
$('.floor-body').slideUp(300);
$(".floor-header").on("click", function () {
var item = $(this).closest(".floor-item");
var isOpen = item.hasClass("open");
$(".floor-item").removeClass("open");
$(".floor-body").slideUp(300);
if (!isOpen) {
item.addClass('open');
item.find('.floor-body').slideDown(300);
item.addClass("open");
item.find(".floor-body").slideDown(300);
}
});
// Lightbox gallery grid items
$(document).on('click', '.grid-item', function() {
var src = $(this).data('img') || $(this).find('img').attr('src');
$('#lightboxImg').attr('src', src);
$('#lightbox').addClass('open');
$('body').css('overflow', 'hidden');
$(document).on("click", ".grid-item", function () {
var src = $(this).data("img") || $(this).find("img").attr("src");
$("#lightboxImg").attr("src", src);
$("#lightbox").addClass("open");
$("body").css("overflow", "hidden");
});
$('#lightboxClose, #lightbox').on('click', function(e) {
$("#lightboxClose, #lightbox").on("click", function (e) {
if (e.target === this) {
$('#lightbox').removeClass('open');
$('body').css('overflow', '');
$("#lightbox").removeClass("open");
$("body").css("overflow", "");
}
});
$(document).on('keydown', function(e) {
if (e.key === 'Escape') { $('#lightbox').removeClass('open'); $('body').css('overflow', ''); }
$(document).on("keydown", function (e) {
if (e.key === "Escape") {
$("#lightbox").removeClass("open");
$("body").css("overflow", "");
}
});
// Form submit
$('#contactForm').on('submit', function(e) {
// Form submit
$("#contactForm").on("submit", function (e) {
e.preventDefault();
var btn = $(this).find('.btn-submit');
btn.text('Wird gesendet...').prop('disabled', true);
setTimeout(function() {
$('#contactForm').hide();
$('#formSuccess').fadeIn(400);
var btn = $(this).find(".btn-submit");
btn.text("Wird gesendet...").prop("disabled", true);
setTimeout(function () {
$("#contactForm").hide();
$("#formSuccess").fadeIn(400);
}, 1200);
});
});