-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(responsive-filters): added examples for vanilla and RISH #417
base: master
Are you sure you want to change the base?
Changes from 5 commits
7efc20f
8b214fa
cb5d4c9
d43ec18
555fdbf
5cb5529
b2f1fff
453c45d
b874694
5c2c7a2
ddd4d5c
6c8ce3d
ed89836
d3a2e39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules | ||
/dist | ||
/.cache |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: 'algolia', | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/dist | ||
/.cache | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"proseWrap": "never", | ||
"trailingComma": "es5" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# responsive-filtering | ||
|
||
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ | ||
|
||
## Get started | ||
|
||
To run this project locally, install the dependencies and run the local server: | ||
|
||
```sh | ||
npm install | ||
npm start | ||
``` | ||
|
||
Alternatively, you may use [Yarn](https://http://yarnpkg.com/): | ||
|
||
```sh | ||
yarn | ||
yarn start | ||
``` | ||
|
||
Open http://localhost:3000 to see your app. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no" | ||
/> | ||
<meta name="theme-color" content="#000000" /> | ||
|
||
<link rel="manifest" href="./manifest.webmanifest" /> | ||
<link rel="shortcut icon" href="./favicon.png" /> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css" | ||
/> | ||
<link rel="stylesheet" href="./src/app.css" /> | ||
|
||
<title>responsive-filtering</title> | ||
</head> | ||
|
||
<body> | ||
<header class="header"> | ||
<h1 class="header-title"> | ||
<a href="/">responsive-filtering</a> | ||
</h1> | ||
<p class="header-subtitle"> | ||
using | ||
<a href="https://github.com/algolia/instantsearch.js"> | ||
InstantSearch.js | ||
</a> | ||
</p> | ||
</header> | ||
|
||
<div class="container"> | ||
<div class="search-panel"> | ||
<div id="searchbox"></div> | ||
|
||
<div class="search-panel__filters"> | ||
<div class="responsive-filters__desktop" id="filters-desktop"> | ||
<div id="category"></div> | ||
<div id="brand"></div> | ||
<div id="free-shipping"></div> | ||
</div> | ||
|
||
<div class="responsive-filters__mobile"> | ||
<div id="sort-by" class="responsive-filters_sort"></div> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<button id="open-filters" class="responsive-filters__open"> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<svg xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M15 1H1l5.6 6.3v4.37L9.4 13V7.3z" | ||
stroke="#fff" | ||
stroke-width="1.29" | ||
fill="none" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path> | ||
</svg> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span id="nb-filters"></span> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</button> | ||
</div> | ||
</div> | ||
|
||
<div class="search-panel_results"> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<div id="hits"></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div | ||
class="modal" | ||
tabindex="-1" | ||
id="filters-modal" | ||
role="dialog" | ||
aria-labelledby="modal-title" | ||
aria-hidden="true" | ||
> | ||
<div class="modal-dialog modal-fullscreen"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="modal-title">Filters</h5> | ||
<button | ||
type="button" | ||
class="btn-close" | ||
data-bs-dismiss="modal" | ||
aria-label="Close" | ||
></button> | ||
</div> | ||
<div class="modal-body" id="modal-body"></div> | ||
<div id="modal-footer"> | ||
<div class="responsive-filters__footer"> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<div | ||
id="clear-refinements" | ||
class="responsive-filters__clear" | ||
></div> | ||
|
||
<button class="responsive-filters__apply" id="apply-filters"> | ||
<span id="nb-hits"></span> | ||
aymeric-giraudet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
|
||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" | ||
crossorigin="anonymous" | ||
/> | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" | ||
crossorigin="anonymous" | ||
></script> | ||
|
||
<script src="./src/app.js"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"short_name": "instantsearch.js-app", | ||
"name": "instantsearch.js-app Sample", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should reflect that this app is about responsive filtering. I don't recall what are the recommended lengths for each attribute though, I'll let you verify @aymeric-giraudet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"icons": [ | ||
{ | ||
"src": "favicon.png", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
} | ||
], | ||
"start_url": "./index.html", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "responsive-filtering", | ||
"version": "1.0.0", | ||
"private": true, | ||
"main": "src/app.js", | ||
"scripts": { | ||
"start": "parcel index.html --port 3000", | ||
"build": "parcel build index.html", | ||
"lint": "eslint .", | ||
"lint:fix": "npm run lint -- --fix" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "10.0.3", | ||
"eslint": "5.7.0", | ||
"eslint-config-algolia": "13.2.3", | ||
"eslint-config-prettier": "3.6.0", | ||
"eslint-plugin-import": "2.19.1", | ||
"eslint-plugin-prettier": "3.1.2", | ||
"parcel-bundler": "1.12.4", | ||
"prettier": "1.19.1" | ||
}, | ||
"keywords": [ | ||
"algolia", | ||
"InstantSearch", | ||
"Vanilla", | ||
"instantsearch.js" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going with BEM classes, then the
__desktop
part should be a modifier, not an element, because this<div>
isn't nested within aresponsive-filters
block. Same goes for its sibling.responsive-filters__mobile
.Also, do we really need this extra element? Can't we reuse
.search-panel__filters
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the ID instead, but on React I made it as a block by itself