19
19
}
20
20
21
21
/* Turn off weird quarto whitespace behavior */
22
- .masonry-item > p {
22
+ .masonry-item > p ,
23
+ .mega-example-item > p {
23
24
margin : 0 ;
24
25
padding : 0 ;
25
26
position : absolute ;
@@ -29,14 +30,21 @@ h3 a {
29
30
bottom : 0 ;
30
31
}
31
32
33
+ .mega-example-container {
34
+ display : grid ;
35
+ grid-template-columns : repeat (3 , 1fr );
36
+ gap : 1em ;
37
+ }
38
+
32
39
.masonry-container {
33
40
column-count : auto ;
34
41
/* Effectively determines number of columns (wider = fewer cols) */
35
42
column-width : 11rem ;
36
43
column-gap : 1em ;
37
44
}
38
45
39
- .masonry-item {
46
+ .masonry-item ,
47
+ .mega-example-item {
40
48
display : inline-block ;
41
49
width : 100% ;
42
50
margin-bottom : 1em ;
@@ -64,14 +72,24 @@ h3 a {
64
72
font-size : 1em ;
65
73
}
66
74
67
- .masonry-item :hover .embed-hover-overlay {
68
- opacity : 1 ;
69
- pointer-events : auto ;
75
+ .masonry-item :hover .embed-hover-overlay ,
76
+ .mega-example-item :hover .embed-hover-overlay {
77
+ opacity : 1 ;
78
+ pointer-events : auto ;
70
79
}
71
80
72
81
.masonry-item .cell-output table {
73
82
zoom : calc (260 / var (--width ) * var (--dynamic-factor ));
74
83
}
84
+
85
+ .mega-example-item .cell-output table {
86
+ zoom : calc ( 1 / 2600 * var (--mega-container-width ));
87
+ }
88
+
89
+ .mega-example-item .cell-output #mycombinedtable {
90
+ zoom : 0.47 ;
91
+ padding-top : 30px ;
92
+ }
75
93
</style >
76
94
77
95
<script >
@@ -83,6 +101,13 @@ function updateZoom() {
83
101
const factor = Math .max (0.3 , Math .min (2.5 , width / 300 ));
84
102
85
103
document .documentElement .style .setProperty (' --dynamic-factor' , factor);
104
+
105
+ // similar, but for mega examples
106
+ const mega_example_container = document .querySelector (' .mega-example-container' );
107
+ if (! mega_example_container) return ;
108
+
109
+ const mega_example_width = mega_example_container .offsetWidth ;
110
+ document .documentElement .style .setProperty (' --mega-container-width' , mega_example_width);
86
111
}
87
112
88
113
addEventListener (' DOMContentLoaded' , updateZoom);
@@ -111,14 +136,24 @@ addEventListener('DOMContentLoaded', setTableWidths);
111
136
addEventListener (' resize' , setTableWidths);
112
137
</script >
113
138
114
- <!-- ::::: {.grid}
139
+ ::::{.mega-example-container}
140
+
141
+ :::{.mega-example-item style="--width: 724;"}
142
+ {{< embed with-code.qmd#cars_table >}}
143
+ [ Cars] ( ./with-code.html#cars_table ) {.embed-hover-overlay}
144
+ :::
145
+
146
+ :::{.mega-example-item style="--width: 763;"}
147
+ {{< embed with-code.qmd#nfl_table >}}
148
+ [ NFL 2011 Season] ( ./with-code.html#nfl_table ) {.embed-hover-overlay}
149
+ :::
115
150
116
- :::{.g-col-lg-5 .g-col-12 .example .shrink-example }
117
- ### [Two Column Layout](./before-after .qmd#two-column-layout)
118
- {{< embed _raw.qmd#two-column-layout >} }
151
+ :::{.mega-example-item style="--width: 756;" }
152
+ {{< embed with-code .qmd#gini_coefficient_table >}}
153
+ [ Gini Coefficients ] ( ./with-code.html#gini_coefficient_table ) {.embed-hover-overlay }
119
154
:::
120
155
121
- ::::: -->
156
+ ::::
122
157
123
158
::::{.masonry-container}
124
159
0 commit comments