-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added very simple grid; commit to backkup
- Loading branch information
1 parent
29bc57e
commit efcc4f8
Showing
3 changed files
with
178 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,95 @@ | ||
function renderCompanies() { | ||
// Array of companies | ||
const companies = [ | ||
{ | ||
name: "TechCorp", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://techcorp.com", | ||
tags: ["Tech", "Innovation"], | ||
}, | ||
{ | ||
name: "FinanceHub", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://financehub.com", | ||
tags: ["Finance", "Banking"], | ||
}, | ||
{ | ||
name: "RetailWorld", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://retailworld.com", | ||
tags: ["Retail", "E-commerce"], | ||
}, | ||
{ | ||
name: "RetailWorld", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://retailworld.com", | ||
tags: ["Retail", "E-commerce"], | ||
}, | ||
{ | ||
name: "RetailWorld", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://retailworld.com", | ||
tags: ["Retail", "E-commerce"], | ||
}, | ||
{ | ||
name: "RetailWorld", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://retailworld.com", | ||
tags: ["Retail", "E-commerce"], | ||
}, | ||
{ | ||
name: "RetailWorld", | ||
logo: "https://via.placeholder.com/100", | ||
url: "https://retailworld.com", | ||
tags: ["Retail", "E-commerce"], | ||
}, | ||
]; | ||
|
||
} | ||
// Function to create cards | ||
function createCompanyCards(companies) { | ||
const grid = document.getElementById("companyGrid"); | ||
|
||
companies.forEach((company) => { | ||
// Create column wrapper | ||
const col = document.createElement("div"); | ||
col.className = "col-lg-4"; // Flex column for 3-per-row layout | ||
|
||
// Create card container | ||
const card = document.createElement("div"); | ||
card.className = "company-card"; | ||
|
||
// Add logo | ||
const logo = document.createElement("img"); | ||
logo.src = company.logo; | ||
logo.alt = `${company.name} Logo`; | ||
card.appendChild(logo); | ||
|
||
// Add name | ||
const name = document.createElement("h3"); | ||
name.textContent = company.name; | ||
card.appendChild(name); | ||
|
||
function filterCompanies() { | ||
// Add link | ||
const link = document.createElement("a"); | ||
link.href = company.url; | ||
link.target = "_blank"; | ||
link.textContent = "Visit Website"; | ||
card.appendChild(link); | ||
|
||
// Add tags | ||
company.tags.forEach((tag) => { | ||
const tagBubble = document.createElement("span"); | ||
tagBubble.textContent = tag; | ||
tagBubble.className = "tag-bubble"; | ||
card.appendChild(tagBubble); | ||
}); | ||
|
||
// Append card to column | ||
col.appendChild(card); | ||
|
||
// Append column to grid | ||
grid.appendChild(col); | ||
}); | ||
} | ||
|
||
} | ||
// Call the function | ||
createCompanyCards(companies); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* Container to center the content */ | ||
.container { | ||
max-width: 1200px; | ||
margin: 0 auto; | ||
padding: 20px; | ||
} | ||
|
||
/* Row setup */ | ||
.row { | ||
display: flex; | ||
flex-wrap: wrap; /* Wrap cards to the next row when needed */ | ||
margin-left: -15px; /* Match card padding for alignment */ | ||
margin-right: -15px; | ||
} | ||
|
||
/* Column behavior (e.g., col-lg-4) */ | ||
.col-lg-4 { | ||
flex: 0 0 33.333%; /* 3 columns per row */ | ||
max-width: 33.333%; /* Ensure max-width is the same */ | ||
padding-left: 15px; | ||
padding-right: 15px; | ||
box-sizing: border-box; /* Include padding in the box size */ | ||
} | ||
|
||
.col-lg-12 { | ||
flex: 0 0 100%; /* Full width for larger content */ | ||
max-width: 100%; | ||
} | ||
|
||
/* Company card styling */ | ||
.company-card { | ||
background: #fff; | ||
border: 1px solid #ddd; | ||
border-radius: 10px; | ||
padding: 20px; | ||
text-align: center; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
transition: transform 0.2s ease, box-shadow 0.2s ease; | ||
} | ||
|
||
.company-card:hover { | ||
transform: translateY(-5px); | ||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.company-card img { | ||
max-width: 100px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.company-card h3 { | ||
font-size: 1.2em; | ||
margin: 10px 0; | ||
color: #333; | ||
} | ||
|
||
.company-card a { | ||
display: inline-block; | ||
margin-top: 10px; | ||
color: #007bff; | ||
text-decoration: none; | ||
font-weight: bold; | ||
} | ||
|
||
.company-card a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
/* Tag bubble styles */ | ||
.tag-bubble { | ||
display: inline-block; | ||
background-color: #007bff; | ||
color: white; | ||
padding: 5px 10px; | ||
border-radius: 15px; | ||
font-size: 0.8em; | ||
margin-top: 10px; | ||
} |