Skip to content

Commit ede8cbf

Browse files
committed
feat: add pages and shared layout
1 parent 1f35816 commit ede8cbf

18 files changed

+1174
-165
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"build": "vite build"
66
},
77
"devDependencies": {
8+
"@tailwindcss/aspect-ratio": "^0.4.2",
9+
"@tailwindcss/forms": "^0.5.3",
810
"autoprefixer": "^10.4.8",
911
"axios": "^0.27",
1012
"laravel-vite-plugin": "^0.5.0",

postcss.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
plugins: {
3+
"tailwindcss/nesting": {},
34
tailwindcss: {},
45
autoprefixer: {},
56
},

resources/css/app.css

Lines changed: 0 additions & 31 deletions
This file was deleted.

resources/css/bootstrap.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
.mobile-menu {
6+
@apply hidden;
7+
8+
&--visible {
9+
@apply flex;
10+
}
11+
}

resources/css/home.css

Whitespace-only changes.

resources/css/search.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.mobile-filters-menu {
2+
@apply hidden;
3+
4+
&--visible {
5+
@apply flex;
6+
}
7+
}
8+

resources/js/app.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

resources/js/bootstrap.js

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
1-
import _ from 'lodash';
1+
import _ from "lodash";
2+
import axios from "axios";
3+
4+
import { handleMobileMenu } from "./utils";
5+
26
window._ = _;
37

48
/**
59
* We'll load the axios HTTP library which allows us to easily issue requests
610
* to our Laravel back-end. This library automatically handles sending the
711
* CSRF token as a header based on the value of the "XSRF" token cookie.
812
*/
9-
10-
import axios from 'axios';
1113
window.axios = axios;
14+
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
1215

13-
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
14-
15-
/**
16-
* Echo exposes an expressive API for subscribing to channels and listening
17-
* for events that are broadcast by Laravel. Echo and event broadcasting
18-
* allows your team to easily build robust real-time web applications.
19-
*/
20-
21-
// import Echo from 'laravel-echo';
22-
23-
// import Pusher from 'pusher-js';
24-
// window.Pusher = Pusher;
25-
26-
// window.Echo = new Echo({
27-
// broadcaster: 'pusher',
28-
// key: import.meta.env.VITE_PUSHER_APP_KEY,
29-
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
30-
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
31-
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
32-
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
33-
// enabledTransports: ['ws', 'wss'],
34-
// });
16+
/** Mobile menu */
17+
handleMobileMenu(".mobile-menu");

resources/js/home.js

Whitespace-only changes.

resources/js/search.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { handleMobileMenu } from "./utils";
2+
3+
/** Mobile filters menu */
4+
handleMobileMenu(".mobile-filters-menu");

resources/js/utils.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export function handleMobileMenu(target) {
2+
const mobileMenu = document.querySelector(target);
3+
4+
function toggleMobileMenu(value) {
5+
mobileMenu.classList[value ? "add" : "remove"](
6+
`${target.slice(1)}--visible`
7+
);
8+
}
9+
10+
document
11+
.querySelector(`${target}-open-trigger`)
12+
.addEventListener("click", () => toggleMobileMenu(true));
13+
14+
document
15+
.querySelector(`${target}-close-trigger`)
16+
.addEventListener("click", () => toggleMobileMenu(false));
17+
}

0 commit comments

Comments
 (0)