From 1756f0d6b1e45a6924a0a38bc9816e15d9d8218f Mon Sep 17 00:00:00 2001 From: GregTheMadMonk Date: Tue, 27 Sep 2022 02:30:47 +0300 Subject: [PATCH] Improve "Centre was created..." position on the main page Improve the underlined image links fix --- data/home/assets/css/main.css | 10 ++++++++++ data/home/assets/js/util.js | 7 +++++-- .../assets/sass/custom/_home_creationinfo.scss | 15 +++++++++++++++ data/home/assets/sass/main.scss | 3 +++ src/main/kotlin/ru/mipt/spc/spcHome.kt | 6 +++--- 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 data/home/assets/sass/custom/_home_creationinfo.scss diff --git a/data/home/assets/css/main.css b/data/home/assets/css/main.css index 1e5bce4..6585e4e 100644 --- a/data/home/assets/css/main.css +++ b/data/home/assets/css/main.css @@ -2491,4 +2491,14 @@ body.is-menu-visible #menu { opacity: 1; visibility: visible; } +#main div.inner.home_creationinfo { + display: flex; + justify-content: center; + align-items: center; + padding-top: 2.25em; } + #main div.inner.home_creationinfo a > span { + display: block; } + #main div.inner.home_creationinfo p { + margin: 0 0 0 1em; } + /*# sourceMappingURL=main.css.map */ diff --git a/data/home/assets/js/util.js b/data/home/assets/js/util.js index 8fd37a9..ede5563 100644 --- a/data/home/assets/js/util.js +++ b/data/home/assets/js/util.js @@ -585,8 +585,11 @@ }; // Remove `border-bottom` from all `` elements that also contain an `` - document.querySelectorAll("a > img").forEach( - imgEl => { imgEl.parentElement.style.borderBottom = "none" } + document.querySelectorAll("a > img, a > span > img").forEach( + imgEl => { + while (imgEl.tagName != "A") imgEl = imgEl.parentElement; + imgEl.style.borderBottom = "none"; + } ); })(jQuery); diff --git a/data/home/assets/sass/custom/_home_creationinfo.scss b/data/home/assets/sass/custom/_home_creationinfo.scss new file mode 100644 index 0000000..07db872 --- /dev/null +++ b/data/home/assets/sass/custom/_home_creationinfo.scss @@ -0,0 +1,15 @@ +// A custom style for main page block with SPC creation info + #main div.inner.home_creationinfo { + display: flex; + justify-content: center; + align-items: center; + padding-top: 2.25em; + + a > span { + display: block; + } + + p { + margin: 0 0 0 1em; + } + } diff --git a/data/home/assets/sass/main.scss b/data/home/assets/sass/main.scss index b41583a..faf8472 100644 --- a/data/home/assets/sass/main.scss +++ b/data/home/assets/sass/main.scss @@ -74,3 +74,6 @@ @import 'layout/footer'; @import 'layout/wrapper'; @import 'layout/menu'; + +// Custom modifications. + @import 'custom/home_creationinfo'; diff --git a/src/main/kotlin/ru/mipt/spc/spcHome.kt b/src/main/kotlin/ru/mipt/spc/spcHome.kt index b9c1120..d6ea7f0 100644 --- a/src/main/kotlin/ru/mipt/spc/spcHome.kt +++ b/src/main/kotlin/ru/mipt/spc/spcHome.kt @@ -98,9 +98,9 @@ context(WebPage) private fun HTML.spcHome() { div { id = "main" section { - div("inner") { + div("inner home_creationinfo") { a(href = "https://mipt.ru/education/departments/fpmi/") { - span("image left") { + span("image") { img { src = "images/FPMI.jpg" alt = "FPMI" @@ -274,4 +274,4 @@ internal fun SiteBuilder.spcHome(dataPath: Path, prefix: Name = Name.EMPTY) { } } -} \ No newline at end of file +}