394394 justify-content : center;
395395 }
396396
397- /* ✅ Right-peek only (desktop) */
398- @media (min-width : 768px ){
399- /* 关键:把整个 stage 往左拉回去,抵消左侧露出 */
400- # diamond-sponsor-carousel .owl-stage-outer {
401- overflow : hidden; /* 默认就是 hidden,强调一下 */
402- }
403- # diamond-sponsor-carousel .owl-stage {
404- margin-left : -70px ; /* ✅ 这里要和 JS 里 stagePadding 一致 */
405- }
406- }
407-
408- /* ✅ Arrows on the sides of the carousel (not below) */
409- # diamond-sponsor-carousel {
410- position : relative;
411- }
412-
413- /* owl 默认会把 nav 放在下面,这里强制绝对定位到两侧 */
414- # diamond-sponsor-carousel .owl-nav {
415- position : absolute;
416- top : 50% ;
417- left : 0 ;
418- right : 0 ;
419- transform : translateY (-50% );
420- pointer-events : none; /* 让容器不挡点击 */
421- margin : 0 !important ;
422- }
423-
424- # diamond-sponsor-carousel .owl-nav button {
425- pointer-events : auto; /* 按钮可点击 */
426- position : absolute;
427- width : 44px ;
428- height : 44px ;
429- border-radius : 999px ;
430- background : rgba (255 , 255 , 255 , 0.92 ) !important ;
431- box-shadow : 0 2px 8px rgba (0 , 0 , 0 , 0.18 );
432- font-size : 26px !important ;
433- line-height : 44px !important ;
434- margin : 0 !important ;
435- }
436-
437- # diamond-sponsor-carousel .owl-nav .owl-prev {
438- left : -18px ; /* ✅ 位于卡片左侧 */
439- }
440- # diamond-sponsor-carousel .owl-nav .owl-next {
441- right : -18px ; /* ✅ 位于卡片右侧 */
442- }
443-
444- /* 小屏稍微收回来 */
445- @media (max-width : 600px ){
446- # diamond-sponsor-carousel .owl-nav .owl-prev { left : -10px ; }
447- # diamond-sponsor-carousel .owl-nav .owl-next { right : -10px ; }
448- }
397+ /* ===========================
398+ ✅ Diamond carousel centered + arrows on both sides
399+ =========================== */
400+ # diamond-sponsor-wrapper {
401+ display : flex;
402+ justify-content : center;
403+ }
404+
405+ # diamond-sponsor-carousel {
406+ width : 100% ;
407+ max-width : 1100px ;
408+ margin : 0 auto;
409+ position : relative;
410+ }
411+
412+ /* 每个 slide 里把 card 居中 */
413+ # diamond-sponsor-carousel .diamond-slide {
414+ padding : 10px ;
415+ display : flex;
416+ justify-content : center;
417+ }
418+
419+ /* 给左右箭头留空间,避免压到卡片 */
420+ # diamond-sponsor-carousel .owl-stage-outer {
421+ padding : 0 70px ;
422+ overflow : hidden;
423+ }
424+
425+ /* arrows placed at left/right sides */
426+ # diamond-sponsor-carousel .owl-nav {
427+ position : absolute;
428+ top : 50% ;
429+ left : 0 ;
430+ right : 0 ;
431+ transform : translateY (-50% );
432+ pointer-events : none;
433+ margin : 0 !important ;
434+ }
435+
436+ # diamond-sponsor-carousel .owl-nav button {
437+ pointer-events : auto;
438+ position : absolute;
439+ width : 44px ;
440+ height : 44px ;
441+ border-radius : 999px ;
442+ background : rgba (255 , 255 , 255 , 0.92 ) !important ;
443+ box-shadow : 0 2px 8px rgba (0 , 0 , 0 , 0.18 );
444+ font-size : 26px !important ;
445+ line-height : 44px !important ;
446+ margin : 0 !important ;
447+ z-index : 10 ;
448+ }
449+
450+ # diamond-sponsor-carousel .owl-nav .owl-prev { left : 12px ; }
451+ # diamond-sponsor-carousel .owl-nav .owl-next { right : 12px ; }
452+
453+ /* Mobile: 箭头空间小一点 */
454+ @media (max-width : 600px ){
455+ # diamond-sponsor-carousel .owl-stage-outer { padding : 0 52px ; }
456+ # diamond-sponsor-carousel .owl-nav .owl-prev { left : 8px ; }
457+ # diamond-sponsor-carousel .owl-nav .owl-next { right : 8px ; }
458+ }
449459
450460
451461
@@ -1911,20 +1921,19 @@ <h3 style="font-size: 22px; color:#fff; margin:0;">
19111921 navText : [ '❮' , '❯' ] ,
19121922 smartSpeed : 600 ,
19131923
1914- // 3 个且显示 2 个:允许 loop
1924+ // 3 个以上桌面显示 2 个才需要 loop;手机显示 1 个则 2 个以上也可 loop
19151925 loop : ( slideCount > 2 ) ,
19161926
19171927 responsive : {
19181928 0 : {
19191929 items : 1 ,
1920- stagePadding : 0 ,
1921- autoplay : false , // ✅ 手机不自动滚动
1922- autoplayHoverPause : true
1930+ autoplay : true , // ✅ 手机也自动滚动
1931+ autoplayHoverPause : true ,
1932+ autoplayTimeout : 3500
19231933 } ,
19241934 768 : {
19251935 items : 2 ,
1926- stagePadding : 70 , // ✅ 右侧露出一点
1927- autoplay : true , // 桌面仍可自动滚动
1936+ autoplay : true ,
19281937 autoplayHoverPause : true ,
19291938 autoplayTimeout : 4500
19301939 }
@@ -1933,7 +1942,5 @@ <h3 style="font-size: 22px; color:#fff; margin:0;">
19331942 } ) ;
19341943 </ script >
19351944
1936-
1937-
19381945</ body >
19391946</ html >
0 commit comments