Skip to content
Permalink
Browse files

General optimizations

  • Loading branch information
Thoulah committed Oct 27, 2019
1 parent edaf901 commit 63c2bf4a985bb6060bc24ff71fe691329601eb57

Some generated files are not rendered by default. Learn more.

@@ -1,34 +1,34 @@
$link-color: $darkerBlue;
$link-hover-color: $darkBlue;
$link-color: $darkerBlue;
$link-hover-color: $darkBlue;

$enable-rounded: true;
$enable-shadows: true;
$enable-gradients: true;
$enable-transitions: true;
$enable-print-styles: false;
$enable-rounded: true;
$enable-shadows: true;
$enable-gradients: true;
$enable-transitions: true;
$enable-print-styles: false;

$component-active-color: $middleBlue;
$component-active-bg: $darkerBlue;
$component-active-color: $middleBlue;
$component-active-bg: $darkerBlue;

$headings-color: $tardisBlue;
$headings-color: $tardisBlue;

$dropdown-bg: $tardisBlue;
$dropdown-border-color: darken($tardisBlue, 6.5%);
$dropdown-divider-bg: $middleBlue;
$dropdown-link-color: $lightBlue;
$dropdown-link-hover-color: darken($tardisBlue, 6.5%);
$dropdown-link-hover-bg: $middleBlue;
$dropdown-link-active-color: $component-active-color !default;
$dropdown-link-active-bg: darken($tardisBlue, 6.5%);
$dropdown-bg: $tardisBlue;
$dropdown-border-color: darken($tardisBlue, 6.5%);
$dropdown-divider-bg: $middleBlue;
$dropdown-link-color: $lightBlue;
$dropdown-link-hover-color: darken($tardisBlue, 6.5%);
$dropdown-link-hover-bg: $middleBlue;
$dropdown-link-active-color: $component-active-color !default;
$dropdown-link-active-bg: darken($tardisBlue, 6.5%);

$nav-divider-margin-y: .1rem 0;
$nav-divider-margin-y: .1rem 0;

$navbar-padding-y: 0;
$navbar-brand-font-size: 1.8rem;
$navbar-dark-color: $lightBlue;
$navbar-dark-hover-color: rgba($white, .7) !default;
$navbar-dark-active-color: $darkBlue;
$navbar-dark-disabled-color: rgba($white, .25) !default;
$navbar-dark-toggler-border-color: rgba($white, .1) !default;
$navbar-padding-y: 0;
$navbar-brand-font-size: 1.8rem;
$navbar-dark-color: $lightBlue;
$navbar-dark-hover-color: rgba($white, .7) !default;
$navbar-dark-active-color: $darkBlue;
$navbar-dark-disabled-color: rgba($white, .25) !default;
$navbar-dark-toggler-border-color: rgba($white, .1) !default;

$breadcrumb-padding-y: .2rem;
$breadcrumb-padding-y: .2rem;
@@ -93,6 +93,12 @@ h1, h2, h3, h4, h5, h6, .breadcrumb, label {
}

&-albums {
.list-group {
.list-group-item {
border: 0;
}
}

svg.text-muted {
color: $lighterBlue !important;
}
@@ -101,11 +107,18 @@ h1, h2, h3, h4, h5, h6, .breadcrumb, label {
overflow-x: hidden;
}
}

&-albums,
&-lyrics {
.badge {
background-color: $lighterBlue;
color: $body-color;
}
}
}
}

