All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 3s
1271 lines
48 KiB
HTML
1271 lines
48 KiB
HTML
{extend name="public/base" /}
|
||
{block name="style"}
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/header.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/index.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/swiper.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/amd.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/cpu.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/progress.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/gpu.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/memory.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/m2.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/fs.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/xn.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/ips.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/rgb.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/bly.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/qb.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/wift.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/endurance.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/zoom.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/tabs.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/window.css">
|
||
<link rel="stylesheet" href="__CSS__/topic_laptop/footer.css">
|
||
<script type="text/javascript">
|
||
(function (doc, win)
|
||
{
|
||
var docEl = doc.documentElement;
|
||
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
|
||
|
||
function setRootFontSize ()
|
||
{
|
||
var clientWidth = docEl.clientWidth;
|
||
console.log(clientWidth,'=clientWidth=')
|
||
if (!clientWidth) return;
|
||
var fontSize = clientWidth / 7.5; // 750px/7.5=100px,375px/7.5=50px
|
||
// 直接修改内联样式,优先级最高
|
||
docEl.setAttribute('style', 'font-size: ' + fontSize + 'px !important;');
|
||
console.log(fontSize,'=fontSize=')
|
||
}
|
||
|
||
setRootFontSize();
|
||
win.addEventListener(resizeEvt, setRootFontSize);
|
||
doc.addEventListener('DOMContentLoaded', setRootFontSize);
|
||
})(document, window);
|
||
</script>
|
||
{/block}
|
||
|
||
{block name="main"}
|
||
{notempty name="data.top_focus_images"}
|
||
<!-- 顶部轮播 -->
|
||
<div class="swiper-container auto-swiper-container" style="margin-top:60px;">
|
||
<div class="swiper-wrapper">
|
||
{volist name="data.top_focus_images" id="tfi"}
|
||
<div class="swiper-slide auto-swiper-slide">
|
||
<div class="swiper-container-texts" style="color:#fff">
|
||
<div class="swiper-container-texts-t">{$tfi.title}</div>
|
||
<div class="swiper-container-texts-p">{$tfi.desc|raw|htmlspecialchars_decode}</div>
|
||
<div class="swiper-container-texts-img">
|
||
<a href="{$tfi.link}">
|
||
<img src="{$tfi.extra_image}" alt="">
|
||
</a>
|
||
</div>
|
||
</div>
|
||
<img src="{$tfi.image}" alt="{$tfi.title}" />
|
||
</div>
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.perf"}
|
||
<!-- 笔记本配置图 -->
|
||
<div class="amd-box">
|
||
<div class="amd-img-header">
|
||
{notempty name="data.perf.0"}
|
||
<img src="{$data.perf.0.image}" alt="{$data.perf.0.title}" loading="lazy">
|
||
{/notempty}
|
||
</div>
|
||
<div class="amd-img-main " data-order="2" data-name="">
|
||
<div class="amd-img-main-left">
|
||
{notempty name="data.perf.1"}
|
||
<img src="{$data.perf.1.image}" alt="{$data.perf.1.title}" loading="lazy">
|
||
{/notempty}
|
||
{notempty name="data.perf.2"}
|
||
<img src="{$data.perf.2.image}" alt="{$data.perf.2.title}" loading="lazy">
|
||
{/notempty}
|
||
{notempty name="data.perf.3"}
|
||
<img src="{$data.perf.3.image}" alt="{$data.perf.3.title}" loading="lazy">
|
||
{/notempty}
|
||
{notempty name="data.perf.4"}
|
||
<img src="{$data.perf.4.image}" alt="{$data.perf.4.title}" loading="lazy">
|
||
{/notempty}
|
||
</div>
|
||
<div class="amd-img-main-right">
|
||
{notempty name="data.perf.5"}
|
||
<img src="{$data.perf.5.image}" alt="{$data.perf.5.title}" loading="lazy">
|
||
{/notempty}
|
||
{notempty name="data.perf.6"}
|
||
<img src="{$data.perf.6.image}" alt="{$data.perf.6.title}" loading="lazy">
|
||
{/notempty}
|
||
{notempty name="data.perf.7"}
|
||
<img src="{$data.perf.7.image}" alt="{$data.perf.7.title}" loading="lazy">
|
||
{/notempty}
|
||
{notempty name="data.perf.8"}
|
||
<img src="{$data.perf.8.image}" alt="{$data.perf.8.title}" loading="lazy">
|
||
{/notempty}
|
||
</div>
|
||
</div>
|
||
<div class="amd-img-footer">
|
||
{notempty name="data.perf.9"}
|
||
<img src="{$data.perf.9.image}" alt="{$data.perf.9.title}" loading="lazy">
|
||
{/notempty}
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.cpu"}
|
||
<!-- 超能引擎 -->
|
||
<div class="cpu">
|
||
{assign name="cpu_first_section" value=":array_shift($data.cpu)"/}
|
||
<div class="cpu-main" style="background: url('{$cpu_first_section.image|default=\'\'}');background-size:100% auto">
|
||
<div class="cpu-texts">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="cpu-texts-t f36 lh1">{$cpu_first_section.title|default=''|raw}</div>
|
||
<p class="cpu-texts-p f18">{$cpu_first_section.short_title|default=''|raw}</p>
|
||
{else/}
|
||
<div class="cpu-texts-t">{$cpu_first_section.title|default=''|raw}</div>
|
||
<p class="cpu-texts-p">{$cpu_first_section.short_title|default=''|raw}</p>
|
||
{/eq}
|
||
</div>
|
||
<div class="cpu-footer">
|
||
<div class="cpu-footer-img">
|
||
{volist name="data.cpu" id="co"}
|
||
<img src="{$co.image}" alt="{$co.title}" loading="lazy">
|
||
{/volist}
|
||
</div>
|
||
<div class="cpu-footer-desc">{$cpu_first_section.desc|default=''|raw}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
<!-- 进度条 -->
|
||
<div class="progress">
|
||
<div class="progress-title">{:lang_i18n('CineBench R23 多核跑分')}</div>
|
||
<div class="progress-section">
|
||
<div class="progress-item">
|
||
<div class="progress-bar-container">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m4-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label ">
|
||
<span class="device-name colorLinearGradient font20">Ryzen7 7735HS:</span>
|
||
<span class="value m4-max colorLinearGradient font20">13766</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w645">
|
||
<div class="progress-bar-container ">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name colorCBCFD8 font18">Ryzen5 7640HS:</span>
|
||
<span class="value colorCBCFD8 font18">12950</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w585">
|
||
<div class="progress-bar-container ">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name font18 colorCBCFD8 font18">{:lang_i18n('锐龙9 6900HX')}:</span>
|
||
<span class="value font18 colorCBCFD8 font18">13183</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w454">
|
||
<div class="progress-bar-container">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name font18 colorCBCFD8">{:lang_i18n('酷睿i5-12450H')}:</span>
|
||
<span class="value font18 colorCBCFD8">10200</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w321">
|
||
<div class="progress-bar-container">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name m2-max font18 colorCBCFD8">Ryzen5 6600H:</span>
|
||
<span class="value font18 colorCBCFD8">10297</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="progress-p">{:lang_i18n('*此跑分为ORICO实验室测定所得,请以实际使用为准')}</div>
|
||
</div>
|
||
{notempty name="data.gpu"}
|
||
<!-- 显卡 GPU -->
|
||
<div class="gpu">
|
||
{assign name="gpu_first_section" value=":array_shift($data.gpu)"/}
|
||
<div class="gpu-texts">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="gpu-texts-t f36">{$gpu_first_section.title|default=''|raw}</div>
|
||
<div class="gpu-texts-p f18">{$gpu_first_section.short_title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="gpu-texts-t">{$gpu_first_section.title|default=''|raw}</div>
|
||
<div class="gpu-texts-p">{$gpu_first_section.short_title|default=''|raw}</div>
|
||
{/eq}
|
||
</div>
|
||
<div class="gpu-main-img" style="background: url('{$gpu_first_section.image|default=\'\'}');background-size:100% auto">
|
||
<div class="gpu-amd-img">
|
||
<img src="{$gpu_first_section.extra_image|default=''}" alt="" loading="lazy">
|
||
</div>
|
||
<div class="gpu-footer-imgs">
|
||
{volist name="data.gpu" id="go"}
|
||
<img src="{$go.image}" alt="{$go.title}" loading="lazy">
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
<!-- 进度条 -->
|
||
<div class="progress">
|
||
<div class="progress-title">{:lang_i18n('3DMARK Time Spy显卡得分')}</div>
|
||
<div class="progress-section">
|
||
<div class="progress-item">
|
||
<div class="progress-bar-container">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m4-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label ">
|
||
<span class="device-name colorLinearGradient font20">Ryzen7 7735HS:</span>
|
||
<span class="value m4-max colorLinearGradient font20">1700</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w596">
|
||
<div class="progress-bar-container ">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name colorCBCFD8 font18">NVIDIA GTX 750:</span>
|
||
<span class="value colorCBCFD8 font18">1000</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w596">
|
||
<div class="progress-bar-container ">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name font18 colorCBCFD8 font18">i7-13620H:</span>
|
||
<span class="value font18 colorCBCFD8 font18">1000</span>
|
||
</div>
|
||
</div>
|
||
<div class="progress-item w467">
|
||
<div class="progress-bar-container">
|
||
<div class="progress-bar">
|
||
<div class="progress-fill m2-max" data-value="100"></div>
|
||
</div>
|
||
</div>
|
||
<div class="label">
|
||
<span class="device-name font18 colorCBCFD8">Ryzen5 6600H:</span>
|
||
<span class="value font18 colorCBCFD8">950</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="progress-p">{:lang_i18n('*此跑分为ORICO实验室测定所得,请以实际使用为准')}</div>
|
||
</div>
|
||
{notempty name="data.ram"}
|
||
<!-- 内存 memory-->
|
||
<div class="memory">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="memory-t f36 lh1">{$data.ram.title|raw}</div>
|
||
{else/}
|
||
<div class="memory-t">{$data.ram.title|raw}</div>
|
||
{/eq}
|
||
<div class="memory-img" style="background: url('{$data.ram.image|default=\'\'}'); background-size:100% auto">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="memory-p f18">{$data.ram.short_title|raw}</div>
|
||
{else/}
|
||
<div class="memory-p ">{$data.ram.short_title|raw}</div>
|
||
{/eq}
|
||
<div class="memory-footer-img">{$data.ram.desc|raw}</div>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.hard_drive"}
|
||
<!-- ssd -->
|
||
<div class="m2">
|
||
{assign name="ssd_first_section" value=":array_shift($data.hard_drive)"/}
|
||
<div class="m2-bg" style="background: url('{$ssd_first_section.image|default=\'\'}');background-size:100% auto">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="m2-bg-t1 f36 lh1">{$ssd_first_section.title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="m2-bg-t1">{$ssd_first_section.title|default=''|raw}</div>
|
||
{/eq}
|
||
<div class="m2-bg-p">{$ssd_first_section.short_title|default=''|raw}</div>
|
||
<div class="m2-img-box">
|
||
{volist name="data.hard_drive" id="ho"}
|
||
<img src="{$ho.image}" alt="{$ho.title}" loading="lazy">
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.cooling_system"}
|
||
<!-- fs -->
|
||
<div class="fs">
|
||
{notempty name="data.cooling_system.0"}
|
||
<div class="dl">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="dl-t f36">{$data.cooling_system.0.title|raw}</div>
|
||
<p class="dl-p f18">{$data.cooling_system.0.short_title|raw}</p>
|
||
{else/}
|
||
<div class="dl-t">{$data.cooling_system.0.title|raw}</div>
|
||
<p class="dl-p">{$data.cooling_system.0.short_title|raw}</p>
|
||
{/eq}
|
||
</div>
|
||
{/notempty}
|
||
<div class="fs-box">
|
||
{notempty name="data.cooling_system.0"}
|
||
<video
|
||
src="{$data.cooling_system.0.video|default=''}"
|
||
class="fs-video" muted loop playsinline autoplay
|
||
poster="{$data.cooling_system.0.image|default=''}"
|
||
preload="auto" style="width: 100%;">
|
||
您的浏览器不支持HTML5视频播放,请升级浏览器
|
||
</video>
|
||
<div class="fs-ts">{$data.cooling_system.0.desc|raw}</div>
|
||
{/notempty}
|
||
<div class="fs-box-img">
|
||
<div class="fs-h-img">
|
||
{notempty name="data.cooling_system.1"}<img src="{$data.cooling_system.1.image}" alt="">{/notempty}
|
||
{notempty name="data.cooling_system.2"}<img src="{$data.cooling_system.2.image}" alt="">{/notempty}
|
||
</div>
|
||
<div class="fs-b-img" style="min-height: 20px;">
|
||
{notempty name="data.cooling_system.3"}<img src="{$data.cooling_system.3.image}" alt="">{/notempty}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.apps"}
|
||
<!-- 性能大拿 -->
|
||
<div class="xn">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="xn-t f28 ">{$data.apps.title|default=''}</div>
|
||
{else/}
|
||
<div class="xn-t">{$data.apps.title|default=''}</div>
|
||
{/eq}
|
||
<div class="xn-container">
|
||
<div class="xn-image-section">
|
||
<img src="{$data.apps.image|default=''}" alt="" class="zoom-image first-image">
|
||
</div>
|
||
</div>
|
||
<div class="xn-p">{$data.apps.desc|default=''|raw}</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.screen_soft_light"}
|
||
<!-- IPS -->
|
||
<div class="ips">
|
||
{assign name="ips_fisrt_section" value=":array_shift($data.screen_soft_light)"/}
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="ips-t f48">{$ips_fisrt_section.title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="ips-t">{$ips_fisrt_section.title|default=''|raw}</div>
|
||
{/eq}
|
||
<div class="ips-bg" style="background: url('{$ips_fisrt_section.image|default=\'\'}');background-size:100% auto">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<p class="f18">{$ips_fisrt_section.short_title|default=''|raw}</p>
|
||
{else/}
|
||
<p>{$ips_fisrt_section.short_title|default=''|raw}</p>
|
||
{/eq}
|
||
</div>
|
||
<div class="ips-imgs">
|
||
{volist name="data.screen_soft_light" id="lo"}
|
||
<img src="{$lo.image}" alt="">
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.screen_color_gamut"}
|
||
<!-- 色彩RGB -->
|
||
<div class="rgb">
|
||
{assign name="gamut_first_section" value=":array_shift($data.screen_color_gamut)"/}
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="rgb-t f36 lh1">{$gamut_first_section.title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="rgb-t">{$gamut_first_section.title|default=''|raw}</div>
|
||
{/eq}
|
||
<div class="rgb-bg" style="background: url('{$gamut_first_section.image|default=\'\'}');background-size:100% auto">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<p class="rgb-p f18">{$gamut_first_section.short_title|default=''|raw}</p>
|
||
{else/}
|
||
<p class="rgb-p">{$gamut_first_section.short_title|default=''|raw}</p>
|
||
{/eq}
|
||
</div>
|
||
<div class="rgb-imgs">
|
||
{volist name="data.screen_color_gamut" id="go"}
|
||
<img src="{$go.image}" alt="">
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.screen_anti_glare"}
|
||
<!-- 对比图 -->
|
||
<div class="bly">
|
||
{assign name="glare_first_section" value=":array_shift($data.screen_anti_glare)"/}
|
||
<div class="bly-texts">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="bly-t f36 lh1">{$glare_first_section.title|default=''|raw}</div>
|
||
<div class="bly-p f18">{$glare_first_section.short_title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="bly-t">{$glare_first_section.title|default=''|raw}</div>
|
||
<div class="bly-p">{$glare_first_section.short_title|default=''|raw}</div>
|
||
{/eq}
|
||
</div>
|
||
<div class="beforeafter ba-slider" style="border-radius: 0.14rem;height: 3.4rem;">
|
||
{assign name="glare_left" value=":array_shift($data.screen_anti_glare)"/}
|
||
<img src="{$glare_left.image|default=''}" loading="lazy">
|
||
<div class="resize">
|
||
{assign name="glare_right" value=":array_shift($data.screen_anti_glare)"/}
|
||
<img src="{$glare_right.image|default=''}" loading="lazy">
|
||
</div>
|
||
<span class="handle"></span>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.exterior_texture"}
|
||
<!-- 轮播图 -->
|
||
<div class="qb">
|
||
<div class="qb-text">
|
||
{assign name="texture_first_section" value=":array_shift($data.exterior_texture)"/}
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="qb-t f36 lh1">{$texture_first_section.title|default=''|raw}</div>
|
||
<div class="qb-p f18">{$texture_first_section.short_title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="qb-t">{$texture_first_section.title|default=''|raw}</div>
|
||
<div class="qb-p">{$texture_first_section.short_title|default=''|raw}</div>
|
||
{/eq}
|
||
<div class="swiper-container auto-swiper-container">
|
||
<div class="swiper-wrapper">
|
||
{volist name="data.exterior_texture" id="to"}
|
||
<a class="swiper-slide auto-swiper-slide">
|
||
<img src="{$to.image}" alt="" loading="lazy">
|
||
</a>
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.network_card"}
|
||
<!-- wifi -->
|
||
{assign name="wifi_first_section" value=":array_shift($data.network_card)"/}
|
||
<div class="wifi" style="background: url('{$wifi_first_section.image|default=\'\'}');background-size:100% auto">
|
||
<div class="wifi-texts">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="wifi-t f36 ">{$wifi_first_section.title|default=''|raw}</div>
|
||
<div class="wifi-p f18">{$wifi_first_section.short_title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="wifi-t">{$wifi_first_section.title|default=''|raw}</div>
|
||
<div class="wifi-p">{$wifi_first_section.short_title|default=''|raw}</div>
|
||
{/eq}
|
||
</div>
|
||
<div class="wifi-img">
|
||
{volist name="data.network_card" id="co"}
|
||
<img src="{$co.image}" alt="" loading="lazy">
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.battery_life"}
|
||
<!-- 长久续航 -->
|
||
{assign name="battery_first_section" value=":array_shift($data.battery_life)"/}
|
||
<div class="endurance" style="background: url('{$battery_first_section.image|default=\'\'|raw}');background-size:100% auto">
|
||
<div class="endurance-texts">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="endurance-t f36">{$battery_first_section.title|default=''|raw}</div>
|
||
<div class="endurance-p f18">{$battery_first_section.short_title|default=''|raw}</div>
|
||
{else/}
|
||
<div class="endurance-t">{$battery_first_section.title|default=''|raw}</div>
|
||
<div class="endurance-p">{$battery_first_section.short_title|default=''|raw}</div>
|
||
{/eq}
|
||
</div>
|
||
<div class="endurance-img">
|
||
{volist name="data.battery_life" id="lo"}
|
||
<img src="{$lo.image}" alt="" loading="lazy">
|
||
{/volist}
|
||
</div>
|
||
<div class="endurance-footer-p">{$battery_first_section.desc|default=''|raw}</div>
|
||
</div>
|
||
{/notempty}
|
||
<!-- 接口大满贯 -->
|
||
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="zoom-t f36 lh1">{:lang_i18n('接口大满贯')}</div>
|
||
{else/}
|
||
<div class="zoom-t">{:lang_i18n('接口大满贯')}</div>
|
||
{/eq}
|
||
<div class="zoom-container" id="zoomContainer">
|
||
<div class="img-wrapper">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<p class="zoom-p f18">{:lang_i18n('标配多种接口,会议室连接电脑、</br>U盘传输文件、TF卡读取等,全都轻松搞定')}</p>
|
||
{else/}
|
||
<p class="zoom-p">{:lang_i18n('标配多种接口,会议室连接电脑、</br>U盘传输文件、TF卡读取等,全都轻松搞定')}</p>
|
||
{/eq}
|
||
<img src="__IMAGES__/topic_laptop/zoom-img-1.png" alt="接口图" class="bg-img" id="bgImg" loading="lazy">
|
||
</div>
|
||
<!-- 左边 -->
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="annotation anno-delay-1 anno-up1" style="top: 29%; left: 33%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">Gigabit <br/> Ethernet</span>
|
||
</div>
|
||
{else/}
|
||
<div class="annotation anno-delay-1 anno-up" style="top: 32.5%; left: 32%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">千兆网口</span>
|
||
</div>
|
||
{/eq}
|
||
<div class="annotation anno-delay-1" style="top:60%; left: 39%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">{:lang_i18n('肯辛通锁孔')}</span>
|
||
</div>
|
||
<div class="annotation anno-delay-1" style="top: 68%; left: 26%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">{:lang_i18n('USB-A<br/>(5Gbps)')}</span>
|
||
</div>
|
||
<div class="annotation anno-delay-1 anno-up1" style="top:35.5%; left:18%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">{:lang_i18n('USB-A<br/>(480Mbps)')}</span>
|
||
</div>
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="annotation anno-delay-1" style="top: 73%; left: 13.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">3.5mm <br/> Combo Audio</span>
|
||
</div>
|
||
{else/}
|
||
<div class="annotation anno-delay-1" style="top: 73%; left: 15.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">3.5mm<br/>耳麦合一</span>
|
||
</div>
|
||
{/eq}
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="annotation anno-delay-1 anno-up1" style="top: 40%; left: 9.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">TF 3.0 <br/> Card Slot</span>
|
||
</div>
|
||
{else/}
|
||
<div class="annotation anno-delay-1 anno-up" style="top: 43%; left: 9%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">TF口3.0</span>
|
||
</div>
|
||
{/eq}
|
||
|
||
<!-- 右边 -->
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="annotation anno-delay-1" style="top: 64%; left: 56.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">All-in-One <br/> USB-C</span>
|
||
</div>
|
||
{else/}
|
||
<div class="annotation anno-delay-1" style="top: 64%; left: 58.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">全功能<br/>USB-C</span>
|
||
</div>
|
||
{/eq}
|
||
|
||
<div class="annotation anno-up anno-delay-1" style="top: 34%; left: 66.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">{:lang_i18n('HDMI')}</span>
|
||
</div>
|
||
<div class="annotation anno-delay-1" style="top: 70.5%; left: 71.5%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">{:lang_i18n('USB-A<br/>(5Gbps)')}</span>
|
||
</div>
|
||
<div class="annotation anno-up1 anno-delay-1" style="top:38.5%; left: 78%;">
|
||
<span style="text-align: center; font-size: 0.16rem;">{:lang_i18n('USB-C<br/>(5Gbps)')}</span>
|
||
</div>
|
||
</div>
|
||
{notempty name="data.scene_focus_images"}
|
||
<!-- 滑块 -->
|
||
<div class="swiper swiper-container-1" style="width: 6.82rem;margin: 0 auto;">
|
||
<div class="swiper-wrapper">
|
||
{volist name="data.scene_focus_images" id="fo"}
|
||
<div class="swiper-slide" style="width: 4.5rem;">
|
||
<img src="{$fo.image}" alt="" style="width: 4.5rem;">
|
||
<div>
|
||
<div class="swiper-slide-t">{$fo.title}</div>
|
||
<div class="swiper-slide-p">{$fo.short_title}</div>
|
||
</div>
|
||
</div>
|
||
{/volist}
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.camare_microphone_security"}
|
||
<!-- tabs -->
|
||
{assign name="camare_microphone" value=":array_shift($data.camare_microphone_security)"/}
|
||
{assign name="security" value=":array_shift($data.camare_microphone_security)"/}
|
||
<div class="tabs-container">
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
{notempty name="camare_microphone"}
|
||
<div class="tab-t active f36 lh1" data-index="0">{$camare_microphone.title|default=''}</div>
|
||
{/notempty}
|
||
{notempty name="security"}
|
||
<div class="tab-t f36 lh1" data-index="1">{$security.title|default=''}</div>
|
||
{/notempty}
|
||
{else/}
|
||
{notempty name="camare_microphone"}
|
||
<div class="tab-t active" data-index="0">{$camare_microphone.title|default=''}</div>
|
||
{/notempty}
|
||
{notempty name="security"}
|
||
<div class="tab-t" data-index="1">{$security.title|default=''}</div>
|
||
{/notempty}
|
||
{/eq}
|
||
<div class="tab-content">
|
||
{notempty name="camare_microphone"}
|
||
<div class="tab-panel active">
|
||
<div class="tab-panel-img">
|
||
<img src="{$camare_microphone.image}" alt="" class="content-image" loading="lazy">
|
||
</div>
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="security"}
|
||
<div class="tab-panel">
|
||
<video
|
||
src="{$security.video}"
|
||
id="securityVideo" class="content-video" muted loop playsinline autoplay
|
||
style="width: 100%;margin:0 auto;">
|
||
您的浏览器不支持HTML5视频播放,请升级浏览器
|
||
</video>
|
||
</div>
|
||
{/notempty}
|
||
</div>
|
||
<div class="tabs-header-box">
|
||
<div class="tabs-header">
|
||
{notempty name="camare_microphone"}
|
||
<div class="tab-item active" data-index="0">{$camare_microphone.short_title|default=''|raw}</div>
|
||
{/notempty}
|
||
{notempty name="security"}
|
||
<div class="tab-item" data-index="1">{$security.short_title|default=''|raw}</div>
|
||
{/notempty}
|
||
<div class="tab-indicator"></div>
|
||
</div>
|
||
</div>
|
||
{notempty name="camare_microphone"}
|
||
<div class="tabs-p active" data-index="0">{$camare_microphone.desc|default=''|raw}</div>
|
||
{/notempty}
|
||
{notempty name="security"}
|
||
<div class="tabs-p" data-index="1">{$security.desc|default=''|raw}</div>
|
||
{/notempty}
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.unified_preinstall"}
|
||
<!-- windows11-->
|
||
<div class="window">
|
||
<img src="{$data.unified_preinstall.image}" alt="">
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.product_testing"}
|
||
<!-- 六宫格 -->
|
||
<div class="footer-imgs">
|
||
{volist name="data.product_testing" id="to"}
|
||
<img src="{$to.image}">
|
||
{/volist}
|
||
</div>
|
||
{/notempty}
|
||
{notempty name="data.webpage_footnotes"}
|
||
<!-- 底部文字 -->
|
||
{eq name=":cookie('think_lang')" value="en-us"}
|
||
<div class="footer-texts-en">
|
||
{$data.webpage_footnotes.desc|raw|htmlspecialchars_decode}
|
||
</div>
|
||
{else/}
|
||
<div class="footer-texts">
|
||
{$data.webpage_footnotes.desc|raw|htmlspecialchars_decode}
|
||
</div>
|
||
{/eq}
|
||
|
||
{/notempty}
|
||
{/block}
|
||
{block name="script"}
|
||
<script src="__JS__/before-after.min.js" type="text/javascript"></script>
|
||
<script>
|
||
// 轮播初始化
|
||
let swiper;
|
||
let swiper1;
|
||
window.onload = function ()
|
||
{
|
||
if (typeof Swiper === 'undefined') {
|
||
console.error('Swiper加载失败,请刷新页面重试');
|
||
return;
|
||
}
|
||
swiper = new Swiper('.auto-swiper-container', {
|
||
autoplay: {
|
||
delay: 3000,
|
||
disableOnInteraction: false,
|
||
},
|
||
loop: true,
|
||
slidesPerView: 1,
|
||
spaceBetween: 0,
|
||
pagination: false,
|
||
navigation: false,
|
||
scrollbar: false,
|
||
on: {
|
||
resize: function ()
|
||
{
|
||
this.update();
|
||
},
|
||
},
|
||
});
|
||
swiper1 = new Swiper('.swiper-container-1', {
|
||
slidesPerView: 'auto', // 关键:让Swiper识别你设置的4.5rem宽度,不自动计算
|
||
freeMode: true, // 自由滑动,跟手
|
||
grabCursor: true, // 手势提示
|
||
touchMoveStopPropagation: true, // 防滑动穿透
|
||
spaceBetween: 10 // 图片间距(可选)
|
||
});
|
||
};
|
||
|
||
// 进度条动画 - 零HTML改动,仅优化性能
|
||
function animateProgressBars (container)
|
||
{
|
||
// 性能优化1:用WeakMap管理状态,避免污染DOM属性
|
||
const animationState = new WeakMap();
|
||
const state = animationState.get(container) || { isAnimating: false };
|
||
|
||
// 防止重复触发
|
||
if (state.isAnimating) return;
|
||
state.isAnimating = true;
|
||
animationState.set(container, state);
|
||
|
||
const progressFills = container.querySelectorAll('.progress-fill');
|
||
console.log(progressFills, '=progressFills=')
|
||
progressFills.forEach(fill =>
|
||
{
|
||
clearTimeout(fill._animateTimer);
|
||
// 性能优化2:重置用transform而非width
|
||
fill.style.transform = 'scaleX(0)';
|
||
// 性能优化3:用requestAnimationFrame替代setTimeout,对齐浏览器刷新
|
||
fill._animateTimer = requestAnimationFrame(() =>
|
||
{
|
||
const targetValue = fill.getAttribute('data-value');
|
||
console.log(targetValue, '=targetValue=')
|
||
console.log(fill.style)
|
||
// 性能优化4:用transform替代width,消除重排
|
||
fill.style.transform = `scaleX(${targetValue / 100})`;
|
||
});
|
||
});
|
||
}
|
||
function isElementInView (el)
|
||
{
|
||
const rect = el.getBoundingClientRect();
|
||
const viewportHeight = window.innerHeight;
|
||
const viewportWidth = window.innerWidth;
|
||
|
||
const intersects = (
|
||
rect.bottom > 0 &&
|
||
rect.top < viewportHeight &&
|
||
rect.right > 0 &&
|
||
rect.left < viewportWidth
|
||
);
|
||
if (!intersects) return false;
|
||
const visibleHeight = Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0);
|
||
const visibleWidth = Math.min(rect.right, viewportWidth) - Math.max(rect.left, 0);
|
||
const visibleRatio = (visibleHeight * visibleWidth) / (rect.height * rect.width);
|
||
return visibleRatio >= 0.1;
|
||
}
|
||
function isProgressContainerAbove (container)
|
||
{
|
||
const rect = container.getBoundingClientRect();
|
||
return rect.bottom <= 0 || isElementInView(container);
|
||
}
|
||
|
||
const debounce = (fn, delay = 16) =>
|
||
{
|
||
let timer = null;
|
||
return (isResize = false) =>
|
||
{
|
||
clearTimeout(timer);
|
||
timer = setTimeout(() => fn(isResize), delay);
|
||
};
|
||
};
|
||
|
||
// 修复1:修正选择器,匹配HTML中的.progress-section
|
||
const progressContainers = document.querySelectorAll('.progress-section');
|
||
const progressAnimatedMap = new Map();
|
||
const progressPermanentMap = new Map();
|
||
|
||
progressContainers.forEach(container =>
|
||
{
|
||
progressAnimatedMap.set(container, false);
|
||
progressPermanentMap.set(container, false);
|
||
});
|
||
|
||
const handleProgressScroll = debounce((isResize) =>
|
||
{
|
||
if (isResize) return;
|
||
|
||
progressContainers.forEach(container =>
|
||
{
|
||
if (progressPermanentMap.get(container)) return;
|
||
|
||
const isAnimated = progressAnimatedMap.get(container);
|
||
if (isElementInView(container) && !isAnimated) {
|
||
animateProgressBars(container);
|
||
progressAnimatedMap.set(container, true);
|
||
progressPermanentMap.set(container, true);
|
||
}
|
||
});
|
||
});
|
||
|
||
let progressResizeTimer = null;
|
||
const handleProgressResize = () =>
|
||
{
|
||
clearTimeout(progressResizeTimer);
|
||
progressResizeTimer = setTimeout(() =>
|
||
{
|
||
progressContainers.forEach(container =>
|
||
{
|
||
const isPermanent = progressPermanentMap.get(container);
|
||
if (isPermanent) {
|
||
const progressFills = container.querySelectorAll('.progress-fill');
|
||
progressFills.forEach(fill =>
|
||
{
|
||
clearTimeout(fill._animateTimer);
|
||
const targetValue = fill.getAttribute('data-value');
|
||
fill.style.transform = `scaleX(${targetValue / 100})`;
|
||
});
|
||
}
|
||
});
|
||
}, 200);
|
||
};
|
||
|
||
const initAllProgressContainers = () =>
|
||
{
|
||
setTimeout(() =>
|
||
{
|
||
progressContainers.forEach(container =>
|
||
{
|
||
if (!progressPermanentMap.get(container) && isProgressContainerAbove(container)) {
|
||
animateProgressBars(container);
|
||
progressAnimatedMap.set(container, true);
|
||
progressPermanentMap.set(container, true);
|
||
}
|
||
});
|
||
}, 100);
|
||
};
|
||
|
||
window.addEventListener('scroll', () => handleProgressScroll(false), { passive: true });
|
||
window.addEventListener('resize', handleProgressResize);
|
||
document.addEventListener('DOMContentLoaded', initAllProgressContainers);
|
||
|
||
|
||
// Tab切换
|
||
const tabItems = document.querySelectorAll('.tab-item');
|
||
const tabPanels = document.querySelectorAll('.tab-panel');
|
||
const tabPs = document.querySelectorAll('.tabs-p');
|
||
const tabT = document.querySelectorAll('.tab-t');
|
||
const indicator = document.querySelector('.tab-indicator');
|
||
const securityVideo = document.getElementById('securityVideo');
|
||
let prevIndex = 0;
|
||
const tabRects = [];
|
||
|
||
function cacheTabRects ()
|
||
{
|
||
tabRects.length = 0;
|
||
tabItems.forEach(item =>
|
||
{
|
||
tabRects.push({
|
||
left: item.offsetLeft,
|
||
width: item.offsetWidth
|
||
});
|
||
});
|
||
const initRect = tabRects[0];
|
||
indicator.style.width = initRect.width + 'px';
|
||
|
||
indicator.style.transform = `translateX(${initRect.left}px)`;
|
||
}
|
||
cacheTabRects();
|
||
function resetVideo ()
|
||
{
|
||
if (securityVideo) {
|
||
securityVideo.pause();
|
||
securityVideo.currentTime = 0;
|
||
}
|
||
}
|
||
|
||
function playVideo ()
|
||
{
|
||
if (securityVideo) {
|
||
securityVideo.muted = true;
|
||
securityVideo.play().catch(err =>
|
||
{
|
||
console.log('自动播放失败,请手动点击播放:', err);
|
||
});
|
||
}
|
||
}
|
||
tabItems.forEach(item =>
|
||
{
|
||
item.addEventListener('click', () =>
|
||
{
|
||
const index = parseInt(item.dataset.index);
|
||
if (index === prevIndex) return;
|
||
|
||
tabItems[prevIndex].classList.remove('active');
|
||
item.classList.add('active');
|
||
|
||
tabPanels[prevIndex].classList.remove('active');
|
||
tabPanels[index].classList.add('active');
|
||
|
||
tabPs[prevIndex].classList.remove('active');
|
||
tabPs[index].classList.add('active');
|
||
|
||
tabT[prevIndex].classList.remove('active');
|
||
tabT[index].classList.add('active');
|
||
|
||
if (index === 1) {
|
||
playVideo();
|
||
} else if (prevIndex === 1) {
|
||
resetVideo();
|
||
}
|
||
|
||
const rect = tabRects[index];
|
||
indicator.style.width = rect.width + 'px';
|
||
|
||
indicator.style.transform = `translateX(${rect.left}px)`;
|
||
|
||
prevIndex = index;
|
||
});
|
||
});
|
||
|
||
// 接口模块动画
|
||
(function ()
|
||
{
|
||
const TRIGGER_RATIO = 0.1;
|
||
let lastScrollY = window.scrollY;
|
||
let isResizing = false;
|
||
let resizeTimer = null;
|
||
|
||
const zoomContainer = document.getElementById('zoomContainer');
|
||
const annotations = document.querySelectorAll('.annotation');
|
||
const bgImg = document.getElementById('bgImg');
|
||
|
||
const elState = new Map();
|
||
if (zoomContainer) {
|
||
elState.set(zoomContainer, {
|
||
isInView: false,
|
||
isFadedIn: false
|
||
});
|
||
}
|
||
|
||
const isElementInView = (el) =>
|
||
{
|
||
const rect = el.getBoundingClientRect();
|
||
const viewportHeight = window.innerHeight;
|
||
const viewportWidth = window.innerWidth;
|
||
|
||
const intersects = (
|
||
rect.bottom > 0 &&
|
||
rect.top < viewportHeight &&
|
||
rect.right > 0 &&
|
||
rect.left < viewportWidth
|
||
);
|
||
|
||
if (!intersects) return false;
|
||
|
||
const visibleHeight = Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0);
|
||
const visibleWidth = Math.min(rect.right, viewportWidth) - Math.max(rect.left, 0);
|
||
const visibleRatio = (visibleHeight * visibleWidth) / (rect.height * rect.width);
|
||
|
||
return visibleRatio >= TRIGGER_RATIO;
|
||
};
|
||
|
||
const isElementAboveViewport = (el) =>
|
||
{
|
||
const rect = el.getBoundingClientRect();
|
||
return rect.bottom <= 0 || isElementInView(el);
|
||
};
|
||
|
||
const fadeInInterface = (el) =>
|
||
{
|
||
if (!el || elState.get(el).isFadedIn) return;
|
||
annotations.forEach(anno => anno.classList.add('anno-show'));
|
||
bgImg.classList.add('zoom-out');
|
||
elState.get(el).isFadedIn = true;
|
||
};
|
||
|
||
const hideInterface = (el) =>
|
||
{
|
||
if (isResizing) return;
|
||
if (!el || !elState.get(el).isFadedIn) return;
|
||
annotations.forEach(anno => anno.classList.remove('anno-show'));
|
||
bgImg.classList.remove('zoom-out');
|
||
elState.get(el).isFadedIn = false;
|
||
};
|
||
|
||
const debounce = (fn, delay = 16) =>
|
||
{
|
||
let timer = null;
|
||
return (isResize = false) =>
|
||
{
|
||
clearTimeout(timer);
|
||
isResizing = isResize;
|
||
timer = setTimeout(() =>
|
||
{
|
||
fn();
|
||
isResizing = false;
|
||
}, delay);
|
||
};
|
||
};
|
||
|
||
const handleScroll = debounce((isResize) =>
|
||
{
|
||
if (isResize) return;
|
||
|
||
const currentScrollY = window.scrollY;
|
||
const isScrollUp = currentScrollY < lastScrollY;
|
||
const isScrollDown = currentScrollY > lastScrollY;
|
||
|
||
if (!zoomContainer) return;
|
||
|
||
const prevInView = elState.get(zoomContainer).isInView;
|
||
const currentInView = isElementInView(zoomContainer);
|
||
elState.set(zoomContainer, { ...elState.get(zoomContainer), isInView: currentInView });
|
||
|
||
if (isScrollDown) {
|
||
if (currentInView && !prevInView) {
|
||
fadeInInterface(zoomContainer);
|
||
}
|
||
}
|
||
|
||
if (isScrollUp) {
|
||
if (!currentInView && prevInView) {
|
||
hideInterface(zoomContainer);
|
||
}
|
||
}
|
||
|
||
lastScrollY = currentScrollY;
|
||
});
|
||
|
||
const handleResize = () =>
|
||
{
|
||
clearTimeout(resizeTimer);
|
||
isResizing = true;
|
||
resizeTimer = setTimeout(() =>
|
||
{
|
||
isResizing = false;
|
||
if (zoomContainer && elState.get(zoomContainer).isFadedIn) {
|
||
annotations.forEach(anno => anno.classList.add('anno-show'));
|
||
bgImg.classList.add('zoom-out');
|
||
}
|
||
}, 200);
|
||
};
|
||
|
||
const initInterfaceElement = () =>
|
||
{
|
||
setTimeout(() =>
|
||
{
|
||
if (zoomContainer && isElementAboveViewport(zoomContainer)) {
|
||
fadeInInterface(zoomContainer);
|
||
}
|
||
}, 100);
|
||
};
|
||
|
||
window.addEventListener('scroll', () => handleScroll(false), { passive: true });
|
||
window.addEventListener('resize', handleResize);
|
||
window.addEventListener('load', initInterfaceElement);
|
||
document.addEventListener('DOMContentLoaded', initInterfaceElement);
|
||
})();
|
||
// 图片对比滑块
|
||
$(document).ready(function ()
|
||
{
|
||
$('.ba-slider').beforeAfter({
|
||
startPercent: 50,
|
||
handle: '.handle',
|
||
resize: '.resize'
|
||
});
|
||
});
|
||
|
||
// 视频自动播放(移除显隐逻辑,仅保留播放/暂停核心)
|
||
(function ()
|
||
{
|
||
const allVideos = document.querySelectorAll('.fs-video');
|
||
const fsBox = document.querySelector('.fs-box');
|
||
let isVideoPlaying = false;
|
||
let videoTip = null;
|
||
|
||
// 初始化视频提示
|
||
// const initVideoTip = () =>
|
||
// {
|
||
// if (!fsBox || videoTip) return;
|
||
// videoTip = document.createElement('div');
|
||
// videoTip.className = 'video-tip';
|
||
// videoTip.innerText = '点击播放视频';
|
||
// fsBox.appendChild(videoTip);
|
||
// videoTip.style.display = 'none';
|
||
// };
|
||
|
||
// 停止所有视频(仅暂停,无显隐)
|
||
function stopAllVideos ()
|
||
{
|
||
allVideos.forEach((video) =>
|
||
{
|
||
video.pause(); // 仅暂停,删除display修改
|
||
});
|
||
isVideoPlaying = false;
|
||
if (videoTip) videoTip.style.display = 'none';
|
||
}
|
||
|
||
// 播放指定视频(仅播放,无显隐)
|
||
const playTargetVideo = (video) =>
|
||
{
|
||
if (!video) return;
|
||
stopAllVideos();
|
||
|
||
// 强制静音+播放
|
||
video.muted = true;
|
||
video.play().then(() =>
|
||
{
|
||
isVideoPlaying = true;
|
||
if (videoTip) videoTip.style.display = 'none';
|
||
}).catch((err) =>
|
||
{
|
||
console.log('视频自动播放失败:', err);
|
||
if (videoTip) videoTip.style.display = 'block';
|
||
// 点击视频手动播放(仅执行一次)
|
||
video.addEventListener('click', () =>
|
||
{
|
||
video.play();
|
||
isVideoPlaying = true;
|
||
if (videoTip) videoTip.style.display = 'none';
|
||
}, { once: true });
|
||
});
|
||
};
|
||
|
||
// 可视区判断(优化触发时机)
|
||
const isFsBoxInView = () =>
|
||
{
|
||
if (!fsBox) return false;
|
||
const rect = fsBox.getBoundingClientRect();
|
||
return rect.top < window.innerHeight * 0.8 && rect.bottom > window.innerHeight * 0.2;
|
||
};
|
||
|
||
// 滚动处理(防抖+节流)
|
||
let lastVideoScrollTime = 0;
|
||
const handleVideoScroll = () =>
|
||
{
|
||
const now = Date.now();
|
||
if (now - lastVideoScrollTime < 50) return; // 节流50ms
|
||
lastVideoScrollTime = now;
|
||
|
||
if (isFsBoxInView() && !isVideoPlaying) {
|
||
const video = fsBox.querySelector('.fs-video');
|
||
playTargetVideo(video);
|
||
} else if (!isFsBoxInView() && isVideoPlaying) {
|
||
stopAllVideos();
|
||
}
|
||
};
|
||
|
||
// 页面交互后自动播放(仅执行一次)
|
||
document.addEventListener('click', () =>
|
||
{
|
||
if (isFsBoxInView() && !isVideoPlaying) {
|
||
const video = fsBox.querySelector('.fs-video');
|
||
playTargetVideo(video);
|
||
}
|
||
}, { once: true });
|
||
|
||
// 窗口缩放处理(移除显隐相关,仅保留状态判断)
|
||
let isVideoResizing = false;
|
||
let videoResizeTimer = null;
|
||
const handleVideoResize = () =>
|
||
{
|
||
clearTimeout(videoResizeTimer);
|
||
isVideoResizing = true;
|
||
videoResizeTimer = setTimeout(() =>
|
||
{
|
||
isVideoResizing = false;
|
||
// 移除显隐逻辑,仅保留状态标记
|
||
}, 200);
|
||
};
|
||
|
||
// 初始化执行
|
||
// initVideoTip();
|
||
window.addEventListener('scroll', handleVideoScroll, { passive: true });
|
||
window.addEventListener('resize', handleVideoResize);
|
||
// 页面加载完成后尝试播放视频
|
||
window.addEventListener('load', () =>
|
||
{
|
||
if (isFsBoxInView()) {
|
||
const video = fsBox.querySelector('.fs-video');
|
||
playTargetVideo(video);
|
||
}
|
||
});
|
||
})();
|
||
// 图片放大动效
|
||
document.addEventListener('DOMContentLoaded', function ()
|
||
{
|
||
const zoomImages = document.querySelectorAll('.zoom-image');
|
||
let isResizing = false;
|
||
let resizeTimer = null;
|
||
|
||
const isImageAboveViewport = (image) =>
|
||
{
|
||
const rect = image.getBoundingClientRect();
|
||
return rect.bottom <= 0 || (rect.top < window.innerHeight * (2 / 3) && rect.bottom > 0);
|
||
};
|
||
|
||
const debounce = (fn) =>
|
||
{
|
||
let timer = null;
|
||
return () =>
|
||
{
|
||
clearTimeout(timer);
|
||
timer = setTimeout(() =>
|
||
{
|
||
if (!isResizing) fn();
|
||
}, 16);
|
||
};
|
||
};
|
||
|
||
const handleScroll = debounce(() =>
|
||
{
|
||
zoomImages.forEach(image =>
|
||
{
|
||
const imageRect = image.getBoundingClientRect();
|
||
const windowHeight = window.innerHeight;
|
||
const triggerPoint = windowHeight * (2 / 3);
|
||
|
||
if (imageRect.top < triggerPoint && imageRect.bottom > 0) {
|
||
image.classList.add('active');
|
||
} else {
|
||
image.classList.remove('active');
|
||
}
|
||
});
|
||
});
|
||
|
||
const handleResize = () =>
|
||
{
|
||
clearTimeout(resizeTimer);
|
||
isResizing = true;
|
||
resizeTimer = setTimeout(() =>
|
||
{
|
||
isResizing = false;
|
||
zoomImages.forEach(image =>
|
||
{
|
||
if (image.classList.contains('active')) {
|
||
image.classList.add('active');
|
||
}
|
||
});
|
||
}, 200);
|
||
};
|
||
|
||
const initZoomImages = () =>
|
||
{
|
||
zoomImages.forEach(image =>
|
||
{
|
||
if (isImageAboveViewport(image)) {
|
||
image.classList.add('active');
|
||
}
|
||
});
|
||
};
|
||
|
||
window.addEventListener('scroll', handleScroll, { passive: true });
|
||
window.addEventListener('resize', handleResize);
|
||
window.addEventListener('load', initZoomImages);
|
||
document.addEventListener('DOMContentLoaded', initZoomImages);
|
||
window.dispatchEvent(new Event('scroll'));
|
||
});
|
||
</script>
|
||
{/block}
|