Fix front-end resources

This commit is contained in:
Pig Fang 2018-08-19 19:02:22 +08:00
parent 4e10159781
commit 98d228da4c
7 changed files with 48 additions and 9 deletions

View File

@ -153,7 +153,7 @@ if (! function_exists('bs_favicon')) {
function bs_favicon()
{
// Fallback to default favicon
$url = Str::startsWith($url = (option('favicon_url') ?: config('options.favicon_url')), 'http') ? $url : assets($url);
$url = Str::startsWith($url = (option('favicon_url') ?: config('options.favicon_url')), 'http') ? $url : url($url);
return <<< ICONS
<link rel="shortcut icon" href="$url">

View File

@ -12,7 +12,7 @@ return [
'api_type' => 'false',
'announcement' => 'Welcome to Blessing Skin {version}!',
'color_scheme' => 'skin-blue',
'home_pic_url' => './resources/assets/dist/images/bg.jpg',
'home_pic_url' => './public/bg.jpg',
'custom_css' => '',
'custom_js' => '',
'player_name_rule' => 'official',
@ -42,5 +42,5 @@ return [
'plugins_enabled' => '',
'copyright_prefer' => '0',
'score_per_closet_item' => '0',
'favicon_url' => 'dist/images/favicon.ico'
'favicon_url' => 'public/favicon.ico'
];

View File

@ -1,2 +0,0 @@
*
!.gitignore

View File

@ -1,4 +1,4 @@
@import "general.styl";
@import "common.styl";
html {
background: #f1f1f1;

View File

@ -126,7 +126,45 @@
<!-- App Scripts -->
@include('common.dependencies.script')
<script type="text/javascript">
<script>
function isMobileBrowserScrolling() {
var currentWindowWidth = $(window).width();
var currentWindowHeight = $(window).height();
if ($.cachedWindowWidth === undefined) {
$.cachedWindowWidth = currentWindowWidth;
}
if ($.cachedWindowHeight === undefined) {
$.cachedWindowHeight = currentWindowHeight;
}
var isWidthChanged = (currentWindowWidth !== $.cachedWindowWidth);
var isHeightChanged = (currentWindowHeight !== $.cachedWindowHeight);
// If the window width & height changes simultaneously, the resize can't be fired by scrolling.
if (isWidthChanged && isHeightChanged) {
return false;
}
// If only width was changed, it also can't be.
if (isWidthChanged) {
return false;
}
// If width didn't change but height changed ?
if (isHeightChanged) {
var last = $.lastWindowHeight;
$.lastWindowHeight = currentWindowHeight;
if (last === undefined || currentWindowHeight === last) {
return true;
}
}
// If both width & height did not change
return false;
}
function changeWrapperHeight() {
var btn = $('p a.button');

View File

@ -6,7 +6,7 @@
<meta name="robots" content="noindex,nofollow" />
<title>@lang('setup.wizard.master.title')</title>
<link rel="shortcut icon" href="{{ assets('dist/images/favicon.ico') }}">
<link rel="stylesheet" type="text/css" href="{{ assets('dist/css/install.css') }}">
<link rel="stylesheet" type="text/css" href="{{ webpack_assets('setup.css') }}">
@yield('style')
</head>

View File

@ -25,6 +25,7 @@ const config = {
'./resources/assets/src/stylus/common.styl',
],
home: './resources/assets/src/stylus/home.styl',
setup: './resources/assets/src/stylus/setup.styl',
'langs/en': './resources/lang/en/front-end.js',
'langs/zh_CN': './resources/lang/zh_CN/front-end.js',
},
@ -71,7 +72,7 @@ const config = {
]
},
{
test: /(common|home)\.styl$/,
test: /(common|home|setup)\.styl$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders: 3 } },
@ -119,6 +120,8 @@ const config = {
flatten: true
},
'node_modules/chart.js/dist/Chart.min.js',
'resources/assets/src/images/bg.jpg',
'resources/assets/src/images/favicon.ico',
]),
new BundleAnalyzerPlugin({
openAnalyzer: false,