Parcourir la source

Switch PDA stylesheet to useragent detection

master
Parent
révision
d8cda8dfc7
6 fichiers modifiés avec 98 ajouts et 11 suppressions
  1. +13
    -0
      app/Helper/PDA.php
  2. +1
    -0
      public/css/main.css
  3. +14
    -0
      public/css/page/index.css
  4. +30
    -4
      public/css/page/subforum.css
  5. +30
    -3
      public/css/pda.css
  6. +10
    -4
      resources/views/layout/default.blade.php

+ 13
- 0
app/Helper/PDA.php Voir le fichier

@@ -0,0 +1,13 @@
<?php

namespace App\Helper;

class PDA
{
public static function isPDA()
{
$ua = $_SERVER['HTTP_USER_AGENT'] ?? '';
if (str_contains($ua, 'Windows CE; PPC;')) return true;
return false;
}
}

+ 1
- 0
public/css/main.css Voir le fichier

@@ -11,6 +11,7 @@ body {
padding: 15px;
margin: 0 auto;
line-height: 1.3;
background: #333;
}

p {


+ 14
- 0
public/css/page/index.css Voir le fichier

@@ -16,6 +16,10 @@
border: none;
}

body.simple .row.subforums {
padding: 0;
}

.cell {
width: 50%;
float: left;
@@ -29,6 +33,16 @@
margin-left: 5px;
}

body.simple .cell {
width: unset;
float: none;
}

body.simple .cell .row {
margin-left: 0;
margin-right: 0;
}

.row.subforum h3,
.row.lastThread h4 {
margin: 0;


+ 30
- 4
public/css/page/subforum.css Voir le fichier

@@ -2,6 +2,10 @@
padding: 0;
}

body.simple .row.threads {
padding: 0;
}

.row.thread {
position: relative;
padding-top: 0;
@@ -19,6 +23,13 @@
height: 44px;
}

body.simple .row.thread img.icon {
width: 22px;
height: 22px;
top: 5px;
left: 5px;
}

.row.thread a {
margin: 1px 0;
display: block;
@@ -32,20 +43,35 @@
padding-top: 10px;
}

body.simple .row.thread a.main {
padding-top: 0;
padding-left: 27px;
width: unset;
min-height: 27px;
}

.row.thread .meta {
position: relative;
width: 100%;
padding-bottom: 10px;
}

.row.thread a.left,
.row.thread a.right {
.row.thread .meta a.left,
.row.thread .meta a.right {
display: block;
float: left;
width: 49.5%;
}

.row.thread a.right {
.row.thread .meta a.right {
float: right;
text-align: right;
}
}

body.simple .row.thread .meta a {
float: none;
width: unset;
text-align: left;
font-size: 10px;
padding-left: 27px;
}

+ 30
- 3
public/css/pda.css Voir le fichier

@@ -1,10 +1,37 @@
.row.titlebar .logo {
/* reduce padding */
body.simple {
padding: 5px;
}

body.simple .row {
padding: 5px;
}

body.simple .row.spacer {
height: 5px;
padding: 0;
}

/* Fix header styling */
body.simple .row.titlebar .logo {
position: relative;
padding: 10px 15px;
padding: 0;
text-align: center;
margin: 0;
}

.row.titlebar .menu {
body.simple .row.titlebar .menu {
text-align: center;
padding: 10px 0 0 0;
}

body.simple .row.titlebar .menu a {
line-height: 1;
}

/* Fix stats styling */
body.simple .row.stats span {
display: block;
width: unset;
float: none;
}

+ 10
- 4
resources/views/layout/default.blade.php Voir le fichier

@@ -1,3 +1,6 @@
@php
$pda = App\Helper\PDA::isPDA();
@endphp
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Frameset//EN' 'http://www.w3.org/TR/html4/frameset.dtd'>
<html class="lang-eng" dir="ltr" ng-app="" >
<head>
@@ -7,13 +10,16 @@
<meta charset='ISO-8859-1'>
<link rel='icon' type='image/x-icon' href='/favicon.ico' />
<link rel='stylesheet' type='text/css' href='/css/main.css'/>
@if ($pda)
<link rel='stylesheet' type='text/css' href='/css/pda.css'/>
@else
<link rel='stylesheet' type='text/css' href='/css/mobile.css'/>
@endif
@yield('scripts')
<meta name='theme-color' content='#333'>
<title>Knockout Lite | @yield('title', 'Index')</title>
</head>
<body>
<body class="{{ $pda ? 'simple' : null }}">
@yield('page')
@yield('scripts')
<link rel='stylesheet' type='text/css' href='/css/mobile.css'/>
<link rel='stylesheet' type='text/css' media='handheld' href='/css/pda.css'/>
</body>
</html>

Chargement…
Annuler
Enregistrer