mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
landing-page: Adjust font size for long integration categories/names.
This commit is contained in:
@@ -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 $lozenge_icon;
|
||||||
var currentblock;
|
var currentblock;
|
||||||
var instructionbox = $("#integration-instruction-block");
|
var instructionbox = $("#integration-instruction-block");
|
||||||
@@ -53,7 +78,6 @@ var integration_events = function () {
|
|||||||
return this.id || null;
|
return this.id || null;
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
|
|
||||||
var show_integration = function (hash) {
|
var show_integration = function (hash) {
|
||||||
// the version of the hash without the leading "#".
|
// the version of the hash without the leading "#".
|
||||||
var _hash = hash.replace(/^#/, "");
|
var _hash = hash.replace(/^#/, "");
|
||||||
@@ -125,6 +149,8 @@ var integration_events = function () {
|
|||||||
$(".integration-categories-dropdown").removeClass('hide');
|
$(".integration-categories-dropdown").removeClass('hide');
|
||||||
$(".integrations .catalog").removeClass('hide');
|
$(".integrations .catalog").removeClass('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adjust_font_sizing();
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onhashchange = update_hash;
|
window.onhashchange = update_hash;
|
||||||
|
|||||||
@@ -1818,7 +1818,7 @@ a:not(.no-style):hover:before {
|
|||||||
.portico-landing.integrations .integration-lozenge .integration-name {
|
.portico-landing.integrations .integration-lozenge .integration-name {
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin-bottom: 0;
|
margin: 10px 4px 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.portico-landing.integrations .integration-lozenge .integration-name.create-your-own {
|
.portico-landing.integrations .integration-lozenge .integration-name.create-your-own {
|
||||||
|
|||||||
Reference in New Issue
Block a user