Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
@@ -0,0 +1,121 @@
<x-content.content-card icon="discord-icon" classes="border dark:border-gray-900">
<x-slot:title>
{{ __('Discord') }}
</x-slot:title>
<x-slot:under-title>
<span id="guildName"></span>
</x-slot:under-title>
<div class="text-sm dark:text-gray-200">
<div id="guildUsers" class="h-[129px] overflow-auto"> </div>
<a id="guildInvite" target="blank">
<x-form.secondary-button classes="mt-3">
{{ __('Join server') }}
</x-form.secondary-button>
</a>
</div>
</x-content.content-card>
@push('javascript')
<script>
window.onload = DiscordApi();
function DiscordApi() {
let init = {
method: 'GET',
mode: 'cors',
cache: 'reload'
}
//gets discord widget json from url with in settings specifed id
fetch("https://discordapp.com/api/guilds/{{ setting('discord_widget_id') }}/widget.json", init).then(
function(res) {
//if there is a problem with discord or id sends an error message in console
if (res.status != 200) {
console.error("Discord widget cant connect to discord (" + res.status + ")");
return;
}
res.json().then(function(data) {
let users = data.members;
let guildName = data.name;
//sets the subtitle of the card to the guild name
document.getElementById('guildName').innerText = guildName;
//loops over every user in json array and display them in the widget
for (let i = 0; i < data.members.length; i++) {
let container = document.createElement('div')
let leftContainer = document.createElement('div')
let imgContainer = document.createElement('div')
let img = document.createElement('img')
let status = document.createElement('div')
let rightContainer = document.createElement('div')
let name = document.createElement('p')
let motto = document.createElement('p')
//sets styleing
container.classList.add('flex', 'items-center', 'gap-x-2')
leftContainer.classList.add('relative')
imgContainer.classList.add('h-9', 'w-9', 'bg-gray-100', 'dark:bg-gray-800',
'rounded-full', 'flex', 'items-center', 'justify-center', 'overflow-hidden')
status.classList.add('absolute', 'bottom-0', 'right-0', 'w-3', 'h-3',
'rounded-full', 'border-2', 'dark:border-gray-800')
name.classList.add('font-semibold')
motto.classList.add('dark:text-gray-400')
//sets styling for exceptions
if (i === 0) {
name.classList.add('mt-1')
}
if (i !== 0) {
imgContainer.classList.add('mt-1')
name.classList.add('mt-3')
}
if (users[i].status === 'online') {
status.style.backgroundColor = "#16a34a";
}
if (users[i].status === 'idle') {
status.style.backgroundColor = "#e9b124";
}
if (users[i].status === 'dnd') {
status.style.backgroundColor = "#9c0017";
}
//adds attributes to elements
img.setAttribute('src', data.members[i].avatar_url);
if (users[i].nick === undefined) {
name.innerText = users[i].username;
} else {
name.innerText = users[i].nick;
}
if (users[i].game !== undefined) {
motto.innerText = users[i].game.name;
}
//append all elements to each other
container.appendChild(leftContainer)
leftContainer.appendChild(imgContainer)
imgContainer.appendChild(img)
leftContainer.appendChild(status)
container.appendChild(rightContainer)
rightContainer.appendChild(name)
rightContainer.appendChild(motto)
document.getElementById('guildUsers').appendChild(container)
}
//Checks if join server link is null and removes btn form webpage
if (data.instant_invite === null) {
document.getElementById('guildInvite').remove()
document.getElementById('guildUsers').style.height = "176px"
} else {
//Gives the "Join server" button a href to the default selected channel in the server
//link is recived from widget json
document.getElementById('guildInvite').setAttribute('href', data.instant_invite)
}
})
});
}
</script>
@endpush
@@ -0,0 +1,22 @@
@props(['user'])
<div class="relative flex items-center justify-between overflow-hidden rounded px-10 me-backdrop border-2"
style="background: rgba(0, 0, 0, 0.3) url({{ setting('cms_me_backdrop') }}); border-color: var(--border-color);">
<div>
<a href="{{ route('profile.show', $user) }}"
class="absolute -bottom-12 left-0 transition duration-300 ease-in-out hover:scale-105 group">
<img style="image-rendering: pixelated;"
src="{{ setting('avatar_imager') }}{{ $user->look }}&direction=2&head_direction=3&gesture=sml&action=wav&size=l"
alt="{{ $user->username }}"
class="border-4 border-gray-800 group-hover:border-[var(--border-color)] transition-colors rounded-xl">
</a>
</div>
<a data-turbolinks="false" href="{{ route('nitro-client') }}">
<button
class="font-bold py-2 px-4 rounded-lg shadow-lg transition-all duration-300 hover:scale-105 hover:opacity-90"
style="background-color: var(--button-color); color: var(--button-text-color);">
{{ __('Go to :hotel', ['hotel' => setting('hotel_name')]) }}
</button>
</a>
</div>
@@ -0,0 +1,15 @@
@props(['colSpan'])
<div class="col-span-2 lg:col-span-{{ $colSpan }}">
{{ $image }}
<div class="shadow">
<div class="flex gap-x-2 rounded-t border-b p-3" style="background-color: var(--color-surface); border-color: var(--color-text-muted);">
<p class="font-semibold" style="color: var(--color-text)">{{ $title }}</p>
</div>
<section class="rounded-b p-3" style="background-color: var(--color-surface); color: var(--color-text);">
{{ $slot }}
</section>
</div>
</div>
@@ -0,0 +1,55 @@
<a data-turbolinks="false" href="{{ route('settings.account.show') }}"
class="{{ request()->routeIs('settings.account.show') ? 'bg-[var(--color-primary)]' : '' }} flex gap-x-2 justify-center items-center rounded p-2 md:p-4 text-center font-semibold transition duration-200 ease-in-out"
:style="request()->routeIs('settings.account.show') ? 'background-color: var(--color-primary); color: var(--button-text-color)' : 'background-color: var(--color-surface); color: var(--color-text)'"
onmouseover="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-primary)'; this.style.color='var(--button-text-color)'; }"
onmouseout="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-surface)'; this.style.color='var(--color-text)'; }">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
</svg>
<span class="hidden md:inline">{{ __('Account') }}</span>
</a>
<a data-turbolinks="false" href="{{ route('settings.preferences.show') }}"
class="{{ request()->routeIs('settings.preferences.show') ? 'bg-[var(--color-primary)]' : '' }} flex gap-x-2 justify-center items-center rounded p-2 md:p-4 text-center font-semibold transition duration-200 ease-in-out"
:style="request()->routeIs('settings.preferences.show') ? 'background-color: var(--color-primary); color: var(--button-text-color)' : 'background-color: var(--color-surface); color: var(--color-text)'"
onmouseover="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-primary)'; this.style.color='var(--button-text-color)'; }"
onmouseout="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-surface)'; this.style.color='var(--color-text)'; }">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
<span class="hidden md:inline">{{ __('Preferences') }}</span>
</a>
<a data-turbolinks="false" href="{{ route('settings.password.show') }}"
class="{{ request()->routeIs('settings.password.show') ? 'bg-[var(--color-primary)]' : '' }} flex gap-x-2 justify-center items-center rounded p-2 md:p-4 text-center font-semibold transition duration-200 ease-in-out"
:style="request()->routeIs('settings.password.show') ? 'background-color: var(--color-primary); color: var(--button-text-color)' : 'background-color: var(--color-surface); color: var(--color-text)'"
onmouseover="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-primary)'; this.style.color='var(--button-text-color)'; }"
onmouseout="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-surface)'; this.style.color='var(--color-text)'; }">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
<span class="hidden md:inline">{{ __('Password') }}</span>
</a>
<a data-turbolinks="false" href="{{ route('settings.two-factor') }}"
class="{{ request()->routeIs('settings.two-factor') ? 'bg-[var(--color-primary)]' : '' }} flex gap-x-2 justify-center items-center rounded p-2 md:p-4 text-center font-semibold transition duration-200 ease-in-out"
:style="request()->routeIs('settings.two-factor') ? 'background-color: var(--color-primary); color: var(--button-text-color)' : 'background-color: var(--color-surface); color: var(--color-text)'"
onmouseover="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-primary)'; this.style.color='var(--button-text-color)'; }"
onmouseout="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-surface)'; this.style.color='var(--color-text)'; }">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
</svg>
<span class="hidden md:inline">{{ __('2FA') }}</span>
</a>
<a data-turbolinks="false" href="{{ route('settings.session-logs') }}"
class="{{ request()->routeIs('settings.session-logs') ? 'bg-[var(--color-primary)]' : '' }} flex gap-x-2 justify-center items-center rounded p-2 md:p-4 text-center font-semibold transition duration-200 ease-in-out"
:style="request()->routeIs('settings.session-logs') ? 'background-color: var(--color-primary); color: var(--button-text-color)' : 'background-color: var(--color-surface); color: var(--color-text)'"
onmouseover="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-primary)'; this.style.color='var(--button-text-color)'; }"
onmouseout="if(!this.classList.contains('bg-[var(--color-primary)]')) { this.style.backgroundColor='var(--color-surface)'; this.style.color='var(--color-text)'; }">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
</svg>
<span class="hidden md:inline">{{ __('Sessions') }}</span>
</a>