mouette/index.html

217 lines
No EOL
9.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Hello, world!</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="dist/mouette.min.css" />
<link
rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🐦</text></svg>"
/>
</head>
<body class="wrapper">
<nav class="toolbar">
<ul class="menu horizontal">
<li><a href="#">Home</a></li>
<li><a href="#">Mouette</a></li>
<li><span class="active">Exemple</span></li>
</ul>
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#" class="button">Mouette</a></li>
</ul>
</nav>
<header>
<h1>Hello, world!</h1>
</header>
<nav>
<ul class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Mouette</a></li>
<li><span class="active">Exemple</span></li>
</ul>
</nav>
<div class="alert"><p>Lorem ipsum dolor sit amet, consectetur <a href="#">adipiscing</a> elit, sed do. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do. </p></div>
<p>Lorem ipsum dolor sit amet, <mark>consectetur adipiscing elit</mark>, sed do. </p>
<hr />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do. Lorem <a href="#">ipsum dolor</a> sit amet, consectetur adipiscing elit, sed do. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do. </p>
<p>
<button>Bouton</button>
<a href="#" class="button">Bouton lien</a>
<a class="button">Bouton non cliquable mais lien</a>
<span class="button">Bouton span</span>
<br />
<button disabled>Bouton disabled</button>
<a href="#" class="button disabled">Bouton lien disabled</a>
<br />
<a href="#" class="badge">Badge lien</a>
<span class="badge">Badge span</span>
<br />
<a href="#" class="button link">Bouton lien .link</a>
<br />
<div class="button-group">
<button>Bouton (groupé)</button>
<a href="#" class="button">Bouton lien</a>
<a href="#" class="button">Bouton lien</a>
<button>Bouton</button>
</div>
</p>
<main>
<section>
<ul>
<li>Test 1</li>
<li>Test 1</li>
<li>Test 1</li>
<li>Test 1</li>
</ul>
</section>
<section>
<ol>
<li>Test 2</li>
<li>Test 2</li>
<li>Test 2</li>
<li>Test 2</li>
</ol>
</section>
<section></section>
</main>
<form action="#">
<input type="submit" value="Submit">
</form>
<table class="centered">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
<td>Row 1, Column 3</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
<td>Row 2, Column 3</td>
</tr>
</table>
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Row 1, Column 1</th>
<th>Row 1, Column 2</th>
<th>Row 1, Column 3</th>
</tr>
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
<td>Row 1, Column 3</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
<td>Row 2, Column 3</td>
</tr>
</table>
<table>
<thead>
<tr>
<th>Row 1, Column 1</th>
<th>Row 1, Column 2</th>
<th>Row 1, Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
<td>Row 1, Column 3</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
<td>Row 2, Column 3</td>
</tr>
</tbody>
</table>
<div class="accordion">
<details name="reqs">
<summary>Graduation Requirements</summary>
<p class="tab-content">
Requires 40 credits, including a passing grade in health, geography,
history, economics, and wood shop.
</p>
</details>
<details name="reqs">
<summary>System Requirements</summary>
<p class="tab-content">
Requires a computer running an operating system. The computer must have some
memory and ideally some kind of long-term storage. An input device as well
as some form of output device is recommended.
</p>
</details>
<details name="reqs">
<summary>Job Requirements</summary>
<p class="tab-content">
Requires knowledge of HTML, CSS, JavaScript, accessibility, web performance,
privacy, security, and internationalization, as well as a dislike of
broccoli.
</p>
</details>
</div>
<div class="tabs">
<details open name="tabs"> <!-- default first "tab" to open -->
<summary>Tag</summary>
<div class="content">
<p>Imagine an <strong>accordion-like element</strong> with <strong>native keyboard support</strong> that doesn't require javascript for control.</p>
<p>Enter the details tag.</p>
<details>
<summary>The details tag</summary>
<p>This is a details tag with content</p>
</details>
<p>The details tag gives us a simple accordion with no scripts&mdash;that's great! But it feels like it could be something more...imagine if it could do tabs.</p>
</div>
</details>
<details name="tabs">
<summary>Tabs ?</summary>
<div class="content">
<p>Tabs and accordions work in technically the same way, although tabs typically require a shared parent container and containers to build out the tabs and content separate from each other.</p>
<p>Interactivity is another difference: the ways accordions or tabs are toggled. With accordions it's common to be able to open and close them individually, but with tabs there must always be one, and only one, open.</p>
<p>At first glance there doesn't seem to be a way to make this work. The structure isn't right. The layout isn't right. The functionality isn't quite right. But each of those problems can be solved if we look a bit closer.</p>
</div>
</details>
<details name="tabs">
<summary>CSS</summary>
<div class="content">
<p>With a little help from the <strong>display: contents;</strong> property, we can transform a group of discrete details tags with tab and content area elements as children, into a group of the tab and content area elements from all the details elements mixed together.</p>
<p>Say you had 3 small buckets of red and blue balls. The buckets can interact with each other or bang together, but the balls inside each bucket can't interact with the balls from the other buckets.</p>
<p>You could think of what we are doing like pouring all of the small buckets into a larger bucket. Now all of the balls can interact with each other and we can organize them by color in the bigger bucket. With display: contents; it's as if the details tag isn't there at all&mdash;at least visually.</p>
<p>Now that all the tab and content area elements can interact with each other in the flow of the page, we can use <strong>display: flex;</strong> and <strong>order</strong> to make the tabs flow nicely but also be separate from the content area.</p>
<p>And that's what you see here! Open up the inspector and have a look.</p>
</div>
</details>
<details name="tabs">
<summary>Javascript</summary>
<div class="content">
<p>So you might have thought we could get by without any JS, but we need it a little. Luckily it's the type of script that you can write once and reuse without reconfiguration.</p>
<p>The default functionality of the details tab means that it can be toggled open or closed. That's not what we want for tabs. Each details tag must be manually closed and then another opened. We want a tab to stay open and then close when another is picked.</p>
<p>By watching for attribute changes and blocking keyboard and mouse input from toggling a details tab when a tab is open, we can emulate the expected tab behavior.</p>
<p>Then it's just a matter of toggling the sibling details tags when another is selected.</p>
</div>
</details>
</div>
<img src="https://via.placeholder.com/800x600/" alt="">
<nav>
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">Mouette</a></li>
<li><span class="active">Exemple</span></li>
</ul>
</nav>
<footer>
<small>©
<script>document.write(new Date().getFullYear())</script> Your company name. All Rights Reserved.
</small>
</footer>
</body>
</html>