Skip to content

Commit

Permalink
Refactor QR code component styles and add URL Shortener tool
Browse files Browse the repository at this point in the history
  • Loading branch information
TMHSDigital committed Dec 24, 2024
1 parent 7acb6cd commit 40309ec
Show file tree
Hide file tree
Showing 5 changed files with 770 additions and 1 deletion.
309 changes: 309 additions & 0 deletions css/components/url-shortener.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
.url-shortener {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.input-section {
margin-bottom: 2rem;
}

.url-input-container {
display: flex;
gap: 1rem;
margin-bottom: 1.5rem;
}

.url-input-container input {
flex: 1;
padding: 1rem;
border: 2px solid var(--border-color);
border-radius: 5px;
background: var(--background-light);
color: var(--text-light);
font-size: 1rem;
transition: var(--transition);
}

.url-input-container input:focus {
border-color: var(--primary-color);
outline: none;
box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.options-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
}

.custom-alias {
display: flex;
flex-direction: column;
gap: 0.5rem;
}

.custom-alias input {
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 5px;
background: var(--background-light);
color: var(--text-light);
font-size: 0.9rem;
}

.hint {
font-size: 0.8rem;
color: var(--text-light);
opacity: 0.7;
}

.expiry-options {
display: flex;
flex-direction: column;
gap: 0.5rem;
}

.expiry-options select,
.expiry-options input[type="date"] {
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 5px;
background: var(--background-light);
color: var(--text-light);
font-size: 0.9rem;
}

.result-section {
padding: 2rem;
background: rgba(var(--primary-color-rgb), 0.1);
border-radius: 10px;
margin-top: 2rem;
}

.shortened-url-container {
display: flex;
gap: 1rem;
margin-bottom: 1.5rem;
}

.shortened-url-container input {
flex: 1;
padding: 1rem;
border: 2px solid var(--border-color);
border-radius: 5px;
background: var(--background-light);
color: var(--text-light);
font-size: 1rem;
cursor: text;
}

.stats-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid var(--border-color);
}

.stat {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}

.stat-label {
font-size: 0.9rem;
color: var(--text-light);
opacity: 0.7;
margin-bottom: 0.5rem;
}

.stat-value {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary-color);
}

.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}

.modal-content {
background: var(--background-light);
padding: 2rem;
border-radius: 10px;
max-width: 400px;
width: 90%;
}

.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}

.close-button {
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-light);
cursor: pointer;
padding: 0.5rem;
}

#qr-code {
display: flex;
justify-content: center;
margin: 2rem 0;
}

.features-section {
margin-top: 4rem;
}

.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-top: 2rem;
}

.feature-card {
background: rgba(255, 255, 255, 0.05);
padding: 2rem;
border-radius: 10px;
text-align: center;
transition: var(--transition);
}

.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature-card i {
font-size: 2rem;
color: var(--primary-color);
margin-bottom: 1rem;
}

.feature-card h3 {
margin-bottom: 1rem;
color: var(--text-light);
}

.feature-card p {
color: var(--text-light);
opacity: 0.8;
font-size: 0.9rem;
}

.hidden {
display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
.url-input-container {
flex-direction: column;
}

.options-container {
grid-template-columns: 1fr;
}

.stats-container {
grid-template-columns: 1fr;
gap: 1rem;
}

.shortened-url-container {
flex-direction: column;
}

.shortened-url-container button {
width: 100%;
}
}

.history-section {
max-width: 800px;
margin: 2rem auto;
padding: 2rem;
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-list {
display: flex;
flex-direction: column;
gap: 1rem;
}

.history-item {
display: grid;
grid-template-columns: 1fr auto auto;
gap: 1rem;
padding: 1rem;
background: rgba(255, 255, 255, 0.03);
border-radius: 5px;
align-items: center;
}

.history-item .url-info {
display: flex;
flex-direction: column;
gap: 0.5rem;
}

.history-item .short-url {
font-weight: 700;
color: var(--primary-color);
}

.history-item .long-url {
font-size: 0.9rem;
color: var(--text-light);
opacity: 0.8;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.history-item .meta-info {
font-size: 0.8rem;
color: var(--text-light);
opacity: 0.7;
}

.history-item .action-buttons {
display: flex;
gap: 0.5rem;
}

@media (max-width: 768px) {
.history-item {
grid-template-columns: 1fr;
}

.history-item .action-buttons {
justify-content: flex-end;
}
}
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ <h3>Password Generator</h3>
<span>Strength meter</span>
</div>
</article>

<article class="tool-card" onclick="window.location.href='pages/url-shortener.html'">
<div class="tool-icon">
<i class="fas fa-link"></i>
</div>
<h3>URL Shortener</h3>
<p>Create short, memorable links for easy sharing and tracking.</p>
<div class="tool-features">
<span>Click analytics</span>
<span>Custom aliases</span>
</div>
</article>
</section>

<section class="features">
Expand Down
Loading

0 comments on commit 40309ec

Please sign in to comment.