🎨 Improve class names

This commit is contained in:
Miguel R. Ávila 2021-07-25 11:16:39 -05:00
parent 330a3900e1
commit 15616d931f
7 changed files with 56 additions and 47 deletions

35
app.css
View File

@ -79,7 +79,7 @@ body {
background-color: #00000000; background-color: #00000000;
} }
#themeButton__icon { #themeIcon {
width: 25px; width: 25px;
height: 25px; height: 25px;
} }
@ -123,14 +123,14 @@ body {
justify-content: center; justify-content: center;
} }
.weatherBlock__date { .date {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 30px; margin-top: 30px;
} }
.weatherBlock__weather { .weather {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -166,25 +166,25 @@ body {
color: var(--fg); color: var(--fg);
} }
.weather-icon img { .weatherIcon img {
width: 70px; width: 70px;
height: 70px; height: 70px;
} }
.temperature-value p { .weatherValue p {
font-size: var(--fss); font-size: var(--fss);
font-weight: bolder; font-weight: bolder;
margin-left: 15px; margin-left: 15px;
color: var(--fg); color: var(--fg);
} }
.temperature-description p { .weatherDescription p {
font-size: var(--fss); font-size: var(--fss);
margin-left: 15px; margin-left: 15px;
color: var(--fg); color: var(--fg);
} }
.buttonLink { .buttons {
grid-row: 3 / span 2; grid-row: 3 / span 2;
grid-column: 1 / span 2; grid-column: 1 / span 2;
display: grid; display: grid;
@ -194,47 +194,47 @@ body {
padding: 20px; padding: 20px;
} }
.buttonLink__link { .buttons__link {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
} }
.buttonLink__icon { .buttons__link-icon {
width: 3vh; width: 3vh;
height: 3vh; height: 3vh;
color: var(--fg); color: var(--fg);
} }
.buttonLink__link-1 { .buttons__link-1 {
grid-row: 1; grid-row: 1;
grid-column: 1; grid-column: 1;
} }
.buttonLink__link-2 { .buttons__link-2 {
grid-row: 1; grid-row: 1;
grid-column: 2; grid-column: 2;
} }
.buttonLink__link-3 { .buttons__link-3 {
grid-row: 2; grid-row: 2;
grid-column: 1; grid-column: 1;
} }
.buttonLink__link-4 { .buttons__link-4 {
grid-row: 2; grid-row: 2;
grid-column: 2; grid-column: 2;
} }
.buttonLink__link-5 { .buttons__link-5 {
grid-row: 1; grid-row: 1;
grid-column: 3; grid-column: 3;
} }
.buttonLink__link-6 { .buttons__link-6 {
grid-row: 2; grid-row: 2;
grid-column: 3; grid-column: 3;
} }
.buttonLink__link:hover { .buttons__link:hover {
background-color: var(--accent); background-color: var(--accent);
} }
.buttonLink__link:hover svg { .buttons__link:hover svg {
stroke: var(--sfg); stroke: var(--sfg);
} }
@ -273,7 +273,6 @@ body {
.list__link:hover { .list__link:hover {
background-color: var(--accent); background-color: var(--accent);
color: var(--sfg); color: var(--sfg);
} }
/* M E D I A - Q U E R I E S */ /* M E D I A - Q U E R I E S */

View File

@ -1,4 +1,4 @@
console.log("Connected cards"); console.log('Connected cards');
const printCards = () => { const printCards = () => {
for (const card of CONFIG.cards) { for (const card of CONFIG.cards) {
@ -7,18 +7,18 @@ const printCards = () => {
let item = ` let item = `
<a <a
href="${card.link}" href="${card.link}"
target="${CONFIG.openInNewTab ? "_blank" : ""}" target="${CONFIG.openInNewTab ? '_blank' : ''}"
class="buttonLink__link card buttonLink__link-${ class="card buttons__link buttons__link-${
card.id card.id
}" }"
> >
<i class="buttonLink__icon" data-feather="${ <i class="buttons__link-icon" data-feather="${
card.icon card.icon
}"></i> }"></i>
</a> </a>
`; `;
const position = "beforeend"; const position = 'beforeend';
buttonsContainer.insertAdjacentHTML(position, item); buttonsContainer.insertAdjacentHTML(position, item);
} }

View File

@ -13,11 +13,15 @@ const gree4 = `${CONFIG.greetingEvening}\xa0`;
// Define the hours of the greetings // Define the hours of the greetings
if (hour >= 23 && hour < 5) { if (hour >= 23 && hour < 5) {
document.getElementById('greetings').innerText = gree1 + name; document.getElementById('greetings').innerText =
gree1 + name;
} else if (hour >= 6 && hour < 12) { } else if (hour >= 6 && hour < 12) {
document.getElementById('greetings').innerText = gree2 + name; document.getElementById('greetings').innerText =
gree2 + name;
} else if (hour >= 12 && hour < 17) { } else if (hour >= 12 && hour < 17) {
document.getElementById('greetings').innerText = gree3 + name; document.getElementById('greetings').innerText =
gree3 + name;
} else { } else {
document.getElementById('greetings').innerText = gree4 + name; document.getElementById('greetings').innerText =
gree4 + name;
} }

View File

@ -1,37 +1,37 @@
console.log("Connected lists"); console.log('Connected lists');
const printFirstList = () => { const printFirstList = () => {
let icon = `<i class="list__head" data-feather="${CONFIG.firstListIcon}"></i>`; let icon = `<i class="list__head" data-feather="${CONFIG.firstListIcon}"></i>`;
const position = "beforeend"; const position = 'beforeend';
list_1.insertAdjacentHTML(position, icon); list_1.insertAdjacentHTML(position, icon);
for (const link of CONFIG.lists.firstList) { for (const link of CONFIG.lists.firstList) {
let item = ` let item = `
<a <a
target="${CONFIG.openInNewTab ? "_blank" : ""}" target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${link.link}" href="${link.link}"
class="list__link" class="list__link"
>${link.name}</a >${link.name}</a
> >
`; `;
const position = "beforeend"; const position = 'beforeend';
list_1.insertAdjacentHTML(position, item); list_1.insertAdjacentHTML(position, item);
} }
}; };
const printSecondList = () => { const printSecondList = () => {
let icon = `<i class="list__head" data-feather="${CONFIG.secondListIcon}"></i>`; let icon = `<i class="list__head" data-feather="${CONFIG.secondListIcon}"></i>`;
const position = "beforeend"; const position = 'beforeend';
list_2.insertAdjacentHTML(position, icon); list_2.insertAdjacentHTML(position, icon);
for (const link of CONFIG.lists.secondList) { for (const link of CONFIG.lists.secondList) {
let item = ` let item = `
<a <a
target="${CONFIG.openInNewTab ? "_blank" : ""}" target="${CONFIG.openInNewTab ? '_blank' : ''}"
href="${link.link}" href="${link.link}"
class="list__link" class="list__link"
>${link.name}</a >${link.name}</a
> >
`; `;
const position = "beforeend"; const position = 'beforeend';
list_2.insertAdjacentHTML(position, item); list_2.insertAdjacentHTML(position, item);
} }
}; };

View File

@ -35,6 +35,6 @@ themeToggle.addEventListener('click', () => {
} }
}); });
if(CONFIG.imageBackground) { if (CONFIG.imageBackground) {
document.body.classList.add('withImageBackground'); document.body.classList.add('withImageBackground');
} }

View File

@ -1,6 +1,10 @@
const iconElement = document.querySelector('.weather-icon'); const iconElement = document.querySelector('.weather-icon');
const tempElement = document.querySelector('.temperature-value p'); const tempElement = document.querySelector(
const descElement = document.querySelector('.temperature-description p'); '.temperature-value p'
);
const descElement = document.querySelector(
'.temperature-description p'
);
// App data // App data
const weather = {}; const weather = {};
@ -19,8 +23,10 @@ const key = `${CONFIG.weatherKey}`;
setPosition(); setPosition();
function setPosition(position) { function setPosition(position) {
getWeather(
getWeather(CONFIG.weatherLatitude, CONFIG.weatherLongitude); CONFIG.weatherLatitude,
CONFIG.weatherLongitude
);
} }
// Get the Weather data // Get the Weather data

View File

@ -20,7 +20,7 @@
<body class=""> <body class="">
<button id="themeButton"> <button id="themeButton">
<i id="themeButton__icon" data-feather="moon"></i> <i id="themeIcon" data-feather="moon"></i>
</button> </button>
<div class="container"> <div class="container">
<!-- Clock and Greetings --> <!-- Clock and Greetings -->
@ -37,18 +37,18 @@
<!-- Date and Weather --> <!-- Date and Weather -->
<div class="weatherBlock"> <div class="weatherBlock">
<div class="weatherBlock__date"> <div class="date">
<div id="month" class=""></div> <div id="month" class=""></div>
<div id="day" class=""></div> <div id="day" class=""></div>
</div> </div>
<div class="weatherBlock__weather"> <div class="weather">
<div class="weather-icon"> <div class="weatherIcon">
<img src="assets/icons/OneDark/unknown.png" /> <img src="assets/icons/OneDark/unknown.png" />
</div> </div>
<div class="temperature-value"> <div class="weatherValue">
<p class="">- °<span class="g">c</span></p> <p class="">- °<span class="g">c</span></p>
</div> </div>
<div class="temperature-description"> <div class="weatherDescription">
<p class=""></p> <p class=""></p>
</div> </div>
</div> </div>
@ -60,7 +60,7 @@
└─┘└─┘ ┴ ┴ └─┘┘└┘└─┘ └─┘└─┘ ┴ ┴ └─┘┘└┘└─┘
--> -->
<div class="buttonLink" id="buttonsContainer"></div> <div class="buttons" id="buttonsContainer"></div>
<!-- <!--
┬ ┬┌─┐┌┬┐┌─┐ ┬ ┬┌─┐┌┬┐┌─┐