mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-12-22 09:40:23 -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>
|
||||
<html lang="en">
|
||||
@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>
|
||||
@set('page_title', (isset($title) ? $title . ' - ' : '') . env('SITE_NAME'))
|
||||
<title>{{ $page_title }}</title>
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
|
@ -38,7 +40,7 @@
|
|||
@endif
|
||||
</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')
|
||||
|
||||
<div id="page-content">
|
||||
|
|
Loading…
Reference in a new issue