Skip to content

Commit

Permalink
[UI] Make menu styles like on design (#153)
Browse files Browse the repository at this point in the history
* #153: Make menu styles like on design

* test: upds scrns

* test: upds scrns

* test: do not use absolute paths in generated path for assets

* test: upds scrns

* Update bin/build

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* improve

* test: upd scrns

* merge master

* updates test

* test: upds scrns

* test: upds scrns

---------

Co-authored-by: Paul Keen <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 13, 2024
1 parent c66a21a commit c93b8a5
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 17 deletions.
Binary file modified test/fixtures/screenshots/linux/desktop/blog/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/macos/desktop/blog/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/macos/mobile/nav/hamburger_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 22 additions & 5 deletions themes/beaver/assets/css/navigation.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.btn,
.btn:hover {
padding: 10px 18px;
padding: 11px 18px;
font-size: 16px;
line-height: 24px;
font-weight: 700;
Expand Down Expand Up @@ -92,8 +92,8 @@

.menu-close {
display: none;
width: 25px;
height: 25px;
width: 30px;
height: 30px;
position: absolute;
top: 24px;
left: 16px;
Expand Down Expand Up @@ -183,7 +183,7 @@
transition: .3s;
}

.navigation .-active .link {
.navigation .-active .link {
color: #1a8cff;
}

Expand Down Expand Up @@ -341,7 +341,7 @@
background-color: #121212;
color: #fff;
border-radius: 6px;
margin-top: 10px;
margin-top: 15px;
}

.navigation .item {
Expand Down Expand Up @@ -406,6 +406,17 @@

.navigation .item .arrow {
top: 25px;
right: 15px;
}

.navigation .item .arrow:before {
content: '';
position: absolute;
left: -15px;
right: -15px;
top: -15px;
bottom: -15px;
cursor: pointer;
}

.navigation .item.-open .arrow {
Expand All @@ -415,8 +426,14 @@
.navigation .item:hover .arrow {
border-color: inherit;
}

.navigation .item:hover .link,
.navigation .sub-item:hover .sub-name {
color: inherit;
}

.navigation .link {
font-size: 18px;
padding-right: 15px;
}
}
11 changes: 8 additions & 3 deletions themes/beaver/layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,22 @@
{{ end }}
{{ end }}

<a href="{{ $src.RelPermalink }}">
<a href="{{ $src.RelPermalink }}" rel="nofollow">
<picture>
{{ range $format := $formats }}
{{ $srcset := slice }}
{{ range $index, $size := $sizes }}
{{ $image := $data.Get (printf "%s-%d" $format $index) }}
{{ $srcset = $srcset | append (printf "%s %dw" $image.RelPermalink $size) }}
{{ end }}
<source type="image/{{ $format }}" srcset="{{ delimit $srcset ", " }}" sizes="(max-width: 48rem) 100vw, 48rem" height="{{ $src.Height }}" width="{{ $src.Width }}">
<source type="image/{{ $format }}" srcset="{{ delimit $srcset ", " }}"
sizes="(max-width: 48rem) 100vw, 48rem" height="{{ $src.Height }}" width="{{ $src.Width }}">
{{ end }}
<img loading="lazy" src="{{ ($data.Get (printf "%s-0" $defaultFormat)).RelPermalink }}" alt="{{ $alt }}" height="{{ $src.Height }}" width="{{ $src.Width }}">
<img loading="lazy"
src="{{ ($data.Get (printf "%s-0" $defaultFormat)).RelPermalink }}"
alt="{{ $alt }}"
height="{{ $src.Height }}"
width="{{ $src.Width }}">
</picture>
</a>

Expand Down
2 changes: 1 addition & 1 deletion themes/beaver/layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1 class="fl-heading" style="margin: 0!important;padding: 0!important">Blog</h1
<br>

{{ range (.Paginate (.Pages.ByParam "created_at").Reverse).Pages }}
<a class="link" target="_blank" rel="noopener" href="{{ .Permalink }}">
<a class="link" target="_blank" rel="noopener noreferrer" href="{{ .RelPermalink }}">


<div class="blog-post">
Expand Down
2 changes: 1 addition & 1 deletion themes/beaver/layouts/blog/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<br />

{{ range (.Paginate (.Pages.ByParam "created_at").Reverse).Pages }}
<a class="link" target="_blank" rel="noopener" href="{{ .Permalink }}">
<a class="link" target="_blank" rel="noopener" href="{{ .RelPermalink }}">
<div class="blog-post">
<div class="post-image">
{{ partial "blog/img-cropped.html" (dict "Page" . "width" 180 "height" 180) }}
Expand Down
2 changes: 1 addition & 1 deletion themes/beaver/layouts/page/careers.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ <h2 class="fl-heading">
<li><span class="engineering">{{ .Params.position_type }}</span></li>
</ul>
</div>
<h3 class="pp-content-grid-post-title"><a href='{{ .Permalink }}' title='{{ .Params.position }}'>{{ .Params.position }}</a></h3>
<h3 class="pp-content-grid-post-title"><a href='{{ .RelPermalink }}' title='{{ .Params.position }}'>{{ .Params.position }}</a></h3>
<div class="career-detail">

{{ range .Params.requirements }}
Expand Down
8 changes: 4 additions & 4 deletions themes/beaver/layouts/partials/blog/img-cropped.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@


<picture>
<source srcset="{{ $webp.Permalink }}" type="image/webp">
<source srcset="{{ $cropped.Permalink }}" type="{{ $cropped.MediaType }}">
<img src="{{ $cropped.Permalink }}" alt="{{ .Page.Title }}" width="{{ .width }}" height="{{ .height }}">
<source srcset='{{ $webp.RelPermalink }}' type="image/webp" width="{{ .width }}" height="{{ .height }}">
<source srcset='{{ $cropped.RelPermalink }}' type="{{ $cropped.MediaType }}" width="{{ .width }}" height="{{ .height }}">
<img alt='{{ .Page.Title }}' src="{{ $cropped.RelPermalink }}" width="{{ .width }}" height="{{ .height }}">
</picture>

{{ else }}
<img src="{{ (resources.Get "img/no-image.svg" | resources.Fingerprint).Permalink }}" width="{{ .width }}" height="{{ .height }}" alt="Placeholder Image">
<img src="{{ (resources.Get "img/no-image.svg" | resources.Fingerprint).RelPermalink }}" width="{{ .width }}" height="{{ .height }}" alt="Placeholder Image">
{{ end }}
4 changes: 2 additions & 2 deletions themes/beaver/layouts/partials/clients/grid-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<meta itemprop="userInteractionCount" content="0"/>
</div>
<div class="pp-content-grid-post-image">
<a href="{{ .Permalink }}">
<a href="{{ .RelPermalink }}">
{{ partial "img/client-logo.html" (dict "image" $logo "title" .Params.client.name) }}
</a>
</div>
Expand All @@ -42,4 +42,4 @@
</ul>
</div>
</div>
</div>
</div>

0 comments on commit c93b8a5

Please sign in to comment.