-
Notifications
You must be signed in to change notification settings - Fork 3
Howto guide #57
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
Merged
Howto guide #57
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
d9e7108
Commit pas rapport
abelfodil 116439d
First pass adding content
abelfodil b7f704a
Beautify the page
abelfodil 8f9b08d
Remove separator
abelfodil c08fd2a
Shorten code
abelfodil 8073e7e
Add illustrations
abelfodil e6d17d2
Add material icons
abelfodil 7261f81
Move electrodes to tabs
abelfodil 3d7ea6e
Alternate text and images
abelfodil 9b64e26
Make text bigger
abelfodil 7c16162
Add user friendly electrode placement
abelfodil 38545af
change tab police size
abelfodil 9ee2339
Change column size
abelfodil 15b8e66
cleaner code
abelfodil b8a3ab0
Use cards
abelfodil c395d2d
Fix space
abelfodil 23e242e
cleanup
abelfodil a4ff21f
Update web/src/views/record_my_sleep/index.js
abelfodil a61ee2d
Add intro to list
abelfodil aceace0
Remove space between title and first section
abelfodil baabff9
Add space between elements
abelfodil 7e2a328
Fix tabs
abelfodil dd222b1
Reomve hovering effect
abelfodil 12b5a55
Title
abelfodil 903cab0
Add images
abelfodil ac533e9
Fix
abelfodil aaa925f
Add hovering cards
abelfodil 34d62f9
Update web/src/views/record_my_sleep/index.js
abelfodil 96de1c8
Update web/src/views/record_my_sleep/index.js
abelfodil f57e735
Update web/src/views/record_my_sleep/index.js
abelfodil 87f9e15
Reuse section
abelfodil ede0924
Remove redundant statement
abelfodil 324b140
Add badges
abelfodil 21988f3
Add carousel
abelfodil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import React from 'react'; | ||
| import { Row, Col } from 'reactstrap'; | ||
|
|
||
| const AlternatingTextImage = ({ elements }) => | ||
| elements.map(({ title, text, image }, i) => { | ||
| const textElement = ( | ||
| <> | ||
| <h4 className="display-4">{title}</h4> | ||
| <p className="lead">{text}</p> | ||
| </> | ||
| ); | ||
|
|
||
| const imageElement = <img src={`${process.env.PUBLIC_URL}/${image}`} alt={title} />; | ||
|
|
||
| return ( | ||
| <div className="pt-lg-5" key={i}> | ||
| {i % 2 === 0 ? ( | ||
| <Row> | ||
| <Col xs="8">{textElement}</Col> | ||
| <Col xs="4">{imageElement}</Col> | ||
| </Row> | ||
| ) : ( | ||
| <Row> | ||
| <Col xs="4">{imageElement}</Col> | ||
| <Col xs="8">{textElement}</Col> | ||
| </Row> | ||
| )} | ||
| </div> | ||
| ); | ||
| }); | ||
| export default AlternatingTextImage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import React, { useState } from 'react'; | ||
| import { Carousel, CarouselItem, CarouselControl, CarouselIndicators, CarouselCaption } from 'reactstrap'; | ||
|
|
||
| const SimpleCarousel = ({ items }) => { | ||
| const [activeIndex, setActiveIndex] = useState(0); | ||
| const [animating, setAnimating] = useState(false); | ||
|
|
||
| const next = () => { | ||
| if (animating) return; | ||
| const nextIndex = activeIndex === items.length - 1 ? 0 : activeIndex + 1; | ||
| setActiveIndex(nextIndex); | ||
| }; | ||
|
|
||
| const previous = () => { | ||
| if (animating) return; | ||
| const nextIndex = activeIndex === 0 ? items.length - 1 : activeIndex - 1; | ||
| setActiveIndex(nextIndex); | ||
| }; | ||
|
|
||
| const goToIndex = (newIndex) => { | ||
| if (animating) return; | ||
| setActiveIndex(newIndex); | ||
| }; | ||
|
|
||
| const slides = items.map((item) => { | ||
| return ( | ||
| <CarouselItem onExiting={() => setAnimating(true)} onExited={() => setAnimating(false)} key={item.src}> | ||
| <img src={`${process.env.PUBLIC_URL}/${item.src}`} alt={item.altText} width="100%" /> | ||
| <CarouselCaption captionText="" captionHeader={item.caption} /> | ||
| </CarouselItem> | ||
| ); | ||
| }); | ||
|
|
||
| return ( | ||
| <Carousel activeIndex={activeIndex} next={next} previous={previous}> | ||
| <CarouselIndicators items={items} activeIndex={activeIndex} onClickHandler={goToIndex} /> | ||
| {slides} | ||
| <CarouselControl direction="prev" directionText="Previous" onClickHandler={previous} /> | ||
| <CarouselControl direction="next" directionText="Next" onClickHandler={next} /> | ||
| </Carousel> | ||
| ); | ||
| }; | ||
|
|
||
| export default SimpleCarousel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import React from 'react'; | ||
| import { Table } from 'reactstrap'; | ||
|
|
||
| const SimpleTable = ({ headers, elementsRows }) => ( | ||
| <Table striped borderless responsive> | ||
| <thead> | ||
| <tr> | ||
| {headers.map((header) => ( | ||
| <th key={header}>{header}</th> | ||
| ))} | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {elementsRows.map((row, i) => ( | ||
| <tr key={i}> | ||
| {row.map((element) => ( | ||
| <td key={element}>{element}</td> | ||
| ))} | ||
| </tr> | ||
| ))} | ||
| </tbody> | ||
| </Table> | ||
| ); | ||
|
|
||
| export default SimpleTable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import React, { useState } from 'react'; | ||
| import classnames from 'classnames'; | ||
| import { Card, CardBody, NavItem, NavLink, Nav, TabContent, TabPane } from 'reactstrap'; | ||
|
|
||
| const Tabs = ({ elements, onSelectTab, onHoverTab }) => { | ||
| const [selectedTab, _setSelectedTab] = useState(0); | ||
| const setSelectedTab = (event, tab) => { | ||
| event.preventDefault(); | ||
| _setSelectedTab(tab); | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <div className="nav-wrapper"> | ||
| <Nav className="nav-fill flex-column flex-md-row" id="tabs-icons-text" pills role="tablist"> | ||
| {elements.map(({ id, title }, i) => ( | ||
| <NavItem key={i}> | ||
| <NavLink | ||
| aria-selected={selectedTab === i} | ||
| className={classnames('mb-sm-3 mb-md-0', { | ||
| active: selectedTab === i, | ||
| })} | ||
| onClick={(e) => { | ||
| onSelectTab && onSelectTab(id); | ||
| setSelectedTab(e, i); | ||
| }} | ||
| onMouseOver={() => onHoverTab && onHoverTab(id)} | ||
| onMouseLeave={() => onHoverTab && onHoverTab(null)} | ||
| href="#pablo" | ||
| role="tab" | ||
| > | ||
| {title} | ||
| </NavLink> | ||
| </NavItem> | ||
| ))} | ||
| </Nav> | ||
| </div> | ||
| <Card className="shadow"> | ||
| <CardBody> | ||
| <TabContent activeTab={'selectedTab' + selectedTab}> | ||
| {elements.map(({ content }, i) => ( | ||
| <TabPane key={i} tabId={'selectedTab' + i}> | ||
| <p>{content}</p> | ||
| </TabPane> | ||
| ))} | ||
| </TabContent> | ||
| </CardBody> | ||
| </Card> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default Tabs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "items": [ | ||
| { | ||
| "src": "instructions/res_1.jpg", | ||
| "altText": "Slide 1", | ||
| "caption": "1" | ||
| }, | ||
| { | ||
| "src": "instructions/res_2.jpg", | ||
| "altText": "Slide 2", | ||
| "caption": "2" | ||
| }, | ||
| { | ||
| "src": "instructions/res_3.jpg", | ||
| "altText": "Slide 3", | ||
| "caption": "3" | ||
| }, | ||
| { | ||
| "src": "instructions/res_4.jpg", | ||
| "altText": "Slide 4", | ||
| "caption": "4" | ||
| }, | ||
| { | ||
| "src": "instructions/res_5.jpg", | ||
| "altText": "Slide 5", | ||
| "caption": "5" | ||
| }, | ||
| { | ||
| "src": "instructions/res_6.jpg", | ||
| "altText": "Slide 6", | ||
| "caption": "6" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| .imgs-container { | ||
| position: relative; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .img-container { | ||
| position: relative; | ||
| text-align: center; | ||
| min-width: 50px; | ||
| min-height: 50px; | ||
| display: inline-block; | ||
| } | ||
|
|
||
| .dot { | ||
| height: 10px; | ||
| width: 10px; | ||
| border-radius: 50%; | ||
| display: inline-block; | ||
| position: absolute; | ||
| } | ||
|
|
||
| .dot-select { | ||
| background-color: #fc7c5f; | ||
| } | ||
|
|
||
| .dot-null { | ||
| display: none; | ||
| } | ||
|
|
||
| .top.dot-fpz { | ||
| top: 3%; | ||
| left: 47%; | ||
| } | ||
|
|
||
| .top.dot-cz { | ||
| top: 46%; | ||
| left: 47%; | ||
| } | ||
|
|
||
| .top.dot-pz { | ||
| top: 76%; | ||
| left: 46%; | ||
| } | ||
|
|
||
| .top.dot-oz { | ||
| top: 89%; | ||
| left: 46%; | ||
| } | ||
|
|
||
| .top.dot-a2 { | ||
| top: 48%; | ||
| left: 90%; | ||
| } | ||
|
|
||
| .side.dot-fpz { | ||
| top: 38%; | ||
| left: 70%; | ||
| } | ||
|
|
||
| .side.dot-cz { | ||
| top: 17%; | ||
| left: 43%; | ||
| } | ||
|
|
||
| .side.dot-pz { | ||
| top: 28%; | ||
| left: 27%; | ||
| } | ||
|
|
||
| .side.dot-oz { | ||
| top: 51%; | ||
| left: 23%; | ||
| } | ||
|
|
||
| .side.dot-a2 { | ||
| top: 58%; | ||
| left: 49%; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import React, { useState } from 'react'; | ||
| import { Row, Col } from 'reactstrap'; | ||
|
|
||
| import Tabs from 'components/tabs'; | ||
|
|
||
| import './electrode_display.css'; | ||
|
|
||
| const ElectrodesDisplay = () => { | ||
| const [selectedElectrode, setSelectedElectrode] = useState('fpz'); | ||
|
|
||
| return ( | ||
| <Row> | ||
| <Col xs="8"> | ||
| <Tabs | ||
| onSelectTab={setSelectedElectrode} | ||
| elements={[ | ||
| { | ||
| id: 'fpz', | ||
| title: 'Fpz', | ||
| content: ` | ||
| Fpz is used as one of our active electrodes. To identify the Fpz location, just measure the distance | ||
| starting from your nasion (the easily identifiable depressed area between your eyes) to your inion | ||
| using your flexible measuring tape. Fpz is located at 10 % of the distance along the midline between | ||
| your nasion and your inion.`, | ||
| }, | ||
| { | ||
| id: 'cz', | ||
| title: 'Cz', | ||
| content: ` | ||
| We’re measuring a potential difference between Fpz and that point. Cz is located at 50% of the | ||
| distance along the midline starting from your nasion to your inion.`, | ||
| }, | ||
| { | ||
| id: 'pz', | ||
| title: 'Pz', | ||
| content: ` | ||
| This is our other active electrode. It is located at 70% of the distance between your nasion and your | ||
| inion.`, | ||
| }, | ||
| { | ||
| id: 'oz', | ||
| title: 'Oz', | ||
| content: ` | ||
| This is the point at which Pz is referenced. It is located at 90% of the distance between your nasion | ||
| and your inion.`, | ||
| }, | ||
| { | ||
| id: 'a2', | ||
| title: 'A2', | ||
| content: ` | ||
| This is the electrode that serves as driven ground between your and your OpenBCI board. Simply place it on | ||
| your right earlobe.`, | ||
| }, | ||
| ]} | ||
| /> | ||
| </Col> | ||
| <Col xs="4"> | ||
| <div className="imgs-container"> | ||
| <div className="img-container"> | ||
| <img src={`${process.env.PUBLIC_URL}/illustrations/top.png`} alt="top" /> | ||
| <span className={`top dot dot-select dot-${selectedElectrode}`}></span> | ||
| </div> | ||
| <div className="img-container"> | ||
| <img src={`${process.env.PUBLIC_URL}/illustrations/side.png`} alt="side" /> | ||
| <span className={`side dot dot-select dot-${selectedElectrode}`}></span> | ||
| </div> | ||
| </div> | ||
| </Col> | ||
| </Row> | ||
| ); | ||
| }; | ||
|
|
||
| export default ElectrodesDisplay; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.