Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit c0dcfbe

Browse files
authored
Merge pull request #29 from chiubaca/ui-ux-tidyup
UI UX Tidyup
2 parents 64b36e5 + dbe249d commit c0dcfbe

File tree

10 files changed

+169
-95
lines changed

10 files changed

+169
-95
lines changed

src/App.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="app-background">
3-
<SideBar />
3+
<NavBar />
44

55
<router-view />
66

@@ -9,12 +9,12 @@
99
</template>
1010

1111
<script>
12-
import SideBar from "./components/SideBar.vue";
12+
import NavBar from "./components/NavBar.vue";
1313
import Footer from "./components/Footer.vue";
1414
1515
export default {
1616
components: {
17-
SideBar,
17+
NavBar,
1818
Footer
1919
}
2020
};
@@ -23,4 +23,10 @@ export default {
2323
<!-- Add "scoped" attribute to limit CSS to this component only -->
2424
<style lang="scss">
2525
@import "./assets/styles/main.scss";
26+
.app-background {
27+
display: flex;
28+
min-height: 100vh;
29+
flex-direction: column;
30+
justify-content: space-between;
31+
}
2632
</style>

src/assets/styles/main.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ button:active {
3838
}
3939

4040
input[type=text] {
41+
background-color: var(--app-secondary-background-color);
4142
border: none;
4243
padding: 10px;
4344
border-bottom: 3px solid var(--primary);
4445
}
4546
input[type=password] {
47+
background-color: var(--app-secondary-background-color);
4648
border: none;
4749
padding: 10px;
4850
border-bottom: 3px solid var(--primary);

src/components/Footer.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,20 @@ footer {
1414
display: flex;
1515
align-items: center;
1616
justify-content: center;
17-
position: fixed;
1817
right: 0;
1918
bottom: 0;
20-
padding: 0px 5px 0px 5px;
21-
border-radius: 15px 0 0 0;
22-
23-
height: 50px;
19+
height: 35px;
2420
text-align: center;
2521
color: black;
2622
background-color: var(--app-secondary-background-color);
2723
a {
2824
text-decoration: none;
29-
text-decoration: underline;
30-
color: black;
3125
margin-left: 5px;
26+
border-bottom: 2px solid lightskyblue;
3227
}
3328
a:hover {
34-
background-color: rgb(52, 52, 255);
3529
border-radius: 5px;
30+
background-color: lightskyblue;
3631
}
3732
}
3833
</style>

src/components/NavBar.vue

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<template>
2+
<nav v-if="currentUser" id="nav-bar">
3+
<div id="nav-items">
4+
<router-link :to="{ name: 'home' }">🏠 Home</router-link>
5+
6+
<router-link :to="{ name: 'journals' }">📔 Your Journals</router-link>
7+
8+
<router-link id="profile-link" :to="{ name: 'profile' }"
9+
>🆔 Profile</router-link
10+
>
11+
12+
<ThemeToggle />
13+
</div>
14+
</nav>
15+
</template>
16+
17+
<script>
18+
import { mapGetters } from "vuex";
19+
import ThemeToggle from "./ThemeToggle.vue";
20+
21+
export default {
22+
components: {
23+
ThemeToggle
24+
},
25+
computed: {
26+
...mapGetters("auth", ["currentUser"])
27+
}
28+
};
29+
</script>
30+
31+
<style lang="scss" scoped>
32+
nav#nav-bar {
33+
background-color: var(--app-secondary-background-color);
34+
}
35+
36+
nav#nav-bar #nav-items {
37+
display: flex;
38+
flex-flow: wrap;
39+
text-decoration: none;
40+
align-items: center;
41+
text-align: center;
42+
justify-content: space-evenly;
43+
margin: 30px 10px 0 10px;
44+
45+
a {
46+
border-bottom: solid 3px rgba(255, 255, 255, 0);
47+
padding-bottom: 5px;
48+
text-decoration: none;
49+
font-weight: bold;
50+
}
51+
52+
a:hover {
53+
border-bottom: solid 3px var(--primary);
54+
padding-bottom: 5px;
55+
}
56+
a#profile-link {
57+
text-transform: capitalize;
58+
}
59+
}
60+
nav#nav-bar #nav-items > a,
61+
div {
62+
margin: 20px;
63+
}
64+
</style>

src/components/SetNetlifyURL.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default {
4747
background: beige;
4848
padding: 20px;
4949
border-radius: 15px;
50-
margin-bottom: 60px;
5150
}
5251
5352
#input-container {

src/components/ThemeToggle.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export default {
2626
htmlElement.setAttribute("data-theme", "light");
2727
}
2828
}
29+
},
30+
beforeMount() {
31+
// check saved theme and apply
32+
localStorage.getItem("theme") === "dark"
33+
? (this.darkMode = true)
34+
: (this.darkMode = false);
2935
}
3036
};
3137
</script>

