Skip to content

Commit 3962582

Browse files
committed
minor #1813 [Site] Clean demos & packages pages (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Site] Clean demos & packages pages Commits ------- e55d241 [Site] Clean demos & packages pages
2 parents 277a73b + e55d241 commit 3962582

File tree

9 files changed

+62
-53
lines changed

9 files changed

+62
-53
lines changed

ux.symfony.com/assets/controllers/code-expander-controller.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { Controller } from '@hotwired/stimulus';
44
export default class extends Controller {
55
static targets = ['useStatements', 'expandCodeButton', 'codeContent'];
66

7+
connect() {
8+
if (this.hasExpandCodeButtonTarget && !this.#isOverflowing(this.codeContentTarget)) {
9+
this.expandCodeButtonTarget.remove();
10+
}
11+
}
12+
713
expandUseStatements(event) {
814
this.useStatementsTarget.style.display = 'block';
915
event.currentTarget.remove();

ux.symfony.com/assets/styles/components/_DemoCard.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
max-height: 100%;
3939
width: 100%;
4040
display: block;
41-
transition: transform 500ms linear;
42-
transform: scale(1) translateY(0);
4341
border-radius: .25rem;
44-
transform-style: preserve-3d;
4542
opacity: .80;
4643
}
4744
.DemoCard:hover .DemoCard__image {
@@ -53,7 +50,7 @@
5350
flex: 1;
5451
border-bottom-left-radius: var(--radius);
5552
border-bottom-right-radius: var(--radius);
56-
gap: .5rem;
53+
gap: .15rem;
5754
display: flex;
5855
flex-direction: column;
5956
}
@@ -81,5 +78,6 @@
8178
}
8279

8380
.DemoCard__tags {
81+
margin-top: auto;
8482
margin-bottom: 0;
8583
}

ux.symfony.com/assets/styles/components/_Terminal.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@
1010

1111
.Terminal_header {
1212
display: flex;
13-
background-color: #0D0D0DBA;
13+
background-color: var(--bg-header, #0D0D0DBA);
1414
border-top-left-radius: var(--border-radius);
1515
border-top-right-radius: var(--border-radius);
1616
align-items: center;
1717
justify-content: space-between;
1818
padding: .5rem;
19+
opacity: var(--header-opacity, 1);
20+
transition: all 250ms ease-in-out;
21+
22+
.Terminal:hover & {
23+
opacity: 1;
24+
}
1925

2026
.nav-tabs {
2127
border: 0;

ux.symfony.com/src/Service/UxPackageRepository.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ public function findAll(?string $query = null): array
190190
'I need to translate strings in JavaScript',
191191
'translator.svg'
192192
),
193-
194-
// new UxPackage('form-collection', 'Form Collection', 'app_form_collection', 'linear-gradient(95.22deg, #5920A0 -4.7%, #844EC9 105.43%), #5920A0', 'Handle CollectionType embedded forms with zero custom JavaScript'),
195193
];
196194

197195
if (!$query) {
@@ -212,7 +210,7 @@ public function find(string $name): UxPackage
212210
}
213211
}
214212

215-
throw new \InvalidArgumentException(sprintf('Unknown package "%s"', $name));
213+
throw new \InvalidArgumentException(sprintf('Unknown package "%s".', $name));
216214
}
217215

218216
public function count(): int
@@ -229,6 +227,6 @@ public function findByRoute(string $route): UxPackage
229227
}
230228
}
231229

232-
throw new \InvalidArgumentException(sprintf('Could not find a package for the current route "%s"', $route));
230+
throw new \InvalidArgumentException(sprintf('Could not find a package for the current route "%s".', $route));
233231
}
234232
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<aside style="background-color: var(--bs-secondary-bg-subtle);" class="mt-5">
2+
<div class="container-fluid container-xxl p-4 p-md-5">
3+
<div style="display: grid; gap: 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));">
4+
<twig:DocsLink
5+
title="Documentation"
6+
text="Get going with the official Symfony UX doc."
7+
url="https://symfony.com/bundles/StimulusBundle/current/index.html"
8+
icon="symfony"
9+
/>
10+
<twig:DocsLink
11+
title="Screencasts"
12+
text="Watch UX screencasts on SymfonyCasts."
13+
url="https://symfonycasts.com/screencast/stimulus"
14+
icon="symfonycast"
15+
/>
16+
<twig:DocsLink
17+
title="Community"
18+
text="Feedback · support · contributions."
19+
url="https://github.com/symfony/ux"
20+
icon="github"
21+
/>
22+
</div>
23+
</div>
24+
</aside>

