landing-page: Adjust font size for long integration categories/names.

This commit is contained in:
Jack Zhang
2017-07-10 14:44:00 -07:00
committed by Tim Abbott
parent 6e2f90c8c9
commit bab96ab8a0
2 changed files with 28 additions and 2 deletions

View File

@@ -46,6 +46,31 @@ var integration_events = function () {
}
);
function adjust_font_sizing() {
$('.integration-lozenge').toArray().forEach(function (integration) {
var $integration_name = $(integration).find('.integration-name');
var $integration_category = $(integration).find('.integration-category');
// if the text has wrapped to two lines, decrease font-size
if ($integration_name.height() > 30) {
$integration_name.css('font-size', '1em');
if ($integration_name.height() > 30) {
$integration_name.css('font-size', '.95em');
}
}
if ($integration_category.height() > 30) {
$integration_category.css('font-size', '.8em');
if ($integration_category.height() > 30) {
$integration_category.css('font-size', '.75em');
}
}
});
}
adjust_font_sizing();
$(window).resize(adjust_font_sizing);
var $lozenge_icon;
var currentblock;
var instructionbox = $("#integration-instruction-block");
@@ -53,7 +78,6 @@ var integration_events = function () {
return this.id || null;
}).get();
var show_integration = function (hash) {
// the version of the hash without the leading "#".
var _hash = hash.replace(/^#/, "");
@@ -125,6 +149,8 @@ var integration_events = function () {
$(".integration-categories-dropdown").removeClass('hide');
$(".integrations .catalog").removeClass('hide');
}
adjust_font_sizing();
}
window.onhashchange = update_hash;

View File

@@ -1818,7 +1818,7 @@ a:not(.no-style):hover:before {
.portico-landing.integrations .integration-lozenge .integration-name {
font-size: 1.2em;
font-weight: 400;
margin-bottom: 0;
margin: 10px 4px 0 4px;
}
.portico-landing.integrations .integration-lozenge .integration-name.create-your-own {