Skip to content

Commit

Permalink
modified: css/cards.css
Browse files Browse the repository at this point in the history
	modified:   js/item.js
  • Loading branch information
MEGATREX4 committed Apr 17, 2024
1 parent 3306f77 commit 3a455af
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 44 deletions.
13 changes: 8 additions & 5 deletions css/cards.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
width: auto; /* Allow FiltersContainer to take its natural width */
}

.CPContainer {
margin-left: 20px; /* Add some space between FiltersContainer and CPContainer */
}
}

@media only screen and (max-width: 617px) {
Expand Down Expand Up @@ -80,7 +77,13 @@ html {
position: relative;
}


.CPContainer{
min-width: calc(100% - 900px);
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}

h2 {
color: #ecf9fb;
Expand Down Expand Up @@ -152,7 +155,7 @@ p {
}

.CardsContainer {
max-width: 1520px;
max-width: 1420px;
min-height: 850px;
display: flex;
align-items: center;
Expand Down
82 changes: 43 additions & 39 deletions js/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,45 +197,49 @@ async function updateItemPage() {
if (selectedItem) {
document.title = "СУМ" + " - переклад " + selectedItem.title;

// Update meta description
const metaDescription = document.createElement('meta');
metaDescription.setAttribute('name', 'description');
metaDescription.setAttribute('content', selectedItem.description);
document.head.appendChild(metaDescription);
// Update og:description
const ogDescription = document.createElement('meta');
ogDescription.setAttribute('property', 'og:description');
ogDescription.setAttribute('content', selectedItem.description);
ogDescription.setAttribute('content', truncateText(selectedItem.description, 120));
document.head.appendChild(ogDescription);

//update meta og:title
const ogTitle = document.createElement('meta');
ogTitle.setAttribute('property', 'og:title');
ogTitle.setAttribute('content', "СУМ" + " - переклад " + selectedItem.title);
document.head.appendChild(ogTitle);
//update meta og:image
const ogImage = document.createElement('meta');
ogImage.setAttribute('property', 'og:image');
ogImage.setAttribute('content', selectedItem.image);
document.head.appendChild(ogImage);
//update meta twitter:description
const twitterDescription = document.createElement('meta');
twitterDescription.setAttribute('name', 'twitter:description');
twitterDescription.setAttribute('content', selectedItem.description);
twitterDescription.setAttribute('content', truncateText(selectedItem.description, 120));
document.head.appendChild(twitterDescription);

//update meta twitter:title
const twitterTitle = document.createElement('meta');
twitterTitle.setAttribute('name', 'twitter:title');
twitterTitle.setAttribute('content', "СУМ" + " - переклад " + selectedItem.title);
document.head.appendChild(twitterTitle);
//update meta twitter:image
const twitterImage = document.createElement('meta');
twitterImage.setAttribute('name', 'twitter:image');
twitterImage.setAttribute('content', selectedItem.image);
document.head.appendChild(twitterImage);
// Update meta description
const metaDescription = document.createElement('meta');
metaDescription.setAttribute('name', 'description');
metaDescription.setAttribute('content', selectedItem.description);
document.head.appendChild(metaDescription);
// Update og:description
const ogDescription = document.createElement('meta');
ogDescription.setAttribute('property', 'og:description');
ogDescription.setAttribute('content', selectedItem.description);
document.head.appendChild(ogDescription);

//update og:title
//update meta og:title
const ogTitle = document.createElement('meta');
ogTitle.setAttribute('property', 'og:title');
ogTitle.setAttribute('content', "СУМ" + " - переклад " + selectedItem.title);
document.head.appendChild(ogTitle);

//update og:image
//update meta og:image
const ogImage = document.createElement('meta');
ogImage.setAttribute('property', 'og:image');
ogImage.setAttribute('content', selectedItem.image);
document.head.appendChild(ogImage);

//update meta twitter:description
const twitterDescription = document.createElement('meta');
twitterDescription.setAttribute('name', 'twitter:description');
twitterDescription.setAttribute('content', selectedItem.description);
document.head.appendChild(twitterDescription);

//update meta twitter:title
const twitterTitle = document.createElement('meta');
twitterTitle.setAttribute('name', 'twitter:title');
twitterTitle.setAttribute('content', "СУМ" + " - переклад " + selectedItem.title);
document.head.appendChild(twitterTitle);

//update meta twitter:image
const twitterImage = document.createElement('meta');
twitterImage.setAttribute('name', 'twitter:image');
twitterImage.setAttribute('content', selectedItem.image);
document.head.appendChild(twitterImage);


// Create HTML string for tooltip content
const tooltipContent = selectedItem.tooltip ? selectedItem.tooltip : (selectedItem.verified ? 'Переклад вже в моді! Завантаження додаткових файлів не потрібно. Насолоджуйтеся грою з українською локалізацією!' : '');
Expand Down

0 comments on commit 3a455af

Please sign in to comment.