1
0
mirror of https://github.com/twirl/The-API-Book.git synced 2025-05-13 21:26:26 +02:00

163 lines
4.9 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>
“The API” book by Sergey Konstantinov. Examples to the “Decomposing
UI Components” chapter.
</title>
2023-08-27 22:58:31 +03:00
<link rel="stylesheet" type="text/css" href="../../assets/fonts.css" />
2023-07-30 15:25:21 +03:00
<link rel="icon" type="image/png" href="../../assets/favicon.png" />
<script
type="text/javascript"
src="../../assets/monaco-editor/dev/vs/loader.js"
></script>
<style>
2023-08-27 22:58:31 +03:00
:root {
--example-list-width: 200px;
2023-09-02 23:45:04 +03:00
--live-example-width: 400px;
2023-08-27 22:58:31 +03:00
}
* {
box-sizing: border-box;
}
2023-07-30 15:25:21 +03:00
2023-08-27 22:58:31 +03:00
html,
body {
height: 100%;
2023-07-30 23:04:39 +03:00
margin: 0;
padding: 0;
}
header {
2023-08-27 22:58:31 +03:00
margin: 8px;
2023-07-30 23:04:39 +03:00
}
2023-08-27 22:58:31 +03:00
body {
display: flex;
flex-direction: column;
gap: 8px;
2023-07-30 15:25:21 +03:00
}
2023-08-27 22:58:31 +03:00
p {
margin: 0;
2023-07-30 15:25:21 +03:00
}
2023-08-27 22:58:31 +03:00
#playground {
display: flex;
flex-direction: row-reverse;
gap: 8px;
flex-grow: 1;
2023-07-30 15:25:21 +03:00
}
2023-08-27 22:58:31 +03:00
#live-example {
width: var(--live-example-width);
}
2023-07-30 15:25:21 +03:00
#examples {
2023-08-27 22:58:31 +03:00
display: flex;
width: calc(100% - var(--live-example-width) - 16px);
2023-07-30 15:25:21 +03:00
}
2023-08-27 22:58:31 +03:00
#example-list {
width: var(--example-list-width);
font-size: 80%;
list-style-type: none;
margin: 0;
padding: 0;
2023-07-30 15:25:21 +03:00
}
2023-08-27 22:58:31 +03:00
#example-list li {
border: 2px solid rgba(80, 80, 80, 0.2);
margin: 4px 0;
padding: 2px;
}
#example-list li.selected {
border: 2px solid black;
}
#example-list a {
display: block;
text-decoration: none;
color: inherit;
}
#editor {
min-width: 0 !important;
2023-07-30 23:04:39 +03:00
min-height: 500px;
2023-09-03 23:25:01 +03:00
width: calc(100% - var(--example-list-width) - 16);
2023-08-27 22:58:31 +03:00
float: none;
flex: 1 0 auto;
2023-07-30 15:25:21 +03:00
}
#live-example iframe {
border: none;
margin: 0;
padding: 0;
width: 390px;
height: 500px;
overflow: hidden;
}
</style>
<script src="sandbox.js"></script>
</head>
<body>
2023-07-30 23:04:39 +03:00
<header>
<p>
Studying materials for
<strong
><a href="https://twirl.github.io/The-API-Book/"
>“The API” book</a
>
by Sergey Konstantinov.</strong
>
</p>
<p>
2023-08-01 01:25:30 +03:00
<a
href="https://twirl.github.io/The-API-Book/API.en.html#chapter-44"
2023-08-27 22:58:31 +03:00
>Chapter 44: Problems of Introducing UI Components</a
2023-07-30 23:04:39 +03:00
>. Find the source code of the components and additional tasks
for self-study at the
<a
href="https://github.com/twirl/The-API-Book/tree/gh-pages/docs/examples/01.%20Decomposing%20UI%20Components"
>Github repository.</a
>
</p>
</header>
2023-07-30 15:25:21 +03:00
<div id="playground">
<div id="live-example">
<div>Live example <button id="refresh">Refresh</button></div>
<hr />
</div>
<div id="examples">
<ul id="example-list">
2023-07-30 23:04:39 +03:00
<li id="example-00">
<a href="javascript:showExample('00')"
>The reference: A regular <code>SearchBox</code></a
>
</li>
2023-07-30 15:25:21 +03:00
<li id="example-01">
<a href="javascript:showExample('01')"
2023-08-01 01:25:30 +03:00
>Example #1: A <code>SearchBox</code> with a map</a
2023-07-30 15:25:21 +03:00
>
</li>
<li id="example-02">
<a href="javascript:showExample('02')"
2023-08-01 01:25:30 +03:00
>Example #2: A <code>SearchBox</code> with in-place
actions</a
2023-07-30 15:25:21 +03:00
>
</li>
<li id="example-03">
<a href="javascript:showExample('03')"
2023-08-01 01:25:30 +03:00
>Example #3: A <code>SearchBox</code> with custom
buttons</a
2023-07-30 15:25:21 +03:00
>
</li>
</ul>
<div id="editor"></div>
</div>
</div>
</body>
</html>