cactimurray
2/18/2020 - 3:55 AM

Tweak Tag Cloud and Blog Filtering

// =======================================================

//    Tag Cloud

// =======================================================


// tweak: { "category" : "Tag Cloud", "label" : "Show Inline Title", "title" : "tweak-tag-cloud-title", "type" : "checkbox", "active" : false, "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".sqs-tagcloud" }

// tweak: { "category": "Tag Cloud", "label" : "Inline Title Font", "title" : "tweak-tag-cloud-title-font", "type" : "font", "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".tweak-tag-cloud-title" }
.tweak-tag-cloud-title-font {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  letter-spacing: 0em;
  line-height: 1em;
  text-transform: none;
}

// tweak: { "category": "Tag Cloud", "label": "Inline Title Text Color", "title" : "tweak-tag-cloud-title-text-color", "type" : "color", "target" : ".sqs-tagcloud", "showOnlyWhenPresent" : ".tweak-tag-cloud-title" }
@tweak-tag-cloud-title-text-color: #000000;


// tweak: { "category": "Tag Cloud", "label" : "Font", "title" : "tweak-tag-cloud-font", "type" : "font", "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".sqs-tagcloud" }
.tweak-tag-cloud-font {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  letter-spacing: 0em;
  line-height: 1em;
  text-transform: none;
}

// tweak: { "category" : "Tag Cloud", "label" : "Use Comma Seperator", "title" : "tweak-tag-cloud-comma", "type" : "checkbox", "active" : false, "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".sqs-tagcloud" }

// tweak: { "category" : "Tag Cloud", "label" : "Alignment", "title" : "tweak-tag-cloud-alignment", "type" : "dropdown", "options" : [ "Left", "Center", "Right" ], "default" : "Center", "target" : ".sqs-tagcloud", "showOnlyWhenPresent" : ".sqs-tagcloud" }

// tweak: { "category" : "Tag Cloud", "label" : "Item Spacing", "title" : "tweak-tag-cloud-spacing", "type" : "value", "step" : 0.01, "min" : 0, "max" : 5, "target" : ".sqs-tagcloud", "showOnlyWhenPresent" : ".sqs-tagcloud" }
@tweak-tag-cloud-spacing: 0.618em;

// tweak: { "category": "Tag Cloud", "label": "Text Color", "title" : "tweak-tag-cloud-text-color", "type" : "color", "target" : ".sqs-tagcloud", "showOnlyWhenPresent" : ".sqs-tagcloud" }
@tweak-tag-cloud-text-color: #ffffff;

// tweak: { "category" : "Tag Cloud", "label" : "Use Button Style", "title" : "tweak-tag-cloud-button", "type" : "checkbox", "active" : false, "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".sqs-tagcloud", "js": true }

// tweak: { "category" : "Tag Cloud", "label" : "Use Rounded Button Style", "title" : "tweak-tag-cloud-rounded", "type" : "checkbox", "active" : false, "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".tweak-tag-cloud-button", "js": true }

// tweak: { "category": "Tag Cloud", "label": "Button Color", "title" : "tweak-tag-cloud-button-color", "type" : "color", "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".tweak-tag-cloud-button" }
@tweak-tag-cloud-button-color: #000000;

// tweak: { "category": "Tag Cloud", "label": "Button Hover Color", "title" : "tweak-tag-cloud-button-hover-color", "type" : "color", "target" : ".sqs-tagcloud", "showOnlyWhenPresent": ".tweak-tag-cloud-button" }
@tweak-tag-cloud-button-hover-color: #000000;


// =======================================================

//    Blog Filter Heading

// =======================================================

// tweak: { "category" : "Blog List Filter Heading", "label" : "Vertical Padding", "title" : "tweak-bloglist-filter-vertical-padding", "type" : "value", "step" : 1, "min" : 0, "max" : 100, "target" : ".BlogList-filter", "showOnlyWhenPresent" : ".BlogList-filter" }
@tweak-bloglist-filter-vertical-padding: 30px;

// tweak: { "category": "Blog List Filter Heading", "label" : "Font", "title" : "tweak-bloglist-filter-font", "type" : "font", "target" : ".BlogList-filter", "showOnlyWhenPresent": ".BlogList-filter" }
.tweak-bloglist-filter-font {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  letter-spacing: 0em;
  line-height: 1em;
  text-transform: none;
}

// tweak: { "category" : "Blog List Filter Heading", "label" : "Alignment", "title" : "tweak-bloglist-filter-alignment", "type" : "dropdown", "options" : [ "Left", "Center", "Right" ], "default" : "Center", "target" : ".BlogList-filter", "showOnlyWhenPresent" : ".BlogList-filter" }

// tweak: { "category": "Blog List Filter Heading", "label": "Text Color", "title" : "tweak-bloglist-filter-text-color", "type" : "color", "target" : ".BlogList-filter", "showOnlyWhenPresent" : ".BlogList-filter" }
@tweak-bloglist-filter-text-color: #000000;
// -----------------------------------------

//  Tag Cloud

.tagcloud-block {
  display: inline-block;

  .tweak-tag-cloud-font;
  color: @tweak-tag-cloud-text-color;

  .tweak-tag-cloud-alignment-left & { text-align: left; }
  .tweak-tag-cloud-alignment-center & { text-align: center; }
  .tweak-tag-cloud-alignment-right & { text-align: right; }

  .tweak-tag-cloud-comma & { 
    li:not(:last-of-type):after {
      content: ",  ";
    }
  }

  li:not(:last-of-type) {
    margin-right: @tweak-tag-cloud-spacing;
  }

  .tweak-tag-cloud-button & a {
    background-color: @tweak-tag-cloud-button-color;
    padding: 0.2em 1em;

    .tweak-tag-cloud-rounded& {
      border-radius: 200px;
    }

    &:hover,&.active {
      background-color: @tweak-tag-cloud-button-hover-color;
    }

    .transition(background-color 0.1s ease-out);
  }
  
  .tweak-tag-cloud-title & ul:before {
    content: "Filter: ";
    .tweak-tag-cloud-title-font;
    color: @tweak-tag-cloud-title-text-color;
    margin-right: 1em;
  }
}

// -----------------------------------------

//  Blog

.Main-content .BlogList-filter {
  padding-top: @tweak-bloglist-filter-vertical-padding!important;
  padding-bottom: @tweak-bloglist-filter-vertical-padding!important;

  color: @tweak-bloglist-filter-text-color;

  .tweak-bloglist-filter-font;

  .tweak-bloglist-filter-alignment-left & { text-align: left; }
  .tweak-bloglist-filter-alignment-center & { text-align: center; }
  .tweak-bloglist-filter-alignment-right & { text-align: right; }
}
function fixMetaLinks() {
    var a, b, c;
    $(".Blog-meta-item-tag").each(function() {
        a = $(this).attr('href').replace("/tag/", "?tag=");
        $(this).attr('href', a);
    });

    $(".sqs-tagcloud a").each(function() {
        b = this.href;
        c = window.location.href;
        if (b == c) {
            $(this).addClass("active");
        }
    });
};