Skip to content
Merged
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
237 changes: 237 additions & 0 deletions public/build/assets/app-BX862foK.js

Large diffs are not rendered by default.

237 changes: 0 additions & 237 deletions public/build/assets/app-Hu-6rhL7.js

This file was deleted.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"isEntry": true
},
"resources/js/app.js": {
"file": "assets/app-Hu-6rhL7.js",
"file": "assets/app-BX862foK.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true,
Expand Down
2 changes: 2 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ResourceCard from './components/ResourceCard.vue';
import ResourcePill from './components/ResourcePill.vue';
import Pagination from './components/Pagination.vue';
import SingleSelect from './components/Singleselect.vue';
import PasswordField from './components/PasswordField.vue';
import Multiselect from "./components/Multiselect.vue";
import CountrySelect from "./components/CountrySelect.vue";
import ModerateEvent from "./components/ModerateEvent.vue";
Expand Down Expand Up @@ -46,6 +47,7 @@ app.component('ResourceCard', ResourceCard);
app.component('ResourcePill', ResourcePill);
app.component('Pagination', Pagination);
app.component('Singleselect', SingleSelect);
app.component('PasswordField', PasswordField);
app.component('Multiselect', Multiselect);
app.component('CountrySelect', CountrySelect);
app.component('ModerateEvent', ModerateEvent);
Expand Down
46 changes: 46 additions & 0 deletions resources/js/components/PasswordField.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<template>
<div class="relative">
<input
class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4"
v-model="localValue"
:id="id"
:name="name"
:type="type"
:defaultValue="value"
:required="required"
/>
<div
class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer"
:class="[type !== 'password' && 'hidden']"
@click="type = 'text'"
>
<img src="/images/eye.svg" />
</div>
<div
class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer"
:class="[type !== 'text' && 'hidden']"
@click="type = 'password'"
>
<img src="/images/eye-slash.svg" />
</div>
</div>
</template>

<script>
import { ref } from 'vue';

export default {
props: {
required: Boolean,
id: String,
name: String,
value: String,
},
setup(props, { emit }) {
const type = ref('password');
const localValue = ref(props.value || '');

return { type, localValue };
},
};
</script>
41 changes: 1 addition & 40 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4
<div class="mb-3">
<div>
<label for="password" class="font-normal text-xl">@lang('login.password')*</label>
<div class="relative mt-3">
<input id="password" type="password" name="password"
class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4"
value="{{old('title')}}" required>
<img src="/images/eye.svg" id="password-eye" class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer">
<img src="/images/eye-slash.svg" id="password-eye-slash" class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer hidden">
</div>
<password-field id="password" name="password" value="{{old('password')}}" required />
</div>
<div class="text-error-200 font-semibold mt-2">
@component('components.validation-errors', ['field'=>'password'])@endcomponent
Expand Down Expand Up @@ -114,36 +108,3 @@ class="absolute top-0 -right-1/4 h-full max-w-[calc(70vw)] object-cover opacity-
@livewire('still-have-question-section')
</section>
@endsection

@push('scripts')
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
const passwordInput = document.getElementById('password');
const eyeIcon = document.getElementById('password-eye');
const eyeSlashIcon = document.getElementById('password-eye-slash');

const togglePasswordVisibility = (event) => {
event.preventDefault(); // Prevents unintended behavior

if (passwordInput.type === 'password') {
passwordInput.setAttribute('type', 'text');
eyeIcon.classList.add('hidden');
eyeSlashIcon.classList.remove('hidden');
} else {
passwordInput.setAttribute('type', 'password');
eyeIcon.classList.remove('hidden');
eyeSlashIcon.classList.add('hidden');
}

// Refocus input after changing type to avoid losing cursor position
passwordInput.focus();
const val = passwordInput.value;
passwordInput.value = ''; // Temporarily clear
passwordInput.value = val; // Restore to keep cursor at the end
};

eyeIcon.addEventListener('mousedown', togglePasswordVisibility);
eyeSlashIcon.addEventListener('mousedown', togglePasswordVisibility);
});
</script>
@endpush
49 changes: 2 additions & 47 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4
<div class="mb-6">
<div>
<label for="password" class="font-normal text-xl">@lang('login.password')*</label>
<div class="relative mt-3">
<input id="password" type="password" name="password"
class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4"
value="{{old('password')}}" required>
<img src="/images/eye.svg" id="password-eye" class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer">
<img src="/images/eye-slash.svg" id="password-eye-slash" class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer hidden">
</div>
<password-field id="password" name="password" value="{{old('password')}}" required />
</div>
<div class="text-error-200 font-semibold mt-2">
@component('components.validation-errors', ['field'=>'password'])@endcomponent
Expand All @@ -87,13 +81,7 @@ class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4"
<div class="mb-5">
<div>
<label for="password_confirmation" class="font-normal text-xl">@lang('login.confirm_password')*</label>
<div class="relative mt-3">
<input id="password_confirmation" type="password" name="password_confirmation"
class="border-2 border-solid border-dark-blue-200 w-full rounded-full h-12 px-4"
required>
<img src="/images/eye.svg" id="confirm-password-eye" class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer">
<img src="/images/eye-slash.svg" id="confirm-password-eye-slash" class="absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer hidden">
</div>
<password-field id="password_confirmation" name="password_confirmation" required />
</div>
<div class="text-error-200 font-semibold mt-2">
@component('components.validation-errors', ['field'=>'password'])@endcomponent
Expand Down Expand Up @@ -141,36 +129,3 @@ class="absolute top-0 -right-1/4 h-full max-w-[calc(70vw)] object-cover opacity-
@livewire('still-have-question-section')
</section>
@endsection

@push('scripts')
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
const passwordInput = document.getElementById('password');
const confirmPasswordInput = document.getElementById('password_confirmation');
const eyeIcon = document.getElementById('password-eye');
const eyeSlashIcon = document.getElementById('password-eye-slash');
const confirmEyeIcon = document.getElementById('confirm-password-eye');
const confirmEyeSlashIcon = document.getElementById('confirm-password-eye-slash');

const togglePasswordVisibility = () => {
const isPassword = passwordInput.type === 'password';
passwordInput.type = isPassword ? 'text' : 'password';
eyeIcon.style.display = isPassword ? 'none' : 'block';
eyeSlashIcon.style.display = isPassword ? 'block' : 'none';
};

eyeIcon.addEventListener('click', togglePasswordVisibility);
eyeSlashIcon.addEventListener('click', togglePasswordVisibility);

const toggleConfirmPasswordVisibility = () => {
const isConfirmPassword = confirmPasswordInput.type === 'password';
confirmPasswordInput.type = isConfirmPassword ? 'text' : 'password';
confirmEyeIcon.style.display = isConfirmPassword ? 'none' : 'block';
confirmEyeSlashIcon.style.display = isConfirmPassword ? 'block' : 'none';
};

confirmEyeIcon.addEventListener('click', toggleConfirmPasswordVisibility);
confirmEyeSlashIcon.addEventListener('click', toggleConfirmPasswordVisibility);
});
</script>
@endpush
Loading