Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ask1811/H-oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilrgeorge007 committed Mar 19, 2023
2 parents 697683b + d9013e6 commit a541ecd
Show file tree
Hide file tree
Showing 9 changed files with 315 additions and 77 deletions.
2 changes: 2 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Signup from './pages/Signup/Signup';
import Navbar from './Components/Navbar/Navbar';
import Login from './pages/Login/Login';
import Details from './pages/Details/Details';
import Details2 from './pages/Details2/Details2';

function App() {
return (
Expand All @@ -15,6 +16,7 @@ function App() {
<Routes>
<Route path='/' element={<Home />} />
<Route path='/Details' element={<Details />} />
<Route path='/Details2' element={<Details2 />} />
<Route path='/Login' element={<Login />} />
<Route path='/Signup' element={<Signup />} />
</Routes>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/Components/Navbar/Navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ body {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-left: 60px;
padding-right: 60px;
}

.nav > .nav-header {
Expand Down
85 changes: 56 additions & 29 deletions frontend/src/Components/Navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,65 @@ import './Navbar.css';
import translogo from '../../Images/translogo.png'

const Navbar = () => {
return (
<div class="nav">
<input type="checkbox" id="nav-check" />
<div class="nav-header">
<img class='logo' src={translogo} />
<div class="nav-title">
<a href="/" target="_self" className='btn0'>
<span class="replies">H-oracle</span>
if (localStorage.getItem("token") == "xxx") {
return (
<div class="nav">
<div class="nav-header">
<img class='logo' src={translogo} />
<div class="nav-title">
<a href="/" target="_self" className='btn0'>
<span class="replies">H-oracle</span>
</a>
</div>
</div>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>

<div class="nav-links">

<a href="/Login" target="_self" className='btn1'>
<span class="replies">Login</span>
<span class="comments"></span>
</a>

</div>
</div >
)
}
else {
return (
<div class="nav">
<div class="nav-header">
<img class='logo' src={translogo} />
<div class="nav-title">
<a href="/" target="_self" className='btn0'>
<span class="replies">H-oracle</span>
</a>
</div>
</div>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>
</div>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>

<div class="nav-links">
<a href="/Details" target="_self" className='btn1'>
<span class="replies">Details</span>
<span class="comments"></span>
</a>
<a href="/Login" target="_self" className='btn1'>
<span class="replies">Login</span>
<span class="comments"></span>
</a>
<div class="nav-links">
<a href="/Login" target="_self" className='btn1'>
<span class="replies">Login</span>
<span class="comments"></span>
</a>

</div>
</div >
)
</div>
</div >
)
}
}

export default Navbar
export default Navbar;
6 changes: 5 additions & 1 deletion frontend/src/pages/Details/Details.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ const Details = ()=>{
</div>
</form>

<div class="modal-body">
<p></p>
</div>
</div>
</div>
<Dialog
open={open1}
Expand All @@ -234,4 +238,4 @@ const Details = ()=>{
)
}

export default Details;
export default Details;
7 changes: 7 additions & 0 deletions frontend/src/pages/Details/details.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@
background-size:cover;
min-height: 100vh;
}
.control-label {
color: white;
text-decoration: none;
}
.flex-container {
display: flex;
}
26 changes: 26 additions & 0 deletions frontend/src/pages/Details2/Details2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.heading{
text-align: center;
padding-top: 20px;
}
.container{
color: white;
}
.bs, .re, .cp, .mv{
padding-left: 5px;
}

.whole{
background-image: url(../../Images/heart.png);
background-size:cover;
min-height: 100vh;
}
.control-label {
color: white;
text-decoration: none;
}
.g1{
color: #fff;
}
.Guide{
margin-top: 50px;
}
142 changes: 142 additions & 0 deletions frontend/src/pages/Details2/Details2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import React from 'react';
import 'bootstrap/dist/css/bootstrap.css';
import './Details2.css';
import Popover from '@mui/material/Popover';
import Typography from '@mui/material/Typography';
function Details2() {
var _a = React.useState(null), anchorEl = _a[0], setAnchorEl = _a[1];
var handleClick = function (event) {
setAnchorEl(event.currentTarget);
};
var handleClose = function () {
setAnchorEl(null);
};
const open = Boolean(anchorEl);
const id = open ? 'simple-popover' : undefined;
return (
<div className='whole'>
<div className='container'>
<div className='row'>
<h1 className='heading'>Enter the following details</h1>
</div>
<br />
<form>
<div class="form-group row">
<label class="control-label col-sm-2" for="age">Age :</label>
<div class="col-sm-3">
<input type="number" class="form-control" id="age" min='1' />
</div>
<label class="control-label col-sm-2 offset-1" for="gender">Gender:</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
</div>
<br />
<div class="form-group row">
<label className='control-label col-sm-2'>High Cholestrol :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
<a className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Body Mass Index(BMI) :
</a>
<Popover
id={id}
open={open}
anchorEl={anchorEl}
onClose={handleClose}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'left',
}}
>
<Typography sx={{ p: 2 }}>The content of the Popover.</Typography>
</Popover>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
</div>
<br />
<div class="form-group row">
<label className='control-label col-sm-2'>Are you a smoker? :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
<a className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Physical Activity:</a>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
</div>
<br />
<div class="form-group row">
<label className='control-label col-sm-2' aria-describedby={id} variant="contained" onClick={handleClick}>Physical Health :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
<label className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Fruits :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
</div>
<br />
<div class="form-group row">
<label className='control-label col-sm-2' aria-describedby={id} variant="contained" onClick={handleClick}>Vegetables :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
<label className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Heavy Alcohol Consumption :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
</div>
<br />
<div class="form-group row">
<label className='control-label col-sm-2' aria-describedby={id} variant="contained" onClick={handleClick}>Stroke :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
<label className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>High Blood Pressure :</label>
<div class="col-sm-3">
<input type="text" class="form-control" />
</div>
</div>

<br />
<div className='row'>
<input type="submit" class="btn btn-danger col-1 offset-5" value="Submit" />
</div>
</form>

</div >
<div className='Guide'>
<h1 className='g1'>Guidelines to Enter Details</h1>
<h2 className='g1'>*Age: If age is between 18-24 Enter 1</h2>
<h2 className='g1'> 1 = 18-24 / 2 = 25-29 / 3 = 30-34 / 4 = 35-39 / 5 = 40-44 / 6 = 45-49 / 7 = 50-54 / 8 = 55-59 / 9 = 60-64 / 10 = 65-69 / 11 = 70-74 / 12 = 75-79 / 13 = 80 or older
</h2>
<br />
<h2 className='g1'>*Gender: 1: male, 0: female</h2>
<br />
<h2 className='g1'>*Cholestrol: 0 = no high cholesterol, 1 = high cholesterol</h2>
<br />
<h2 className='g1'>*BMI=(Weight in Kg)/(Height in metre)</h2>
<br />
<h2 className='g1'>*Smoker: Have you smoked at least 100 cigarettes in your entire life? [Note: 5 packs = 100 cigarettes] 0 = no 1 = yes</h2>
<br />
<h2 className='g1'>*Physical Activity: Physical Activity in past 30 days - not including job 0 = no 1 = yes</h2>
<br />
<h2 className='g1'>*Physical Health: How many injuries you have had in the past 30 days (Physical illness or injury days in past 30 days scale 1-30)</h2>
<br />
<h2 className='g1'>*Fruits: Do you Consume Fruits 1 or more times per day 0 = no 1 = yes</h2>
<br />
<h2 className='g1'>*Vegetables: Do you consume Vegetables 1 or more times per day 0 = no 1 = yes</h2>
<br />
<h2 className='g1'> *Heavy Alcohol Consumption: (adult men more than or equal to 14 drinks per week and adult women more than or equal to 7 drinks per week) 0 = no 1 = yes</h2>
<br />
<h2 className='g1'> *Stroke: Have you ever had a stroke. 0 = no, 1 = yes</h2>
<br />
<h2 className='g1'>*High Blood Pressure: 0 = no High BP,1 = Yes High BP </h2>
</div>
</div >
)
}

export default Details2;
67 changes: 47 additions & 20 deletions frontend/src/pages/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,55 @@ import React from 'react'
import './Home.css'
import 'bootstrap/dist/css/bootstrap.css'
const Home = () => {
return (
<>
<div className='content'>
<div className='container'>
<div className='row details'>
<p className=' col-6'>Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
<p className='col-3 offset-1'> To check health, enter details here<button type="button" class="btn btn-danger "><a href='/Details' className='dtl'>Details</a></button></p>

if (localStorage.getItem("token") == "xxx") {
return (
<>
<div className='content'>
<div className='container'>
<div className='row details'>
<p className=' col-6'>Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
<p className='col-3 offset-1'> To check health, enter details here<button type="button" class="btn btn-danger "><a href='/Details' className='dtl'>Details</a></button></p>

</div>

</div>

</div>
</>
)
}



else {
return (
<>
<div className='content'>
<div className='container'>
<div className='row details'>
<p className=' col-6'>Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
</div>

</div>

</div>

</div>
</>
)
</>
)
}
}

export default Home

0 comments on commit a541ecd

Please sign in to comment.