Skip to content

Commit a2d6650

Browse files
committed
refactor: 更新示例文档
1 parent 235f38a commit a2d6650

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/BootstrapBlazor.Server/Components/Samples/IntersectionObservers.razor

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
@inject IStringLocalizer<IntersectionObservers> Localizer
33
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
44

5+
<HeadContent>
6+
<style>
7+
.bb-video video {
8+
width: 256px;
9+
}
10+
11+
@@media (min-width: 767.99px) {
12+
.bb-video video {
13+
width: 350px;
14+
}
15+
}
16+
</style>
17+
</HeadContent>
18+
519
<h3>@Localizer["IntersectionObserverTitle"]</h3>
620

721
<h4>@Localizer["IntersectionObserverDescription"]</h4>
@@ -56,23 +70,10 @@
5670
<DemoBlock Title="@Localizer["IntersectionObserverVisibleTitle"]"
5771
Introduction="@Localizer["IntersectionObserverVisibleIntro"]"
5872
Name="Visible">
59-
<HeadContent>
60-
<style>
61-
.bb-video video {
62-
width: 256px;
63-
}
64-
65-
@@media (min-width: 767.99px) {
66-
.bb-video video {
67-
width: 350px;
68-
}
69-
}
70-
</style>
71-
</HeadContent>
7273
<section ignore>
7374
<p>@((MarkupString)Localizer["IntersectionObserverVisibleDesc"].Value)</p>
75+
<div class="text-center @_textColorString">@_videoStateString</div>
7476
</section>
75-
<p class="text-center @_textColorString">@_videoStateString</p>
7677
<IntersectionObserver OnIntersecting="OnVisibleChanged" Threshold="1" AutoUnobserveWhenIntersection="false">
7778
<div class="bb-video-demo scroll">
7879
<div class="bb-video">
@@ -87,8 +88,10 @@
8788
<DemoBlock Title="@Localizer["IntersectionObserverThresholdTitle"]"
8889
Introduction="@Localizer["IntersectionObserverThresholdIntro"]"
8990
Name="Threshold">
90-
<section ignore><p>@((MarkupString)Localizer["IntersectionObserverThresholdDesc"].Value)</p></section>
91-
<p class="text-center">@_thresholdValueString</p>
91+
<section ignore>
92+
<p>@((MarkupString)Localizer["IntersectionObserverThresholdDesc"].Value)</p>
93+
<div class="text-center">@_thresholdValueString</div>
94+
</section>
9295
<IntersectionObserver OnIntersecting="OnThresholdChanged" Threshold="0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1" AutoUnobserveWhenIntersection="false">
9396
<div class="bb-list-load scroll" style="height: 200px;">
9497
<div class="d-flex" style="height: 600px; justify-content: center; align-items: center;">

0 commit comments

Comments
 (0)