You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

182 lines
7.2 KiB

<!DOCTYPE html>
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cover - UIkit tests</title>
<script src="js/test.js"></script>
<style type="text/css">
.test-height { height: 300px; }
</style>
</head>
<body>
<div class="uk-container">
<h1>Cover</h1>
<h2>Fixed Height</h2>
<div class="uk-child-width-1-2@m" uk-grid>
<div>
<h3>Image</h3>
<div class="test-height uk-cover-container uk-light">
<img src="images/photo.jpg" alt="" uk-cover>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
<div>
<h3>Video</h3>
<div class="test-height uk-cover-container uk-light">
<video autoplay loop muted playsinline uk-cover>
<source src="https://quirksmode.org/html5/videos/big_buck_bunny.mp4" type="video/mp4">
<source src="https://quirksmode.org/html5/videos/big_buck_bunny.ogv" type="video/ogg">
</video>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
<div>
<h3>Iframe (YouTube)</h3>
<div class="test-height uk-cover-container uk-light">
<iframe src="https://www.youtube-nocookie.com/embed/YE7VzlLtp-4?autoplay=1&amp;controls=0&amp;showinfo=0&amp;rel=0&amp;loop=1&amp;modestbranding=1&amp;wmode=transparent&amp;playsinline=1" width="560" height="315" frameborder="0" allowfullscreen uk-cover></iframe>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
<div>
<h3>Iframe (Vimeo)</h3>
<div class="test-height uk-cover-container uk-light">
<iframe src="https://player.vimeo.com/video/1084537?title=0&amp;byline=0&amp;autoplay=1&amp;loop=1&amp;setVolume=0" width="500" height="281" frameborder="0" allowfullscreen uk-cover></iframe>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
</div>
<h2>Responsive Height</h2>
<div class="uk-child-width-1-2@m" uk-grid>
<div>
<h3>Video (JS)</h3>
<div class="uk-cover-container uk-light">
<canvas width="600" height="400"></canvas>
<video autoplay loop muted playsinline uk-cover>
<source src="https://quirksmode.org/html5/videos/big_buck_bunny.mp4?test2" type="video/mp4">
<source src="https://quirksmode.org/html5/videos/big_buck_bunny.ogv?test2" type="video/ogg">
</video>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
<div>
<h3>Iframe (YouTube)</h3>
<div class="uk-cover-container uk-light">
<canvas width="600" height="400"></canvas>
<iframe src="https://www.youtube-nocookie.com/embed/YE7VzlLtp-4?autoplay=1&amp;controls=0&amp;showinfo=0&amp;rel=0&amp;loop=1&amp;modestbranding=1&amp;wmode=transparent&amp;playsinline=1" width="560" height="315" frameborder="0" allowfullscreen uk-cover></iframe>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
</div>
<h2>Viewport Height</h2>
<div class="uk-child-width-1-2@m" uk-grid>
<div>
<h3>Video (JS)</h3>
<div class="uk-cover-container uk-light" uk-height-viewport>
<video autoplay loop muted playsinline uk-cover>
<source src="https://quirksmode.org/html5/videos/big_buck_bunny.mp4?test3" type="video/mp4">
<source src="https://quirksmode.org/html5/videos/big_buck_bunny.ogv?test3" type="video/ogg">
</video>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
<div>
<h3>Iframe (YouTube)</h3>
<div class="uk-cover-container uk-light" uk-height-viewport>
<iframe src="https://www.youtube-nocookie.com/embed/YE7VzlLtp-4?autoplay=1&amp;controls=0&amp;showinfo=0&amp;rel=0&amp;loop=1&amp;modestbranding=1&amp;wmode=transparent&amp;playsinline=1" width="560" height="315" frameborder="0" allowfullscreen uk-cover></iframe>
<div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle">
<h1>Heading</h1>
</div>
</div>
</div>
</div>
<h2>JavaScript Options</h2>
<div class="uk-overflow-auto">
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>automute</code></td>
<td>Boolean</td>
<td>true</td>
<td>Automutes the video.</td>
</tr>
<tr>
<td><code>width</code></td>
<td>Number</td>
<td>undefined</td>
<td>The element's width.</td>
</tr>
<tr>
<td><code>height</code></td>
<td>Number</td>
<td>undefined</td>
<td>The element's height.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>