Skip to content

Commit 124baf0

Browse files
more search styling
1 parent 81d108f commit 124baf0

File tree

6 files changed

+395
-1060
lines changed

6 files changed

+395
-1060
lines changed

app/auth/auth.router.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ authRouter.post('/refresh', jwtPassportMiddleware, (request, response) => {
5151
});
5252
});
5353

54-
module.exports = {
55-
authRouter
56-
};
54+
authRouter.post('/logout', localPassportMiddleware, (req, res) => {
55+
res.header('Cache-Control', 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0');
56+
}
57+
module.exports = {
58+
authRouter
59+
};

public/css/main.css

Lines changed: 135 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ body {
1313
background-color: #fff;
1414
}
1515

16+
h1 {
17+
font-size: 3rem;
18+
}
19+
20+
h2 {
21+
font-size: 2.5rem;
22+
}
23+
24+
h3 {
25+
font-size: 2rem;
26+
}
27+
28+
h4 {
29+
font-size: 1.5rem
30+
}
31+
1632
.nav-bar {
1733
height: 40px;
1834
background-color: #131313;
@@ -182,10 +198,6 @@ max-width:370px;
182198
/* margin-bottom: auto; */
183199
}
184200

185-
h1 {
186-
font-size: 2.5rem;
187-
}
188-
189201
.item {
190202
border: 2px solid black;
191203
padding: 10px;
@@ -310,13 +322,6 @@ h1 {
310322

311323
.add-ex a: {}
312324

313-
.search-ex {
314-
height: 40px;
315-
border-radius: 10px;
316-
width: 422px;
317-
padding: 5px;
318-
}
319-
320325
.ex-item {
321326
display: flex;
322327
font-size: 1.25em;
@@ -328,15 +333,16 @@ h1 {
328333
.typeahead,
329334
.tt-query,
330335
.tt-hint {
331-
height: 30px;
336+
height: 50px;
332337
padding: 8px 12px;
333-
font-size: 15px;
334-
line-height: 30px;
338+
font-size: 1.75em;
339+
line-height: 50px;
335340
border: 2px solid #ccc;
336341
-webkit-border-radius: 8px;
337342
-moz-border-radius: 8px;
338343
border-radius: 8px;
339344
outline: none;
345+
min-width: 75%;
340346
}
341347

342348
.typeahead {
@@ -390,9 +396,10 @@ h1 {
390396
text-align: left;
391397
}
392398

393-
.twitter-typeahead {
399+
400+
/* .twitter-typeahead {
394401
width: 100%;
395-
}
402+
} */
396403

397404

398405
/* Date Navigation */
@@ -433,4 +440,115 @@ h1 {
433440
}
434441

435442

436-
/*End Date Navigation CSS*/
443+
/*End Date Navigation CSS*/
444+
445+
446+
/* Search/Add workout Styles */
447+
448+
.ex-container {
449+
display: flex;
450+
margin-left: auto;
451+
margin-right: auto;
452+
width: 960px;
453+
flex-direction: column;
454+
}
455+
456+
.set-wkout {
457+
display: flex;
458+
width: 300px;
459+
min-height: 200px;
460+
background-color: #ecc309;
461+
/* border: #131313 2px solid; */
462+
padding: 15px;
463+
margin: 0 auto;
464+
margin-top: 20px;
465+
border-radius: 5px;
466+
box-shadow: 1px 1px 5px #131313;
467+
}
468+
469+
#the-basics {
470+
display: flex;
471+
margin-left: auto;
472+
margin-right: auto;
473+
margin-top: 30px;
474+
margin-bottom: 50px;
475+
width: 100%;
476+
}
477+
478+
.set-input {
479+
margin-top: 15px;
480+
font-size: 1.25em;
481+
}
482+
483+
.search-btn {
484+
/* justify-content: flex-end; */
485+
height: 50px;
486+
border: 0px;
487+
background-color: #465C8b;
488+
color: #FFF;
489+
font-size: 1.75em;
490+
padding: 5px 10px 5px 10px;
491+
border-radius: 7px;
492+
margin-left: 10px;
493+
min-width: 25%;
494+
}
495+
496+
.search-ex {
497+
height: 50px;
498+
border-radius: 10px;
499+
padding: 5px;
500+
font-size: 1.75em;
501+
}
502+
503+
.form-save {
504+
width: 100%;
505+
}
506+
507+
.save-set {
508+
display: flex;
509+
margin-left: auto;
510+
margin-right: auto;
511+
margin-top: 70px;
512+
font-size: 2em;
513+
border: none;
514+
padding: 5px 10px;
515+
background-color: #465C8b;
516+
border-radius: 5px;
517+
color: #fff;
518+
border: #FFF 2px solid;
519+
}
520+
521+
.save-set:hover {
522+
color: #ecc309;
523+
}
524+
525+
#POST-weight {
526+
border-radius: 3px;
527+
height: 25px;
528+
width: 50%;
529+
padding: 5px;
530+
text-align: center;
531+
}
532+
533+
#weight-lbl {
534+
font-size: 1.25em;
535+
vertical-align: text-top;
536+
}
537+
538+
#POST-reps {
539+
border-radius: 3px;
540+
height: 25px;
541+
width: 50%;
542+
padding: 5px;
543+
text-align: center;
544+
}
545+
546+
#reps-lbl {
547+
margin-right: 13px;
548+
font-size: 1.25em;
549+
vertical-align: text-top;
550+
}
551+
552+
.alphalist {
553+
margin-top: 30px;
554+
}

public/search.html

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,39 @@
1717
<header class="header">
1818
<div class="logo">Fit-Journal</div>
1919
<nav class="nav-login">
20-
<a id="logout-btn" href="">Log Out</a>
20+
<a id="logout-btn" href="/logout">Log Out</a>
2121
</nav>
2222
</header>
2323

2424
<main>
2525

26-
<section class="wo-container ">
27-
<div id="the-basics">
26+
<section class="ex-container ">
27+
<div id="the-basics" class="">
2828
<input class="search-ex typeahead" type="text" placeholder="Search Exercises" />
29+
<button type="button" class="search-btn">Add Exercise</button>
2930
</div>
30-
<div class="js-container"></div>
31-
31+
<div class="set-wkout">
32+
<form action="/api/workout" class="js-setworkOut" method="POST">
33+
<h3 class="exerciseName "></h3>
34+
<div class="set-input">
35+
<label id="reps-lbl" for="POST-reps">Number of reps:</label>
36+
<input id="POST-reps" type="text" name="reps">
37+
</div>
38+
<div class="set-input">
39+
<label id="weight-lbl" for="POST-weight">Amount of weight:</label>
40+
<input id="POST-weight" type="text" name="weight">
41+
</div>
42+
<div class="form-save">
43+
<button class="save-set">Save Set</button>
44+
</div>
45+
</form>
46+
</div>
47+
<div class="js-container alphalist"></div>
48+
<ul>
49+
<li>
50+
<h3>A</h3>
51+
</li>
52+
</ul>
3253

3354
</section>
3455

public/search.js

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function typeAhead(exercises) {
2525
}, {
2626
name: 'exercises',
2727
source: substringMatcher(exercises)
28-
})
28+
});
2929
}
3030
// GET EXERCISES
3131
function getUserExercises() {
@@ -40,27 +40,42 @@ function getUserExercises() {
4040
});
4141
}
4242

