Skip to content

Commit b551462

Browse files
authored
Merge pull request #31 from GuilhermmeDev/design_fixes
design_fixes
2 parents e265658 + c5bc279 commit b551462

31 files changed

Lines changed: 189 additions & 424 deletions

app/Http/Controllers/MainController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ public function welcome()
1818
public function home()
1919
{
2020
$search = request('q');
21+
22+
$query = Campaign::orderBy('created_at', 'desc');
23+
2124
if ($search) {
22-
$campaigns = Campaign::where([['Title', 'like', '%'.$search.'%']])->get();
23-
} else {
24-
$campaigns = Campaign::all();
25+
$query->where('Title', 'like', '%'.$search.'%');
2526
}
2627

28+
$campaigns = $query->get();
29+
2730
return view('home', compact('campaigns', 'search'));
2831
}
2932
}

resources/js/alpine.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Alpine from "alpinejs";
2+
3+
window.Alpine = Alpine;
4+
Alpine.start();

resources/js/app.js

Lines changed: 2 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,4 @@
1-
// resources/js/app.js
2-
31
import "./bootstrap";
42
import "./echo";
5-
6-
import "instascan";
7-
8-
import Alpine from "alpinejs";
9-
window.Alpine = Alpine;
10-
Alpine.start();
11-
12-
import "swiper/swiper-bundle.css";
13-
import Swiper from "swiper/bundle";
14-
15-
// Lógica para o botão de copiar URL
16-
document.addEventListener("DOMContentLoaded", () => {
17-
const buttonCopy = document.querySelector("#copy");
18-
if (buttonCopy) {
19-
buttonCopy.addEventListener("click", (e) => {
20-
const input = document.querySelector("#share-input");
21-
input.select();
22-
document.execCommand("copy");
23-
24-
buttonCopy.innerText = "Copiado!";
25-
setTimeout(() => {
26-
buttonCopy.innerText = "Copiar";
27-
}, 2000);
28-
});
29-
}
30-
});
31-
32-
// Funções e lógica do modal de convite
33-
function closeModal() {
34-
const inviteModal = document.getElementById("invite_modal");
35-
if (inviteModal) {
36-
inviteModal.style.display = "none";
37-
}
38-
}
39-
40-
function openInviteModal() {
41-
const inviteModal = document.getElementById("invite_modal");
42-
if (inviteModal) {
43-
inviteModal.style.display = "flex";
44-
}
45-
}
46-
47-
document.addEventListener("DOMContentLoaded", () => {
48-
const inviteForm = document.getElementById("invite_form");
49-
if (inviteForm) {
50-
inviteForm.addEventListener("submit", function (e) {
51-
e.preventDefault();
52-
53-
const formData = new FormData(this);
54-
const actionUrl =
55-
inviteForm.getAttribute("data-action") || "/campaign/invite";
56-
57-
fetch(actionUrl, {
58-
method: "POST",
59-
headers: {
60-
// Só adiciona o header se o meta existir
61-
...(document.querySelector('meta[name="csrf-token"]')
62-
? {
63-
"X-CSRF-TOKEN": document.querySelector(
64-
'meta[name="csrf-token"]'
65-
).content,
66-
}
67-
: {}),
68-
},
69-
body: formData,
70-
})
71-
.then((response) => response.json())
72-
.then((data) => {
73-
alert(data.message);
74-
closeModal();
75-
})
76-
.catch((error) => {
77-
console.error("Erro:", error);
78-
alert(
79-
"Ocorreu um erro ao enviar o convite. Tente novamente."
80-
);
81-
});
82-
});
83-
}
84-
});
85-
86-
window.closeModal = closeModal;
87-
window.openInviteModal = openInviteModal;
88-
89-
// Inicialização do Swiper (com breakpoints para cards menores e alinhados)
90-
document.addEventListener("DOMContentLoaded", function () {
91-
if (document.querySelector(".mySwiper")) {
92-
const swiper = new Swiper(".mySwiper", {
93-
spaceBetween: 20,
94-
loop: false,
95-
centeredSlides: false, // Garante que os slides não fiquem centralizados
96-
97-
// Adiciona um offset antes do primeiro slide para alinhar com o padding da página (p-5 = 20px)
98-
slidesOffsetBefore: 20,
99-
100-
pagination: {
101-
el: ".swiper-pagination",
102-
clickable: true,
103-
},
104-
105-
navigation: {
106-
nextEl: ".swiper-button-next",
107-
prevEl: ".swiper-button-prev",
108-
},
109-
110-
breakpoints: {
111-
// Mobile (0px e acima)
112-
0: {
113-
slidesPerView: 1.2, // Mostra 1 card completo e um pedaço do próximo
114-
spaceBetween: 15,
115-
slidesOffsetBefore: 20,
116-
},
117-
// Pequenas telas (ex: tablets pequenos, 640px e acima)
118-
640: {
119-
slidesPerView: 2.5, // Mostra 2.5 cards
120-
spaceBetween: 20,
121-
slidesOffsetBefore: 20,
122-
},
123-
// Tablets e desktops menores (768px e acima)
124-
768: {
125-
slidesPerView: 3.5, // Mostra 3.5 cards
126-
spaceBetween: 25,
127-
slidesOffsetBefore: 20,
128-
},
129-
// Desktops médios (992px e acima)
130-
992: {
131-
slidesPerView: 4.5, // Mostra 4.5 cards
132-
spaceBetween: 30,
133-
slidesOffsetBefore: 20,
134-
},
135-
// Desktops maiores (1200px e acima)
136-
1200: {
137-
slidesPerView: 5.5, // Mostra 5.5 cards
138-
spaceBetween: 30,
139-
slidesOffsetBefore: 20,
140-
},
141-
},
142-
});
143-
}
144-
});
3+
import "./validators";
4+
import "./alpine";

