]> xenbits.xensource.com Git - www-xenproject-org.git/commitdiff
fix mobile
authorArnaud Guéras <arnaudgs@gmail.com>
Thu, 21 Nov 2024 16:46:39 +0000 (17:46 +0100)
committerArnaud Guéras <arnaudgs@gmail.com>
Thu, 21 Nov 2024 16:46:39 +0000 (17:46 +0100)
Signed-off-by: Arnaud Guéras <arnaudgs@gmail.com>
25 files changed:
content/all.md [new file with mode: 0644]
content/test.md
hugo_stats.json
themes/xen-project/assets/css/base.scss
themes/xen-project/assets/css/components/carousel.scss
themes/xen-project/assets/css/components/latest-news.scss
themes/xen-project/assets/css/content-markdown.scss
themes/xen-project/assets/css/grid.scss
themes/xen-project/assets/css/molecules/buttons.scss
themes/xen-project/assets/css/molecules/card.scss
themes/xen-project/assets/css/molecules/features-list.scss
themes/xen-project/assets/css/molecules/hero-block.scss
themes/xen-project/assets/css/molecules/list-pages.scss
themes/xen-project/assets/css/molecules/media-block.scss
themes/xen-project/assets/css/molecules/section-square-primary.scss
themes/xen-project/assets/css/molecules/section-square-rounded.scss
themes/xen-project/assets/css/molecules/vertical-lists.scss
themes/xen-project/assets/css/structure.scss
themes/xen-project/assets/css/variables.scss
themes/xen-project/assets/js/carousel.js
themes/xen-project/layouts/_default/all.html [new file with mode: 0644]
themes/xen-project/layouts/_default/list.html
themes/xen-project/layouts/_default/single.html
themes/xen-project/layouts/partials/head.html
themes/xen-project/layouts/partials/latest-news.html

diff --git a/content/all.md b/content/all.md
new file mode 100644 (file)
index 0000000..b9e6247
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: "all pages"
+layout: "all"
+hidden: true
+---
\ No newline at end of file
index b6090f4e3efa3b3d0eef89b3bacaa5e32cae17c5..8da8feb0f62502e58db7d561b4d5ecff17ff0955 100644 (file)
@@ -1,8 +1,11 @@
 ---
 title: "test"
 draft: true
+hidden: true
 ---
-{{<section>}}
-{{<latest-news>}}
+{{<section container="full">}}
+{{<carousel class="mg-t-lg carousel-container-width">}}
+{{<getpages "projects" "hidden">}}
+{{</carousel>}}
+
 {{</section>}}
index 89937bfcc50302364914c070e5a5a9f8e2365ff0..cebe3715ee1530a8ebcafda1481fc6701332fe52 100644 (file)
@@ -48,6 +48,7 @@
     "classes": [
       "active",
       "align-flex-start",
+      "all-pages",
       "ancestor",
       "animated-home-server",
       "animated-home-shadow-screen",
@@ -86,6 +87,7 @@
       "container",
       "container-full",
       "content-markdown",
+      "date",
       "description",
       "download-search",
       "fa",
index 7a5848b4361f07ee51283a0c441935d1eae46900..2c4d499faaf0d5fe8038057a30b00f8260419d15 100644 (file)
@@ -55,6 +55,13 @@ li {
 a {
   color: var(--color-action-text);
   text-decoration: none;
+  word-break: break-word;
+  overflow-wrap: break-word;
+
+  @media (max-width: 600px) {
+    word-break: break-word;
+    overflow-wrap: break-word;
+  }
 
   &:hover {
     text-decoration: underline;
index 0d2d2b0f74e3dc5e71f5dce714c3e9b2f43cf9d2..37de028a43c40fbf302912098a345b5ffac3dcee 100644 (file)
@@ -11,8 +11,6 @@
   --height: auto;
   padding-bottom: 40px;
   overflow: hidden;
-  // margin-left: calc(var(--content-padding-horizontal) * -1);
-  // margin-right: calc(var(--content-padding-horizontal) * -1);
 
   @include phone {
     --number-of-items: 2;
index 3f0dac1eefef4e85970bda5a2f0135fc5ce9e617..91c3bdba0cda478f10afc1a3770b1d5695f9c5e4 100644 (file)
@@ -8,3 +8,9 @@
     text-overflow: ellipsis;
   }
 }
+
+.latest-news {
+  .container h2 {
+    padding: 0 12px;
+  }
+}
index 037326498fd7f1f7f67bad2a3d237242ccd4da3d..9968f88f659a82df6fefccaf7b81e54028427ab7 100644 (file)
   }
 
   th {
-    background-color: #f2f2f2;
+    background-color: var(--color-text-secondary);
+    color: #fff;
     font-weight: bold;
+    border: 1px solid #fff;
   }
 
   tr {
       font-style: italic;
     }
   }
+  // Styles responsive
+  @media screen and (max-width: 768px) {
+    table {
+      display: block;
+      overflow-x: auto;
+      -webkit-overflow-scrolling: touch;
+    }
+
+    td,
+    th {
+      padding: 0.5rem 0.8rem;
+    }
+
+    td:last-child {
+      white-space: normal;
+    }
+  }
 
   h1,
   h2,
     line-height: 1.4;
     margin-top: var(--sp-sm);
     margin-bottom: var(--sp-sm);
+    width: 100%;
+    overflow-x: auto;
+    white-space: pre-wrap;
+  }
+
+  @media (max-width: 600px) {
+    p {
+      word-break: break-word;
+    }
   }
 }
