mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-12 22:14:54 +00:00
Adjust wording: sponsor -> banner
This commit is contained in:
1 parent
619131cb22
commit
ac98f770a6
3 files changed
+38
-38
No files matched your search
@@ -108,7 +108,7 @@ body {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.header-sponsor {
|
||||
.header-banner {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@@ -180,7 +180,7 @@ body {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.platinum-sponsor-slide {
|
||||
.platinum-banner-slide {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@@ -190,26 +190,26 @@ body {
|
||||
transition: opacity 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.platinum-sponsor-slide.active {
|
||||
.platinum-banner-slide.active {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.sponsor-image {
|
||||
.banner-image {
|
||||
object-fit: contain;
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
.sponsor-border {
|
||||
.banner-border {
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.platinum-sponsor-slide .sponsor-image {
|
||||
.platinum-banner-slide .banner-image {
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.gold-sponsors-section {
|
||||
.gold-banners-section {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
@@ -225,19 +225,19 @@ body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gold-sponsor-slide {
|
||||
.gold-banner-slide {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.gold-sponsor-slide.active {
|
||||
.gold-banner-slide.active {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.gold-sponsor-slide .sponsor-image {
|
||||
.gold-banner-slide .banner-image {
|
||||
max-width: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
@@ -66,48 +66,48 @@ class BannerRotation {
|
||||
|
||||
init() {
|
||||
let self = this;
|
||||
this.loadSponsors(function() {
|
||||
this.loadBanners(function() {
|
||||
self.startPlatinumRotation();
|
||||
self.startGoldRotation();
|
||||
});
|
||||
}
|
||||
|
||||
loadSponsors(onSuccess) {
|
||||
loadBanners(onSuccess) {
|
||||
$.ajax({
|
||||
url: 'https://oraios-software.de/serena-sponsors/manifest.php',
|
||||
url: 'https://oraios-software.de/serena-banners/manifest.php',
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
console.log('Sponsors loaded:', response);
|
||||
console.log('Banners loaded:', response);
|
||||
|
||||
function fillSponsors($container, sponsors, className) {
|
||||
$.each(sponsors, function (index, sponsor) {
|
||||
let $img = $('<img src="' + sponsor.image + '" alt="' + sponsor.alt + '" class="sponsor-image">');
|
||||
if (sponsor.image_dark) {
|
||||
function fillBanners($container, banners, className) {
|
||||
$.each(banners, function (index, banner) {
|
||||
let $img = $('<img src="' + banner.image + '" alt="' + banner.alt + '" class="banner-image">');
|
||||
if (banner.image_dark) {
|
||||
$img.addClass('theme-aware-img');
|
||||
$img.attr('data-src-dark', sponsor.image_dark);
|
||||
$img.attr('data-src-light', sponsor.image);
|
||||
$img.attr('data-src-dark', banner.image_dark);
|
||||
$img.attr('data-src-light', banner.image);
|
||||
updateThemeAwareImage($img);
|
||||
}
|
||||
let $anchor = $('<a href="' + sponsor.link + '" target="_blank"></a>');
|
||||
let $anchor = $('<a href="' + banner.link + '" target="_blank"></a>');
|
||||
$anchor.append($img);
|
||||
let $sponsor = $('<div class="' + className + '-slide" data-sponsor="' + (index + 1) + '"></div>');
|
||||
$sponsor.append($anchor);
|
||||
let $banner = $('<div class="' + className + '-slide" data-banner="' + (index + 1) + '"></div>');
|
||||
$banner.append($anchor);
|
||||
if (index === 0) {
|
||||
$sponsor.addClass('active');
|
||||
$banner.addClass('active');
|
||||
}
|
||||
if (sponsor.border) {
|
||||
$img.addClass('sponsor-border');
|
||||
if (banner.border) {
|
||||
$img.addClass('banner-border');
|
||||
}
|
||||
$container.append($sponsor);
|
||||
$container.append($banner);
|
||||
});
|
||||
}
|
||||
|
||||
fillSponsors($('#gold-sponsors'), response.gold, 'gold-sponsor');
|
||||
fillSponsors($('#platinum-sponsors'), response.platinum, 'platinum-sponsor');
|
||||
fillBanners($('#gold-banners'), response.gold, 'gold-banner');
|
||||
fillBanners($('#platinum-banners'), response.platinum, 'platinum-banner');
|
||||
onSuccess();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error('Error loading sponsors:', error);
|
||||
console.error('Error loading banners:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class BannerRotation {
|
||||
}
|
||||
|
||||
rotatePlatinum(direction) {
|
||||
const $slides = $('.platinum-sponsor-slide');
|
||||
const $slides = $('.platinum-banner-slide');
|
||||
const total = $slides.length;
|
||||
|
||||
if (total === 0) return;
|
||||
@@ -151,7 +151,7 @@ class BannerRotation {
|
||||
}
|
||||
|
||||
rotateGold(direction) {
|
||||
const $groups = $('.gold-sponsor-slide');
|
||||
const $groups = $('.gold-banner-slide');
|
||||
const total = $groups.length;
|
||||
|
||||
if (total === 0) return;
|
||||
@@ -378,8 +378,8 @@ class Dashboard {
|
||||
// Initialize theme
|
||||
this.initializeTheme();
|
||||
|
||||
// Initialize sponsor rotation
|
||||
this.sponsorRotation = new BannerRotation();
|
||||
// Initialize banner rotation
|
||||
this.bannerRotation = new BannerRotation();
|
||||
|
||||
// Add ESC key handler for closing modals
|
||||
$(document).keydown(function (e) {
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
<img id="serena-logo" class="theme-aware-img" src="serena-logo.svg" data-src-light="serena-logo.svg" data-src-dark="serena-logo-dark-mode.svg" alt="Serena">
|
||||
</div>
|
||||
|
||||
<!-- Platinum Sponsors in Header -->
|
||||
<div id="platinum-sponsors" class="header-sponsor">
|
||||
<!-- Platinum Banners in Header -->
|
||||
<div id="platinum-banners" class="header-banner">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -134,8 +134,8 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Gold Sponsors -->
|
||||
<section id="gold-sponsors" class="gold-sponsors-section">
|
||||
<!-- Gold Banners -->
|
||||
<section id="gold-banners" class="gold-banners-section">
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user