mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 10:16:00 +00:00
Load sponsor data dynamically (from hades)
This commit is contained in:
1 parent
68bbcc64a9
commit
8f0d87e37d
2 files changed
+40
-20
No files matched your search
@@ -53,8 +53,41 @@ class SponsorRotation {
|
||||
}
|
||||
|
||||
init() {
|
||||
this.startPlatinumRotation();
|
||||
this.startGoldRotation();
|
||||
let self = this;
|
||||
this.loadSponsors(function() {
|
||||
self.startPlatinumRotation();
|
||||
self.startGoldRotation();
|
||||
});
|
||||
}
|
||||
|
||||
loadSponsors(onSuccess) {
|
||||
$.ajax({
|
||||
url: 'https://v32155.1blu.de/serena-sponsors/manifest.php',
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
console.log('Sponsors loaded:', response);
|
||||
let $goldContainer = $('#gold-sponsors');
|
||||
$.each(response.gold, function (index, sponsor) {
|
||||
let $sponsor = $('<div class="gold-sponsor-slide" data-sponsor="' + (index + 1) + '"><img src="' + sponsor.image + '" alt="' + sponsor.alt + '" class="sponsor-image"></div>');
|
||||
if (index === 0) {
|
||||
$sponsor.addClass('active');
|
||||
}
|
||||
$goldContainer.append($sponsor);
|
||||
});
|
||||
let $platinumContainer = $('#platinum-sponsors');
|
||||
$.each(response.platinum, function (index, sponsor) {
|
||||
let $sponsor = $('<div class="platinum-sponsor-slide" data-sponsor="' + (index + 1) + '"><img src="' + sponsor.image + '" alt="' + sponsor.alt + '" class="sponsor-image"></div>');
|
||||
if (index === 0) {
|
||||
$sponsor.addClass('active');
|
||||
}
|
||||
$platinumContainer.append($sponsor);
|
||||
});
|
||||
onSuccess();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error('Error loading sponsors:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
startPlatinumRotation() {
|
||||
@@ -414,7 +447,9 @@ class Dashboard {
|
||||
console.log('Polling for config overview...');
|
||||
let self = this;
|
||||
$.ajax({
|
||||
url: '/get_config_overview', type: 'GET', success: function (response) {
|
||||
url: '/get_config_overview',
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
self.failureCount = 0;
|
||||
|
||||
// Check if the config data has actually changed
|
||||
|
||||
@@ -24,16 +24,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Platinum Sponsors in Header -->
|
||||
<div class="header-sponsor">
|
||||
<div class="platinum-sponsor-slide active">
|
||||
<img src="oraios-ai-ad-banner.png" alt="Platinum Sponsor" class="sponsor-image">
|
||||
</div>
|
||||
<div class="platinum-sponsor-slide">
|
||||
<img src="oraios-software-ad-banner.png" alt="Platinum Sponsor" class="sponsor-image">
|
||||
</div>
|
||||
<div class="platinum-sponsor-slide">
|
||||
<img src="businesswoman_billboard_v2.gif" alt="Platinum Sponsor" class="sponsor-image">
|
||||
</div>
|
||||
<div id="platinum-sponsors" class="header-sponsor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -143,13 +134,7 @@
|
||||
</section>
|
||||
|
||||
<!-- Gold Sponsors -->
|
||||
<section class="gold-sponsors-section">
|
||||
<div class="gold-sponsor-slide active" data-sponsor="1">
|
||||
<img src="oraios-software-ad-banner.png" alt="Gold Sponsor" class="sponsor-image">
|
||||
</div>
|
||||
<div class="gold-sponsor-slide" data-sponsor="2">
|
||||
<img src="oraios-ai-ad-banner.png" alt="Gold Sponsor" class="sponsor-image">
|
||||
</div>
|
||||
<section id="gold-sponsors" class="gold-sponsors-section">
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user