Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/assets/avatar-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/avatar-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,22 @@ document.getElementById("profileImage").addEventListener("change", function(even
reader.readAsDataURL(file);
}
});

// Pour l'adaptation de l'avatar dans edit-profil-info.html au darck mode
function updateImage() {
const img = document.getElementById("previewImage");
if (document.documentElement.classList.contains("dark")) {
// Image pour le mode sombre
img.src = "../assets/avatar-dark.svg";
} else {
// Image pour le mode clair
img.src = "../assets/avatar-light.svg";
}
}

// Vérifier et mettre à jour au chargement de la page
updateImage();

// Détecter le changement de mode sombre
const observer = new MutationObserver(updateImage);
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
34 changes: 17 additions & 17 deletions src/pages/edit-profil-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@
<div
class="flex flex-col md:flex-row md:items-center mt-4 mb-4 gap-9"
>
<img
<img
id="previewImage"
class="w-36 h-36 rounded-full object-cover border border-gray-300 bg-zinc-100 dark:bg-zinc-800 mt-4"
class="w-36 h-36 rounded-full object-cover border border-zinc-300 bg-zinc-100 dark:bg-zinc-800 mt-4"
src=""
alt=""
/>
Expand Down Expand Up @@ -264,7 +264,7 @@
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-zinc-100 border-e-0 rounded-s-md dark:bg-zinc-800 dark:border-white/5 dark:text-gray-400"
>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -284,7 +284,7 @@
<input
type="text"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="julesmukadi"
/>
</div>
Expand All @@ -296,7 +296,7 @@
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-zinc-100 border-e-0 rounded-s-md dark:bg-zinc-800 dark:border-white/5"
>
<svg
class="w-4 h-4 text-gray-500 dark:text-gray-400"
Expand All @@ -313,7 +313,7 @@
<input
type="text"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="Jules MUKADI"
/>
</div>
Expand All @@ -325,14 +325,14 @@
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-zinc-100 border-e-0 rounded-s-md dark:bg-zinc-800 dark:border-white/5 dark:text-gray-400"
>
<ion-icon name="file-tray-stacked-outline"></ion-icon>
</span>
<input
type="text"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="Front-end Developer"
/>
</div>
Expand All @@ -344,14 +344,14 @@
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-zinc-100 border-e-0 rounded-s-md dark:text-gray-400 dark:bg-zinc-800 dark:border-white/5"
>
<ion-icon name="mail-outline" class="size-4"></ion-icon>
</span>
<input
type="email"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="infinitytech@exemple.com"
/>
</div>
Expand All @@ -371,14 +371,14 @@ <h1 class="mb-3">Social profiles</h1>
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-zinc-100 border-e-0 rounded-s-md dark:text-gray-400 dark:bg-zinc-800 dark:border-white/5"
>
<ion-icon name="logo-linkedin" class="size-4"></ion-icon>
</span>
<input
type="text"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-zinc-100 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="https://www.linkedin.com/in/username/"
/>
</div>
Expand All @@ -390,14 +390,14 @@ <h1 class="mb-3">Social profiles</h1>
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 border-zinc-100 bg-gray-200 border rounded-e-0 border-e-0 rounded-s-md dark:text-gray-400 dark:bg-zinc-800 dark:border-white/5"
>
<ion-icon name="logo-github" class="size-4"></ion-icon>
</span>
<input
type="text"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-zinc-100 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="https://github.com/username/"
/>
</div>
Expand All @@ -409,7 +409,7 @@ <h1 class="mb-3">Social profiles</h1>
>
<div class="flex">
<span
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-gray-300 border-e-0 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600"
class="inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border rounded-e-0 border-zinc-100 border-e-0 rounded-s-md dark:text-gray-400 dark:bg-zinc-800 dark:border-white/5"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244" />
Expand All @@ -419,14 +419,14 @@ <h1 class="mb-3">Social profiles</h1>
<input
type="text"
id=""
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
class="rounded-none rounded-e-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-zinc-100 p-2.5 dark:border-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="https://infinitytech.com"
/>
</div>
</div>
<button
type="button"
class="text-white flex justify-center items-center gap-2 mt-12 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
class="text-white flex justify-center items-center gap-2 mt-12 bg-blue-700 hover:bg-blue-800 focus:ring-0 focus:ring-zinc-100 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
>
Update
<svg
Expand Down
2 changes: 1 addition & 1 deletion src/pages/profil-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ <h1 class="text-2xl text-black dark:text-white font-bold p-0">
<div class="flex items-center gap-2">
<!-- Bouton Edit -->
<a
href="#"
href="edit-profil-info.html"
class="bg-blue-700 hover:bg-blue-500 duration-300 text-white px-4 py-2 rounded-full flex items-center gap-2 text-sm font-medium"
>
<ion-icon name="pencil-outline" class="text-base"></ion-icon>
Expand Down