Add viewport to pages, to score better on "Mobile Friendly". master
authorChris Jaekl <cejaekl@yahoo.com>
Fri, 10 Aug 2018 02:48:57 +0000 (22:48 -0400)
committerChris Jaekl <cejaekl@yahoo.com>
Fri, 10 Aug 2018 02:48:57 +0000 (22:48 -0400)
index.html
index_fr.html
index_jp.html
prod/net/jaekl/frank/Schedule.java
prod/net/jaekl/frank/Style.java
test/net/jaekl/frank/ScheduleTest.java

index e372d36..ae8fc81 100644 (file)
@@ -1,6 +1,7 @@
 <HTML>
   <HEAD>
     <META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8"/>
+    <META NAME="viewport" content="width=device-width"/>
     <TITLE>Frank Welcome Page</TITLE>
     <STYLE>
       body {background-color: #F0F0C0; font-size: 1em; }
index 0832a6c..912829b 100644 (file)
@@ -1,6 +1,7 @@
 <HTML>
   <HEAD>
     <META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8"/>
+    <META NAME="viewport" content="width=device-width"/>
     <TITLE>Frank:  Page d'acceuil</TITLE>
     <STYLE>
       body {background-color: #F0F0C0; font-size: 1em; }
index 5cf9813..67e4f2c 100644 (file)
@@ -1,6 +1,7 @@
 <HTML>
   <HEAD>
     <META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8"/>
+    <META NAME="viewport" content="width=device-width"/>
     <TITLE>フランクへようこそ</TITLE>
     <STYLE>
       body {background-color: #F0F0C0; font-size: 1em; }
index eb8cb2b..8db11d5 100644 (file)
@@ -73,7 +73,8 @@ public class Schedule {
        void writeHeader(PrintWriter pw, String title) {
                pw.println("<HTML>");
                pw.println("<HEAD>");
-               pw.println("<TITLE>" + title + "</TITLE>");
+               pw.println("  <META NAME=\"viewport\" content=\"width=device-width\"/>");
+               pw.println("  <TITLE>" + title + "</TITLE>");
                new Style().writeStyle(pw);
                pw.println("</HEAD>");
        }
index f3d58a9..e986e71 100644 (file)
@@ -5,13 +5,14 @@ import java.io.PrintWriter;
 public class Style {
        static final String CSS = 
                        "<STYLE>\n" +
-                       "  body {background-color: #F0F0C0; font-size: 1em; }\n" +
+                       "  body {background-color: #F0F0C0; font-size: 100%; }\n" +
                        "  #errhead td {background-color: #D00000; color: #FFFFFF; font-size: 2em; padding: 3px 3px 3px 3px; text-align: left; }\n" +
                        "  #errtable table { border: 3px solid #D00000; border-collapse: collapse; background-color: #E0E080; }\n" +
                        "  #errtable table, tr, td { padding: 3px; }\n" +
                        "  #errtable tr.alt { background-color: #D0D070; }\n" +
                        "  #errtable td.head {text-align: right; background-color: #D00000; color: #FFFFFF; font-weight: bold; }\n" +
-                       "  #trips {border-collapse: collapse; font-size: 1.5em; }\n" +
+                       "  #trips {border-collapse: collapse; font-size: 80%;}\n" +
+                       "  #trips table {width: 100%;}\n" +
                        "  #trips td, #trips th {border: 1px solid #600000; padding: 3px 3px 3px 3px; text-align: center;}\n" +
                        "  #trips th {background-color: #800000; color: #FFFFFF; }\n" +
                        "  #trips tr.ghost td {background-color: #C0C0C0;}\n" +
index 1e1a517..020e274 100644 (file)
@@ -17,7 +17,9 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class ScheduleTest {
-       static final String TITLE_PREFIX = "<HTML>\n<HEAD>\n<TITLE>";
+       static final String TITLE_PREFIX = "<HTML>\n<HEAD>\n"
+                       + "  <META NAME=\"viewport\" content=\"width=device-width\"/>\n"
+                       + "  <TITLE>";
        static final String TITLE_SUFFIX = "</TITLE>\n" + Style.CSS + "\n</HEAD>\n";