Skip to content

Commit

Permalink
feat: reworked footer
Browse files Browse the repository at this point in the history
  • Loading branch information
berezinant committed Dec 16, 2024
1 parent a2fe934 commit c4a8ebf
Show file tree
Hide file tree
Showing 20 changed files with 346 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tasks.withType<AbstractDokkaTask>().configureEach {
@Language("JSON")
val dokkaBaseConfiguration = """
{
"footerMessage": "(c) 2024 My custom footer message",
"footerMessage": "<div class='kt-footer__license'>Kotlin™ is protected under the <a href='https://kotlinlang.org/foundation/kotlin-foundation.html' data-test='external-link ' target='_blank' rel='noreferrer noopener' class='kt-footer__link'>Kotlin&nbsp;Foundation</a> and licensed under the&nbsp;<a href='https://github.com/JetBrains/kotlin-web-site/blob/master/LICENSE' data-test='external-link ' target='_blank' rel='noreferrer noopener' class='kt-footer__link'>Apache&nbsp;2 license</a>. </div>",
"homepageLink": "https://github.com/Kotlin/dokka/tree/master/dokka-integration-tests/gradle/projects/ui-showcase"
}
""".trimIndent()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import './styles.scss';
function initButton() {
const buttons = document.querySelectorAll('div.button');
buttons.forEach((button: Element) => {
button.addEventListener('keydown', (event) => {
button.addEventListener('keyup', (event) => {
const key = (event as KeyboardEvent).key;
if (key === 'Enter' || key === ' ') {
button.dispatchEvent(new MouseEvent('click'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function handleOutsideClick(event: MouseEvent): void {

function addKeyboardNavigation(dropdown: HTMLElement): void {
new FocusTrap(dropdown);
dropdown.addEventListener('keydown', function (event) {
dropdown.addEventListener('keyup', function (event) {
if (event.key === 'Escape') {
onToggleDropdown(dropdown);
(dropdown.querySelector(DROPDOWN_TOGGLE) as HTMLElement)?.focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function initFilterSection(): void {
option.addEventListener('click', (event) => {
toggleFilterForOption(event.target as Element);
});
option.addEventListener('keydown', (event) => {
option.addEventListener('keyup', (event) => {
const key = (event as KeyboardEvent).key;
if (key === 'Enter' || key === ' ') {
toggleFilterForOption(event.target as Element);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
import './styles.scss';
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*!
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
@import '../_tokens/index';

.footer {
position: relative;

display: flex;
align-items: flex-start;
justify-content: space-between;

min-height: var(--footer-height);
margin-top: auto;

padding: 0 var(--size-m3);

letter-spacing: 0.15px;

color: var(--color-text-light);
background-color: var(--color-background-footer);

font: var(--font-text-s);

.theme-dark & {
color: var(--color-text-light-dt);
background-color: var(--color-background-footer-dt);
}

@media (width < $breakpoint-desktop-min) {
padding: 0 var(--size-s3);
}

&--button {
z-index: 0;

display: inline-flex;
align-items: center;

flex-shrink: 0;
justify-content: center;

width: 40px;
height: 40px;

margin-top: 12px;
padding: 0;

cursor: pointer;

border: none;
border-radius: var(--size-s1);
background-color: transparent;
background-repeat: no-repeat;
background-position: 50% 50%;
background-size: 24px 24px;

font-size: 0;
line-height: 0;

filter: invert(1);

.theme-dark & {
filter: none;
}

@media (hover: hover) {
&:hover {
background-color: var(--color-w10);
}
}

&:active {
background-color: var(--color-w16);
}

&:focus-visible {
outline: var(--focus-outline);
}

&_go-to-top {
background-image: url('../_assets/go-to-top-icon.svg');
}
}

&--link {
color: inherit;

border-bottom: 1px solid var(--color-text-light);

.theme-dark & {
border-bottom-color: var(--color-text-light-dt);
}

&:focus-visible {
outline: var(--focus-outline);
}

&:hover {
border-bottom-color: var(--color-text);

.theme-dark & {
border-bottom-color: var(--color-text-dt);
}
}
}

&--content {
margin: 12px 0;

text-align: right;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as button from './button/index';
import * as checkbox from './checkbox/index';
import * as dropdown from './dropdown/index';
import * as filterSection from './filter-section/index';
import * as footer from './footer/index';
import * as icon from './icon/index';
import * as libraryName from './library-name/index';
import * as libraryVersion from './library-version/index';
Expand All @@ -23,6 +24,7 @@ export {
checkbox,
dropdown,
filterSection,
footer,
icon,
libraryName,
libraryVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@

@media (hover: hover) {
&:hover {
background-color: var(--color-b08);
background-color: var(--color-w10);
}
}

&:active {
background-color: var(--color-w10);
background-color: var(--color-w16);
}

&:focus-visible {
Expand Down Expand Up @@ -85,3 +85,7 @@

background-image: url('../_assets/burger.svg');
}

.navigation-controls--btn_go-to-top {
background-image: url('../_assets/go-to-top-icon.svg');
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public object AssetsInstaller : PageTransformer {
"ui-kit/assets/field-variable.svg",
"ui-kit/assets/filter.svg",
"ui-kit/assets/function.svg",
"ui-kit/assets/go-to-top-icon.svg",
"ui-kit/assets/homepage.svg",
"ui-kit/assets/interface-kotlin.svg",
"ui-kit/assets/interface.svg",
Expand All @@ -135,8 +136,6 @@ public object AssetsInstaller : PageTransformer {
"images/anchor-copy-button.svg",
"images/copy-icon.svg",
"images/copy-successful-icon.svg",
"images/footer-go-to-link.svg",
"images/go-to-top-icon.svg",
"images/logo-icon.svg",
)

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -872,66 +872,3 @@ Just in case of possible performance degradation it excluding tabs with briefs o
div.runnablesample {
height: fit-content;
}

/* --- footer --- */
.footer {
clear: both;
display: flex;
align-items: center;
position: relative;
min-height: var(--footer-height);
font-size: 12px;
line-height: 16px;
letter-spacing: 0.2px;
color: var(--footer-font-color);
margin-top: auto;
background-color: var(--footer-background);
}

.footer--button {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: var(--footer-go-to-top-color);
background-repeat: no-repeat;
background-position: 50% 50%;
padding: 0;
border: none;
cursor: pointer;
font-size: 0;
line-height: 0;
transition: background-color 200ms ease-in-out;
will-change: background-color;
}

.footer--button:hover {
opacity: 0.9;
}

.footer--button_go-to-top {
background-image: url("../images/go-to-top-icon.svg");
margin-left: var(--horizontal-spacing-for-content);
margin-right: 8px;
}

.footer--link {
display: inline-flex;
align-items: center;
color: var(--breadcrumb-font-color);
}

.footer--link_external:after {
content: '';
width: 12px;
height: 12px;
margin-left: 4px;
margin-right: var(--horizontal-spacing-for-content);
background-image: url("../images/footer-go-to-link.svg");
background-repeat: no-repeat;
background-position: 50% 50%;
}

/* /--- footer --- */
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<#macro display>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>
<span>${footerMessage}</span>
<span class="pull-right">
<div class="footer--content">
<span>Generated by </span>
<a class="footer--link footer--link_external" href="https://github.com/Kotlin/dokka">
<span>dokka</span>
Dokka
</a>
</span>
<div>${footerMessage}</div>
</div>
</div>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<@template_cmd name="pathToRoot">
<a class="library-name--link" href="${pathToRoot}index.html">
<@template_cmd name="projectName">
${projectName}
${projectName} project name with a very long text
</@template_cmd>
</a>
</@template_cmd>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c4a8ebf

Please sign in to comment.