Skip to content

Commit

Permalink
Restyle homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Oct 21, 2024
1 parent d7aba9d commit 27540ee
Show file tree
Hide file tree
Showing 18 changed files with 629 additions and 325 deletions.
3 changes: 0 additions & 3 deletions app/Domain/Icon/FontAwesomeFree.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public function icons(): array
'loginGithub' => 'fab fa-github',

// homepage
'microblogsPopular' => 'far fa-comments',
'reputationRanking' => 'fas fa-star',
'forumNews' => 'fas fa-star',
'viewersOnlineLocal' => 'fas fa-eye',
'viewersOnlineGlobal' => 'fas fa-users',
'homepageActivityMicroblog' => 'far fa-person',
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/InitialsSvg.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function __construct(private string $initials)
public function imageSvg(): string
{
return <<<svg
<div class="default-avatar">
<div class="user-avatar default-avatar">
<svg viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
<text x="50%" y="50%" dominant-baseline="central" text-anchor="middle" fill="currentColor">
$this->initials
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function index(): View
),

'globalViewers' => $this->globalViewers(),
'lookAndFeel' => 'lookAndFeelModern',
])
->with('settings', $this->getSettings());
}
Expand Down
8 changes: 4 additions & 4 deletions app/Services/Session/Renderer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Coyote\Services\Session;

use Coyote\Domain\Online\SessionRepository;
use Coyote\Domain\Online\FakeSessionRepository;
use Coyote\Domain\Online\Viewers;
use Coyote\Domain\Online\ViewersStore;
use Coyote\Domain\Spacer;
Expand All @@ -13,9 +13,9 @@ class Renderer
private Spacer $spacer;

public function __construct(
private SessionRepository $session,
private ViewersStore $store,
private Request $request,
private FakeSessionRepository $session,
private ViewersStore $store,
private Request $request,
)
{
$this->spacer = new Spacer(8);
Expand Down
2 changes: 1 addition & 1 deletion app/Services/TwigBridge/Extensions/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function userAvatar(?string $photo, string $name): Html
}
$photoUrl = $this->photo($photo);
$htmlUsername = \htmlSpecialChars($name);
return new StringHtml('<img class="mw-100" src="' . $photoUrl . '" alt="' . $htmlUsername . '">');
return new StringHtml('<img class="user-avatar mw-100" src="' . $photoUrl . '" alt="' . $htmlUsername . '">');
}

public function logo($filename, $secure = null): string
Expand Down
2 changes: 1 addition & 1 deletion public/img/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/img/stream-last-feed.png
Binary file not shown.
15 changes: 15 additions & 0 deletions resources/feature/theme/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,18 @@
}
}
}

@mixin theme {
/**
* The dark() and light() mixins increase selector specificity.
* In some cases, it's necessary to apply a common style to both
* themes, overriding a previously defined style.
* Thus, we need to artificially elevate the specificity
* of the style, without actually changing any style.
*/
html.theme-light &,
html.theme-dark &,
{
@content;
}
}
13 changes: 6 additions & 7 deletions resources/js/components/microblog/comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,25 @@
</a>
</li>
<li class="list-inline-item">
<a
<span
@click="checkAuth(vote, comment)"
@mouseenter.once="loadVoters(comment)"
:aria-label="commentVoters"
:class="{'vote-active': comment.is_voted}"
href="javascript:"
data-balloon-pos="up"
data-balloon-break>
{{ commentLabel }}
</a>
</span>
</li>
<li class="list-inline-item">
<a @click="checkAuth(reply)" href="javascript:">
<span @click="checkAuth(reply)">
Odpowiedz
</a>
</span>
</li>
<li v-if="isAuthorized" class="list-inline-item">
<a href="javascript:" :data-metadata="comment.metadata" :data-url="comment.url">
<span :data-metadata="comment.metadata" :data-url="comment.url">
Zgłoś
</a>
</span>
</li>
</ul>

Expand Down
1 change: 0 additions & 1 deletion resources/sass/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
@import "core/dark_flash";
@import "core/dark_footer";
@import "core/dark_header";
@import "core/dark_homepage";
@import "core/dark_input";
@import "core/dark_job";
@import "core/dark_job_offers";
Expand Down
104 changes: 0 additions & 104 deletions resources/sass/core/_dark_homepage.scss

This file was deleted.

2 changes: 1 addition & 1 deletion resources/sass/core/_dark_topic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body.theme-dark {
border-bottom-color: #2f2f2f;
border-bottom-width: 2px;

.nav-search {
.nav-search { // TODO remove this after new homepage
.search-bar {
background-color: #2a2a2a;

Expand Down
4 changes: 0 additions & 4 deletions resources/sass/core/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
margin-bottom: 18px; // backward compatibility. in bootstrap 3 panel have margin-bottom
}

.card-default {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

.box {
> h4 {
position: relative;
Expand Down
6 changes: 6 additions & 0 deletions resources/sass/icons/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ $icon-admin-table-sort: $fa-var-sort;
$icon-admin-table-sort-asc: $fa-var-sort-down;
$icon-admin-table-sort-desc: $fa-var-sort-up;

@mixin icon {
i.fa-fw {
@content;
}
}

.fa-square-question:before {
content: "\f2fd";
}
Expand Down
Loading

0 comments on commit 27540ee

Please sign in to comment.