Skip to content

Commit 35f8760

Browse files
committed
fix: added footer and corresponding css changes to avoid layout issues
1 parent a1afff2 commit 35f8760

File tree

6 files changed

+60
-28
lines changed

6 files changed

+60
-28
lines changed

components/footer.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<footer
3+
class="py-4 mt-4 text-center text-gray-800 bg-inherit dark:text-gray-50 min-h-max"
4+
>
5+
Made with &hearts; by &copy;
6+
<a href="https://technikhil314.netlify.app">Nikhil Mehta</a>
7+
</footer>
8+
</template>

components/navbar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<header
3-
class="fixed top-0 left-0 right-0 text-gray-800 shadow-lg dark:shadow-dark bg-gray-50 dark:bg-gray-900 z-100 dark:text-gray-50"
2+
<nav
3+
class="sticky top-0 left-0 right-0 z-10 text-gray-800 shadow-lg dark:shadow-dark bg-gray-50 dark:bg-gray-900 dark:text-gray-50"
44
>
5-
<div class="container flex items-center h-full py-4 m-auto">
5+
<div class="container flex items-center py-4 m-auto">
66
<div v-if="showBackButton" class="hidden mr-4 md:block">
77
<NuxtLink to="/">
88
<svg
@@ -147,7 +147,7 @@
147147
</ul>
148148
</nav>
149149
</div>
150-
</header>
150+
</nav>
151151
</template>
152152

153153
<script>

pages/diff.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="contents">
2+
<div class="page-contents">
33
<Navbar :show-back-button="true">
44
<template #right>
55
<button
@@ -52,7 +52,6 @@
5252
<div
5353
class="flex items-stretch w-full gap-4 font-mono text-gray-800 dark:text-gray-50"
5454
>
55-
<h1>{{ name }}</h1>
5655
<div
5756
class="relative flex-1 px-4 py-2 overflow-y-auto border-2 rounded-md dark:border-gray-500 max-h-screen--nav line-number-gutter min-h-80"
5857
>
@@ -83,13 +82,16 @@
8382
</div>
8483
</div>
8584
</main>
85+
<Footer />
8686
</div>
8787
</template>
8888

8989
<script>
9090
import pako from 'pako'
9191
import { undoUrlSafeBase64, escapeHtml } from '../helpers/utils'
92+
import footer from '~/components/footer.vue'
9293
export default {
94+
components: { footer },
9395
layout: 'main',
9496
data() {
9597
return {

pages/index.vue

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
<template>
2-
<div class="contents">
2+
<div class="page-contents">
33
<Navbar />
44
<main class="text-gray-800 dark:text-gray-50">
5-
<h1 class="w-full mb-2 text-xl text-center">
6-
Find difference in any two text blocks and get easy sharable link
7-
</h1>
8-
<h2 class="w-full mb-2 text-center text-md">
9-
Don’t worry, We don’t store any of your data
10-
</h2>
11-
<form class="w-full h-full" @submit="checkForm">
12-
<div class="flex flex-wrap w-full h-full gap-4">
5+
<section>
6+
<header>
7+
<h1 class="w-full mb-2 text-xl text-center">
8+
Find difference in any two text blocks and get easy sharable link
9+
</h1>
10+
<h2 class="w-full mb-2 text-center text-md">
11+
Don’t worry, We don’t store any of your data
12+
</h2>
13+
</header>
14+
</section>
15+
<form class="w-full" @submit="checkForm">
16+
<div class="flex flex-wrap w-full gap-4">
1317
<textarea
18+
rows="28"
1419
id="lhs"
15-
class="flex-1 h-full max-h-full bg-transparent rounded-md resize-none form-textarea"
20+
class="flex-1 bg-transparent rounded-md resize-none form-textarea"
1621
></textarea>
1722
<textarea
1823
id="rhs"
19-
class="flex-1 h-full max-h-full bg-transparent rounded-md resize-none form-textarea"
24+
rows="28"
25+
class="flex-1 bg-transparent rounded-md resize-none form-textarea"
2026
></textarea>
2127
<div class="self-end flex-grow-0 w-full text-center">
2228
<button
@@ -28,6 +34,7 @@
2834
</div>
2935
</form>
3036
</main>
37+
<Footer />
3138
</div>
3239
</template>
3340

@@ -88,8 +95,14 @@ export default Vue.extend({
8895
},
8996
})
9097
</script>
91-
<style>
92-
.page-root {
93-
max-height: calc(100% - 14rem);
98+
99+
<style scoped>
100+
main {
101+
@apply grid gap-4;
102+
103+
grid-template-rows: 100px 1fr;
104+
@media screen and (min-width: 768px) {
105+
grid-template-rows: 60px 1fr;
106+
}
94107
}
95108
</style>

styles/global.scss

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,40 @@
22
:root {
33
color-scheme: dark light;
44
}
5+
6+
html,
7+
body,
8+
#__nuxt,
9+
#__layout,
10+
.page-root {
11+
@apply min-h-[100vh];
12+
}
13+
514
html,
615
body,
716
#__nuxt,
817
#__layout,
918
.page-root,
1019
main {
11-
@apply h-full;
1220
@apply bg-gray-50 dark:bg-gray-900;
1321
}
1422

1523
body {
1624
font-family: 'Open Sans', sans-serif;
1725
}
1826

19-
.hidden {
20-
display: none;
21-
visibility: hidden;
22-
}
23-
2427
.page-root {
2528
@apply flow-root w-full;
2629
}
2730

31+
.page-contents {
32+
@apply grid;
33+
grid-template-rows: 80px 1fr 80px;
34+
}
35+
2836
main {
2937
@apply flex flex-wrap xl:container;
30-
margin-top: 5.5rem;
38+
margin-top: 2rem;
3139
}
3240

3341
/* custom scrollbar */

tailwind.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module.exports = {
1515
},
1616
zIndex: {
1717
'1': 1,
18-
'2': 2
18+
'2': 2,
19+
'10': 10
1920
},
2021
minHeight: {
2122
'80': '20rem'

0 commit comments

Comments
 (0)