summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-27 09:38:35 +0100
committerMartin Fischer <martin@push-f.com>2021-11-27 12:53:39 +0100
commit49a32ffc906ac66b30bab56c450e8f9cb4f85866 (patch)
tree1999cd8a892468ac73a07b8a4c31c7406666693f
parentb60d58b4875aea58106c65faa2753dede70152f1 (diff)
search: start implementing search
-rwxr-xr-xbuild.py1
-rw-r--r--head.html8
-rw-r--r--script.js6
-rw-r--r--style.css15
4 files changed, 29 insertions, 1 deletions
diff --git a/build.py b/build.py
index 5f800c2..4386aca 100755
--- a/build.py
+++ b/build.py
@@ -32,6 +32,7 @@ unstable_features = get_features('unstable')
os.makedirs('target', exist_ok=True)
shutil.copy('style.css', 'target')
+shutil.copy('script.js', 'target')
with open('target/data.json', 'w') as f:
json.dump(dict(unstable=unstable_features, versions=versions), f)
diff --git a/head.html b/head.html
index f0782e8..565f66f 100644
--- a/head.html
+++ b/head.html
@@ -7,7 +7,13 @@
</head>
<body>
-<h1>Rust features</h1>
+<div class=header>
+<div class=left><h1>Rust features</h1></div>
+<input id=search autofocus autocomplete=off>
+<script src=script.js></script>
+<div class=right></div>
+</div>
+<div style="clear: both"></div>
page generated by <a href="https://push-f.com/">push-f</a>
from the <a href="https://github.com/jplatte/caniuse.rs">TOML files</a>
diff --git a/script.js b/script.js
index e69de29..67018f7 100644
--- a/script.js
+++ b/script.js
@@ -0,0 +1,6 @@
+(async function(){
+ const res = await fetch('data.json');
+ const data = await res.json();
+
+ // TODO: implement search
+})();
diff --git a/style.css b/style.css
index 5df3fcd..ea43be2 100644
--- a/style.css
+++ b/style.css
@@ -13,3 +13,18 @@ li {
code {
font-size: 1.1em;
}
+
+.header {
+ display: flex;
+ padding-top: 0.5em;
+ padding-bottom: 1em;
+}
+
+.left, .right {
+ flex: 1;
+}
+
+h1 {
+ margin-top: 0;
+ margin-bottom: 0;
+}