first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View File

@ -0,0 +1,63 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
.other { height: 300px; color: #FFF; }
.other div {
position: absolute;
bottom: 0;
width: 100%;
background: #000;
background: rgba(0,0,0,0.7);
}
.other div p { padding: 10px; }
</style>
</head>
<body>
<div class="container">
<h1>Basic Demo</h1>
<p>In its simplest form, Backstretch can be called by passing in the path to an image, and it will be applied to the page's <code>body</code>.</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch(&quot;pot-holder.jpg&quot;);
&lt;/script&gt;</pre>
<h2>Other Elements</h2>
<p>Or, if you'd like, you can also attach Backstretch to another block level element on the page.</p>
<div class="other">
<div><p>The background image on this element was set using Backstretch.</p></div>
</div>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$(&quot;.other&quot;).backstretch(&quot;coffee.jpg&quot;);
&lt;/script&gt;</pre>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch(["pot-holder.jpg"]);
$(".other").backstretch("coffee.jpg");
</script>
</body>
</html>

View File

@ -0,0 +1,67 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
</style>
</head>
<body>
<div class="container">
<h1>Click Demo</h1>
<p>This demonstrates a commonly-asked question: how do I replace Backstretch's image once it's been called? The simple answer is, you can just call Backstretch again, and the image will be replaced.</p>
<p><em>Note: Any options that you previously passed in will be preserved.</em></p>
<p>
<input type="button" id="pot-holder" value="Show Pot Holder Background" />
<input type="button" id="coffee" value="Show Coffee Background" />
</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch(&quot;pot-holder.jpg&quot;, {speed: 500});
$(&quot;#pot-holder&quot;).click(function (e) {
e.preventDefault();
$.backstretch(&quot;pot-holder.jpg&quot;);
});
$(&quot;#coffee&quot;).click(function (e) {
e.preventDefault();
$.backstretch(&quot;coffee.jpg&quot;);
});
&lt;/script&gt;</pre>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch("pot-holder.jpg", {fade: 500});
$("#pot-holder").click(function (e) {
e.preventDefault();
$.backstretch("pot-holder.jpg");
});
$("#coffee").click(function (e) {
e.preventDefault();
$.backstretch("coffee.jpg");
});
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 KiB

View File

@ -0,0 +1,60 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
</style>
</head>
<body>
<div class="container">
<h1>Slideshow Demo (with lazy-loading)</h1>
<p>This demonstrates how to use a Backstretch slideshow with <b>lazy-loading</b>.</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch([
&quot;pot-holder.jpg&quot;,
&quot;coffee.jpg&quot;,
&quot;dome.jpg&quot;
], {
fade: 750,
duration: 4000,
<b>preload: 1</b>, //Use the lazy-loading functionality
<em>start: 2</em> //Optional - now starts with "dome.jpg"
});
&lt;/script&gt;</pre>
<p><b>Hint:</b> Check the "Network"-Panel in your browser.</p>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch([
"pot-holder.jpg",
"coffee.jpg",
"dome.jpg"
], {
fade: 750,
duration: 4000,
preload: 0,
start: 2
});
</script>
</body>
</html>

View File