.alert,
.lyrics {
.alert {
p:last-of-type {
margin-bottom: 0;
}
@@ -168,10 +181,6 @@ form {
resize: none;
}

img.captcha {
cursor: pointer;
}

&.html2markdown {
textarea {
overflow: auto;
@@ -185,7 +194,6 @@ form {
}

#btn-scrolltop {
background: #a0a0a0;
border-radius: 50%;
bottom: 0px;
color: #fff;
@@ -200,7 +208,6 @@ form {
@include user-select(none);

&:hover {
background: #666;
cursor: pointer;
line-height: 1.4;
}
@@ -58,8 +58,14 @@ public function saveCollection(int $user, array $data, string $status): array
$collectionItem->artist = trim(preg_replace('/\([0-9]+\)/', '', ArrayHelper::getValue($item, 'basic_information.artists.0.name')));
$collectionItem->year = (int) ArrayHelper::getValue($item, 'basic_information.year');
$collectionItem->title = ArrayHelper::getValue($item, 'basic_information.title');
$collectionItem->image_color = null;
$collectionItem->status = $status;
$collectionItem->created = Yii::$app->formatter->asDatetime(ArrayHelper::getValue($item, 'date_added'), 'yyyy-MM-dd HH:mm:ss');
if ($collectionItem->image_color === null) {
$collectionItem->image_color = Image::getAverageImageColor($collectionItem->image);
}
$collectionItem->save();
}
@@ -41,7 +41,7 @@
$this->beginBody();
echo Html::beginTag('header', ['class' => 'site-header fixed-top']);
NavBar::begin([
NavBar::begin([
'brandLabel' => Yii::$app->name,
'brandUrl' => Yii::$app->homeUrl,
'options' => [
@@ -86,16 +86,16 @@
echo Html::beginTag('div', ['class' => 'dropdown-menu']);
foreach (Yii::$app->params['languages'] as $lng => $desc) {
echo ($lng === Yii::$app->language)
? Html::tag('div', $desc . ' ✔', ['class' => 'disabled dropdown-item', 'lang' => $lng])
: Html::a($desc, Url::current(['language' => $lng]), ['class' => 'dropdown-item', 'lang' => $lng]);
? Html::tag('div', $desc . ' ✔', ['class' => 'disabled dropdown-item', 'lang' => $lng])
: Html::a($desc, Url::current(['language' => $lng]), ['class' => 'dropdown-item', 'lang' => $lng]);
}
echo Html::endTag('div');
echo Html::endTag('div');
}
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::endTag('footer');
echo Html::a('▲', null, ['data-placement' => 'left', 'data-toggle' => 'tooltip', 'id' => 'btn-scrolltop', 'title' => Yii::t('mr42', 'Scroll to Top')]);
echo Html::a('▲', null, ['data-placement' => 'left', 'data-toggle' => 'tooltip', 'id' => 'btn-scrolltop', 'class' => 'bg-gradient-dark', 'title' => Yii::t('mr42', 'Scroll to Top')]);
$this->endBody();
echo Html::endTag('body');
@@ -25,13 +25,13 @@
$$tab[] = Html::beginTag('div', ['class' => 'row justify-content-center']);
foreach (Collection::find()->where(['user_id' => 1, 'status' => $tab])->orderBy(['artist' => SORT_ASC, 'year' => SORT_ASC])->all() as $album) {
$$tab[] = Html::beginTag('div', ['class' => 'col-12 col-sm-6 col-md-3 col-xl-2 mt-3 d-sm-flex align-items-stretch']);
$$tab[] = Html::beginTag('div', ['class' => 'card']);
$$tab[] = Html::beginTag('div', ['class' => 'card text-center notranslate']);
$$tab[] = Html::tag('div', $album->artist, ['class' => 'card-header p-2']);
$$tab[] = Html::tag('div', Html::tag('span', $album->title, ['class' => 'card-text mx-auto']), ['class' => 'card-body d-flex p-2']);
$$tab[] = Html::a(
Html::img('@assets/images/blank.png', ['alt' => "{$album->artist} - {$album->year} - {$album->title}", 'class' => 'card-img-top rounded', 'data-src' => Url::to(['music/collection-cover', 'id' => $album->id])]),
Html::img('@assets/images/blank.png', ['alt' => "{$album->artist} - {$album->title} ({$album->year})", 'class' => 'card-img-bottom', 'data-src' => Url::to(['music/collection-cover', 'id' => $album->id])]),
"https://www.discogs.com/release/{$album->id}"
);
$$tab[] = Html::tag('div', Html::tag('small', $album->title, ['class' => 'card-text mt-auto mx-auto font-weight-bold notranslate']), ['class' => 'card-body d-flex text-center p-2']);
$$tab[] = Html::tag('div', Html::tag('small', $album->artist), ['class' => 'card-footer text-center p-2 notranslate']);
$$tab[] = Html::endTag('div');
$$tab[] = Html::endTag('div');
}
@@ -34,26 +34,28 @@
if ($album->tracks) {
echo Html::beginTag('div', ['class' => ['card', $album === end($data) ? 'mb-1' : 'mb-3']]);
echo Html::beginTag('div', ['class' => array_filter(['card-header', (!$album->active) ? 'bg-warning' : null])]);
echo Html::tag('h4', Html::a($album->name, ['lyrics', 'artist' => $album->artist->url, 'year' => $album->year, 'album' => $album->url], ['class' => 'notranslate']) . " ({$album->year})", ['class' => 'float-left']);
echo Html::tag('span', Html::tag('span', $album->year, ['class' => 'badge']) . Html::a($album->name, ['lyrics', 'artist' => $album->artist->url, 'year' => $album->year, 'album' => $album->url], ['class' => 'ml-1 notranslate']), ['class' => 'h4 float-left']);
echo Html::beginTag('div', ['class' => 'float-right']);
if ($album->buy) {
echo Html::a(Yii::$app->icon->name('bandcamp', 'brands')->class('mr-1') . Yii::t('mr42', 'Buy'), $album->buy, ['class' => 'btn btn-sm btn-outline-secondary ml-1', 'title' => Yii::t('mr42', 'Buy This Album')]);
echo Html::a(Yii::$app->icon->name('bandcamp', 'brands')->class('mr-1') . Yii::t('mr42', 'Buy'), $album->buy, ['class' => 'btn btn-sm btn-outline-dark ml-1', 'title' => Yii::t('mr42', 'Buy This Album')]);
}
if ($album->playlist_url) {
echo Html::a(Yii::$app->icon->name($album->playlist_source, 'brands')->class('mr-1') . Yii::t('mr42', 'Play'), $album->playlist_url, ['class' => 'btn btn-sm btn-outline-secondary ml-1', 'title' => Yii::t('mr42', 'Play Album')]);
echo Html::a(Yii::$app->icon->name($album->playlist_source, 'brands')->class('mr-1') . Yii::t('mr42', 'Play'), $album->playlist_url, ['class' => 'btn btn-sm btn-outline-dark ml-1', 'title' => Yii::t('mr42', 'Play Album')]);
}
echo Html::a(Yii::$app->icon->name('file-pdf')->class('mr-1') . Yii::t('mr42', 'PDF'), ['albumpdf', 'artist' => $album->artist->url, 'year' => $album->year, 'album' => $album->url], ['class' => 'btn btn-sm btn-outline-secondary ml-1', 'title' => Yii::t('mr42', 'PDF')]);
echo Html::a(Yii::$app->icon->name('file-pdf')->class('mr-1') . Yii::t('mr42', 'PDF'), ['albumpdf', 'artist' => $album->artist->url, 'year' => $album->year, 'album' => $album->url], ['class' => 'btn btn-sm btn-outline-dark ml-1', 'title' => Yii::t('mr42', 'PDF')]);
echo Html::endTag('div');
echo Html::endTag('div');
echo Html::beginTag('div', ['class' => 'd-flex']);
echo Html::beginTag('div', ['class' => 'row card-body']);
echo Html::beginTag('div', ['class' => 'row card-body notranslate']);
foreach (array_chunk($album->tracks, ceil(count($album->tracks) / 3)) as $tracks) {
echo Html::beginTag('div', ['class' => 'col-md-4']);
echo Html::beginTag('div', ['class' => 'col-md-4 list-group']);
foreach ($tracks as $track) {
echo Html::beginTag('div', ['class' => 'text-truncate notranslate']);
$track->name = Html::a($track->name, ['lyrics', 'artist' => $album->artist->url, 'year' => $album->year, 'album' => $album->url, '#' => $track->track]);
echo implode(' · ', [$track->track, $track->name . $track->nameExtra]) . $track->icons;
echo Html::beginTag('div', ['class' => 'list-group-item list-group-item-action text-truncate py-0']);
echo Html::tag('span', $track->track, ['class' => 'badge']);
echo Html::a($track->name, ['lyrics', 'artist' => $album->artist->url, 'year' => $album->year, 'album' => $album->url, '#' => $track->track], ['class' => 'ml-1']);
echo $track->nameExtra;
echo $track->icons;
echo Html::endTag('div');
}
echo Html::endTag('div');

0 comments on commit 63c2bf4

Please sign in to comment.
You can’t perform that action at this time.