43-
function showExercises(item) {
44-
let exercises = [];
45-
console.log(item)
46-
// exercises.push(item.exercise);
47-
// for (let i=0; i < item.length)
48-
// $('.js-container').append(`<p class="ex-item">${item.exercise}</p>`)
49-
// typeAhead(exercises);
50-
}
51-
5243
function exerciseLoop(res) {
5344
let exercises = []
54-
// res.map((item, index) => showExercises(item));
5545
res.map(item => exercises.push(item.exercise))
5646
console.log(exercises)
5747
typeAhead(exercises)
5848
}
5949

50+
function clearInput() {
51+
$('input').val("")
52+
}
53+
54+
55+
56+
// Save exercise set to workout
57+
// capture name of exercise
58+
function selectExercise() {
59+
$('.search-btn').on('click', function() {
60+
let searchVal = $('.search-ex').val();
61+
$('.exerciseName').html(`${searchVal}`);
62+
});
63+
64+
}
65+
// unhide set adder
66+
function showSetAdd() {
67+
68+
}
69+
70+
function
71+
// save to workout
72+
73+
6074
function onPageLoad() {
61-
typeAhead();
75+
// typeAhead();
76+
clearInput();
6277
getUserExercises();
63-
78+
selectExercise();
6479
}
6580

6681

0 commit comments

Comments
 (0)