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

163 lines
4.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>
“The API” book by Sergey Konstantinov. Examples to the “Decomposing
UI Components” chapter.
</title>
<link rel="stylesheet" type="text/css" href="../../assets/fonts.css" />
<link rel="icon" type="image/png" href="../../assets/favicon.png" />
<script
type="text/javascript"
src="../../assets/monaco-editor/dev/vs/loader.js"
></script>
<style>
:root {
--example-list-width: 200px;
--live-example-width: 400px;
}
* {
box-sizing: border-box;
}
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
header {
margin: 8px;
}
body {
display: flex;
flex-direction: column;
gap: 8px;
}
p {
margin: 0;
}
#playground {
display: flex;
flex-direction: row-reverse;
gap: 8px;
flex-grow: 1;
}
#live-example {
width: var(--live-example-width);
}
#examples {
display: flex;
width: calc(100% - var(--live-example-width) - 16px);
}
#example-list {
width: var(--example-list-width);
font-size: 80%;
list-style-type: none;
margin: 0;
padding: 0;
}
#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;
min-height: 500px;
width: calc(100% - var(--example-list-width) - 16);
float: none;
flex: 1 0 auto;
}
#live-example iframe {
border: none;
margin: 0;
padding: 0;
width: 390px;
height: 500px;
overflow: hidden;
}
</style>
<script src="sandbox.js"></script>
</head>
<body>
<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>
<a
href="https://twirl.github.io/The-API-Book/API.en.html#chapter-44"
>Chapter 44: Problems of Introducing UI Components</a
>. 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>
<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">
<li id="example-00">
<a href="javascript:showExample('00')"
>The reference: A regular <code>SearchBox</code></a
>
</li>
<li id="example-01">
<a href="javascript:showExample('01')"
>Example #1: A <code>SearchBox</code> with a map</a
>
</li>
<li id="example-02">
<a href="javascript:showExample('02')"
>Example #2: A <code>SearchBox</code> with in-place
actions</a
>
</li>
<li id="example-03">
<a href="javascript:showExample('03')"
>Example #3: A <code>SearchBox</code> with custom
buttons</a
>
</li>
</ul>
<div id="editor"></div>
</div>
</div>
</body>
</html>