Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d243f83
routing
tanerochris Aug 17, 2019
edef28e
questions predesign
tanerochris Aug 26, 2019
324b06c
dashboard
tanerochris Sep 2, 2019
ae54c90
quiz
tanerochris Sep 17, 2019
4a40fce
show answer
tanerochris Sep 17, 2019
2ba160f
simple question quiz complete
tanerochris Sep 17, 2019
bf3f528
explore
zanguejoel Sep 18, 2019
9b109d2
explore
zanguejoel Sep 18, 2019
ff7702b
game
tanerochris Sep 18, 2019
20aa893
wecome page design
zanguejoel Sep 20, 2019
3f4be38
explore
zanguejoel Sep 20, 2019
13b3d27
start of videos
tanerochris Sep 20, 2019
20bb526
Merge branch 'develop' of https://github.com/tanerochris/devC-react36…
tanerochris Sep 20, 2019
bc13408
removed package json
tanerochris Sep 20, 2019
ceb6a84
removed yarn json
tanerochris Sep 20, 2019
f6a7ce5
removed john legend
tanerochris Sep 20, 2019
a885ce9
merge to master
tanerochris Sep 24, 2019
3f8ddaf
link to test app
tanerochris Sep 24, 2019
3bd1999
Update README.md
tanerochris Sep 24, 2019
a1a4cac
Update README.md
tanerochris Sep 24, 2019
c32143a
watch
tanerochris Sep 25, 2019
89d9282
updated readme
tanerochris Sep 25, 2019
d90f2e3
update merge changes
Oct 24, 2019
8d96513
Unmade changes
Oct 24, 2019
256af02
quiz
tanerochris Oct 24, 2019
dab5ab1
explore
zanguejoel Oct 24, 2019
5bd5496
Merge branch 'master' of https://github.com/tab1tha/devC-react360 int…
tanerochris Oct 24, 2019
e7df90f
Merge branch 'tab1tha-master' into develop
tanerochris Oct 24, 2019
3976f0f
update and merged files
Oct 28, 2019
d51bc5a
update
Oct 28, 2019
6edde41
adding the number of question
Oct 28, 2019
86c5228
adding the cancer questions
Oct 28, 2019
763a122
removing unwanted file
Oct 28, 2019
ba18a72
video json
tanerochris Oct 29, 2019
b99e1a8
Merge branch 'develop' of https://github.com/Wandji69/devC-react360 i…
tanerochris Oct 29, 2019
baba7e0
merged wandji
tanerochris Oct 29, 2019
6f9ff42
Merge branch 'Wandji69-develop' into develop
tanerochris Oct 29, 2019
1d78ab9
added some videos on cirrhosis hepatitis
tsaffi Oct 29, 2019
723d6f9
UI improvements
tanerochris Oct 30, 2019
654c99b
adding breast cancer questions
Oct 30, 2019
45fe1e9
update on questions
Oct 30, 2019
d55cd52
new
zanguejoel Oct 30, 2019
4659bd5
fixed
tanerochris Oct 30, 2019
cf87655
Merge branch 'develop' of https://github.com/tanerochris/devC-react36…
tanerochris Oct 30, 2019
3e6251d
new
zanguejoel Nov 1, 2019
87c47ac
nex explore
zanguejoel Nov 1, 2019
613c1a2
update questions
tanerochris Nov 1, 2019
8a449a9
Merge branch 'Wandji69-develop' into develop
tanerochris Nov 1, 2019
1d1d886
resolve conflicts
tanerochris Nov 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .babelrc
100644 → 100755
Empty file.
Empty file modified .flowconfig
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
*.js.meta
node_modules/
build/
.vscode
package-lock.json
yarn.lock
Empty file modified .vscode/settings.json
100644 → 100755
Empty file.
Empty file modified .watchmanconfig
100644 → 100755
Empty file.
Empty file modified 3d-image.webp
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed John Legend -All of Me (lyrics).mp3
Binary file not shown.
6 changes: 4 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# devC-react360
# HealthPro

