reduce http requests (ugc images + posters)

This commit is contained in:
2015-08-30 17:20:36 +02:00
parent 304c31d870
commit 0eea962e60
5 changed files with 14 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ function getPage($sPath, $asVars, $sType)
if($sType=='html')
{
$sContent = preg_replace('/<script(.*)<\/script>/sU', '', $sContent);
$sContent = preg_replace('/<img src="(.*)"(.*)\/>/sU', '<img source="$1"$2/>', $sContent);
$sContent = preg_replace('/src=("|\')(.*)("|\')/sU', 'source="$2"', $sContent);
}
return $sContent;
@@ -57,7 +57,7 @@ function getTrimImage($iFilmId, $sSize, $sinPath, $sImageExt)
$iBottom = 0;
$iLeft = 0;
$iRight = 0;
$iWhiteLimit = 220;
$iWhiteLimit = 210;
//Top height to crop:
for(; $iTop < $iImageY; ++$iTop)

View File

@@ -100,7 +100,7 @@ function Film(oSettings)
.data('rank', this.getRank())
.data('id', this.id())
.append($('<img>', {'class':'bg', 'src':this.backgroundPoster()}))
.append($('<img>', {'class':'poster', 'src':this.poster()}))
.append($('<img>', {'class':'poster', 'src':this.backgroundPoster()}))
.append($('<div>', {'class':'info'})
.append($('<p>', {'class':'title'})
.append($('<a>', {'class':'name', 'target':'_blank', 'href':this.consts.ugc_url+'film.html?id='+this.id()})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,10 @@
@import 'normalize';
@import 'font-awesome';
/* Variables */
$poster_size:175px;
/* Default Tags */
body {
@@ -197,15 +201,15 @@ main {
position:absolute;
top:50%;
margin-top:-25%;
left:152px;
left:$poster_size;
right:0;
bottom:0;
width:calc(100% - 152px);
width:calc(100% - #{$poster_size});
opacity:0.2;
}
.film img.poster {
width:152px;
width:$poster_size;
display: block;
z-index:2;
}
@@ -214,9 +218,9 @@ main {
z-index:2;
position:absolute;
top:0;
left:152px;
left:$poster_size;
padding-left:1em;
width: calc(100% - 1em - 152px);
width: calc(100% - 1em - #{$poster_size});
}
.film p {