Skip to content

Commit 2a3342c

Browse files
authored
feat(InstantSearch.js): add facet-dropdown code sample (#398)
1 parent 5d2b9fe commit 2a3342c

17 files changed

Lines changed: 6504 additions & 0 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/dist
3+
/.cache
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: 'algolia',
3+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/dist
11+
/.cache
12+
13+
# misc
14+
.DS_Store
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"proseWrap": "never",
4+
"trailingComma": "es5"
5+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# instantsearch.js-app
2+
3+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
4+
5+
## Get started
6+
7+
To run this project locally, install the dependencies and run the local server:
8+
9+
```sh
10+
npm install
11+
npm start
12+
```
13+
14+
Alternatively, you may use [Yarn](https://http://yarnpkg.com/):
15+
16+
```sh
17+
yarn
18+
yarn start
19+
```
20+
21+
Open http://localhost:3000 to see your app.
906 Bytes
Loading
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
8+
/>
9+
<meta name="theme-color" content="#000000" />
10+
11+
<link rel="manifest" href="./manifest.webmanifest" />
12+
<link rel="shortcut icon" href="./favicon.png" />
13+
14+
<link
15+
rel="stylesheet"
16+
href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css"
17+
/>
18+
<link rel="stylesheet" href="./src/Dropdown.css" />
19+
<link rel="stylesheet" href="./src/index.css" />
20+
<link rel="stylesheet" href="./src/app.css" />
21+
22+
<title>instantsearch.js-app</title>
23+
</head>
24+
25+
<body>
26+
<header class="header">
27+
<h1 class="header-title">
28+
<a href="/">instantsearch.js-app</a>
29+
</h1>
30+
<p class="header-subtitle">
31+
using
32+
<a href="https://github.com/algolia/instantsearch.js">
33+
InstantSearch.js
34+
</a>
35+
</p>
36+
</header>
37+
38+
<div class="container">
39+
<div id="searchbox"></div>
40+
41+
<div class="search-panel__filters">
42+
<div id="brand"></div>
43+
<div id="type"></div>
44+
<div id="price"></div>
45+
<div id="price2"></div>
46+
<div id="category"></div>
47+
</div>
48+
49+
<div id="hits"></div>
50+
<div id="pagination"></div>
51+
</div>
52+
53+
<script src="https://cdn.jsdelivr.net/algoliasearch/3.32.0/algoliasearchLite.min.js"></script>
54+
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4.9.1"></script>
55+
<script src="./src/app.js"></script>
56+
</body>
57+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "instantsearch.js-app",
3+
"name": "instantsearch.js-app Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.png",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "facet-dropdown",
3+
"version": "1.0.0",
4+
"private": true,
5+
"main": "src/app.js",
6+
"scripts": {
7+
"start": "parcel index.html --port 3000",
8+
"build": "parcel build index.html",
9+
"lint": "eslint .",
10+
"lint:fix": "npm run lint -- --fix"
11+
},
12+
"devDependencies": {
13+
"babel-eslint": "10.0.3",
14+
"eslint": "5.7.0",
15+
"eslint-config-algolia": "13.2.3",
16+
"eslint-config-prettier": "3.6.0",
17+
"eslint-plugin-import": "2.19.1",
18+
"eslint-plugin-prettier": "3.1.2",
19+
"parcel-bundler": "1.12.4",
20+
"prettier": "1.19.1"
21+
},
22+
"keywords": [
23+
"algolia",
24+
"InstantSearch",
25+
"Vanilla",
26+
"instantsearch.js"
27+
]
28+
}

0 commit comments

Comments
 (0)