resources/js/bootstrap.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import axios from 'axios';
1+
import axios from "axios";
22
window.axios = axios;
33

4-
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
4+
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
55

66
/**
77
* Echo exposes an expressive API for subscribing to channels and listening
88
* for events that are broadcast by Laravel. Echo and event broadcasting
99
* allow your team to quickly build robust real-time web applications.
1010
*/
11-
12-
import './echo';

resources/js/validators.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Funções e lógica do modal de convite
2+
function closeModal() {
3+
const inviteModal = document.getElementById("invite_modal");
4+
if (inviteModal) {
5+
inviteModal.style.display = "none";
6+
}
7+
}
8+
9+
function openInviteModal() {
10+
const inviteModal = document.getElementById("invite_modal");
11+
if (inviteModal) {
12+
inviteModal.style.display = "flex";
13+
}
14+
}
15+
16+
document.addEventListener("DOMContentLoaded", () => {
17+
const inviteForm = document.getElementById("invite_form");
18+
if (inviteForm) {
19+
inviteForm.addEventListener("submit", function (e) {
20+
e.preventDefault();
21+
22+
const formData = new FormData(this);
23+
const actionUrl =
24+
inviteForm.getAttribute("data-action") || "/campaign/invite";
25+
26+
fetch(actionUrl, {
27+
method: "POST",
28+
headers: {
29+
// Só adiciona o header se o meta existir
30+
...(document.querySelector('meta[name="csrf-token"]')
31+
? {
32+
"X-CSRF-TOKEN": document.querySelector(
33+
'meta[name="csrf-token"]'
34+
).content,
35+
}
36+
: {}),
37+
},
38+
body: formData,
39+
})
40+
.then((response) => response.json())
41+
.then((data) => {
42+
alert(data.message);
43+
closeModal();
44+
})
45+
.catch((error) => {
46+
console.error("Erro:", error);
47+
alert(
48+
"Ocorreu um erro ao enviar o convite. Tente novamente."
49+
);
50+
});
51+
});
52+
}
53+
54+
const buttonCopy = document.querySelector("#copy");
55+
if (buttonCopy) {
56+
buttonCopy.addEventListener("click", (e) => {
57+
const input = document.querySelector("#share-input");
58+
input.select();
59+
document.execCommand("copy");
60+
61+
buttonCopy.innerText = "Copiado!";
62+
setTimeout(() => {
63+
buttonCopy.innerText = "Copiar";
64+
}, 2000);
65+
});
66+
}
67+
});
68+
69+
window.closeModal = closeModal;
70+
window.openInviteModal = openInviteModal;

resources/views/auth/forgot-password.blade.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@
2727

2828
<body class="h-screen bg-white dark:bg-neutral-900 text-gray-900 dark:text-gray-100">
2929
<div class="absolute top-0 left-0 z-50 pt-4 pl-4">
30-
<a href="{{ route('login') }}"
30+
<a href="{{ redirect()->back()->getTargetUrl()}}"
3131
class="flex items-center gap-2 px-4 py-2 rounded-lg text-black dark:text-white text-base font-semibold focus:outline-none">
3232
<svg class="w-5 h-5 text-black dark:text-white" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /></svg>
3333
Voltar
3434
</a>
3535
</div>
3636
<main class="h-full flex flex-col justify-center items-center">
37-
<img src="{{ asset('assets/logo1.svg') }}" alt="logo doeit" class="w-24 h-24 mb-6">
38-
<section class="max-w-3xl min-h-[520px] px-6 py-16 mx-auto text-center bg-white dark:bg-neutral-800 rounded-lg shadow-lg relative flex flex-col justify-start" id="forgotPasswordSection">
37+
<a href="{{redirect()->back()->getTargetUrl()}}">
38+
<img src="{{ asset('assets/logo1.svg') }}" alt="logo doeit" class="w-24 h-24 mb-6">
39+
</a>
40+
<section class="max-w-3xl min-h-[520px] px-6 py-16 mx-auto text-center bg-white dark:bg-neutral-800 rounded-lg shadow-lg relative flex flex-col justify-center" id="forgotPasswordSection">
3941
<h1 class="text-3xl font-semibold text-gray-900 dark:text-gray-100">Perdeu a Senha?</h1>
4042
<p class="max-w-md mx-auto mt-5 text-gray-700 dark:text-gray-300">Não se preocupe. Nós iremos te mandar um e-mail de recupação de senha.</p>
4143

