Skip to content

Commit

Permalink
Merge pull request #479 from MastersAcademy/11-hall_of_fame_card_temp…
Browse files Browse the repository at this point in the history
…late_NosatskyiK1

code optimization
  • Loading branch information
vladyslav-yermolin-moc authored Mar 30, 2024
2 parents 444ba39 + f575bd6 commit 358cc6a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 38 deletions.
1 change: 0 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
content="List of projects created by students of the Front-End for Beginners 2023 course at Masters Academy.">
<meta name="description"
content="List of projects created by students of the Front-End for Beginners 2023 course at Masters Academy.">
<link rel="stylesheet" href="./src/styles/card.css">
<link rel="stylesheet" href="./src/styles/style.css">
<link rel="icon" type="image/x-icon" href="./src/favicon.png">
<title>Hall of Fame</title>
Expand Down
9 changes: 6 additions & 3 deletions docs/src/js/cards.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { developers } from './developers.js';
import { developers, supportedSocials } from './developers.js';

developers.sort(() => Math.random() - 0.5);
const cardContainer = document.querySelector('[data-card-container]');
Expand All @@ -12,9 +12,12 @@ const socialTemplate = document.querySelector('[data-template-social]');
const cardSocialTemplateLink = socialTemplate.content.querySelector('[data-template-social-link]');
const cardSocialTemplateIcon = socialTemplate.content.querySelector('[data-template-social-icon]');

