Browse Source

Improve mobile experience

This includes complying with standards that allow mobile browsers to
create a pseudo-app out of the site, complete with homescreen icon,
splash-screen, and a minimal browser-less UI
spaghetti 1 year ago
parent
commit
56bbe9afb4

+ 22
- 20
design/privateheader.php View File

@@ -7,23 +7,25 @@ define('FOOTER_FILE', SERVER_ROOT.'/design/privatefooter.php');
7 7
 <html lang="en">
8 8
 <head>
9 9
   <title><?=display_str($PageTitle)?></title>
10
-  <meta charset="utf-8" />
11
-  <meta name="userid" content="<?=G::$LoggedUser['ID']?>" />
12
-  <meta name="authkey" content="<?=G::$LoggedUser['AuthKey']?>" />
13
-  <link rel="shortcut icon" href="favicon.ico?v=<?=md5_file('favicon.ico')?>" />
10
+  <meta charset="utf-8">
11
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
12
+  <meta name="userid" content="<?=G::$LoggedUser['ID']?>">
13
+  <meta name="authkey" content="<?=G::$LoggedUser['AuthKey']?>">
14
+  <link rel="shortcut icon" href="favicon.ico?v=<?=md5_file('favicon.ico')?>">
15
+  <link rel="manifest" href="/manifest.php">
14 16
   <link rel="search" type="application/opensearchdescription+xml" title="<?=SITE_NAME?>" href="<?=STATIC_SERVER?>opensearch.xml">
15 17
   <link rel="alternate" type="application/rss+xml"
16 18
       href="feeds.php?feed=feed_news&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
17
-      title="<?=SITE_NAME?> - News" />
19
+      title="<?=SITE_NAME?> - News">
18 20
   <link rel="alternate" type="application/rss+xml"
19 21
       href="feeds.php?feed=feed_blog&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
20
-      title="<?=SITE_NAME?> - Blog" />
22
+      title="<?=SITE_NAME?> - Blog">
21 23
   <link rel="alternate" type="application/rss+xml"
22 24
       href="feeds.php?feed=feed_changelog&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
23
-      title="<?=SITE_NAME?> - Gazelle Change Log" />
25
+      title="<?=SITE_NAME?> - Gazelle Change Log">
24 26
   <link rel="alternate" type="application/rss+xml"
25 27
       href="feeds.php?feed=torrents_notify_<?=G::$LoggedUser['torrent_pass']?>&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
26
-      title="<?=SITE_NAME?> - P.T.N." />
28
+      title="<?=SITE_NAME?> - P.T.N.">
27 29
 <?
