$this->writeExtras();
$this->log('Extras written');
$this->populateConfig();
+ $this->log('Config populated');
$this->writeCSS($linksCSS);
$this->log('CSS written');
$this->writeIndex();
$favicon = '';
$hasIos = false;
- if ($iosico = $this->checkThemeImage($this->theme->parametres->iosicon)) {
- $hasIos = true;
- $this->vdir->copy($iosico, 'data/apple-touch-icon.png');
- $favicon .= '<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />' . "\n\t";
- }
+ //if ($iosico = $this->checkThemeImage($this->theme->parametres->iosicon)) {
+ // $hasIos = true;
+ // $this->vdir->copy($iosico, 'data/apple-touch-icon.png');
+ // $favicon .= '<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />' . "\n\t";
+ //}
if ($this->theme->parametres->favicon != '') {
$pngFile = $this->checkThemeImage($this->theme->parametres->favicon);
protected function writeIndex()
{
$iv = $this->getIndexVars();
+ $this->log('Got index vars');
foreach ($iv as $k => $v) {
$this->seo->html = str_replace($k, $v, $this->seo->html);
}
$this->lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack);
$this->lessVariables['pages-background'] = $this->book->parametres->forceWhiteBackground ? '#ffffff' : 'transparent';
+ $this->log('CSS 1');
+
// General theme
$cssWidth = $this->cssWidth;
$cssHeight = $this->cssHeight;
$this->lessVariables['book-page-correct-width'] = $w;
$this->lessVariables['book-page-correct-height'] = $h;
}
+
+ $this->log('CSS 2');
$this->lessVariables['book-page-height'] = $h;
$this->lessVariables['book-page-ratio'] = floatval($w) / floatval($h);
$this->lessVariables['page-shade-opacity'] = min(1, $this->theme->parametres->shadeAlpha / 50);
$this->lessVariables['shadow-opacity'] = wsHTML5::colorToArray($this->theme->parametres->bookShadeColor)['opacity'] * 1.2;
$this->lessVariables['edges-display'] = $this->_lessBoolean($this->theme->parametres->usePageEdges);
- $this->lessVariables['edge-left-offset'] = $this->theme->parametres->pageEdgeLeftOffset;
- $this->lessVariables['edge-right-offset'] = $this->theme->parametres->pageEdgeRightOffset;
- $this->lessVariables['edges-opacity'] = $this->theme->parametres->pageEdgeOpacity / 100;
+ $this->lessVariables['edge-left-offset'] = 0;
+ $this->lessVariables['edge-right-offset'] = 0;
+ $this->lessVariables['edges-opacity'] = 1;
+
$this->lessVariables['page-number-color'] = wsHTML5::colorToCSS($this->theme->parametres->colorPageNumber);
$this->lessVariables['display-page-number'] = $this->_lessBoolean($this->theme->parametres->displayPageNumber);
$this->lessVariables['page-transition-duration'] = $this->book->parametres->mobileTransitionDuration . 's';
$corrText = $this->isMobileFirst() ? 0 : 4;
-
+ $this->log('CSS 3');
if ($this->cssSVGScale != 1) {
$texts = '.texts{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';';
$texts .= wsHTML5::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
// Background
$res[] = $this->_cssBackground();
-
+ $this->log('CSS 4');
// Archives
// Header
$header = 'header{';
}
$header .= '}';
$res[] = $header;
-
+ $this->log('CSS 5');
// Logo
$logo = '#logo{';
if ($l = $this->checkThemeImage($this->theme->parametres->logo)) {
// Credits
$res[] = 'footer,footer a{color:' . wsHTML5::colorToCSS($this->theme->parametres->creditsColor) . ';}';
-
+ $this->log('CSS 6');
// Arrows
$this->lessVariables['arrows-background'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA);
$this->lessVariables['arrows-color'] = wsHTML5::colorToCSS($this->theme->parametres->arrowsColor);
// Audio description buttons
$this->lessVariables['audiodescription-background'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA);
$this->lessVariables['audiodescription-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA);
-
+ $this->log('CSS 7');
// Links Styles
$this->lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor);
$this->lessVariables['inlineslideshow-transition-time'] = (floatval($this->book->parametres->inlineSlideshowTransitionDuration) * 1000) . 'ms';
if (!isset($this->book->parametres->bookmarkCornerSize)) {
$this->book->parametres->bookmarkCornerSize = 10;
}
-
+ $this->log('CSS 8');
$this->lessVariables['bookmark-star-disabled-color'] = wsHTML5::colorToCSS($this->theme->parametres->bookmarkStarDisabledColor);
$this->lessVariables['bookmark-star-enabled-color'] = wsHTML5::colorToCSS($this->theme->parametres->bookmarkStarEnabledColor);
$this->lessVariables['bookmark-color'] = wsHTML5::colorToCSS($this->theme->parametres->bookmarkBackgroundColor);
$this->lessVariables['menu-background-blue'] = 'max(45, min(255-45, blue(@menu-background)))';
$this->lessVariables['menu-button-background'] = 'overlay(rgb(@menu-background-red, @menu-background-green, @menu-background-blue), #c0c0c0)';
}
-
+ $this->log('CSS 9');
$this->lessVariables['menu-text'] = $menuTextColor;
$this->lessVariables['menu-field-background'] = wsHTML5::colorToCSS($this->theme->parametres->subFieldColor);
$this->lessVariables['menu-field-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextFieldColor);
$this->lessVariables['menu-select-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextSelectColor);
$this->lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI);
$this->lessVariables['menu-overlay'] = wsHTML5::colorToCSS($this->theme->parametres->popupVideoOverlay);
-
+ $this->log('CSS 10');
// Chapters
$this->lessVariables['menu-chapters-columns-count'] = max(1, min(6, $this->book->parametres->chaptersColumns));
$this->lessVariables['menu-chapters-columns-width'] = $this->book->parametres->chaptersColMaxWidth;
$this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack);
$res[] = '.mview.archives{background-image:url("../images/' . $this->book->parametres->externalArchivesBack . '");}';
}
-
+ $this->log('CSS 11');
# Index
$thumbw = $this->book->parametres->mobileNavigationType === 'portrait' ? 200 : 100;
$this->lessVariables['thumb-width'] = $thumbw . 'px';
$this->lessVariables['tooltip-background'] = wsHTML5::colorToCSS($this->theme->parametres->tooltipBackColor);
$this->lessVariables['tooltip-color'] = wsHTML5::colorToCSS($this->theme->parametres->tooltipTextColor);
$this->lessVariables['tooltip-font-size'] = 14 * ($this->theme->parametres->tooltipTextSize / 100);
-
+ $this->log('CSS 12');
#Videos
if ($this->book->parametres->bigPlayImage) {
$this->lessVariables['video-bigplay-image'] = '~"../data/links/' . $this->book->parametres->bigPlayImage . '"';
if ($this->book->parametres->textPopupStylesheet) {
$res[] = file_get_contents($this->wdir . '/' . $this->book->parametres->textPopupStylesheet);
}
-
+ $this->log('CSS 13');
$this->_writeLess($this->lessVariables, $lessContents);
$this->stylesheets[] = 'data/style/style.css';
$this->vdir->file_put_contents('data/style/style.css', implode("\n", $res));