## Setup
## Link to test application
[https://community-challenge.herokuapp.com/](https://community-challenge.herokuapp.com/)
## Setup locally
* With node installed, run the following command to install React 360 cli
`npm install -g react-360-cli`

Expand Down
Empty file modified __tests__/index-test.js
100644 → 100755
Empty file.
187 changes: 187 additions & 0 deletions bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
/**
* Produces production builds of the React application (index.vr.js) and the
* client-side implementation (client.js).
*/

'use strict';

const child_process = require('child_process');
const fs = require('fs');
const path = require('path');

const args = process.argv.slice(2);

let customAssetRoot = null;
for (let i = 0; i < args.length; i++) {
if (args[i] === '--assets' && args[i + 1]) {
customAssetRoot = args[i + 1];
if (customAssetRoot[customAssetRoot.length - 1] !== '/') {
customAssetRoot += '/';
}
}
}

function buildScript(root, buildDir, input, output) {
// Allow overriding the CLI location with an env variable
const cliLocation =
process.env.RN_CLI_LOCATION ||
path.resolve('node_modules', 'react-native', 'local-cli', 'cli.js');
return new Promise((resolve, reject) => {
const npm = child_process.spawn(
/^win/.test(process.platform) ? 'node.exe' : 'node',
[
cliLocation,
'bundle',
'--entry-file',
input,
'--platform',
'vr',
'--bundle-output',
output,
'--dev',
'false',
'--assets-dest',
buildDir,
],
{stdio: 'inherit', cwd: root},
);
npm.on('close', code => {
if (code !== 0) {
reject(code);
}
resolve();
});
});
}

function updateHTML(root, output, assetRoot) {
const indexPath = path.join(root, 'index.html');
let contents = null;
try {
contents = fs.readFileSync(indexPath, 'utf8');
} catch (e) {
return [
'Could not find index.html. You will need to manually update the paths to your bundled JavaScript files',
];
}
const writeErrors = [];
if (contents.indexOf('./client.bundle') < 0) {
writeErrors.push(
'Could not find path to client in index.html. You will need to manually update it.',
);
} else {
contents = contents.replace(
'client.bundle?platform=vr',
'client.bundle.js',
);
}
if (contents.indexOf('index.bundle') < 0) {
writeErrors.push(
'Could not find path to index.js in index.html. You will need to manually update it.',
);
} else {
contents = contents.replace(
/index\.bundle\?platform=vr(&dev=true)?/,
'index.bundle.js',
);
}
if (assetRoot) {
if (contents.indexOf("'static_assets/'") < 0) {
writeErrors.push('Could not find assetRoot');
} else {
contents = contents.replace(
/assetRoot:\s*'static_assets\/'/,
`assetRoot: '${assetRoot}'`,
);
}
}
try {
fs.writeFileSync(path.join(output, 'index.html'), contents, 'utf8');
} catch (e) {
return [`Unable to write index.html to ${output}`];
}
return writeErrors;
}

function hasPackage(dir) {
const packagePath = path.join(dir, 'package.json');
try {
fs.statSync(packagePath);
} catch (e) {
return false;
}
const pkg = require(packagePath);
if (pkg && pkg.dependencies && pkg.dependencies['react-360']) {
return true;
}
return false;
}

function findProjectDir(dir) {
while (!hasPackage(dir)) {
const next = path.join(dir, '..');
if (dir === next) {
console.log('Could not find a React 360 project directory');
process.exit(1);
}
dir = path.join(dir, '..');
}
return dir;
}

// Allow overriding the project location with an env variable
const projectDir =
process.env.PROJECT_LOCATION || findProjectDir(process.cwd());

const buildDir = path.join(projectDir, 'build');

new Promise((resolve, reject) => {
try {
const stat = fs.statSync(buildDir);
if (stat.isDirectory()) {
return resolve();
}
} catch (e) {}
fs.mkdir(path.join(projectDir, 'build'), err => {
if (err) {
console.log('Failed to create `build` directory');
return reject(1);
}
resolve();
});
})
.then(() => {
return Promise.all([
buildScript(
projectDir,
buildDir,
path.resolve(projectDir, 'index.js'),
path.resolve(projectDir, 'build', 'index.bundle.js'),
),
buildScript(
projectDir,
buildDir,
path.resolve(projectDir, 'client.js'),
path.resolve(projectDir, 'build', 'client.bundle.js'),
),
]);
})
.then(() => {
console.log(
'Production versions of JS were successfully built.' +
'They can be found at ' +
path.resolve(projectDir, 'build'),
);
const errors = updateHTML(projectDir, path.resolve(projectDir, 'build'), customAssetRoot);
if (errors.length) {
errors.forEach(err => console.log(' ** ', err));
}
})
.catch(err => {
console.log(
'An error occurred during the bundling process. Exited with code ' +
err +
'.\nLook at the packager output above to see what went wrong.',
);
process.exit(1);
});
93 changes: 76 additions & 17 deletions client.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,87 @@
// This file contains the boilerplate to execute your React app.
// If you want to modify your application's content, start in "index.js"

import {ReactInstance} from 'react-360-web';
import {ReactInstance, Surface, Location, Module} from 'react-360-web';
import { card } from './utils'
// instance used for wide application data transport
class TemporalStore extends Module {
quiz = {
answerSelected: false,
answerFound: false,
currentQuiz: ''
}
video = {
currentWatch: "", // selected disease
watchSelected: 0 // specific video selected
}
constructor() {
super('TemporalStore')
}
}
class SurfaceManagement extends Module{
static surfaces = {}
static props = null
static r360 = null
constructor(surfaces){
super('SurfaceManagement')
}
detachSurface(name){
if(name && SurfaceManagement.surfaces[name])
SurfaceManagement.r360.detachRoot(SurfaceManagement.surfaces[name])
}
attachSurface(name, params, w, h){
if(!name || !params)
return
const Card = card(params, w, h)
const surface = SurfaceManagement.r360.renderToSurface(
SurfaceManagement.r360.createRoot(name, {}),
Card,
name
)
SurfaceManagement.surfaces[name] = surface
}
attachExploreSurface(name, type, params){
if(!name || !type || !params)
return
const panel = new Surface(params[0], params[1], type);
panel.setAngle(params[2], params[3]);
const surface = SurfaceManagement.r360.renderToSurface(
SurfaceManagement.r360.createRoot(name),
panel,
);
SurfaceManagement.surfaces[name] = surface
}
attachLocation(name, params){
if(!name || !params)
return
const surface = SurfaceManagement.r360.renderToLocation(
SurfaceManagement.r360.createRoot(name),
new Location([params[0], params[1], params[2]]),
);
SurfaceManagement.surfaces[name] = surface
}
detachAll(){
for(let surface in SurfaceManagement.surfaces){
SurfaceManagement.r360.detachRoot(SurfaceManagement.surfaces[surface])
}
}
}

function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
nativeModules: [ new TemporalStore(), new SurfaceManagement()],
...options,
});