28 30
 if (isset(G::$LoggedUser['Notify'])) {
29 31
   foreach (G::$LoggedUser['Notify'] as $Filter) {
@@ -31,32 +33,32 @@ if (isset(G::$LoggedUser['Notify'])) {
31 33
 ?>
32 34
   <link rel="alternate" type="application/rss+xml"
33 35
       href="feeds.php?feed=torrents_notify_<?=$FilterID?>_<?=G::$LoggedUser['torrent_pass']?>&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>&amp;name=<?=urlencode($FilterName)?>"
34
-      title="<?=SITE_NAME?> - <?=display_str($FilterName)?>" />
36
+      title="<?=SITE_NAME?> - <?=display_str($FilterName)?>">
35 37
 <?
36 38
   }
37 39
 }
38 40
 ?>
39 41
   <link rel="alternate" type="application/rss+xml"
40 42
       href="feeds.php?feed=torrents_all&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
41
-      title="<?=SITE_NAME?> - All Torrents" />
43
+      title="<?=SITE_NAME?> - All Torrents">
42 44
   <link rel="alternate" type="application/rss+xml"
43 45
       href="feeds.php?feed=torrents_movies&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
44
-      title="<?=SITE_NAME?> - Movie Torrents" />
46
+      title="<?=SITE_NAME?> - Movie Torrents">
45 47
   <link rel="alternate" type="application/rss+xml"
46 48
       href="feeds.php?feed=torrents_anime&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
47
-      title="<?=SITE_NAME?> - Anime Torrents" />
49
+      title="<?=SITE_NAME?> - Anime Torrents">
48 50
   <link rel="alternate" type="application/rss+xml"
49 51
       href="feeds.php?feed=torrents_manga&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
50
-      title="<?=SITE_NAME?> - Manga Torrents" />
52
+      title="<?=SITE_NAME?> - Manga Torrents">
51 53
   <link rel="alternate" type="application/rss+xml"
52 54
       href="feeds.php?feed=torrents_games&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
53
-      title="<?=SITE_NAME?> - Games Torrents" />
55
+      title="<?=SITE_NAME?> - Games Torrents">
54 56
   <link rel="alternate" type="application/rss+xml"
55 57
       href="feeds.php?feed=torrents_other&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>"
56
-      title="<?=SITE_NAME?> - Other Torrents" />
58
+      title="<?=SITE_NAME?> - Other Torrents">
57 59
   <link rel="stylesheet" type="text/css"
58
-      href="<?=STATIC_SERVER?>styles/global.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/global.css')?>" />
59
-  <link rel="stylesheet" href="<?=STATIC_SERVER?>styles/tooltipster/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/tooltipster/style.css')?>" type="text/css" media="screen" />
60
+      href="<?=STATIC_SERVER?>styles/global.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/global.css')?>">
61
+  <link rel="stylesheet" href="<?=STATIC_SERVER?>styles/tooltipster/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/tooltipster/style.css')?>" type="text/css" media="screen">
60 62
 <?
61 63
 if (empty(G::$LoggedUser['StyleURL'])) {
62 64
   if (($StyleColors = G::$Cache->get_value('stylesheet_colors')) === false) {
@@ -69,7 +71,7 @@ if (empty(G::$LoggedUser['StyleURL'])) {
69 71
   if (isset($StyleColors[G::$LoggedUser['StyleName']])) { ?>
70 72
 <meta name="theme-color" content="<?=$StyleColors[G::$LoggedUser['StyleName']]?>">
71 73
 <? } ?>
72
-<link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen" href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.G::$LoggedUser['StyleName'].'/style.css')?>" />
74
+<link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen" href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.G::$LoggedUser['StyleName'].'/style.css')?>">
73 75
 <?
74 76
 } else {
75 77
   $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
@@ -82,7 +84,7 @@ if (empty(G::$LoggedUser['StyleURL'])) {
82 84
     $StyleURL = G::$LoggedUser['StyleURL'];
83 85
   }
84 86
 ?>
85
-<link rel="stylesheet" type="text/css" media="screen" href="<?=$StyleURL?>" title="External CSS" />
87
+<link rel="stylesheet" type="text/css" media="screen" href="<?=$StyleURL?>" title="External CSS">
86 88
 <?
87 89
 }
88 90
 $ExtraCSS = explode(',', $CSSIncludes);
@@ -91,7 +93,7 @@ foreach ($ExtraCSS as $CSS) {
91 93
     continue;
92 94
   }
93 95
 ?>
94
-  <link rel="stylesheet" type="text/css" media="screen" href="<?=STATIC_SERVER."styles/$CSS/style.css?v=".filemtime(SERVER_ROOT.STATIC_SERVER."styles/$CSS/style.css")?>" />
96
+  <link rel="stylesheet" type="text/css" media="screen" href="<?=STATIC_SERVER."styles/$CSS/style.css?v=".filemtime(SERVER_ROOT.STATIC_SERVER."styles/$CSS/style.css")?>">
95 97
 <?
96 98
 }
97 99
 

+ 5
- 3
design/publicheader.php View File

@@ -6,10 +6,12 @@ define('FOOTER_FILE',SERVER_ROOT.'/design/publicfooter.php');
6 6
 <html>
7 7
 <head>
8 8
   <title><?=display_str($PageTitle)?></title>
9
-  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
10
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10 11
   <meta name="theme-color" content="#461640">
11
-  <link rel="shortcut icon" href="favicon.ico?v=<?=md5_file('favicon.ico');?>" />
12
-  <link href="<?=STATIC_SERVER ?>styles/public/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/public/style.css')?>" rel="stylesheet" type="text/css" />
12
+  <link rel="shortcut icon" href="favicon.ico?v=<?=md5_file('favicon.ico');?>">
13
+  <link rel="manifest" href="/manifest.php">
14
+  <link href="<?=STATIC_SERVER ?>styles/public/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/public/style.css')?>" rel="stylesheet" type="text/css">
13 15
 <?
14 16
   $Scripts = ['jquery', 'global', 'ajax.class', 'cookie.class', 'storage.class', 'public', 'u2f'];
15 17
   foreach($Scripts as $Script) {

+ 14
- 0
manifest.php View File

@@ -0,0 +1,14 @@
1
+<? require 'classes/config.php'; ?>
2
+{
3
+  "name": "<?=SITE_NAME?>",
4
+  "short_name": "<?=SITE_NAME?>",
5
+  "start_url": "index.php",
6
+  "display": "standalone",
7
+  "background_color": "#FCC2E6",
8
+  "theme_color": "#451740",
9
+  "icons": [{
10
+    "src": "static/common/icon.png",
11
+    "sizes": "512x512",
12
+    "type": "image/png"
13
+  }]
14
+}

+ 2
- 2
sections/login/login.php View File

@@ -17,7 +17,7 @@ if (!$Banned) {
17 17
   <table class="layout">
18 18
     <tr>
19 19
       <td colspan="2">
20
-        <input type="text" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}" autofocus="autofocus" placeholder="Username" size="40" />
20
+        <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}" autofocus="autofocus" placeholder="Username" size="40" />
21 21
       </td>
22 22
     </tr>
23 23
     <tr>
@@ -25,7 +25,7 @@ if (!$Banned) {
25 25
         <input type="password" name="password" id="password" class="inputtext" required="required" maxlength="307200" pattern=".{6,307200}" placeholder="Password" />
26 26
       </td>
27 27
       <td>
28
-        <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA" />
28
+        <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}" inputmode="numeric" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA" />
29 29
       </td>
30 30
     </tr>
31 31
     <tr>

BIN
static/common/icon.png View File


+ 1
- 1
static/functions/jquery.js
File diff suppressed because it is too large
View File


+ 2
- 1
static/styles/public/style.css View File

@@ -118,10 +118,11 @@ input[type="text"]:invalid, input[type="password"]:invalid {
118 118
   background-size: contain;
119 119
   display: flex;
120 120
   align-items: center;
121
+  margin: 0 10%;
121 122
 }
122 123
 
123 124
 #maincontent {
124
-  margin: auto 10% auto auto;
125
+  margin: auto 0 auto auto;
125 126
   background-color: transparent;
126 127
 }
127 128
 

Loading…
Cancel
Save