-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5037607
commit 25ae66e
Showing
3 changed files
with
103 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor | ||
.env | ||
.phpunit.result.cache | ||
.phpunit.result.cache | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?php | ||
|
||
if (!function_exists('windowWidthLessThan')) { | ||
function windowWidthLessThan(int $value): bool | ||
{ | ||
return session('windowW') < $value; | ||
} | ||
} | ||
|
||
if (!function_exists('windowWidthGreaterThan')) { | ||
function windowWidthGreaterThan(int $value): bool | ||
{ | ||
return session('windowW') > $value; | ||
} | ||
} | ||
|
||
if (!function_exists('windowWidthBetween')) { | ||
function windowWidthBetween(int $expression): bool | ||
{ | ||
$between = collect(explode(',', $expression)); | ||
$w = session('windowW'); | ||
return ($w > $between->first()) && ($w < $between->last()); | ||
} | ||
} | ||
|
||
if (!function_exists('windowHeightLessThan')) { | ||
function windowHeightLessThan(int $value): bool | ||
{ | ||
return session('windowH') < $value; | ||
} | ||
} | ||
|
||
if (!function_exists('windowHeightGreaterThan')) { | ||
function windowHeightGreaterThan(int $value): bool | ||
{ | ||
return session('windowH') > $value; | ||
} | ||
} | ||
|
||
if (!function_exists('windowHeightBetween')) { | ||
function windowHeightBetween(int $expression): bool | ||
{ | ||
$between = collect(explode(',', $expression)); | ||
$h = session('windowH'); | ||
return ($h > $between->first()) && ($h < $between->last()); | ||
} | ||
} | ||
|
||
if (!function_exists('windowXs')) { | ||
function windowXs(): bool | ||
{ | ||
$w = session('windowW'); | ||
return ($w > 0) && | ||
($w < config('breakpoints.window-width.Xs', 640)); | ||
} | ||
} | ||
|
||
if (!function_exists('windowSm')) { | ||
function windowSm(): bool | ||
{ | ||
$w = session('windowW'); | ||
return ($w >= config('breakpoints.window-width.Sm', 640)) | ||
&& ($w < config('breakpoints.window-width.Md', 768)); | ||
} | ||
} | ||
|
||
if (!function_exists('windowMd')) { | ||
function windowMd(): bool | ||
{ | ||
$w = session('windowW'); | ||
return ($w >= config('breakpoints.window-width.Md', 768)) | ||
&& ($w < config('breakpoints.window-width.Lg', 1024)); | ||
} | ||
} | ||
|
||
if (!function_exists('windowLg')) { | ||
function windowLg(): bool | ||
{ | ||
$w = session('windowW'); | ||
return ($w >= config('breakpoints.window-width.Lg', 1024)) | ||
&& ($w < config('breakpoints.window-width.Xl', 1280)); | ||
} | ||
} | ||
|
||
if (!function_exists('windowXl')) { | ||
function windowXl(): bool | ||
{ | ||
$w = session('windowW'); | ||
return ($w >= config('breakpoints.window-width.Xl', 1280)) | ||
&& ($w < config('breakpoints.window-width.2xl', 1536)); | ||
} | ||
} | ||
|
||
if (!function_exists('window2xl')) { | ||
function window2xl(): bool | ||
{ | ||
return session('windowW') >= config('breakpoints.window-width.2xl', 1536); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters