Skip to content

Commit

Permalink
feat: new idea + home updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Fupete committed Sep 27, 2024
1 parent 16adda9 commit cca3ea6
Show file tree
Hide file tree
Showing 24 changed files with 678 additions and 64 deletions.
14 changes: 11 additions & 3 deletions src/_includes/ideaslist.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
{% endif %}
{% if ideaslist | length > 0 %}
<ol reversed class="ideaslist">
{% for idea in ideaslist | reverse %}
{% if page.fileSlug === '' or page.fileSlug === 'en' or page.fileSlug === 'it'%}
{% set sliceEnd = ideaslist | length %}
{% set sliceStart = sliceEnd - 1 %}
{% endif %}
{% for idea in ideaslist.slice(sliceStart,sliceEnd) | reverse %}
{% if idea.data.lang === page.lang %}
<li class="ideaslist-item{% if idea.url == url %} ideaslist-item-active{% endif %}">
<h2>
{% if page.fileSlug === '' or page.fileSlug === 'en' or page.fileSlug === 'it'%}
<h3>{% else %}
<h2>{% endif %}
<a href="{{ idea.url | url }}" class="ideaslist-link">
{% if idea.data.title %}{{ idea.data.title }}{% else %}<code>{{ idea.url }}</code>{% endif %}
</a>
</h2>
{% if page.fileSlug === '' or page.fileSlug === 'en' or page.fileSlug === 'it'%}
</h3>{% else %}
</h2>{% endif %}
<time class="ideaslist-date" datetime="{{ idea.date | dateToFormat('yyyy-MM-dd') }}">{{ idea.date |
dateToFormat('DDD') }}</time>
{# {% if idea.data.tags %}
Expand Down
20 changes: 10 additions & 10 deletions src/assets/css/2-design-tokens/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
--tableBorderColor: #111;

// pagefind
--pagefind-ui-primary: #06c;
--pagefind-ui-text: #040404;
--pagefind-ui-background: #fefefe;
--pagefind-ui-border: #666;
--pagefind-ui-tag: #666;
--pagefind-ui-primary: #06c!important;
--pagefind-ui-text: #040404!important;
--pagefind-ui-background: #fefefe!important;
--pagefind-ui-border: #666!important;
--pagefind-ui-tag: #666!important;
}

@media (prefers-color-scheme: dark) {
Expand All @@ -26,10 +26,10 @@
--tableBorderColor: #fdfdfd;

// pagefind
--pagefind-ui-primary: #0080ff;
--pagefind-ui-text: #fefefe;
--pagefind-ui-background: #040404;
--pagefind-ui-border: #666;
--pagefind-ui-tag: #666;
--pagefind-ui-primary: #0080ff!important;
--pagefind-ui-text: #fefefe!important;
--pagefind-ui-background: #040404!important;
--pagefind-ui-border: #666!important;
--pagefind-ui-tag: #666!important;
}
}
2 changes: 1 addition & 1 deletion src/assets/css/7-components/_ideaslist.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ol.ideaslist {
list-style-type: none;
padding: 0;
margin-bottom: var(--spacing-xx-large);
margin-bottom: var(--spacing-large);
}

.ideaslist-item {
Expand Down
57 changes: 27 additions & 30 deletions src/assets/css/7-components/_pagefind-ui.scss
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
:root {
--pagefind-ui-scale: 1;
--pagefind-ui-border-width: 1;
--pagefind-ui-border-radius: 4px;
--pagefind-ui-image-border-radius: 4px;
--pagefind-ui-image-box-ratio: 1 / 1;
--pagefind-ui-font: 'Inter', sans-serif;
// --pagefind-ui-scale: .9!important;
--pagefind-ui-border-width: 2px!important;
--pagefind-ui-border-radius: 4px!important;
--pagefind-ui-image-border-radius: 4px!important;
--pagefind-ui-image-box-ratio: 16 / 9!important;
--pagefind-ui-font: 'Inter', sans-serif!important;
}

.search-box {
padding-top: var(--spacing-medium);
padding-top: var(--spacing-medium)!important;
}

.pagefind-ui__result.svelte-j9e30.svelte-j9e30 {
.pagefind-ui__result {
list-style-type: none;
display: flex;
align-items: flex-start;
gap: min(calc(40px * var(--pagefind-ui-scale)), 3%);
padding: calc(30px * var(--pagefind-ui-scale)) 0
calc(40px * var(--pagefind-ui-scale));
border-top: solid var(--pagefind-ui-border-width) var(--pagefind-ui-border);
margin-bottom: var(--spacing-x-large)!important;
}
.pagefind-ui__result.svelte-j9e30.svelte-j9e30:last-of-type {
border-bottom: solid var(--pagefind-ui-border-width) var(--pagefind-ui-border);
border-bottom: solid var(--pagefind-ui-border-width) var(--pagefind-ui-border);
.pagefind-ui__result:last-of-type {
border-bottom: none!important;
}
.pagefind-ui__result-thumb.svelte-j9e30.svelte-j9e30 {
width: min(30%, calc((30% - (100px * var(--pagefind-ui-scale))) * 100000));
max-width: calc(120px * var(--pagefind-ui-scale));
margin-top: calc(10px * var(--pagefind-ui-scale));
aspect-ratio: var(--pagefind-ui-image-box-ratio);
position: relative;
width: min(30%, calc((30% - (100px * var(--pagefind-ui-scale))) * 100000));
max-width: calc(120px * var(--pagefind-ui-scale));
margin-top: calc(10px * var(--pagefind-ui-scale));
aspect-ratio: var(--pagefind-ui-image-box-ratio);
position: relative;
float:right;
margin-left: var(--spacing-large)!important;
}
.pagefind-ui__result-image.svelte-j9e30.svelte-j9e30 {
display: block;
Expand Down Expand Up @@ -400,22 +397,22 @@ legend.svelte-1v2r7ls.svelte-1v2r7ls {
'.SFNSText-Regular', 'San Francisco', 'Roboto', 'Segoe UI', 'Helvetica Neue',
'Lucida Grande', 'Ubuntu', 'arial', sans-serif;
}
.pagefind-ui.svelte-e9gkc3 {
.pagefind-ui {
width: 100%;
color: var(--pagefind-ui-text);
font-family: var(--pagefind-ui-font);
}
.pagefind-ui__hidden.svelte-e9gkc3 {
.pagefind-ui__hidden {
display: none !important;
}
.pagefind-ui__suppressed.svelte-e9gkc3 {
.pagefind-ui__suppressed {
opacity: 0;
pointer-events: none;
}
.pagefind-ui__form.svelte-e9gkc3 {
.pagefind-ui__form {
position: relative;
}
.pagefind-ui__form.svelte-e9gkc3:before {
.pagefind-ui__form:before {
background-color: var(--pagefind-ui-text);
width: calc(18px * var(--pagefind-ui-scale));
height: calc(18px * var(--pagefind-ui-scale));
Expand All @@ -432,7 +429,7 @@ legend.svelte-1v2r7ls.svelte-1v2r7ls {
z-index: 9;
pointer-events: none;
}
.pagefind-ui__search-input.svelte-e9gkc3 {
.pagefind-ui__search-input {
height: calc(64px * var(--pagefind-ui-scale));
padding: 0 calc(70px * var(--pagefind-ui-scale)) 0
calc(54px * var(--pagefind-ui-scale));
Expand All @@ -448,10 +445,10 @@ legend.svelte-1v2r7ls.svelte-1v2r7ls {
box-sizing: border-box;
font-weight: 700;
}
// .pagefind-ui__search-input.svelte-e9gkc3::placeholder {
// .pagefind-ui__search-input::placeholder {
// opacity: 0.2;
// }
.pagefind-ui__search-clear.svelte-e9gkc3 {
.pagefind-ui__search-clear {
position: absolute;
top: calc(3px * var(--pagefind-ui-scale));
right: calc(3px * var(--pagefind-ui-scale));
Expand All @@ -464,21 +461,21 @@ legend.svelte-1v2r7ls.svelte-1v2r7ls {
background-color: var(--pagefind-ui-background);
border-radius: var(--pagefind-ui-border-radius);
}
.pagefind-ui__drawer.svelte-e9gkc3 {
.pagefind-ui__drawer {
gap: calc(60px * var(--pagefind-ui-scale));
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.pagefind-ui__results-area.svelte-e9gkc3 {
.pagefind-ui__results-area {
min-width: min(calc(400px * var(--pagefind-ui-scale)), 100%);
flex: 1000;
margin-top: calc(20px * var(--pagefind-ui-scale));
}
.pagefind-ui__results.svelte-e9gkc3 {
.pagefind-ui__results {
padding: 0;
}
.pagefind-ui__message.svelte-e9gkc3 {
.pagefind-ui__message {
box-sizing: content-box;
font-size: calc(16px * var(--pagefind-ui-scale));
height: calc(24px * var(--pagefind-ui-scale));
Expand All @@ -488,7 +485,7 @@ legend.svelte-1v2r7ls.svelte-1v2r7ls {
font-weight: 700;
margin-top: 0;
}
.pagefind-ui__button.svelte-e9gkc3 {
.pagefind-ui__button {
margin-top: calc(40px * var(--pagefind-ui-scale));
border: var(--pagefind-ui-border-width) solid var(--pagefind-ui-border);
border-radius: var(--pagefind-ui-border-radius);
Expand All @@ -502,7 +499,7 @@ legend.svelte-1v2r7ls.svelte-1v2r7ls {
font-weight: 700;
cursor: pointer;
}
.pagefind-ui__button.svelte-e9gkc3:hover {
.pagefind-ui__button:hover {
border-color: var(--pagefind-ui-primary);
color: var(--pagefind-ui-primary);
background: var(--pagefind-ui-background);
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/pagefind.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ const initSearch = () => {
inputSearch.setAttribute('id', 'site-search');
};
const isHome = document.querySelector('.home');
// xxx if (isHome) initSearch();
if (isHome) initSearch();
Loading

0 comments on commit cca3ea6

Please sign in to comment.