Skip to content

Commit dea9017

Browse files
authored
Merge branch 'main' into 790-make-vacancy-title-clickable
2 parents 0a4a7d5 + f907408 commit dea9017

9 files changed

Lines changed: 152 additions & 68 deletions

File tree

.cursor/rules/common

Submodule common updated 1 file

website/modules/asset/ui/src/index.js

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@ import { setupTagSearchForInput } from './searchInputHandler';
1212
import { FilterModal } from './filterModal';
1313
import { initClientSideFiltering } from './clientSideFiltering';
1414

15-
/* eslint-enable sort-imports */
15+
function revealLoaded() {
16+
document
17+
.querySelectorAll(
18+
'.breadcrumb.loading, .sf-container.loading, .page-main_content.loading',
19+
)
20+
.forEach((el) => {
21+
el.classList.remove('loading');
22+
el.classList.add('loaded');
23+
if (el.hasAttribute('aria-busy')) {
24+
el.setAttribute('aria-busy', 'false');
25+
}
26+
});
27+
}
1628

1729
function initConfiguration() {
1830
window.DEFAULT_VISIBLE_TAGS_COUNT = 5;
@@ -57,13 +69,11 @@ function initFontChanger() {
5769

5870
setInterval(() => {
5971
currentFontIndex = (currentFontIndex + 1) % fonts.length;
60-
// Use Array.prototype.at() for safer array access
6172
const currentFont = fonts.at(currentFontIndex);
6273
heroContent.style.fontFamily = currentFont;
6374
}, 500);
6475
}
6576

66-
// Tag search filter for case studies page
6777
function initCaseStudiesTagFilter({
6878
inputSelector = '.tag-search',
6979
containerSelector = '.filter-section',
@@ -92,30 +102,24 @@ function initializeAllComponents() {
92102
initClientSideFiltering();
93103
}
94104

95-
// Barba pages
96105
function initBarbaPageTransitions() {
97106
if (!document.querySelector('[data-barba="container"]')) return;
98107

99108
apos.util.onReady(() => {
100-
// Initialize case studies filter handler
101109
initCaseStudiesFilterHandler();
102110

103-
// Original Barba enter callback
104111
const originalEnterCallback = function (data, hasFilterAnchor) {
105-
// Scroll to the top after page transition (unless we have a filter anchor)
106112
if (!hasFilterAnchor) {
107113
window.scrollTo(0, 0);
108114
}
109115

110-
// Close menu if it's open
111116
const menuButton = document.getElementById('nav-icon');
112117
const menu = document.querySelector('[data-menu]');
113118
if (menuButton && menu) {
114119
menu.classList.remove('open');
115120
menuButton.classList.remove('open');
116121
}
117122

118-
// Trigger video play after transition
119123
const video = data.next.container.querySelector('video');
120124
if (video) {
121125
video.play();
@@ -160,7 +164,6 @@ function initBarbaPageTransitions() {
160164
cacheIgnore: false,
161165
preventRunning: true,
162166
timeout: 10000,
163-
164167
transitions: [
165168
{
166169
sync: false,
@@ -175,28 +178,27 @@ function initBarbaPageTransitions() {
175178
],
176179
});
177180

178-
// Add after hook for updating menu state
179181
barba.hooks.after(() => {
180182
// Update menu active state
181183
const currentPath = window.location.pathname;
182184
const menuLinks = document.querySelectorAll('.sf-nav__list a');
183-
184-
// First, remove active class from all menu items
185185
menuLinks.forEach((link) => link.classList.remove('active'));
186-
187-
// Then, add active class to the current menu item
188186
menuLinks.forEach((link) => {
189187
const href = link.getAttribute('href');
190188
const hrefPath = new URL(href, window.location.origin).pathname;
191189
if (hrefPath === currentPath) {
192190
link.classList.add('active');
193191
}
194192
});
193+
194+
revealLoaded();
195+
if (!window.caseStudiesFilterModal) {
196+
initFilterModal();
197+
}
195198
});
196199
});
197200
}
198201

199-
// Anchor Navigation
200202
function initAnchorNavigation() {
201203
const anchors = document.querySelectorAll('a[href^="#"]');
202204
if (!anchors.length) return;
@@ -216,7 +218,6 @@ function initAnchorNavigation() {
216218

217219
function initMenuToggle() {
218220
apos.util.onReady(() => {
219-
// Menu Open
220221
const menuButton = document.getElementById('nav-icon');
221222
const menu = document.querySelector('[data-menu]');
222223

@@ -227,7 +228,6 @@ function initMenuToggle() {
227228
menuButton.classList.toggle('open');
228229
});
229230

230-
// Close menu when clicking on menu items for non-logged users
231231
const menuLinks = menu.querySelectorAll('a');
232232
menuLinks.forEach((link) => {
233233
link.addEventListener('click', () => {
@@ -240,7 +240,6 @@ function initMenuToggle() {
240240
});
241241
}
242242

243-
// Filter Case Studies modal for Case Studies mobile page
244243
function initFilterModal() {
245244
if (!document.querySelector('.cs_list')) {
246245
return;
@@ -257,19 +256,23 @@ function initFilterModal() {
257256
});
258257
}
259258

260-
document.addEventListener('DOMContentLoaded', initFilterModal);
261-
262-
if (typeof barba !== 'undefined') {
263-
barba.hooks.after(() => {
264-
initFilterModal();
265-
});
259+
if (document.readyState === 'loading') {
260+
document.addEventListener('DOMContentLoaded', initFilterModal);
261+
} else {
262+
initFilterModal();
266263
}
267264

268265
export default () => {
269266
initConfiguration();
270267

271268
initializeAllComponents();
272269

270+
if (document.readyState === 'loading') {
271+
document.addEventListener('DOMContentLoaded', revealLoaded);
272+
} else {
273+
revealLoaded();
274+
}
275+
273276
apos.util.onReady(() => {
274277
initCaseStudiesFilterHandler();
275278
});
@@ -278,17 +281,15 @@ export default () => {
278281
initAnchorNavigation();
279282
initMenuToggle();
280283

281-
// Case studies anchor fix
282284
setTimeout(() => {
283285
const { pathname, search, hash } = window.location;
284-
const isCasesPage = pathname.includes('/cases');
285-
const hasFilterParams =
286-
search.includes('industry') ||
287-
search.includes('stack') ||
288-
search.includes('caseStudyType') ||
289-
hash.includes('filter');
290-
291-
if (isCasesPage && hasFilterParams) {
286+
if (
287+
pathname.includes('/cases') &&
288+
(search.includes('industry') ||
289+
search.includes('stack') ||
290+
search.includes('caseStudyType') ||
291+
hash.includes('filter'))
292+
) {
292293
const filterAnchor = document.getElementById('filter');
293294
if (filterAnchor) filterAnchor.scrollIntoView({ behavior: 'smooth' });
294295
}

website/modules/asset/ui/src/scss/_animation.scss

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,40 @@
5555
filter: blur(0);
5656
}
5757
}
58+
59+
// Loading/Loaded states for reveal animations
60+
.loading {
61+
opacity: 0;
62+
overflow: hidden;
63+
visibility: hidden;
64+
transform: translateY(20px);
65+
transition:
66+
opacity 0.6s ease-out,
67+
transform 0.6s ease-out;
68+
}
69+
70+
.loaded {
71+
opacity: 1;
72+
overflow: visible;
73+
visibility: visible;
74+
transform: translateY(0);
75+
}
76+
77+
// Specific loading states for breadcrumbs and containers
78+
.breadcrumb.loading,
79+
.sf-container.loading {
80+
opacity: 0 !important;
81+
visibility: hidden !important;
82+
transform: translateY(15px);
83+
transition:
84+
opacity 0.5s ease-out,
85+
visibility 0.5s ease-out,
86+
transform 0.5s ease-out;
87+
}
88+
89+
.breadcrumb.loaded,
90+
.sf-container.loaded {
91+
opacity: 1 !important;
92+
visibility: visible !important;
93+
transform: translateY(0);
94+
}

website/modules/asset/ui/src/scss/_carousel.scss

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@
4444
text-decoration: none;
4545
@include truncate-lines(2);
4646
}
47-
&__wrapper{
47+
&__wrapper {
4848
display: flex;
4949
flex-direction: row;
5050
flex-wrap: wrap;
5151
margin-bottom: 4px;
5252
@include breakpoint-medium {
5353
margin-bottom: 8px;
5454
}
55-
5655
}
57-
&__container{
56+
&__container {
5857
display: flex;
5958
flex-direction: column;
6059
justify-content: center;
@@ -92,16 +91,13 @@
9291
@include truncate-lines(1);
9392
}
9493
&__content {
95-
font-weight: 500;
96-
font-size: 14px;
97-
line-height: 21px;
98-
color: $gray-300;
99-
margin: 0;
100-
@include breakpoint-medium {
101-
@include truncate-lines(8);
102-
}
94+
font-weight: 500;
95+
font-size: 14px;
96+
line-height: 21px;
97+
color: $gray-300;
98+
margin: 0;
10399
}
104-
100+
105101
&__url {
106102
text-decoration: none;
107103
font-weight: 700;

website/modules/asset/ui/src/scss/_cases.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
&_content {
88
display: flex;
99
flex-direction: column;
10-
gap: 2rem;
1110
margin-bottom: 3rem;
1211
}
1312

website/modules/asset/ui/src/scss/_testimonials.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,19 @@
7171
}
7272
.sf-person__content {
7373
color: $gray-300;
74-
@include truncate-lines(7);
74+
75+
overflow-x: hidden;
76+
overflow-y: auto;
77+
max-height: 150px;
78+
79+
overflow-wrap: anywhere;
80+
word-break: break-word;
81+
82+
-webkit-overflow-scrolling: touch;
83+
overscroll-behavior: contain;
84+
scrollbar-gutter: stable both-edges;
85+
padding-right: 12px;
86+
7587
@include font-settings(14px, 150%, 400);
7688
}
7789
}
@@ -134,7 +146,6 @@
134146
@include breakpoint-medium {
135147
height: 400px;
136148
.sf-person__content {
137-
@include truncate-lines(10);
138149
@include font-settings(22px, 150%, 400);
139150
}
140151
}

website/modules/case-studies-page/views/index.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
data-default-visible-tags="{{ data.defaultVisibleTagsCount }}"
77
>
88
<div class="cs_content">
9-
<div class="page-main_content">{% area data.page, 'main' %}</div>
9+
<div
10+
class="page-main_content loading"
11+
id="page-main_content"
12+
aria-busy="true"
13+
>
14+
{% area data.page, 'main' %}
15+
</div>
1016

1117
<div id="filter" class="filter-anchor"></div>
1218

@@ -295,6 +301,16 @@ <h4 class="portfolio-title">{{ article.portfolioTitle }}</h4>
295301
<script>
296302
window.totalPages = {{ data.totalPages | json }};
297303
</script>
304+
305+
<noscript>
306+
<style>
307+
#page-main_content {
308+
opacity: 1 !important;
309+
overflow: visible !important;
310+
visibility: visible !important;
311+
}
312+
</style>
313+
</noscript>
298314
<script src="/js/modules/case-studies-page/infinite-scroll.js"></script>
299315

300316
{% endblock main %}

0 commit comments

Comments
 (0)