@ -0,0 +1,73 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
</style>
</head>
<body>
<div class="container">
<h1>Multiple Resolutions Demo</h1>
<p>
In order to change the image based on the resolution, we can specify a set of images for each item in the slideshow.<br />
Each item specifies a <code>width</code> and a <code>url</code>, where the <code>width</code> is the <b>minimum</b> width of the screen for this specific image.<br />
If we have an image of with 1920px, and we want it to be used between screen widths of 1280 and 1920, we'll specify a <code>width</code> of 1280.
</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch([
[
{ &quot;width&quot;: 1280, &quot;url&quot;: &quot;sample1_1920.jpg&quot; },
{ &quot;width&quot;: 960, &quot;url&quot;: &quot;sample1_1280.jpg&quot; },
{ &quot;width&quot;: 480, &quot;url&quot;: &quot;sample1_960.jpg&quot; },
{ &quot;width&quot;: 0, &quot;url&quot;: &quot;sample1_480.jpg&quot; }
],
[
{ &quot;width&quot;: 1280, &quot;url&quot;: &quot;sample2_1920.jpg&quot; },
{ &quot;width&quot;: 960, &quot;url&quot;: &quot;sample2_1280.jpg&quot; },
{ &quot;width&quot;: 480, &quot;url&quot;: &quot;sample2_960.jpg&quot; },
{ &quot;width&quot;: 0, &quot;url&quot;: &quot;sample2_480.jpg&quot; }
]
]);
&lt;/script&gt;</pre>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch([
[
{ "width": 1920, "url": "sample1_1920.jpg" },
{ "width": 1280, "url": "sample1_1280.jpg" },
{ "width": 960, "url": "sample1_960.jpg" },
{ "width": 480, "url": "sample1_480.jpg" }
],
[
{ "width": 1920, "url": "sample2_1920.jpg" },
{ "width": 1280, "url": "sample2_1280.jpg" },
{ "width": 960, "url": "sample2_960.jpg" },
{ "width": 480, "url": "sample2_480.jpg" }
]
]);
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 KiB

View File

@ -0,0 +1,55 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
</style>
</head>
<body>
<div class="container">
<h1>Slideshow Demo</h1>
<p>This demonstrates a commonly-asked question: how do I use Backstretch to create a slideshow of background images? Easy! Just pass in an array of image paths.</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch([
&quot;pot-holder.jpg&quot;,
&quot;coffee.jpg&quot;,
&quot;dome.jpg&quot;
], {
fade: 750,
duration: 4000
});
&lt;/script&gt;</pre>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch([
"pot-holder.jpg",
"coffee.jpg",
"dome.jpg"
], {
fade: 750,
duration: 4000
});
</script>
</body>
</html>

View File

@ -0,0 +1,57 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
</style>
</head>
<body>
<div class="container">
<h1>Slideshow Demo</h1>
<p>This demonstrates a multiple random transitions.</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch([
&quot;pot-holder.jpg&quot;,
&quot;coffee.jpg&quot;,
&quot;dome.jpg&quot;
], {
duration: 4000,
transition: 'push_left|push_right|cover_up|cover_down|fade',
transitionDuration: 250
});
&lt;/script&gt;</pre>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch([
"pot-holder.jpg",
"coffee.jpg",
"dome.jpg"
], {
duration: 4000,
transition: 'push_left|push_right|cover_up|cover_down|fade',
transitionDuration: 250
});
</script>
</body>
</html>

View File

@ -0,0 +1,57 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body { font-family: Helvetica, Arial, sans-serif; line-height: 1.3em; -webkit-font-smoothing: antialiased; }
.container {
width: 90%;
margin: 20px auto;
background-color: #FFF;
padding: 20px;
}
pre, code {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre { border: 1px solid #CCC; background-color: #EEE; color: #333; padding: 10px; overflow: scroll; }
code { padding: 2px 4px; background-color: #F7F7F9; border: 1px solid #E1E1E8; color: #D14; }
</style>
</head>
<body>
<div class="container" style="opacity: 0.7">
<h1>Slideshow Demo</h1>
<p>This demonstrates a usage of backstretch with mixed images and youtube videos.</p>
<pre>&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;jquery.backstretch.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$.backstretch([
{ url: &quot;https://www.youtube.com/watch?v=a7nXUqGBdRQ&quot;, duration: 7000, mute: false, alignY: 0 },
&quot;https://www.youtube.com/watch?v=Nq0Ddu2EwFQ&quot;,
&quot;pot-holder.jpg&quot;
], {
fade: 750,
duration: 4000,
preload: 5
});
&lt;/script&gt;</pre>
</div>
<script src="../libs/jquery/jquery.js"></script>
<script src="../src/jquery.backstretch.js"></script>
<script>
$.backstretch([
{ url: "https://www.youtube.com/watch?v=a7nXUqGBdRQ", duration: 7000, mute: false, alignY: 0 },
"https://www.youtube.com/watch?v=Nq0Ddu2EwFQ",
"pot-holder.jpg"
], {
fade: 750,
duration: 4000,
preload: 5
});
</script>
</body>
</html>