index 32db705235408983f79f4b30317951d03789e0f6..6b42caa5f6c0aa4548a37b2af4b8b976e204ef42 100644 (file)
@@ -29,6 +29,16 @@ section {
   margin-top: var(--block-space);
 }
 
+.col {
+  h2,
+  h3,
+  h4 {
+    &:first-child {
+      margin-top: 0;
+    }
+  }
+}
+
 .section-row {
   --min-col-width: 300px;
   @include tablet {
@@ -69,24 +79,29 @@ section {
   display: flex;
   flex-direction: row;
   --gap: var(--sp-lg);
+  --cols: 3;
+  --min-col-width: 300px;
   gap: var(--gap);
   justify-content: flex-start;
   align-items: stretch;
   flex-wrap: wrap;
-  --cols: 3;
-  --min-col-width: 300px;
+
   > *,
   > .col {
-    min-width: var(--min-col-width);
-    flex: 0 0 calc((100% / var(--cols)) - var(--gap));
-  }
-}
+    flex: 1 1 auto;
 
-.row-from-list .card__content {
+    @include phone {
+      --basis: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
+      min-width: var(--min-col-width);
+      flex: 1 1 var(--basis);
+    }
+  }
 }
 
 @for $i from 1 through 5 {
-  .cols-#{$i} {
-    --cols: #{$i};
+  @include phone {
+    .cols-#{$i} {
+      --cols: #{$i};
+    }
   }
 }
index 65e8c81d40f69329871e8fcf5dad8820e1f4f469..d95dc5d7283a298d1cbed92ea1c360000798cf18 100644 (file)
     }
   }
 }
+
+@media (max-width: 600px) {
+  .container,
+  .mg-t-md {
+    &:has(> .btn ~ .btn) {
+      display: flex;
+      flex-direction: column;
+      gap: var(--sp-sm);
+      align-items: center;
+
+      > .btn {
+        margin: 0;
+      }
+    }
+  }
+}
index 4277bf7040ce932bce7afc1f01502e8dda1d5ce6..4d1bc74c82b6479934eeda7f4d7b709194620296 100644 (file)
     line-clamp: 4;
     overflow: hidden;
     text-overflow: ellipsis;