function addSocialLinks(container, object) {
function addSocialLinks(container, socialLinks) {
container.innerHTML = '';
Object.entries(object).forEach((element) => {
Object.entries(socialLinks).forEach((element) => {
if (!supportedSocials.includes(element[0])) {
return;
}
const [socialName, link] = element;
cardSocialTemplateIcon.classList.add(`social__img-${socialName}`);
cardSocialTemplateLink.href = link;
Expand Down
33 changes: 9 additions & 24 deletions docs/src/js/developers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export const supportedSocials = [
'telegram',
'github',
'linkedIn',
'facebook',
'instagram'
];
export const developers = [
{
firstName: 'Ekaterina',
Expand All @@ -6,7 +13,6 @@ export const developers = [
project: 'Project Pokemons',
image: 'src/img/title_pokemon.png',
links: {
telegram: 'https://www.t.me/rogerosha',
github: 'https://www.github.com/rogerosha',
},
},
Expand All @@ -17,7 +23,6 @@ export const developers = [
project: 'Project Pokemons',
image: 'src/img/title_pokemon.png',
links: {
telegram: 'https://t.me/kostyaa_n',
github: 'https://github.com/NosatskyiK',
},
},
Expand All @@ -28,11 +33,7 @@ export const developers = [
project: 'Project Pokemons',
image: 'src/img/title_pokemon.png',
links: {
telegram: 'https://t.me/max_snischuk',
github: 'https://github.com/snischuk',
linkedIn: 'https://www.linkedin.com/in/max-snischuk/',
facebook: 'https://www.facebook.com/s.max.target',
instagram: 'https://www.instagram.com/max_snischuk/',
},
},
{
Expand All @@ -42,9 +43,7 @@ export const developers = [
project: 'Project Pokemons',
image: 'src/img/title_pokemon.png',
links: {
telegram: 'https://t.me/Rohanskyi',
github: 'https://github.com/Rooosss',
linkedIn: 'https://www.linkedin.com/in/rostyslav-vyshemirskyi-b33bbb1b4/',
},
},
{
Expand All @@ -55,7 +54,6 @@ export const developers = [
image: 'src/img/games.jpg',
links: {
github: 'https://github.com/IgorFromUA',
linkedIn: 'https://www.linkedin.com/in/ihor-zapisochnyi-751b9424b/',
},
},
{
Expand All @@ -66,7 +64,6 @@ export const developers = [
image: 'src/img/games.jpg',
links: {
github: 'https://github.com/Allocene',
linkedIn: 'https://www.linkedin.com/in/artur-kobylatsky/',
},
},
{
Expand All @@ -76,7 +73,7 @@ export const developers = [
project: 'Project Games',
image: 'src/img/games.jpg',
links: {
telegram: 'https://t.me/sergo_sj',
github: 'https://github.com/SerhiiNSN',
},
},
{
Expand All @@ -87,7 +84,6 @@ export const developers = [
image: 'src/img/games.jpg',
links: {
github: 'https://github.com/dmytro-shevchenko1',
facebook: 'https://www.facebook.com/profile.php?id=100086849614305',
},
},
{
Expand All @@ -98,8 +94,6 @@ export const developers = [
image: 'src/img/games.jpg',
links: {
github: 'https://github.com/SviatoslavTaranenko',
instagram: 'https://www.instagram.com/sviat_taranenko',
linkedIn: 'https://www.linkedin.com/in/%D1%81%D0%B2%D1%8F%D1%82%D0%BE%D1%81%D0%BB%D0%B0%D0%B2-%D1%82%D0%B0%D1%80%D0%B0%D0%BD%D0%B5%D0%BD%D0%BA%D0%BE-6bb602273/',
},
},
{
Expand All @@ -109,7 +103,7 @@ export const developers = [
project: 'Project Games',
image: 'src/img/games.jpg',
links: {
instagram: 'https://www.instagram.com/mary.demch/',
github: 'https://github.com/demasha0908',
},
},
{
Expand All @@ -119,7 +113,6 @@ export const developers = [
project: 'Project Games',
image: 'src/img/games.jpg',
links: {
telegram: 'https://t.me/slonyara8888',
github: 'https://github.com/AndriiMorozov88',
},
},
Expand All @@ -131,7 +124,6 @@ export const developers = [
image: 'src/img/games.jpg',
links: {
github: 'https://github.com/Bogdandrummer',
linkedIn: 'https://www.linkedin.com/in/%D0%B1%D0%BE%D0%B3%D0%B4%D0%B0%D0%BD-%D1%8F%D1%86%D0%B5%D0%BD%D1%82%D1%8E%D0%BA-841247270/',
},
},
{
Expand All @@ -141,11 +133,7 @@ export const developers = [
project: 'Project Games',
image: 'src/img/games.jpg',
links: {
telegram: 'https://t.me/davidka_T',
github: 'https://github.com/DavidTereshchenko',
linkedIn: 'https://www.linkedin.com/in/david-tereshchenko-7bb98b240',
instagram: 'https://www.instagram.com/davidushka_te?igshid=YzVkODRmOTdmMw%3D%3D&utm_source=qr',
facebook: 'https://www.facebook.com/david.tereshchenko.77',
},
},
{
Expand All @@ -166,7 +154,6 @@ export const developers = [
image: 'src/img/title_pokemon.png',
links: {
github: 'https://github.com/lesiaturuta',
facebook: 'https://www.facebook.com/lesia.turuta',
},
},
{
Expand All @@ -176,7 +163,6 @@ export const developers = [
project: 'Project Games',
image: 'src/img/games.jpg',
links: {
telegram: 'https://t.me/Arconiel',
github: 'https://github.com/vBrusentsov',
},
},
Expand All @@ -188,7 +174,6 @@ export const developers = [
image: 'src/img/games.jpg',
links: {
github: 'https://github.com/igor0806',
facebook: 'https://www.facebook.com/profile.php?id=100009665057721',
},
},
];
10 changes: 1 addition & 9 deletions docs/src/styles/card.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");

body {
padding: 0;
box-sizing: border-box;
font-family: "Roboto", sans-serif;
}

.wrapper, .card-container {
.card-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
Expand Down
5 changes: 4 additions & 1 deletion docs/src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
@import url("reset.css");
@import url("header.css");
@import url("footer.css");
@import url("card.css");

body {
font-family: Roboto, "Roboto", sans-serif;
font-family: "Roboto", sans-serif;
}

.wrapper {
display: flex;
flex-direction: column;
justify-content: center;
flex-wrap: wrap;
margin: 0 auto;
min-width: 400px;
min-height: 100vh;
Expand Down

0 comments on commit 358cc6a

Please sign in to comment.