ux.symfony.com/templates/components/CodeWithExplanationRow.html.twig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
{% block content %}{% endblock %}
88
{% endapply %}
99
</div>
10-
<div class="col-12 col-md-6" {{ not reversed ? 'order-md-1' }}>
11-
<twig:CodeBlock :filename="filename" />
10+
<div class="col-12 col-md-6 {{ not reversed ? 'order-md-1' }}" style="padding-inline: 0;">
11+
<twig:CodeBlock
12+
:filename="filename"
13+
style="--bg-header: rgba(13, 13, 13, 0.729); --header-opacity: .5;"
14+
/>
1215
</div>
1316
</div>

ux.symfony.com/templates/main/demos.html.twig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
<div class="hero">
1212
<div class="container-fluid container-xxl px-4 pt-4 px-md-5">
1313
<h1 class="text-center mt-5">All Demos</h1>
14+
<div style="font-size: 1rem; line-height: 1.75rem;" class="mt-4 text-center demo-introduction">
15+
<p>
16+
Discover all that <code>Symfony UX</code> offers through our collection of demos!<br/>
17+
Source code is provided for each demo: PHP, Twig, JS, and CSS.
18+
</p>
19+
</div>
20+
<p class="text-center mt-2 mb-5">
21+
</p>
1422
</div>
1523
</div>
1624

@@ -23,3 +31,7 @@
2331
</div>
2432

2533
{% endblock %}
34+
35+
{% block aside %}
36+
{{ include('_aside.html.twig') }}
37+
{% endblock %}

ux.symfony.com/templates/main/homepage.html.twig

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,29 +113,6 @@
113113
</div>
114114
</div>
115115

116-
<aside style="background-color: var(--bs-secondary-bg-subtle);" class="mt-5">
117-
<div class="container-fluid container-xxl p-4 p-md-5">
118-
<div style="display: grid; gap: 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));">
119-
<twig:DocsLink
120-
title="Documentation"
121-
text="Get going with the official Symfony UX doc."
122-
url="https://symfony.com/bundles/StimulusBundle/current/index.html"
123-
icon="symfony"
124-
/>
125-
<twig:DocsLink
126-
title="Screencasts"
127-
text="Watch UX screencasts on SymfonyCasts."
128-
url="https://symfonycasts.com/screencast/stimulus"
129-
icon="symfonycast"
130-
/>
131-
<twig:DocsLink
132-
title="Community"
133-
text="Feedback · support · contributions."
134-
url="https://github.com/symfony/ux"
135-
icon="github"
136-
/>
137-
</div>
138-
</div>
139-
</aside>
116+
{{ include('_aside.html.twig') }}
140117

141118
{% endblock %}

ux.symfony.com/templates/main/packages.html.twig

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
{% block content %}
1010
<div class="hero">
1111
<div class="container-fluid container-xxl px-4 pt-4 px-md-5">
12-
<h1 class="text-center mt-5">All Packages</h1>
13-
<p class="text-center mt-2 mb-5">A treasure chest of packages to solve your<br>frontend problems.</p>
12+
<h1 class="text-center mt-5">Symfony UX Packages</h1>
13+
<p class="text-center mt-2 mb-5">A treasure chest of bundles, components and packages</p>
1414
</div>
1515
</div>
1616

@@ -26,20 +26,5 @@
2626
{% endblock %}
2727

2828
{% block aside %}
29-
<div style="background-color: var(--bs-secondary-bg);" class="mt-5">
30-
<div class="container-fluid container-xxl p-5">
31-
<div style="display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));">
32-
<twig:DocsLink
33-
url="https://symfonycasts.com/screencast/stimulus"
34-
title="Screencasts"
35-
text="Jump right into with the Symfony UX & Stimulus screencast."
36-
/>
37-
<twig:DocsLink
38-
url="https://symfony.com/doc/current/frontend/ux.html"
39-
title="Documentation"
40-
text="Ready to get started? The official symfony.com UX Docs."
41-
/>
42-
</div>
43-
</div>
44-
</div>
29+
{{ include('_aside.html.twig') }}
4530
{% endblock %}

0 commit comments

Comments
 (0)