From 1b0233030287ebdb5a2c67da3b036078ca2ed682 Mon Sep 17 00:00:00 2001 From: Teromene Date: Wed, 3 Aug 2016 20:07:49 +0200 Subject: [PATCH] Improved style for HtmlFormat. --- css/HtmlFormat.css | 100 +++++++++++++++++++++++++++++++++++++++++ formats/HtmlFormat.php | 38 ++++------------ 2 files changed, 109 insertions(+), 29 deletions(-) create mode 100644 css/HtmlFormat.css diff --git a/css/HtmlFormat.css b/css/HtmlFormat.css new file mode 100644 index 00000000..33061287 --- /dev/null +++ b/css/HtmlFormat.css @@ -0,0 +1,100 @@ +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { + + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; + +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { + + display: block; + +} + +/* Let's go for the actual style */ + +body { + + background-color: #EEEEEE; + font-family: 'Noto Sans'; + +} + +section { + + background-color: #FFFFFF; + width: 90%; + margin: 30px auto; + padding: 10px 15px; + + box-shadow: 0px 1px 2px rgba(0,0,0, 0.25); + +} + +section > h2 { + + font-size: 200%; + font-weight: bold; + text-align: center; + +} + +h1.pagetitle { + + font-size: 300%; + font-weight: bold; + + text-align: center; + color: #2196F3; + +} +a.backlink, a.backlink:link, a.backlink:visited, a.itemtitle, a.itemtitle:link, a.itemtitle:visited { + + color: #2196F3; + +} + +.backlink { + + display: block; + text-align: center; + +} + +section > div.content { + + padding: 10px; + +} + +section > time { + + color: #888; + font-size: 80%; + +} + +button.backbutton { + + line-height: 1em; + color: #FFF; + font-weight: bold; + vertical-align: middle; + padding: 6px 12px; + margin: 12px auto 0px; + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); + border-radius: 2px; + border: 1px solid transparent; + min-width: 140px; + background: #2196F3 none repeat scroll 0% 0%; + cursor: pointer; + + width: calc(20% - 4px); + +} + diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php index 4bc48abd..4d86eae8 100644 --- a/formats/HtmlFormat.php +++ b/formats/HtmlFormat.php @@ -18,41 +18,21 @@ class HtmlFormat extends FormatAbstract{ foreach($this->getDatas() as $data){ $entryUri = is_null($data->uri) ? $uri : $data->uri; $entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title)); - $entryTimestamp = is_null($data->timestamp) ? '' : ''; - $entryAuthor = is_null($data->author) ? '' : '
by: ' . $data->author . ''; - $entryContent = is_null($data->content) ? '' : '

' . $this->sanitizeHtml($data->content). '

'; + $entryTimestamp = is_null($data->timestamp) ? '' : ''; + $entryAuthor = is_null($data->author) ? '' : '

by: ' . $data->author . '

'; + $entryContent = is_null($data->content) ? '' : '
' . $this->sanitizeHtml($data->content). '
'; $entries .= << -

{$entryTitle}

+
+

{$entryTitle}

{$entryTimestamp} {$entryAuthor} {$entryContent} - +
EOD; } - $styleCss = <<<'EOD' -body{ - font-family:"Trebuchet MS",Verdana,Arial,Helvetica,sans-serif; - font-size:10pt; - background-color:#aaa; - background-image:linear-gradient(#eee, #aaa); - background-attachment:fixed; -} -div.feeditem{border:1px solid black;padding:1em;margin:1em;background-color:#fff;} -div.feeditem:hover { background-color:#ebf7ff; } -h1 {border-bottom:dotted #bbb;margin:0 1em 1em 1em;} -h2 {margin:0;} -h2 a {color:black;text-decoration:none;} -h2 a:hover {text-decoration:underline;} -span.menu {margin-left:1em;} -span.menu img {vertical-align:middle;} -span.menu a { color:black; text-decoration:none; padding:0.4em; } -span.menu a:hover { background-color:white; } - -EOD; /* Data are prepared, now let's begin the "MAGIE !!!" */ $toReturn = << {$title} - + -

{$title}

-← back to rss-bridge feed +

{$title}

+ {$entries}