Skip to content

Commit

Permalink
πŸ’„ Improved Lists space
Browse files Browse the repository at this point in the history
  • Loading branch information
migueravila committed Feb 10, 2022
1 parent 467c6e0 commit 4fb3f10
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 48 deletions.
21 changes: 15 additions & 6 deletions app.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,21 @@ body {
color: var(--fg);
}

.reduceGap {
grid-gap: 2rem !important;
}

.removeGap {
grid-gap: 0 !important;
}

.linksBlock {
grid-row: 3 / span 2;
grid-column: 1 / span 4;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(2, 1fr);
grid-gap: 30px;
grid-gap: 1.5rem;
}

.linksBlockLeft {
Expand Down Expand Up @@ -284,13 +292,14 @@ body {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(2, 1fr);
grid-gap: 30px;
padding: 0.3rem;
grid-gap: 3rem;
padding: 0.4rem;
}

.list {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}

Expand All @@ -303,7 +312,7 @@ body {
grid-row: 1 / span 2;
}
.listIcon {
margin-top: 3vh;
/* margin-top: 3vh; */
margin-bottom: 2vh;
color: var(--fg);
width: var(--icon);
Expand Down Expand Up @@ -346,11 +355,11 @@ body {
font-size: var(--fg-secondary);
}

.list {
.linksBlockRight {
display: none;
}

.buttons {
.linksBlockLeft {
grid-column: 1 / span 4;
}

Expand Down
4 changes: 4 additions & 0 deletions assets/js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ const generateLayout = () => {
case 'bento':
linksBlockLeft.insertAdjacentHTML(position, firstButtonsContainer);
linksBlockRight.insertAdjacentHTML(position, firstListsContainer);
linksBlock.classList.remove("reduceGap");
linksBlock.classList.remove("removeGap");
break;
case 'lists':
linksBlockLeft.insertAdjacentHTML(position, firstListsContainer);
linksBlockRight.insertAdjacentHTML(position, secondListsContainer);
linksBlock.classList.add("reduceGap");
break;
case 'buttons':
linksBlockLeft.insertAdjacentHTML(position, firstButtonsContainer);
linksBlockRight.insertAdjacentHTML(position, secondButtonsContainer);
linksBlock.classList.add("removeGap");
break;
default:
break;
Expand Down
42 changes: 21 additions & 21 deletions assets/js/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ const generateFirstListsContainer = () => {
for (const list of CONFIG.firstlistsContainer) {
let item = `
<div class="card list list__${list.id}" id="list_${list.id}">
<i class="listIcon" icon-name="${list.icon}"></i>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[0].link}"
class="listItem"
>${list.links[0].name}</a>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[1].link}"
class="listItem"
>${list.links[1].name}</a>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[2].link}"
class="listItem"
>${list.links[2].name}</a>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[3].link}"
class="listItem"
>${list.links[3].name}</a>
<i class="listIcon" icon-name="${list.icon}"></i>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[0].link}"
class="listItem"
>${list.links[0].name}</a>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[1].link}"
class="listItem"
>${list.links[1].name}</a>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[2].link}"
class="listItem"
>${list.links[2].name}</a>
<a
target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${list.links[3].link}"
class="listItem"
>${list.links[3].name}</a>
</div>
`;
const position = 'beforeend';
Expand Down
45 changes: 24 additions & 21 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CONFIG = {
twelveHourFormat: false,

// Layout
bentoLayout: 'buttons', // 'bento', 'lists', 'buttons'
bentoLayout: 'lists', // 'bento', 'lists', 'buttons'

// Greetings
greetingMorning: 'Good morning!',
Expand Down Expand Up @@ -46,6 +46,9 @@ const CONFIG = {
hourDarkThemeActive: '18:30',
hourDarkThemeInactive: '07:00',

// ╦ ╦╔╗╔╦╔═╔═╗
// β•‘ β•‘β•‘β•‘β•‘β• β•©β•—β•šβ•β•—
// β•©β•β•β•©β•β•šβ•β•© β•©β•šβ•β•
// β”Œβ” ┬ β”¬β”Œβ”¬β”β”Œβ”¬β”β”Œβ”€β”β”Œβ”β”Œβ”Œβ”€β”
// β”œβ”΄β”β”‚ β”‚ β”‚ β”‚ β”‚ ││││└─┐
// β””β”€β”˜β””β”€β”˜ β”΄ β”΄ β””β”€β”˜β”˜β””β”˜β””β”€β”˜
Expand Down Expand Up @@ -92,47 +95,47 @@ const CONFIG = {
secondButtonsContainer: [
{
id: '1',
name: 'Odysee',
icon: 'youtube',
link: 'https://odysee.com/',
name: 'Music',
icon: 'headphones',
link: 'https://open.spotify.com',
},
{
id: '2',
name: 'Odysee',
icon: 'youtube',
link: 'https://odysee.com/',
name: 'twitter',
icon: 'twitter',
link: 'https://twitter.com/',
},
{
id: '3',
name: 'Odysee',
icon: 'youtube',
link: 'https://odysee.com/',
name: 'bot',
icon: 'bot',
link: 'https://discord.com/app',
},
{
id: '4',
name: 'Odysee',
icon: 'youtube',
link: 'https://odysee.com/',
name: 'Amazon',
icon: 'shopping-bag',
link: 'https://amazon.com/',
},
{
id: '5',
name: 'Odysee',
icon: 'youtube',
link: 'https://odysee.com/',
name: 'Hashnode',
icon: 'pen-tool',
link: 'https://hashnode.com/',
},
{
id: '6',
name: 'Odysee',
icon: 'youtube',
link: 'https://odysee.com/',
name: 'Figma',
icon: 'figma',
link: 'https://figma.com/',
},
],

// ┬ β”¬β”Œβ”€β”β”Œβ”¬β”β”Œβ”€β”
// β”‚ │└─┐ β”‚ └─┐
// β”΄β”€β”˜β”΄β””β”€β”˜ β”΄ β””β”€β”˜

// Links
// First Links Container
firstlistsContainer: [
{
icon: 'music',
Expand Down Expand Up @@ -180,7 +183,7 @@ const CONFIG = {
},
],

// Links
// Second Links Container
secondListsContainer: [
{
icon: 'binary',
Expand Down

0 comments on commit 4fb3f10

Please sign in to comment.