Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67ad176

Browse files
committed
fix(home): fix mobile responsiveness for wide-featured project
1 parent a6b04b9 commit 67ad176

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

dot-org/layouts/index.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,36 @@
99
<section class="flex flex-col gap-8">
1010
<h2 class="ngx-section-header">FEATURED PROJECTS</h2>
1111
<div class="flex flex-col gap-8">
12-
{{ partial "projects/card-wide.html" (index $projects 0) }}
12+
{{ with index $projects 0 }}
13+
<!-- Wide Card Hidden on Mobile Screens-->
14+
<div class="hidden w-full bg-white ngx-card-border lg:flex">
15+
<div class="w-56 h-56 shrink-0 proj-image-bg flex items-center justify-center">
16+
{{ with .Resources.Get (.Param "image") }}
17+
<img src="{{ .RelPermalink }}" alt="{{ .Title }}" class="w-36 h-36"/>
18+
{{ end }}
19+
</div>
20+
<div class="p-4 gap-2 flex-col flex">
21+
<h3 class="font-semibold text-2xl">{{ .Title }}</h3>
22+
<p class="text-gray-600 grow text-wrap text-sm">
23+
{{ .Plain | htmlUnescape }}
24+
</p>
25+
<div class="flex w-full gap-1">
26+
{{ if .Params.github_url }}
27+
{{ $iconLinkArgs := (dict "TargetURL" .Params.github_url "TargetIconPath" "svg/github-logo.svg") }}
28+
{{ partial "icon-link.html" $iconLinkArgs }}
29+
{{ end }}
30+
{{ if .Params.external_url }}
31+
{{ $iconLinkArgs := (dict "TargetURL" .Params.external_url "TargetIconPath" "svg/external-link.svg") }}
32+
{{ partial "icon-link.html" $iconLinkArgs }}
33+
{{ end }}
34+
</div>
35+
</div>
36+
</div>
37+
<!-- Handles mobile screens w/ regular card -->
38+
<div class="w-full lg:hidden">
39+
{{ partial "projects/featured-card.html" . }}
40+
</div>
41+
{{ end }}
1342
<div class="w-full flex flex-wrap md:flex-nowrap justify-between gap-8 ">
1443
{{ range after 1 $projects }}
1544
{{ partial "projects/featured-card.html" . }}

dot-org/layouts/partials/projects/card-wide.html

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)