Skip to content

Commit

Permalink
replace bulma cards with box for quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
mskian committed Dec 17, 2024
1 parent c93d279 commit 277a4b3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
6 changes: 2 additions & 4 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,15 @@ function renderQuotes(page: number): void {
container.innerHTML = '';
quotesCache[page].forEach((quote) => {
const card = document.createElement('div');
card.className = 'column is-half';
card.className = 'box';

card.innerHTML = `
<div class="card">
<div class="card-content">
<div class="content">
<p class="quote-text">${quote.content.replace(/\n/g, '<br>')}</p>
<button class="button is-small is-primary copy-btn mt-3">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
`;

const copyBtn = card.querySelector('.copy-btn') as HTMLButtonElement;
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1 class="title has-text-centered is-size-5">தமிழ் கவிதைக
<span class="slider"></span>
</label>
</div>
<div id="quotes-container" class="columns is-multiline is-centered"></div>
<div id="quotes-container"></div>
<div id="pagination" class="pagination-container">
<button id="prev-btn" class="page-button">&laquo; Prev</button>
<button id="next-btn" class="page-button">Next &raquo;</button>
Expand Down
39 changes: 19 additions & 20 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,21 @@ body {
justify-content: center;
}

.card {
.box {
position: relative;
background: #833471;
border: 1px solid #B33771;
color: #F8EFBA;
border-radius: 15px;
margin-bottom: 10px;
border-radius: 20px;
padding: 30px;
padding-top: 68px;
padding-bottom: 50px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
word-wrap: break-word;
margin-bottom: 1rem;
text-align: center;
}

.card-content {
font-family: "Anek Tamil", sans-serif;
margin-top: 4rem;
margin-bottom: 3rem;
word-wrap: break-word;
letter-spacing: .04em;
}

.copy-btn {
position: absolute;
top: 5px;
Expand All @@ -63,14 +61,15 @@ body {
transform: scale(1.1);
}

.quote-text {
font-size: 18px;
font-family: "Anek Tamil", sans-serif;
font-weight: 600;
line-height: 1.6;
margin-bottom: 45px;
word-wrap: break-word;
}
.quote-text {
font-size: 16px;
font-family: "Anek Tamil", sans-serif;
font-weight: 600;
line-height: 1.6;
margin-bottom: 40px;
text-align: left;
word-wrap: break-word;
}
.title {
color: #1d1702;
font-family: "Anek Tamil", sans-serif;
Expand Down Expand Up @@ -171,7 +170,7 @@ body.has-background-dark {
color: #f7d794;
}

body.has-background-dark .card {
body.has-background-dark .box {
background-image: linear-gradient(to right top, #32072b, #290924, #21081d, #1a0617, #10030e);
border: 1px solid #9a74f1;
}
Expand Down

0 comments on commit 277a4b3

Please sign in to comment.