Skip to content

Commit

Permalink
Merge pull request #1 from TMHSDigital/Cutting-Edge-Theme
Browse files Browse the repository at this point in the history
Cutting edge theme->>merge to main
  • Loading branch information
TMHSDigital authored Jul 9, 2024
2 parents f9f38c0 + 08200a4 commit a2bcf2c
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 22 deletions.
26 changes: 26 additions & 0 deletions css/ascii-art.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.ascii-output {
background-color: #1a1a1a;
border: 1px solid #00fff2;
border-radius: 5px;
padding: 1rem;
margin-top: 1rem;
font-family: monospace;
white-space: pre-wrap;
overflow-x: auto;
}

#ascii-output {
color: #00fff2;
font-size: 0.8rem;
line-height: 1;
}

#text-input {
width: 100%;
background-color: #1f2937;
border: 1px solid #374151;
color: #fff;
padding: 0.5rem;
border-radius: 5px;
resize: vertical;
}
8 changes: 8 additions & 0 deletions css/color-palette.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#image-container img {
max-width: 100%;
height: auto;
margin-top: 1rem;
border-radius: 5px;
}

#palette-container {
display: flex;
justify-content: space-between;
Expand All @@ -14,4 +21,5 @@
text-align: center;
font-size: 0.8rem;
margin-top: 0.5rem;
color: #fff;
}
43 changes: 43 additions & 0 deletions css/qr-generator.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#qr-input, #qr-size, #qr-correction {
width: 100%;
background-color: #1f2937;
border: 1px solid #374151;
color: #fff;
padding: 0.5rem;
border-radius: 5px;
}

#qr-output {
display: flex;
justify-content: center;
margin-top: 1rem;
background-color: #fff;
padding: 1rem;
border-radius: 5px;
}

#download-link {
display: block;
margin-top: 1rem;
text-align: center;
}

.options-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
margin-bottom: 1rem;
}

#qr-color, #qr-bg-color {
width: 100%;
height: 40px;
padding: 0;
border: none;
cursor: pointer;
}

#qr-rounded {
width: 20px;
height: 20px;
}
2 changes: 1 addition & 1 deletion css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ label {
color: #00fff2;
}