src/pages/AllJournals.vue

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
<template>
2-
<div id="journal-background" class="space">
3-
<h1>📔 Your Journals</h1>
2+
<main>
3+
<div class="space">
4+
<h1>📔 Your Journals</h1>
45

5-
<div id="create-journal-container" class="shadow">
6-
<!-- fix to stop page from refreshing when hitting enter:
6+
<div id="create-journal-container" class="shadow">
7+
<!-- fix to stop page from refreshing when hitting enter:
78
https://stackoverflow.com/questions/2215462/html-form-when-i-hit-enter-it-refreshes-page -->
8-
<form id="create-new-journal" onkeypress="return event.keyCode != 13">
9-
<input
10-
v-model="journal.title"
11-
required
12-
type="text"
13-
placeholder="Name of new journal"
14-
@keyup.enter="submit()"
15-
/>
16-
<input
17-
name="create journal"
18-
value="Create Journal"
19-
type="button"
20-
@click="submit()"
21-
/>
22-
</form>
9+
<form id="create-new-journal" onkeypress="return event.keyCode != 13">
10+
<input
11+
v-model="journal.title"
12+
required
13+
type="text"
14+
placeholder="Name of new journal"
15+
@keyup.enter="submit()"
16+
/>
17+
<input
18+
name="create journal"
19+
value="Create Journal"
20+
type="button"
21+
@click="submit()"
22+
/>
23+
</form>
24+
</div>
2325
</div>
24-
2526
<div id="journals-container">
2627
<JournalCard
2728
v-for="(item, index) in allJournals"
@@ -31,7 +32,7 @@
3132
@update-journal="updateJournalTitle"
3233
/>
3334
</div>
34-
</div>
35+
</main>
3536
</template>
3637

3738
<script>
@@ -119,6 +120,12 @@ export default {
119120
</script>
120121

121122
<style lang="scss" scoped>
123+
#journals-background {
124+
max-width: 28rem;
125+
padding: 1rem;
126+
margin: 1rem;
127+
}
128+
122129
#create-journal-container {
123130
background: var(--app-secondary-background-color);
124131
flex-direction: column;
@@ -142,10 +149,6 @@ export default {
142149
justify-content: center;
143150
}
144151
145-
#journals-background {
146-
background-color: black;
147-
}
148-
149152
input[type="button"] {
150153
border: none;
151154
padding: 15px;

src/pages/AllPosts.vue

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
<template>
2-
<div class="space">
3-
<h1>📝 Your Posts</h1>
4-
<div id="create-post-container" class="shadow">
5-
<form class="new-post">
6-
<input v-model="post.title" type="text" placeholder="Title" />
7-
<textarea
8-
v-model="post.contents"
9-
type="text"
10-
placeholder="What's on your mind?"
11-
/>
12-
<input
13-
type="button"
14-
name="add post"
15-
value="Add Post"
16-
@click="submit()"
17-
/>
18-
</form>
2+
<main>
3+
<div class="space">
4+
<h1>📝 Your Posts</h1>
5+
<div id="create-post-container" class="shadow">
6+
<form class="new-post">
7+
<input v-model="post.title" type="text" placeholder="Title" />
8+
<textarea
9+
v-model="post.contents"
10+
type="text"
11+
placeholder="What's on your mind?"
12+
/>
13+
<input
14+
type="button"
15+
name="add post"
16+
value="Add Post"
17+
@click="submit()"
18+
/>
19+
</form>
20+
</div>
1921
</div>
2022

2123
<div id="posts-container">
@@ -27,7 +29,7 @@
2729
@update-post="updatePost"
2830
/>
2931
</div>
30-
</div>
32+
</main>
3133
</template>
3234

3335
<script>
@@ -116,6 +118,7 @@ export default {
116118
}
117119
textarea {
118120
background: var(--app-secondary-background-color);
121+
resize: vertical;
119122
}
120123
}
121124

src/pages/Home.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626
<Login v-if="currentUser === null" />
2727
<div v-else id="greeting">
28-
<h2>🖐️ Welcome Back!</h2>
28+
<h2>🖐️ Welcome Back {{ currentUser.user_metadata.full_name }}!</h2>
2929
<p>
3030
You're logged in. Go check out your
3131
<router-link :to="{ name: 'journals' }">journals ➡️ </router-link>.
@@ -62,16 +62,15 @@ export default {
6262

6363
<!-- Add "scoped" attribute to limit CSS to this component only -->
6464
<style lang="scss">
65-
.home {
66-
height: 100vh;
67-
}
68-
6965
#greeting {
7066
border-style: dashed;
7167
padding: 15px;
7268
border-radius: 15px;
7369
border-color: #c6c6c6;
7470
border-width: 1px;
71+
h2 {
72+
text-transform: capitalize;
73+
}
7574
}
7675
img#logo {
7776
width: 100%;

0 commit comments

Comments
 (0)