v0.6.0 - Darkmode

This commit is contained in:
frederikpyt
2020-08-11 09:13:48 +02:00
parent d071e583f5
commit 64c260a63f
12 changed files with 116 additions and 37 deletions
@@ -31,17 +31,17 @@
</select>
<label for="dark">Sprog / Languages:</label>
<label for="dark">Tema / Theme:</label>
<select name="light" id="darkmode">
@if(request()->cookie('mode') == "light")
<option selected name="ligthmode" value="Light">Light</option>
<option selected name="ligthmode" style="color: black;" value="Light">{{ __("msg.lys") }}</option>
@else
<option name="light" value="light">Light</option>
<option name="light" style="color: black;" value="light">{{ __("msg.lys") }}</option>
@endif
@if(request()->cookie('mode') == "dark")
<option selected name="darkmode" value="dark">Dark</option>
<option selected name="darkmode" style="color: black;" value="dark">{{ __("msg.mørk") }}</option>
@else
<option name="dark" value="dark">Dark</option>
<option name="dark" style="color: black;" value="dark">{{ __("msg.mørk") }}</option>
@endif
</select>
@@ -17,7 +17,7 @@
<span>{{__('msg.telefon')}} Nr.:</span>
<input type="text" name="phone" id="phone" value="{{ Auth::user()->phone }}" required>
<button type="submit" class="btn text-center btn-sde-blue mt-1">{{__('msg.rediger')}}</button>
<button onclick="window.location.href = '{{ route('users.account') }}';" class="btn text-center btn-sde-blue mt-1">{{__('msg.tilbage')}}</button>
<a href="{{ route('users.account') }}" class="btn text-center btn-sde-blue mt-1">{{__('msg.tilbage')}}</a>
</form>
</main>
@endsection
@@ -40,18 +40,37 @@
@endsection
@section("scripts")
<script>
function show($passID, $faID) {
var inputPass = document.getElementById($passID);
var faEye = document.getElementById($faID);
@if(request()->cookie("mode") == "dark")
<script>
function show($passID, $faID) {
var inputPass = document.getElementById($passID);
var faEye = document.getElementById($faID);
if (inputPass.type === "password") {
inputPass.type = "text";
faEye.style.color = "#000";
} else {
inputPass.type = "password";
faEye.style.color = "#808080";
if (inputPass.type === "password") {
inputPass.type = "text";
faEye.style.color = "#333333";
} else {
inputPass.type = "password";
faEye.style.color = "#ffffff";
}
}
}
</script>
</script>
@else
<script>
function show($passID, $faID) {
var inputPass = document.getElementById($passID);
var faEye = document.getElementById($faID);
if (inputPass.type === "password") {
inputPass.type = "text";
faEye.style.color = "#333333";
} else {
inputPass.type = "password";
faEye.style.color = "#808080";
}
}
</script>
@endif
@endsection