/* Render your app content to the default location
r360.renderToLocation(
r360.createRoot('Hello360', { }),
r360.getDefaultLocation()
); */
// Render your app content to the default cylinder surface
})
SurfaceManagement.r360 = r360
const IndexSurface = r360.getDefaultSurface();
//IndexSurface.setShape(Surface.SurfaceShape.Flat);
r360.renderToSurface(
r360.createRoot('Hello360', { }),
r360.getDefaultSurface()
);

r360.createRoot('Index', { }),
IndexSurface,
'Index'
)
// Load the initial environment
r360.compositor.setBackground(r360.getAssetURL('360_world.jpg'));
r360.compositor.setBackground(r360.getAssetURL('169523.jpg'));

}

window.React360 = {init};
Empty file modified components/D3Model.js
100644 → 100755
Empty file.
Empty file modified components/Label1.js
100644 → 100755
Empty file.
Empty file modified components/Label2.js
100644 → 100755
Empty file.
Empty file modified components/Label3.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion components/Option.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class Option extends React.Component{
// // which cursor the user was using, and which React tag was targeted
// const inputEvent = event.inputEvent;
// console.log(event)
console.log('we are in child');

let newColor= this.state.btnStyle.backgroundColor === "red" ? "blue" : "red"
this.setState({
btnStyle: {
Expand Down
3 changes: 1 addition & 2 deletions components/OptionsModule.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const styles = StyleSheet.create({
options: {
width: 300,
height: 250,
borderColor: '#639dda',
borderWidth: 2,
borderWidth: 0,
justifyContent: 'center',
},
})
23 changes: 0 additions & 23 deletions components/Router.js

This file was deleted.

Empty file modified components/Sphere.js
100644 → 100755
Empty file.
Loading