mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-26 00:51:26 -05:00
Add a body class based on whether a desktop or mobile device has been detected
This commit is contained in:
parent
961120131e
commit
df7676ece8
1 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
@set('page_title', (isset($title) ? $title . ' - ' : '') . env('SITE_NAME'))
|
@set('page_title', (isset($title) ? $title . ' - ' : '') . env('SITE_NAME'))
|
||||||
|
@set('device_mobile', preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent')))
|
||||||
|
|
||||||
|
<head>
|
||||||
<title>{{ $page_title }}</title>
|
<title>{{ $page_title }}</title>
|
||||||
|
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
@ -38,7 +40,7 @@
|
||||||
@endif
|
@endif
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="page-{{ Request::path() == '/' ? 'index' : preg_replace('/\/.*/', '', Request::path()) }}">
|
<body class="page-{{ Request::path() == '/' ? 'index' : preg_replace('/\/.*/', '', Request::path()) }} {{ $device_mobile ? 'mobile-browser' : 'desktop-browser' }}">
|
||||||
@yield('page-top')
|
@yield('page-top')
|
||||||
|
|
||||||
<div id="page-content">
|
<div id="page-content">
|
||||||
|
|
Loading…
Reference in a new issue