@@ -122,4 +124,4 @@ class="flex items-center gap-2 px-4 py-2 rounded-lg text-black dark:text-white t
122124
<script src="/node_modules/flowbite/dist/flowbite.min.js"></script>
123125
</body>
124126

125-
</html>
127+
</html>

resources/views/auth/login.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<link rel="canonical" href="https://doeit.com.br/login" />
1111
<link rel="icon" href="{{ asset('assets/favicon.svg') }}" type="image/x-icon"/>
12-
<script defer src="js/cdn.min.js"></script>
1312
<title>Login - Doeit</title>
1413
@vite(['resources/css/app.css', 'resources/js/app.js'])
1514
</head>
@@ -52,7 +51,7 @@ class="w-full mt-2 px-3 py-2 text-gray-500 dark:text-gray-300 bg-transparent out
5251
<div class="relative">
5352
<label class="font-medium text-gray-900 dark:text-gray-100" for="password">Senha</label>
5453
<div class="flex flex-col w-full">
55-
<div class="flex flex-row w-full mt-2 text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-neutral-600 focus:border-indigo-600 shadow-sm rounded-lg pr-5 items-center justify-between">
54+
<div class="flex flex-row w-full px-3 py-2 mt-2 text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-neutral-600 focus:border-indigo-600 shadow-sm rounded-lg pr-5 items-center justify-between">
5655
<input
5756
id="password"
5857
type="password"

resources/views/auth/register-cpf.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
@vite(['resources/css/app.css', 'resources/js/app.js'])
7-
<link rel="icon" href="{{ asset('assets/favicon.svg') }}" type="image/x-icon" /> <script defer src="js/cdn.min.js"></script>
7+
<link rel="icon" href="{{ asset('assets/favicon.svg') }}" type="image/x-icon" />
88
<link rel="stylesheet" href="{{ asset('css/fonts.css') }}">
99
<title>DoeIt - Cadastro de CPF</title>
1010
<style>
@@ -152,4 +152,4 @@ function validateForm() {
152152
}
153153
</script>
154154
</body>
155-
</html>
155+
</html>

resources/views/auth/register.blade.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<link rel="canonical" href="https://doeit.com.br/register" />
1111
<link rel="icon" href="{{ asset('assets/favicon.svg') }}" type="image/x-icon"/>
12-
<script defer src="js/cdn.min.js"></script>
1312
<title>Registro - Doeit</title>
1413
@vite(['resources/css/app.css', 'resources/js/app.js'])
1514

@@ -78,7 +77,7 @@ class="w-full mt-1 px-3 py-2 text-gray-500 dark:text-gray-300 bg-transparent out
7877
<div class="relative">
7978
<label class="font-medium text-gray-900 dark:text-gray-100">Senha</label>
8079
<div class="flex flex-col w-full">
81-
<div class="flex flex-row w-full mt-2 text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-neutral-600 focus:border-indigo-600 shadow-sm rounded-lg pr-5 items-center justify-between">
80+
<div class="flex flex-row w-full px-3 py-2 mt-2 text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-neutral-600 focus:border-indigo-600 shadow-sm rounded-lg pr-5 items-center justify-between">
8281
<input
8382
placeholder="Insira sua senha"
8483
id="password"
@@ -105,7 +104,7 @@ class="object-cover size-6 cursor-pointer"
105104
<div class="relative">
106105
<label class="font-medium text-gray-900 dark:text-gray-100">Confirmar senha</label>
107106
<div class="flex flex-col w-full">
108-
<div class="flex flex-row w-full mt-2 text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-neutral-600 focus:border-indigo-600 shadow-sm rounded-lg pr-5 items-center justify-between">
107+
<div class="flex flex-row w-full mt-2 px-3 py-2 text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-neutral-600 focus:border-indigo-600 shadow-sm rounded-lg pr-5 items-center justify-between">
109108
<input
110109
placeholder="Confirme sua senha"
111110
id="cpassword"

0 commit comments

Comments
 (0)