input[type="file"], input[type="number"] {
input[type="file"], input[type="number"], input[type="text"], textarea {
background-color: #1f2937;
border: 1px solid #374151;
color: #fff;
Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Services Hub</title>
<link rel="stylesheet" href="css/styles.css">
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
Expand All @@ -19,6 +20,8 @@ <h1 class="neon-text">Digital Services Hub</h1>
<ul class="services-list">
<li><a href="pages/image-resizer.html">Futuristic Image Resizer</a></li>
<li><a href="pages/color-palette.html">Color Palette Generator</a></li>
<li><a href="pages/ascii-art.html">ASCII Art Converter</a></li>
<li><a href="pages/qr-generator.html">QR Code Generator</a></li>
</ul>

<p class="cta-text">Choose a service above to get started, or visit our <a href="pages/about.html">About page</a> to learn more.</p>
Expand Down
18 changes: 18 additions & 0 deletions js/ascii-art.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const textInput = document.getElementById('text-input');
const convertButton = document.getElementById('convert-button');
const asciiOutput = document.getElementById('ascii-output');

const asciiChars = ['@', '#', 'S', '%', '?', '*', '+', ';', ':', ',', '.'];

function textToAscii(text) {
return text.split('').map(char => {
const index = Math.floor(Math.random() * asciiChars.length);
return asciiChars[index];
}).join('');
}

convertButton.addEventListener('click', () => {
const inputText = textInput.value;
const asciiArt = inputText.split('\n').map(line => textToAscii(line)).join('\n');
asciiOutput.textContent = asciiArt;
});
4 changes: 2 additions & 2 deletions js/color-palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ fileInput.addEventListener('change', (e) => {
if (file) {
const reader = new FileReader();
reader.onload = (e) => {
imageContainer.innerHTML = `<img src="${e.target.result}" id="image" class="max-w-full">`;
imageContainer.innerHTML = `<img src="${e.target.result}" id="uploaded-image">`;
};
reader.readAsDataURL(file);
}
});

generateButton.addEventListener('click', () => {
const image = document.getElementById('image');
const image = document.getElementById('uploaded-image');
if (image) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
Expand Down
39 changes: 26 additions & 13 deletions js/common.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
document.addEventListener('DOMContentLoaded', (event) => {
const nav = document.getElementById('main-nav');
nav.innerHTML = `
<a href="../index.html">Home</a>
<a href="image-resizer.html">Image Resizer</a>
<a href="color-palette.html">Color Palette</a>
<a href="about.html">About</a>
`;
const currentPath = window.location.pathname;

// Adjust links if we're on the homepage
if (window.location.pathname.endsWith('index.html') || window.location.pathname.endsWith('/')) {
nav.innerHTML = nav.innerHTML.replace('../index.html', 'index.html');
nav.innerHTML = nav.innerHTML.replace('image-resizer.html', 'pages/image-resizer.html');
nav.innerHTML = nav.innerHTML.replace('color-palette.html', 'pages/color-palette.html');
nav.innerHTML = nav.innerHTML.replace('about.html', 'pages/about.html');
}
const navItems = [
{ href: "index.html", text: "Home" },
{ href: "pages/image-resizer.html", text: "Image Resizer" },
{ href: "pages/color-palette.html", text: "Color Palette" },
{ href: "pages/ascii-art.html", text: "ASCII Art" },
{ href: "pages/qr-generator.html", text: "QR Code" },
{ href: "pages/about.html", text: "About" }
];

const navHTML = navItems.map(item => {
let href = item.href;
if (currentPath.includes('/pages/')) {
href = href.replace('pages/', '');
if (item.href === 'index.html') {
href = '../' + href;
}
} else if (currentPath.endsWith('/') || currentPath.endsWith('index.html')) {
if (item.href !== 'index.html') {
href = 'pages/' + href.replace('pages/', '');
}
}
return `<a href="${href}">${item.text}</a>`;
}).join('');

nav.innerHTML = navHTML;
});
48 changes: 48 additions & 0 deletions js/qr-generator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const qrInput = document.getElementById('qr-input');
const qrSize = document.getElementById('qr-size');
const qrCorrection = document.getElementById('qr-correction');
const qrColor = document.getElementById('qr-color');
const qrBgColor = document.getElementById('qr-bg-color');
const qrRounded = document.getElementById('qr-rounded');
const generateButton = document.getElementById('generate-button');
const qrOutput = document.getElementById('qr-output');
const downloadLink = document.getElementById('download-link');

let qr = null;

generateButton.addEventListener('click', () => {
const inputText = qrInput.value;
if (inputText) {
qrOutput.innerHTML = ''; // Clear previous QR code

qr = new QRCode(qrOutput, {
text: inputText,
width: parseInt(qrSize.value),
height: parseInt(qrSize.value),
colorDark: qrColor.value,
colorLight: qrBgColor.value,
correctLevel: QRCode.CorrectLevel[qrCorrection.value]
});

// Apply rounded corners if selected
if (qrRounded.checked) {
setTimeout(() => {
const qrImage = qrOutput.querySelector('img');
qrImage.style.borderRadius = '15px';
}, 50);
}

// Enable download after a short delay to ensure QR code is generated
setTimeout(() => {
const qrImage = qrOutput.querySelector('img');
downloadLink.href = qrImage.src;
downloadLink.download = 'qrcode.png';
downloadLink.style.display = 'inline-block';
}, 100);
}
});

// Update QR code in real-time as options change
[qrSize, qrCorrection, qrColor, qrBgColor, qrRounded].forEach(element => {
element.addEventListener('change', () => generateButton.click());
});
59 changes: 53 additions & 6 deletions pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,70 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About - Digital Services Hub</title>
<link rel="stylesheet" href="../css/styles.css">
<style>
.feature-list {
list-style-type: none;
padding: 0;
}
.feature-list li {
margin-bottom: 0.5rem;
display: flex;
align-items: center;
}
.feature-list li::before {
content: '🚀';
margin-right: 0.5rem;
}
.coming-soon {
font-style: italic;
color: #00fff2;
}
</style>
</head>
<body>
<div class="container">
<h1 class="neon-text">About Our Services</h1>
<h1 class="neon-text">About Digital Services Hub</h1>

<nav id="main-nav"></nav>

<div class="content">
<p>Welcome to our Digital Services Hub! We offer a range of tools to help with your digital media needs.</p>
<p>Welcome to the Digital Services Hub - your gateway to cutting-edge digital tools and AI-powered services!</p>

<h2>Our Tools:</h2>
<h2>Our Mission</h2>
<p>We strive to provide innovative, user-friendly digital tools that empower creators, developers, and everyday users to unleash their creativity and productivity in the digital realm.</p>

<h2>Current Services</h2>
<ul class="feature-list">
<li>Futuristic Image Resizer: Resize your images with style</li>
<li>Color Palette Generator: Extract beautiful color schemes from images</li>
<li>ASCII Art Converter: Transform text into ASCII masterpieces</li>
<li>QR Code Generator: Create custom QR codes for various purposes</li>
</ul>

<h2>Upcoming Features</h2>
<p>We're constantly innovating! Here's a sneak peek at some exciting services we're working on:</p>
<ul class="feature-list">
<li>AI Text Summarizer <span class="coming-soon">(Coming Soon!)</span></li>
<li>Sentiment Analysis Tool <span class="coming-soon">(Coming Soon!)</span></li>
<li>AI-powered Image Enhancement <span class="coming-soon">(Coming Soon!)</span></li>
<li>Virtual Background Generator <span class="coming-soon">(Coming Soon!)</span></li>
<li>Text-to-Speech Converter <span class="coming-soon">(Coming Soon!)</span></li>
</ul>
<p>And many more AI-integrated and high-tech services on the horizon!</p>

<h2>Our Commitment</h2>
<p>At Digital Services Hub, we are committed to:</p>
<ul>
<li>Futuristic Image Resizer: Quickly resize your images with our sleek tool.</li>
<li>Color Palette Generator: Extract color palettes from your favorite images.</li>
<li>Providing free, accessible tools for all users</li>
<li>Continuously updating and improving our services</li>
<li>Maintaining a user-friendly, futuristic interface</li>
<li>Protecting user privacy and data security</li>
</ul>

<p>All our tools are free to use and designed with a futuristic aesthetic. We're constantly working on adding new features and tools to enhance your digital workflow.</p>
<h2>Get Involved</h2>
<p>We welcome feedback, suggestions, and contributions from our community. If you have ideas for new features or improvements, please visit our GitHub repository and open an issue or submit a pull request.</p>

<p>Thank you for choosing Digital Services Hub. Together, let's shape the future of digital creativity and productivity!</p>
</div>
</div>

Expand Down
35 changes: 35 additions & 0 deletions pages/ascii-art.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ASCII Art Converter - Digital Services Hub</title>
<link rel="stylesheet" href="../css/styles.css">
<link rel="stylesheet" href="../css/ascii-art.css">
</head>
<body>
<div class="container">
<h1 class="neon-text">ASCII Art Converter</h1>

<nav id="main-nav"></nav>

<div class="content">
<div class="input-group">
<label for="text-input">Enter your text:</label>
<textarea id="text-input" rows="3" placeholder="Type your text here..."></textarea>
</div>

<button id="convert-button" class="tech-button">Convert to ASCII Art</button>

<div id="output-container" class="ascii-output">
<pre id="ascii-output"></pre>
</div>

<p class="instructions">Enter your text and click 'Convert to ASCII Art' to see the result.</p>
</div>
</div>

<script src="../js/common.js"></script>
<script src="../js/ascii-art.js"></script>
</body>
</html>
Loading

0 comments on commit a2bcf2c

Please sign in to comment.