top of page
Writer's pictureRachel Terry

Elevate your site with Color Finders, Quotes & Menu Codes

In today's digital world, effective online marketing and web design require a keen eye for color schemes that resonate with your brand or message. The HEX Code Color Finder is a simple but powerful tool that can help you identify and experiment with colors to enhance your online presence. In this tutorial, we'll walk you through how to use this tool and provide two other code snippets that can boost your website design. Plus, we'll show you how to leverage ChatGPT to create the code you need. Let's get started!




Part 1: HEX Code Color Finder

 

Step 1: Set Up the HTML

First, create a new HTML file or open an existing one. We'll use the following code:


<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>HEX Code Color Finder</title>

<style>

body {

font-family: Poppins, sans-serif;

text-align: center;

}

#color-picker {

display: flex;

flex-direction: column;

align-items: center;

margin-top: 20px;

}

#color-display {

width: 100px;

height: 100px;

margin-bottom: 10px;

border: 2px solid #333;

}

input[type="color"] {

width: 100px;

height: 40px;

padding: 10px;

}

</style>

</head>

<body>

<div id="color-picker">

<h1>HEX Code Color Finder</h1>

<div id="color-display"></div>

<input type="color" id="color-input">

</div>


<script>

const colorDisplay = document.getElementById("color-display");

const colorInput = document.getElementById("color-input");


colorInput.addEventListener("input", () => {

const selectedColor = colorInput.value;

colorDisplay.style.backgroundColor = selectedColor;

});

</script>

</body>

</html>



**This code sets up a simple web page with a color finder that allows you to select a color and see it displayed in real-time.






Step 2 for all: Embed in Your Website

Copy and paste this code into your website's HTML wherever you want to include the HEX Code Color Finder. Customize the styling and layout to match your site's design.




Part 2: Random Quote Generator

 

Step 1: Create the HTML Structure

Let's create a code snippet for a Random Quote Generator. It's a fun addition to your website. Here's the HTML structure:


<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Random Quote Generator</title>

<style>

body {

font-family: Arial, sans-serif;

text-align: center;

}

#quote-container {

margin: 50px auto;

max-width: 600px;

padding: 20px;

border: 1px solid #ccc;

border-radius: 5px;

}

button {

background-color: #333;

color: #fff;

padding: 10px 20px;

border: none;

cursor: pointer;

}

</style>

</head>

<body>

<div id="quote-container">

<h2>Random Quote:</h2>

<p id="quote"></p>

<button id="generate-quote">Generate Quote</button>

</div>


<script>

const quotes = [

"The only way to do great work is to love what you do. - Steve Jobs",

"Innovation distinguishes between a leader and a follower. - Steve Jobs",

"Success is not final, failure is not fatal: It is the courage to continue that counts. - Winston Churchill"

];


const quoteContainer = document.getElementById("quote");

const generateButton = document.getElementById("generate-quote");


generateButton.addEventListener("click", () => {

const randomIndex = Math.floor(Math.random() * quotes.length);

const randomQuote = quotes[randomIndex];

quoteContainer.textContent = randomQuote;

});

</script>

</body>

</html>



**This code snippet creates a Random Quote Generator that displays a random quote each time the "Generate Quote" button is clicked. Customize the quotes to fit your website's theme or message.






Part 3: Responsive Navigation Menu

 

Step 1: Design a Responsive Navigation Menu

Now, let's add a responsive navigation menu to your website. Here's the HTML structure:


<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Responsive Navigation Menu</title>

<style>

body {

font-family: Arial, sans-serif;

margin: 0;

padding: 0;

}

.navbar {

background-color: #333;

overflow: hidden;

}

.navbar a {

float: left;

font-size: 16px;

color: white;

text-align: center;

padding: 14px 16px;

text-decoration: none;

}

.navbar a:hover {

background-color: #ddd;

color: #333;

}

.navbar a.active {

background-color: #4CAF50;

color: white;

}

@media screen and (max-width: 600px) {

.navbar a {

float: none;

display: block;

text-align: left;

}

}

</style>

</head>

<body>

<div class="navbar">

<a class="active" href="#home">Home</a>

<a href="#about">About</a>

<a href="#services">Services</a>

<a href="#contact">Contact</a>

</div>

</body>

</html>


**This code snippet creates a responsive navigation menu that collapses into a mobile-friendly drop down menu on small screens.





Part 4: ChatGPT for Code Assistance

 

Now, let's see how ChatGPT can assist you in creating these code snippets.


Step 1: Open ChatGPT


You can access ChatGPT through OpenAI's platform or API. Once you have access, you can use prompts like the following to generate code:

  • "Generate HTML and CSS for a HEX Code Color Finder with real-time color display."

  • "Create HTML and JavaScript for a Random Quote Generator with a 'Generate Quote' button."

  • "Generate HTML and CSS for a responsive navigation menu that collapses on small screens."

ChatGPT can provide code snippets and even help you with customization based on your specific requirements.


By following this tutorial and using ChatGPT for assistance, you can enhance your online marketing and web design efforts with these code snippets.Feel free to adapt and integrate them into your website to engage your audience and elevate your digital presence.


Whether you're a web designer crafting beautiful color schemes with the HEX Code Finder, or an online Blogger adding dynamic content with the Random Quote Generator and responsive Navigation Menu, these tools will empower you to create a more engaging and visually appealing online experience. Don't miss the opportunity to boost your website's interactivity and captivate your audience, making a lasting impression on every visitor.


Tag me on IG @my.life.edit_rachelt with any new codes you create! I'd love to see them in action!








13 views0 comments

Comments


bottom of page