Skip to content

Commit

Permalink
Update about page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Jan 12, 2025
1 parent 07bce30 commit 62b89ff
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 61 deletions.
34 changes: 19 additions & 15 deletions resources/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,27 @@


.page_about {
dl {
display: grid;
grid-gap: 4px 16px;
@apply md:auto-cols-[auto_1fr];
}

dt {
@apply md:w-64;
@apply font-semibold md:font-normal;
}

dd {
@apply ms-6 md:col-start-2;
}
.config {
dl {
display: grid;
grid-gap: 4px 16px;
@apply md:auto-cols-[auto_1fr];
}

.config-value-bool {
padding: .1em .2em;
@apply bg-gray-100 rounded
dt {
@apply md:w-64;
@apply font-semibold md:font-normal;
}

dd {
@apply ms-6 md:col-start-2;
}

.config-value-bool {
padding: .1em .2em;
@apply bg-gray-100 rounded
}
}
}
158 changes: 112 additions & 46 deletions resources/views/backend/about.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,123 @@

<br>

@php
$urlCount = n_abb($url->count());
$visitCount = n_abb($visit->count());
$userUrlCount = n_abb($url->userUrlCount());
$userLinkVisitCount = n_abb($visit->userLinkVisitCount());
$guestUrlCount = n_abb($url->guestUserUrlCount());
$guestUserLinkVisitCount = n_abb($visit->guestUserLinkVisitCount());
@endphp

<div class="card-default">
<div class="card_header__sub_header">Links</div>
<dl>
@php
$urlCount = n_abb($url->count());
$visitCount = n_abb($visit->count());
$userUrlCount = n_abb($url->userUrlCount());
$userLinkVisitCount = n_abb($visit->userLinkVisitCount());
$guestUrlCount = n_abb($url->guestUserUrlCount());
$guestUserLinkVisitCount = n_abb($visit->guestUserLinkVisitCount());
@endphp
<dt>Total</dt>
<dd>{{ $urlCount }} ({{ $visitCount }} visits)</dd>

<dt>User</dt>
<dd>{{ $userUrlCount }} ({{ $userLinkVisitCount }} visits)</dd>

<dt>Guest</dt>
<dd>{{ $guestUrlCount }} ({{ $guestUserLinkVisitCount }} visits)</dd>
</dl>
@php
$urlCount = n_abb($url->count());
$visitCount = n_abb($visit->count());
$userUrlCount = n_abb($url->userUrlCount());
$userLinkVisitCount = n_abb($visit->userLinkVisitCount());
$guestUrlCount = n_abb($url->guestUserUrlCount());
$guestUserLinkVisitCount = n_abb($visit->guestUserLinkVisitCount());
@endphp

<div class="mt-4 mb-6 px-2 md:px-0">
<dl class="grid grid-cols-1 gap-2.5 sm:gap-3 md:gap-5 md:grid-cols-2 lg:grid-cols-3">
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1">
Total
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl">
{{ $urlCount }} ({{ $visitCount }} visits)
</dd>
</div>
</div>
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1">
User
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl">
{{ $userUrlCount }} ({{ $userLinkVisitCount }} visits)
</dd>
</div>
</div>
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1">
Guest
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl">
{{ $guestUrlCount }} ({{ $guestUserLinkVisitCount }} visits)
</dd>
</div>
</div>
</dl>
</div>

<div class="card_header__sub_header">Users</div>
<dl>
<dt>User</dt>
<dd>{{ n_abb($user->count()) }}</dd>

<dt>Guest</dt>
<dd>{{ n_abb($user->totalGuestUsers()) }}</dd>
</dl>
<div class="mt-4 mb-6 px-2 md:px-0">
<dl class="grid grid-cols-1 gap-2.5 sm:gap-3 md:gap-5 md:grid-cols-2 lg:grid-cols-3">
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1">
User
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl">
{{ n_abb($user->count()) }}
</dd>
</div>
</div>
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1">
Guest
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl">
{{ n_abb($user->totalGuestUsers()) }}
</dd>
</div>
</div>
</dl>
</div>

<div class="card_header__sub_header">Random String</div>
<div class="font-light text-sm">Random String Generation for Shortened URLs.</div> <br>
<dl>
<dt>Potential Output</dt>
<dd>
@if ($keyGenerator->possibleOutput() === PHP_INT_MAX)
(<code>PHP_INT_MAX</code>) {{ number_format(PHP_INT_MAX) }}
@else
@php
$number = strlen(KeyGeneratorService::ALPHABET);
$powNumber = config('urlhub.keyword_length');
$result = number_format($keyGenerator->possibleOutput());
@endphp

( {{ $number }}<sup>{{ $powNumber }}</sup> ) {{ $result }}
@endif
</dd>

<dt>Generated Count</dt>
<dd>{{ number_format($keyGenerator->totalKey()) }}</dd>
</dl>
<div class="font-light text-sm">Random String Generation for Shortened URLs.</div>
<div class="mt-4 mb-6 px-2 md:px-0">
<dl class="grid grid-cols-1 md:grid-flow-col md:auto-cols-auto gap-2.5 sm:gap-3">
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1">
Potential Output
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl">
@if ($keyGenerator->possibleOutput() === PHP_INT_MAX)
(<code>PHP_INT_MAX</code>) {{ number_format(PHP_INT_MAX) }}
@else
@php
$number = strlen(KeyGeneratorService::ALPHABET);
$powNumber = config('urlhub.keyword_length');
$result = number_format($keyGenerator->possibleOutput());
@endphp

( {{ $number }}<sup>{{ $powNumber }}</sup> ) {{ $result }}
@endif
</dd>
</div>
</div>
<div class="bg-neutral-50 border border-border-200 flex items-start px-4 space-x-2 overflow-hidden py-3 text-opacity-0 transition transform rounded-md md:space-x-3">
<div>
<dt class="-mt-0 text-sm font-medium text-gray-600 md:mt-1 md:w-64">
Generated Count
</dt>
<dd class="-mt-1 font-normal text-gray-900 md:mt-1 md:text-xl md:w-64">
{{ number_format($keyGenerator->totalKey()) }}
</dd>
</div>
</div>
</dl>
</div>
</div>

<br>
Expand All @@ -92,7 +158,7 @@
$reservedActiveKeyList = $keyGenerator->reservedActiveKeyword()->toArray();
$reservedKeyword = $keyGenerator->reservedKeyword();
@endphp
<div class="card-default">
<div class="card-default config">
<div class="card_header">{{ __('Configuration') }}</div>

<div class="card_header__sub_header">Shortened Links</div>
Expand Down

0 comments on commit 62b89ff

Please sign in to comment.