Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ohbendy committed Jul 24, 2024
2 parents 6a2d2b2 + 663320e commit 49995fb
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 54 deletions.
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- seo -%}
<link rel="stylesheet" href="https://cdn.datatables.net/fixedheader/4.0.1/css/fixedHeader.dataTables.min.css">
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
{%- feed_meta -%}
{%- if jekyll.environment == 'production' and site.google_analytics -%}
Expand Down
1 change: 1 addition & 0 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="//cdn.datatables.net/2.0.8/js/dataTables.min.js"></script>
<script src="https://cdn.datatables.net/fixedheader/4.0.1/js/dataTables.fixedHeader.min.js"></script>
<script src="//cdn.datatables.net/rowgroup/1.5.0/js/dataTables.rowGroup.min.js"></script>
<script src="https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.min.js"></script>
<script src="{{ "/assets/js/main.js" | relative_url }}"></script>
2 changes: 0 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
</div>
</main>

<!-- {%- include footer.html -%} -->

{%- include scripts.html -%}

</body>
Expand Down
68 changes: 18 additions & 50 deletions _sass/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ table {
padding: 0.25rem 0.25rem;
}

td:nth-child(6n+1) {
td:nth-child(7n+1) {
font-size: 0.8rem
}
}
Expand All @@ -199,55 +199,23 @@ table {
}

// Fix strange hidden table when using DataTable's scrollX
#myTable #DataTables_Table_0 {
width: 100% !important;
overflow: visible;
}

#myTable #DataTables_Table_0_wrapper .dt-layout-table {
position: relative;
overflow: auto;
width: 100%;
}

// @media screen and (min-width: 600px) {
// .page-content .wrapper {padding:2rem 2rem 1.5rem; max-width: 88%; margin:0 auto}
// h1.post-title {font-size:1.35rem; letter-spacing: normal}
// hr {margin:2rem auto 1.5rem;}
// p {font-size:0.9rem; line-height:1.35rem; max-width:100%}
// table {padding:0.5rem 1rem; margin:2rem auto 3rem;}
// table th {font-size:1rem; padding: 0.25rem 0.25rem;}
// table td {font-size:0.85rem; padding: 0.25rem 0.25rem;}
// td:nth-child(6n+1) {font-size:0.92rem}
// }

// @media screen and (min-width: 1001px) {
// .page-content .wrapper {padding:3rem 4rem 3rem; max-width: 77%; margin: 4rem auto}
// h1.post-title {font-size:1.6rem; letter-spacing: normal}
// hr {margin:3rem auto 3.5rem;}
// p {font-size:1rem; line-height:1.5rem; max-width:75ch}
// table {padding:0.5rem 1rem; margin:3rem auto 4rem;}
// table th {font-size:1.1rem; padding: 0.5rem 0.25rem;}
// table td {font-size:0.93rem; padding: 0.25rem 0.25rem;}
// td:nth-child(6n+1) {font-size:1rem}
// }

// @media screen and (min-width: 1729px) {
// .page-content .wrapper {padding:3rem 4rem 3rem; max-width: 70%;}
// h1.post-title {font-size:2.2rem; letter-spacing: normal}
// hr {margin:3rem auto 3.5rem;}
// p {font-size:1rem; line-height:1.5rem; max-width:75ch}
// table {padding:0.5rem 1rem; margin:3rem auto 4rem;}
// table th {font-size:1.2rem; padding: 0.5rem 0.25rem;}
// table td {font-size:0.9rem; padding: 0.5rem 0.25rem;}
// td:nth-child(6n+1) {font-size:1rem}
// }

// @media screen and (min-width: 3000px) { /*Ben's External Display*/
// .page-content .wrapper {padding:7rem 8rem 7rem; max-width: 65%;}
// h1.post-title {font-size:2.4rem; letter-spacing: normal}
// hr {margin:3rem auto 3.5rem;}
// p {font-size:1.4rem; line-height:2.1rem; max-width:75ch}
// table {padding:1rem 2rem; margin:3rem auto 4rem;}
// table th {font-size:1.5rem}
// table td {font-size:1.125rem}
// td:nth-child(6n+1) {font-size:1.25rem}
// }
.dtfh-floatingparent {
z-index: 90 !important;
}

.dataTable.fixedHeader-floating {
background-color: #ffffff;
}

/* Small devices (640px and up) */
@media (min-width: 640px) {
Expand Down Expand Up @@ -300,7 +268,7 @@ table {
padding: 0.25rem 0.25rem;
}

td:nth-child(6n+1) {
td:nth-child(7n+1) {
font-size: 0.92rem
}
}
Expand Down Expand Up @@ -357,7 +325,7 @@ table {
padding: 0.25rem 0.25rem;
}

td:nth-child(6n+1) {
td:nth-child(7n+1) {
font-size: 1rem
}
}
Expand Down Expand Up @@ -412,7 +380,7 @@ table {
padding: 0.5rem 0.25rem;
}

td:nth-child(6n+1) {
td:nth-child(7n+1) {
font-size: 1rem
}
}
Expand Down Expand Up @@ -449,14 +417,14 @@ table {
padding: 1rem 2rem;

th {
font-size: 1.5rem
font-size: 1.25rem
}

td {
font-size: 1.125rem
}

td:nth-child(6n+1) {
td:nth-child(7n+1) {
font-size: 1.25rem
}
}
Expand Down
28 changes: 26 additions & 2 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ $("document").ready(function () {
ordering: false,
autoWidth: true,
info: false,
columns: [ null, null, null, null, { searchable: false }, null, { searchable: false }]
columns: [ null, null, null, null, { searchable: false }, null, { searchable: false }],
fixedHeader: {
header: true,
headerOffset: -35
}
});

table.on("draw.dt", function (e, settings) {
// $($("#myTable table#DataTables_Table_0")[0]).find(".script-name*[data-script]").each(function (index, cell) {
var t = $(settings.nTable);
t.find(".script-name*[data-script]").each(function (index, cell) {
var rows = t.find(`.script-name*[data-script=${$(cell).data("script")}]`);
Expand All @@ -48,6 +51,11 @@ $("document").ready(function () {
});
});

// Open link in new tab
$("#myTable table a").each(function(index, a) {
a.target = "_blank";
});

$("#myTable table:first").imagesLoaded(function() {
var images = $("#myTable table:first img");
images.each(function(i, img) {
Expand All @@ -58,5 +66,21 @@ $("document").ready(function () {
img.parentNode.innerHTML = wrapper.outerHTML;
}
});

$("#myTable table .is-vertical").mouseenter(function() {
var imgWrapper = $(this).get(0);
var cr = imgWrapper.getBoundingClientRect();
var offset = cr.top + imgWrapper.scrollHeight - window.innerHeight;
var outViewport = offset > 1;

if (outViewport) {
var img = $(imgWrapper).find("img");
img.css("transform", `translateY(-${offset+25}px)`)
}
});

$("#myTable table .is-vertical").mouseleave(function() {
$(this).find("img").removeAttr("style")
});
});
});

0 comments on commit 49995fb

Please sign in to comment.