Skip to content

Commit

Permalink
small corrections
Browse files Browse the repository at this point in the history
- Implemented a custom “fitRows” layout for Isotope to ensure equal height for post tiles.
- Adjusted padding on the landing page
- Adjusted margins for sequential post headlines
  • Loading branch information
Franz-Kafka committed Dec 23, 2024
1 parent 5ba964d commit 3260105
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 2 additions & 4 deletions css/blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,9 @@ h1, h2, h3, h4, h5{
margin-top: 60px;
font-weight: 500;
}
h2 + h3{
margin-top: 30px;
}
h2 + h3,
h3 + h4{
margin-top: 20px;
margin-top: 30px;
}
blockquote{
h4{
Expand Down
8 changes: 4 additions & 4 deletions css/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ body.landing{
}
}
.content{
padding: 20px;
padding: 20px 40px;
font-family: "JetBrainsMono-Regular";
font-size: 14px;
position: relative;
.lines{
position: absolute;
top: 20px;
left: 12px;
left: 25px;
color: var(--main-text-tertiary-color, #B2B2B2);
font-size: 14px;
line-height: 17px;
Expand All @@ -176,7 +176,7 @@ body.landing{
margin: 0;
}
&.haslines{
padding-left: 45px;
padding-left: 60px;
}
}
.bottombar{
Expand Down Expand Up @@ -565,7 +565,7 @@ body.landing{
z-index: 1;
}
.window button.copy{
right: 20px;
right: 40px;
top: 15px;
}
}
Expand Down
11 changes: 8 additions & 3 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ $(document).ready(function(){


/** FILTER LINE */
if ($('.filterbar').length !== 0) {
if ($('.filterbar').length !== 0) {

/* CUSTOM FITROWS FUNCTION FOR ISOTOPE TO GET EQUAL HEIGHT TILES */
!function(t){"use strict";function i(t){var i=t.create("fitRows");return i.prototype._resetLayout=function(){if(this.x=0,this.y=0,this.maxY=0,this.row=0,this.rows=[],this._getMeasurement("gutter","outerWidth"),this.options.equalheight)for(var t=0;t<this.isotope.items.length;t++)this.isotope.items[t].css({height:"auto"})},i.prototype._getItemLayoutPosition=function(t){t.getSize();var i=this.gutter||0,s=t.size.outerWidth,o=Math.ceil(this.isotope.size.innerWidth+i);0!==this.x&&s+this.x+i>o&&(this.x=0,this.y=this.maxY+i),0===this.x&&0!==this.y&&this.row++;var e={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=s+i,void 0===this.rows[this.row]?(this.rows[this.row]=[],this.rows[this.row].start=this.y,this.rows[this.row].end=this.maxY):this.rows[this.row].end=Math.max(this.rows[this.row].end,this.maxY),t.row=this.row,e},i.prototype._equalHeight=function(){for(var t=0;t<this.isotope.items.length;t++){var i=this.isotope.items[t].row,s=this.rows[i];if(s){var o=s.end-s.start;o-=this.isotope.items[t].size.borderTopWidth+this.isotope.items[t].size.borderBottomWidth,o-=this.isotope.items[t].size.marginTop+this.isotope.items[t].size.marginBottom,o-=this.gutter.height||0,!1==this.isotope.items[t].size.isBorderBox&&(o-=this.isotope.items[t].size.paddingTop+this.isotope.items[t].size.paddingBottom),this.isotope.items[t].size.height=o,this.isotope.items[t].css({height:o.toString()+"px"})}}},i.prototype._getContainerSize=function(){return this.options.equalheight&&this._equalHeight(),{height:this.maxY}},i}"function"==typeof define&&define.amd?define(["../layout-mode"],i):"object"==typeof exports?module.exports=i(require("../layout-mode")):i(t.Isotope.LayoutMode)}(window);

var $grid = $('.newstiles').isotope({
itemSelector: '.postpreview',
layoutMode: 'fitRows',
fitRows: {
gutter: 20
gutter: 20,
equalheight: true
},
getSortData: {
title: '[data-title]'
Expand Down Expand Up @@ -786,4 +791,4 @@ $(document).ready(function(){
$(this).wrapInner('<code class="language-plaintext"></code>');
});

});
});

0 comments on commit 3260105

Please sign in to comment.