+
+    @media (max-width: 600px) {
+      word-break: break-word;
+      overflow-wrap: break-word;
+    }
   }
 
   &__date {
index a5a4228ae5ec33e0c6de66d12f64b8ac863c23f0..f5bdcfcb84c923f155977844e52dbf4374b1fbec 100644 (file)
@@ -7,6 +7,7 @@
   --feature-item-title-gap: 0.5rem;
 
   @include tablet {
+    --feature-padding: 2.5rem;
     --features-columns-count: 2;
     --feature-item-title-font-size: 2.5rem;
     --feature-item-title-gap: 1.3rem;
   border-radius: var(--feature-border-radius);
   border-radius: 16px;
   background: var(--color-brand-surface);
-  padding: 40px;
+  --title-direction: column;
+  --icon-font-size: 0.6em;
+  --icon-size: 36px;
+
+  @include tablet {
+    // --title-direction: column;
+    --icon-font-size: 1.8rem;
+  }
 
   &-content {
     flex: 1;
 
   // Icon styles
   &__icon {
+    --icon-size: 2.5em;
+    font-size: var(--icon-font-size);
+    width: var(--icon-size);
+    height: var(--icon-size);
     display: flex !important;
-    width: 72px;
-    height: 72px;
+
     justify-content: center;
     align-items: center;
-    font-size: 0.8em;
     border-radius: 100px;
     border: 2px solid var(--color-surface);
     color: var(--color-surface);
       0px 11px 15px 0px rgba(71, 84, 103, 0.1),
       0px 9px 46px 0px rgba(71, 84, 103, 0.06),
       0px 24px 38px 0px rgba(71, 84, 103, 0.04);
-    font-size: 1.5rem;
   }
 
   // Title styles
   &__title {
     display: flex;
+    flex-wrap: wrap;
     gap: var(--feature-item-title-gap);
     font-size: var(--feature-item-title-font-size);
     font-weight: 500;
     margin: 0 0 1.05rem;
     padding-bottom: 0.28em;
     display: flex;
-    flex-direction: column;
+    flex-direction: var(--title-direction);
     align-items: flex-start;
   }
 
index 92ae179318faa2569dd0c29a615643859f440cf1..9f91b9342df1c63b72d49881395a5ba7e0fb0fa0 100644 (file)
@@ -1,15 +1,14 @@
 .hero-block {
   --margin-top: var(--sp-xs);
   --margin-bottom: var(--sp-xxl);
-  --title-font-size: 2.25rem;
 
   margin-top: var(--margin-top);
   margin-bottom: var(--margin-bottom);
+  --title-font-size: clamp(1.3rem, 1.3rem + 2vw, 4rem);
 
   @include tablet {
     --margin-top: var(--sp-xxxl);
     --margin-bottom: var(--sp-sm);
-    --title-font-size: 4rem;
   }
 
   .media-block__title {
index 741222f75d0773c5367d9cb345cb3a1d3f50b2c2..c170275766111dbf92f701f448a5f1b5e28e53bf 100644 (file)
@@ -1,21 +1,35 @@
 .list-pages {
-  --gap: var(--sp-md);
-  --cols: 2;
+  --gap: 12px;
+  --cols: 1;
+  --basis: 100%;
   display: flex;
   flex-direction: row;
   flex-wrap: wrap;
   gap: var(--gap);
 
+  @include phone {
+    --cols: 2;
+  }
+
   @include tablet {
+    --gap: var(--sp-md);
     --cols: 3;
   }
 
-  @include tablet-up {
+  @include desktop {
     --cols: 4;
   }
 
-  > * {
-    --basis: calc((100% / var(--cols)) - var(--gap));
-    flex: 0 0 var(--basis);
+  > *,
+  > .card {
+    // flex: 1;
+    // width: 100%;
+    // flex-basis: auto;
+
+    @include phone {
+      --basis: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
+      width: auto;
+      flex: 0 0 var(--basis);
+    }
   }
 }
index dff3ab11dc3b153ed08a0da1466c685429e0e90f..e7e947832cab418b1aa882de7da04a16ad4fc5a8 100644 (file)
@@ -79,7 +79,7 @@
     letter-spacing: -0.00125em;
     font-weight: 700;
     text-transform: uppercase;
-    line-height: 67%;
+    line-height: 80%;
   }
 
   &__content,
index 815f95d291ab3bf8f8571877bc85ba393097dd77..e051326f4ea8049bbd95a457eb46026a39fdaf7a 100644 (file)
@@ -3,6 +3,10 @@
   margin-left: auto;
   margin-right: auto;
   max-width: 1920px;
-  padding: var(--sp-xl) var(--sp-lg);
+  padding: 24px 12px;
   border-radius: 24px;
+
+  @include tablet {
+    padding: var(--sp-xl) var(--sp-lg);
+  }
 }
index 03e66b8ee507c238565da8833b2e52a645250d0d..797dade9401812858907210b382adc0f688a3d83 100644 (file)
@@ -4,5 +4,9 @@
   margin-left: auto;
   margin-right: auto;
   max-width: 1920px;
-  padding: var(--sp-xl) var(--sp-lg);
+  padding: 24px 12px;
+
+  @include tablet {
+    padding: var(--sp-xl) var(--sp-lg);
+  }
 }
index b2f38266b27aab6888d75f35f2fb51c516dfc8b9..44f208921573df7e2a3c11bb725d070d7d4065ef 100644 (file)
@@ -4,15 +4,24 @@
   justify-content: space-between;
   flex-wrap: wrap;
   flex-direction: row;
-  gap: var(--sp-lg) var(--sp-md);
+  --gap: var(--sp-md);
+  gap: var(--sp-lg) var(--gap);
   margin-top: var(--sp-md);
 
+  @media (max-width: 600px) {
+    --cols: 1 !important;
+  }
+
   .list-column {
-    flex-basis: calc((100% / var(--cols)) - var(--sp-md));
+    --basis: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
+    flex: 1 1 var(--basis);
+    word-break: break-word;
+    overflow-wrap: break-word;
+    //flex-basis: calc((100% / var(--cols)) - var(--sp-md));
   }
 }
+
 .list-column {
-  flex: 1;
   --border-left: 2px solid var(--color-brand-fill);
   padding-left: var(--sp-sm-md);
   //border-left: var(--border-left);
index 85984f2f843eb8af7417d1532450e915ca5d5f57..60c80f56b95ba7d2e67868e8e551979ad1850618 100644 (file)
@@ -4,7 +4,11 @@
   flex-wrap: wrap;
   justify-content: stretch;
   align-items: stretch;
-  padding-top: 80px;
+  padding-top: 30px;
+
+  @include phone {
+    padding-top: 80px;
+  }
 
   &.has-aside {
     max-width: 1920px;
index b81a3bb935722b9ccecdcbdf551de6c153c0a449..ea229ff596c77c9bd4a505248a9a5d14082cfcf4 100644 (file)
@@ -1,6 +1,6 @@
 :root {
   --container-width: 1312px;
-  --content-padding-horizontal: 20px;
+  --content-padding-horizontal: 12px;
 
   --font-size: 1em;
   --font-family: "gotham", sans-serif;
@@ -27,7 +27,6 @@
 
   @include tablet {
     --content-padding-horizontal: 40px;
-
     --container-paddings: var(--sp-lg);
     --section-space: 100px;
     --block-space: 160px;
index 04f4803e684ef25e99458dbc2382ae811734f8a5..d6c59ea096a6e0f49c3694fbb2ac69a6703ed6da 100644 (file)
     carouselElement.classList.add("carousel-initialized");
   };
 
+  /**
+   * Waits for elements matching the selector to be present in the DOM within the given element.
+   * @param {HTMLElement} element - The parent element to observe for the selector.
+   * @param {string} selector - The CSS selector to match the elements.
+   * @returns {Promise<NodeListOf<Element>>} A promise that resolves with the matched elements.
+   */
   const waitForElements = (element, selector) => {
     return new Promise((resolve) => {
       const items = element.querySelectorAll(selector);
diff --git a/themes/xen-project/layouts/_default/all.html b/themes/xen-project/layouts/_default/all.html
new file mode 100644 (file)
index 0000000..5edc123
--- /dev/null
@@ -0,0 +1,15 @@
+{{ define "main" }}
+  <div class="all-pages">
+    <h1>{{ .Title }}</h1>
+
+    <ul>
+      {{ range .Site.Pages }}
+        {{ if not .Params.hidden }}
+          <li>
+            <a href="{{ .RelPermalink }}">{{ .Title }}</a>
+          </li>
+        {{ end }}
+      {{ end }}
+    </ul>
+  </div>
+{{ end }}
index 21a2f27edca94ac409df11e65309e7576fc5cf53..bada205cead3db016d24908ca603bd6a99e45cc3 100644 (file)
@@ -1,10 +1,12 @@
 {{ define "main" }}
-  <div class="container section-space">
-    <h1>{{ .Title }}</h1>
-    {{ .Content }}
-    {{ range .Pages }}
-      <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
-      {{ .Summary }}
-    {{ end }}
-  </div>
+  <article class="article">
+    <div class="container section-space">
+      <h1>{{ .Title }}</h1>
+      {{ .Content }}
+      {{ range .Pages }}
+        <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+        {{ .Summary }}
+      {{ end }}
+    </div>
+  </article>
 {{ end }}
index ecc4f4c0b0e1bb9910364e3af9703dacae688705..d982fb408226d46173108b726d69de0f97d92bb1 100644 (file)
@@ -8,7 +8,7 @@
   {{ if eq $asidePosition "before" }}
     {{ partial "aside.html" . }}
   {{ end }}
-  <article class="article" data-blog-api-key="{{ .Site.Params.blogApiKey }}">
+  <article class="article">
     <div class="container page-top">
       <h1>{{ .Title }}</h1>
       <div class="description">
index 30d01d2e226d2b3bd477d6b39d291688069fc8f1..3ecafc91118eb5debe5a3be07134d9661bd9ce0a 100644 (file)
@@ -43,6 +43,6 @@
   {{ partialCached "head/css.html" . }}
 
   <script>
-    const siteParams = {{ .Site.Params  }};
+    var siteParams = window.siteParams = {{ .Site.Params  }};
   </script>
 </head>
index 95bf0b02100b0c0824da00c28b95351524dd8501..3a54f0a678f61dbda20497019e71f80267de3dd7 100644 (file)
@@ -1,4 +1,4 @@
-<div class="latest-news" data-max-cards="10" data-blog-api-key="{{ .Site.Params.blogApiKey }}">
+<div class="latest-news" data-max-cards="10">
   <div class="container">
     <h2>
       Latest <strong>news</strong>