Skip to content

Commit ab47cc0

Browse files
committed
Added Flickity Safari fix
1 parent f4c28df commit ab47cc0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

index.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
.gallery-cell {
3333
border: 2px solid white;
3434
}
35+
.flickity-viewport {
36+
-webkit-transform: translateZ(0);
37+
transform: translateZ(0);
38+
will-change: transform;
39+
}
40+
/* wyndchyme was here. The above is a fix for a stupid Flickity bug on Safari. Don't touch it. */
3541
</style>
3642
</head>
3743
<body>
@@ -153,6 +159,28 @@
153159
<script src="scripts/main/sidebarfit.js"></script>
154160
<script src="/scripts/main/header.js"></script>
155161
<script src="/scripts/main/posswap.js"></script>
162+
<script>
163+
document.addEventListener("DOMContentLoaded", function () {
164+
var flkty = new Flickity('.carousel', {
165+
cellAlign: 'left',
166+
contain: true,
167+
wrapAround: true
168+
});
169+
170+
// Add a tiny, invisible transition to prevent Safari freeze
171+
var carouselElement = document.querySelector('.carousel');
172+
carouselElement.style.transition = 'transform 0.1ms ease'; // Invisible transition
173+
174+
// Optional: Force a dummy transform every so often to keep the moving state
175+
setInterval(function () {
176+
carouselElement.style.transform = 'translate3d(0, 0, 0)';
177+
}, 1000); // Adjust interval as needed
178+
});
179+
</script>
180+
181+
182+
183+
156184

157185

158186
</body>

0 commit comments

Comments
 (0)