Skip to content

Commit c2fe7a1

Browse files
Maddageokala
authored andcommitted
Remove schedule layout hack
This was put in because (IIRC) the first room lined up with the edge of the screen at Cardiff, and made it appear there was only one track when viewing on mobile. Nowadays, Pretalx automatically adjusts itself to show everything in a single column, and this hack therefore doesn't do anything helpful, but does mean that the date header slowly disappears from view in a parallax sort of way as one scrolls down.
1 parent 0a2d1db commit c2fe7a1

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/_layouts/schedule.html

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,6 @@ <h2>{{ page.title }}</h2>
2222
style="--pretalx-clr-primary: #3aa57c; display: block; margin: 0 auto;">
2323
</pretalx-schedule>
2424

25-
<script language='javascript'>
26-
/* This is a hack to resize the injected pretalx schedule so more of
27-
* it fits on the page, without knowing anything about the inner
28-
* structure of the injected content.
29-
*
30-
* We wait for the page to have horizontal scroll-bar, at which point
31-
* we can calculate ratios for CSS transforms that shrink the width
32-
* of the injected content so it fits horizontally again. A shrinking
33-
* CSS transform will center the content by default, so first we use a
34-
* translation to shift it to the left (the order of transform operations
35-
* matters).
36-
*
37-
* To keep things from getting too squished, we never scale down to
38-
* less than 70% of the original content width.
39-
*
40-
* Sadly, if the user resizes their browser window or zooms in/out,
41-
* they will need to refresh to get this to run again.
42-
*/
43-
var rescale_done = false;
44-
function rescale_schedue() {
45-
if (!rescale_done) {
46-
var ratio1 = Math.max(70, Math.round(100 * window.innerWidth / document.documentElement.scrollWidth) - 2);
47-
var ratio2 = Math.round((100 - ratio1)/2);
48-
if (ratio1 < 100) {
49-
var ps = document.getElementById('pretalx-schedule');
50-
var style = ps.getAttribute('style');
51-
ps.setAttribute('style', style + 'transform: translateX(-' + ratio2 +'%) scaleX('+ ratio1 +'%) translateY(-' + ratio2 +'%) scaleY('+ ratio1 +'%);');
52-
rescale_done = true;
53-
}
54-
}
55-
}
56-
/* Check whether we need to resize every 50ms, starting 500ms after
57-
* this compiles and giving up after 4 seconds.
58-
*/
59-
for (var i = 10; i < 80; i++) {
60-
setTimeout(rescale_schedue, 50 * i);
61-
}
62-
</script>
63-
6425
{% endif %}
6526

6627
</main>

0 commit comments

Comments
 (0)