-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5b33df
commit b4b9f5f
Showing
1 changed file
with
3 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,11 @@ | ||
<script> | ||
import { onMount, onDestroy } from 'svelte'; | ||
let adClass = 'wwads-horizontal'; // 默认类名 | ||
function handleResize() { | ||
if (window.innerWidth < 1280) { // XL 断点 | ||
adClass = 'wwads-vertical'; | ||
} else { | ||
adClass = 'wwads-horizontal'; | ||
} | ||
} | ||
onMount(() => { | ||
handleResize(); // 初始检查 | ||
window.addEventListener('resize', handleResize); // 添加监听器 | ||
}); | ||
onDestroy(() => { | ||
window.removeEventListener('resize', handleResize); // 清理监听器 | ||
}); | ||
// WWAD | ||
</script> | ||
|
||
<div class="flex xl:flex-col not-content"> | ||
<div class="w-full xl:flex-1"> | ||
<div class="max-w-full xl:max-w-[12rem] w-full pt-4 px-4 text-sm leading-6"> | ||
<div class={"wwads-cn " + adClass + " wwads-sticky"} data-id="135" style="min-height: 0; margin-top: 0; border-width: 1px; border-radius: 0.5rem"></div> | ||
<div class="w-full pt-4 px-4 text-sm leading-6"> | ||
<div class="wwads-cn wwads-horizontal xl:wwads-vertical wwads-sticky max-w-full xl:max-w-[12rem]" data-id="135" style="min-height: 0; margin-top: 0; border-width: 1px; border-radius: 0.5rem"></div> | ||
</div> | ||
</div> | ||
</div> |