| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8" /> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 |
<title>Scroll Plugin 1</title> |
| 7 |
<link rel="stylesheet" href="/assets/main.css" /> |
| 8 |
<script src="/dist/Swup.umd.js"></script> |
| 9 |
<script src="https://unpkg.com/@swup/scroll-plugin@3"></script> |
| 10 |
<style> |
| 11 |
.scroll-anchors > * { |
| 12 |
display: block; |
| 13 |
margin: 1000px 0; |
| 14 |
} |
| 15 |
</style> |
| 16 |
</head> |
| 17 |
<body> |
| 18 |
<main id="swup" class="wrapper transition-default"> |
| 19 |
<h1>Scroll Plugin 1</h1> |
| 20 |
|
| 21 |
<p> |
| 22 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias assumenda |
| 23 |
consectetur consequatur enim esse incidunt iusto, magnam maxime molestias nisi |
| 24 |
perferendis perspiciatis quibusdam quos repellat, vel veniam vero voluptate |
| 25 |
voluptatem. |
| 26 |
</p> |
| 27 |
|
| 28 |
<h2>Anchors</h2> |
| 29 |
|
| 30 |
<div class="scroll-anchors"> |
| 31 |
<div id="anchor" data-testid="anchor">Anchor</div> |
| 32 |
<div id="anchor-by-id" data-testid="anchor-by-id">Anchor by id</div> |
| 33 |
<a name="anchor-by-name" data-testid="anchor-by-name">Anchor by name</a> |
| 34 |
<div id="anchor-%21" data-testid="anchor-encoded">Anchor with encoded ID</div> |
| 35 |
<div id="anchor-!" data-testid="anchor-unencoded">Anchor with unencoded ID</div> |
| 36 |
<div id="anchor:with:colon" data-testid="anchor-with-colon">Anchor with colon</div> |
| 37 |
<div id="anchor-with-unicode-テスト" data-testid="anchor-with-unicode"> |
| 38 |
Anchor with unicode |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
|
| 42 |
<p> |
| 43 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias assumenda consectetur |
| 44 |
consequatur enim esse incidunt iusto, magnam maxime molestias nisi perferendis |
| 45 |
perspiciatis quibusdam quos repellat, vel veniam vero voluptate voluptatem. |
| 46 |
</p> |
| 47 |
|
| 48 |
<h2>Links</h2> |
| 49 |
|
| 50 |
<ul> |
| 51 |
<li> |
| 52 |
<a href="/plugins/scroll-plugin/page-2.html" data-testid="link-to-page" |
| 53 |
>Link to page</a |
| 54 |
> |
| 55 |
</li> |
| 56 |
<li> |
| 57 |
<a href="#anchor" data-testid="link-to-anchor">Link to anchor</a> |
| 58 |
</li> |
| 59 |
<li> |
| 60 |
<a href="#top" data-testid="link-to-top">Link to top</a> |
| 61 |
</li> |
| 62 |
<li> |
| 63 |
<a |
| 64 |
href="/plugins/scroll-plugin/page-1.html#anchor" |
| 65 |
data-testid="link-to-self-anchor" |
| 66 |
>Link to self with anchor</a |
| 67 |
> |
| 68 |
</li> |
| 69 |
<li> |
| 70 |
<a |
| 71 |
href="/plugins/scroll-plugin/page-2.html#anchor" |
| 72 |
data-testid="link-to-page-anchor" |
| 73 |
>Link to page with anchor</a |
| 74 |
> |
| 75 |
</li> |
| 76 |
<li> |
| 77 |
<a href="#anchor-by-id" data-testid="link-to-anchor-by-id" |
| 78 |
>Link to anchor by id</a |
| 79 |
> |
| 80 |
</li> |
| 81 |
<li> |
| 82 |
<a href="#anchor-by-name" data-testid="link-to-anchor-by-name" |
| 83 |
>Link to anchor by name</a |
| 84 |
> |
| 85 |
</li> |
| 86 |
<li> |
| 87 |
<a href="#anchor-%21" data-testid="link-to-anchor-encoded" |
| 88 |
>Link to anchor with url-encoding</a |
| 89 |
> |
| 90 |
</li> |
| 91 |
<li> |
| 92 |
<a href="#anchor-!" data-testid="link-to-anchor-unencoded" |
| 93 |
>Link to anchor without url-encoding</a |
| 94 |
> |
| 95 |
</li> |
| 96 |
<li> |
| 97 |
<a href="#anchor:with:colon" data-testid="link-to-anchor-with-colon" |
| 98 |
>Link to anchor with colon</a |
| 99 |
> |
| 100 |
</li> |
| 101 |
<li> |
| 102 |
<a href="#anchor-with-unicode-テスト" data-testid="link-to-anchor-with-unicode" |
| 103 |
>Link to anchor with unicode</a |
| 104 |
> |
| 105 |
</li> |
| 106 |
</ul> |
| 107 |
</main> |
| 108 |
<script> |
| 109 |
window._swup = new Swup({ |
| 110 |
plugins: [new SwupScrollPlugin({ scrollFriction: 0.1, scrollAcceleration: 0.2 })] |
| 111 |
}); |
| 112 |
</script> |
| 113 |
</body> |
| 114 |
</html> |