Skip to content

Commit

Permalink
Update mobile nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Ancocodet committed Mar 11, 2024
1 parent 8fd7ecf commit 02cca78
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"typescript": "5.0.2"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.21",
Expand Down
3 changes: 1 addition & 2 deletions src/components/item_list.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Collection, Item} from "@/lib/types";
import Image from "next/image";

export default function ItemList(collection: Collection) {

Expand Down Expand Up @@ -64,7 +63,7 @@ export default function ItemList(collection: Collection) {

return (
<div className="w-full text-center py-10" id={ collection.caption.toLowerCase() }>
<h1 className="text-3xl font-bold" id={ collection.caption.toLowerCase() + "_header" }>{collection.caption}</h1>
<h1 className="text-3xl font-bold dark:text-white text-black" id={ collection.caption.toLowerCase() + "_header" }>{collection.caption}</h1>
<div className="py-3 px-4 lg:px-12 flex flex-wrap justify-center" key={ collection.caption.toLowerCase() }>
{getItems().map((value) => {
return buildItem(value)
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default function Home() {
}

return (
<div className="w-full h-full bg-gray-100" key={"home_page"}>
<div className={mobileMenu ? "bg-gray-800 w-full h-full fixed z-10" : "hidden"} key={"mobile_menu"}>
<div className="w-screen h-full bg-gray-100 dark:bg-gray-700" key={"home_page"}>
<div className={mobileMenu ? "bg-gray-800 w-screen h-full fixed z-20 translate-x-0 transition-all duration-150 ease-in-out md:-translate-x-full" : "bg-gray-800 w-screen h-full fixed z-10 -translate-x-full transition-all duration-150 ease-in-out"} key={"mobile_menu"}>
<ul className="flex flex-col gap-3 pt-12 px-5">
{
collections.map((collection) => {
Expand Down Expand Up @@ -89,7 +89,7 @@ export default function Home() {
}
</a>
</div>
<div className="py-12">
<div className="py-12 z-0">
{
collections.map((value) => {
return ItemList(getCollection(value))
Expand Down
4 changes: 2 additions & 2 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ root {
}

.item {
@apply shadow-md rounded-md overflow-hidden inline-block relative my-2;
@apply shadow-md rounded-md overflow-hidden inline-block relative my-2 bg-white dark:bg-gray-800;
}

.item img {
Expand All @@ -35,7 +35,7 @@ root {
}

.item .description {
@apply opacity-0 bg-neutral-700 bg-opacity-75 w-full h-full text-white absolute left-0 top-0 z-10 p-5 transition-all duration-300 ease-in-out;
@apply opacity-0 bg-black bg-opacity-65 w-full h-full text-white absolute left-0 top-0 z-10 p-5 transition-all duration-300 ease-in-out;
}

.item:hover .description {
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
extend: {},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography')
],
}

0 comments on commit 02cca78

Please sign in to comment.