更新网站架构

This commit is contained in:
2026-03-09 16:35:17 +08:00
parent 4cbc52c51b
commit bf0daf987b
180 changed files with 60682 additions and 491 deletions
@@ -0,0 +1,106 @@
(function ($) {
$.fn.countTo = function (options) {
options = options || {};
return $(this).each(function () {
// set options for current element
var settings = $.extend(
{},
$.fn.countTo.defaults,
{
from: $(this).data("from"),
to: $(this).data("to"),
speed: $(this).data("speed"),
refreshInterval: $(this).data("refresh-interval"),
decimals: $(this).data("decimals")
},
options
);
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(settings.speed / settings.refreshInterval),
increment = (settings.to - settings.from) / loops;
// references & variables that will change with each update
var self = this,
$self = $(this),
loopCount = 0,
value = settings.from,
data = $self.data("countTo") || {};
$self.data("countTo", data);
// if an existing interval can be found, clear it first
if (data.interval) {
clearInterval(data.interval);
}
data.interval = setInterval(updateTimer, settings.refreshInterval);
// initialize the element with the starting value
render(value);
function updateTimer() {
value += increment;
loopCount++;
render(value);
if (typeof settings.onUpdate == "function") {
settings.onUpdate.call(self, value);
}
if (loopCount >= loops) {
// remove the interval
$self.removeData("countTo");
clearInterval(data.interval);
value = settings.to;
if (typeof settings.onComplete == "function") {
settings.onComplete.call(self, value);
}
}
}
function render(value) {
var formattedValue = settings.formatter.call(self, value, settings);
$self.html(formattedValue);
}
});
};
$.fn.countTo.defaults = {
from: 0, // the number the element should start at
to: 0, // the number the element should end at
speed: 1000, // how long it should take to count between the target numbers
refreshInterval: 100, // how often the element should be updated
decimals: 0, // the number of decimal places to show
formatter: formatter, // handler for formatting the value before rendering
onUpdate: null, // callback method for every time the element is updated
onComplete: null // callback method for when the element finishes updating
};
function formatter(value, settings) {
return value.toFixed(settings.decimals);
}
})(jQuery);
jQuery(function ($) {
// custom formatting example
$(".count-number").data("countToOptions", {
formatter: function (value, options) {
return value
.toFixed(options.decimals)
.replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
}
});
// start all the timers
$(".timer").each(count);
function count(options) {
var $this = $(this);
options = $.extend({}, options || {}, $this.data("countToOptions") || {});
$this.countTo(options);
}
});
+108
View File
@@ -0,0 +1,108 @@
(function ($) {
"use strict";
// Page loading animation
$(window).on('load', function() {
$('#js-preloader').addClass('loaded');
});
$(window).scroll(function() {
var scroll = $(window).scrollTop();
var box = $('.header-text').height();
var header = $('header').height();
if (scroll >= box - header) {
$("header").addClass("background-header");
} else {
$("header").removeClass("background-header");
}
})
var width = $(window).width();
$(window).resize(function() {
if (width > 767 && $(window).width() < 767) {
location.reload();
}
else if (width < 767 && $(window).width() > 767) {
location.reload();
}
})
const elem = document.querySelector('.trending-box');
const filtersElem = document.querySelector('.trending-filter');
if (elem) {
const rdn_events_list = new Isotope(elem, {
itemSelector: '.trending-items',
layoutMode: 'masonry'
});
if (filtersElem) {
filtersElem.addEventListener('click', function(event) {
if (!matchesSelector(event.target, 'a')) {
return;
}
const filterValue = event.target.getAttribute('data-filter');
rdn_events_list.arrange({
filter: filterValue
});
filtersElem.querySelector('.is_active').classList.remove('is_active');
event.target.classList.add('is_active');
event.preventDefault();
});
}
}
// Menu Dropdown Toggle
if($('.menu-trigger').length){
$(".menu-trigger").on('click', function() {
$(this).toggleClass('active');
$('.header-area .nav').slideToggle(200);
});
}
// Menu elevator animation
$('.scroll-to-section a[href*=\\#]:not([href=\\#])').on('click', function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
var width = $(window).width();
if(width < 991) {
$('.menu-trigger').removeClass('active');
$('.header-area .nav').slideUp(200);
}
$('html,body').animate({
scrollTop: (target.offset().top) - 80
}, 700);
return false;
}
}
});
// Page loading animation
$(window).on('load', function() {
if($('.cover').length){
$('.cover').parallax({
imageSrc: $('.cover').data('image'),
zIndex: '1'
});
}
$("#preloader").animate({
'opacity': '0'
}, 600, function(){
setTimeout(function(){
$("#preloader").css("visibility", "hidden").fadeOut();
}, 300);
});
});
})(window.jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff