-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
121 lines (112 loc) · 5.22 KB
/
Copy pathindex.html
File metadata and controls
121 lines (112 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SEO essentials -->
<title>ColorCraft · CSS Color Code Converter | HEX, RGB, HSL</title>
<meta name="description" content="Convert CSS colors instantly between HEX, RGB, and HSL formats. Live preview, copy codes, dark mode. Free & client-side.">
<meta name="keywords" content="color converter, hex to rgb, rgb to hex, hsl, css color, color code converter">
<meta name="author" content="ColorCraft">
<!-- Open Graph / social -->
<meta property="og:title" content="ColorCraft – CSS Color Converter">
<meta property="og:description" content="Convert HEX, RGB, HSL instantly. Live preview and copy.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://colorcraft.demo">
<meta property="og:image" content="https://via.placeholder.com/1200x630/1e293b/ffffff?text=ColorCraft">
<meta name="twitter:card" content="summary_large_image">
<!-- favicon inline -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234f46e5'><circle cx='12' cy='12' r='10' fill='%23ff0000'/><circle cx='8' cy='8' r='2' fill='white'/></svg>">
<!-- main stylesheet -->
<link rel="stylesheet" href="style.css">
<!-- google fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap" rel="stylesheet">
</head>
<body>
<!-- semantic header with navbar -->
<header>
<nav class="navbar glass" aria-label="Main navigation">
<div class="logo">🎨 ColorCraft</div>
<ul class="nav-menu" id="nav-menu">
<li><a href="index.html" class="active">Home</a></li>
<li><a href="#tool">Converter</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<div class="nav-actions">
<a href="signin.html" class="login-btn" id="loginBtn">Login</a>
<button id="darkModeToggle" class="theme-toggle" aria-label="Toggle dark mode">🌙</button>
<button class="mobile-toggle" id="mobileToggle" aria-label="Menu">☰</button>
</div>
</nav>
</header>
<main>
<!-- hero section -->
<section id="home" class="hero glass">
<h1>CSS <span class="gradient-text">Color Code Converter</span></h1>
<p class="subhead">Convert between HEX, RGB, and HSL instantly. Live preview, copy with one click.</p>
</section>
<!-- tool section (card style) -->
<section id="tool" class="tool-section">
<h2>⚙️ Convert any color</h2>
<div class="tool-card glass">
<!-- color preview box -->
<div class="color-preview" id="colorPreview" style="background-color: #4f46e5;"></div>
<!-- input area -->
<div class="input-group">
<label for="colorInput">Enter color (HEX, RGB, or HSL):</label>
<div class="input-row">
<input type="text" id="colorInput" placeholder="e.g. #4f46e5, rgb(79,70,229), hsl(245,75%,59%)" value="#4f46e5">
<button id="resetBtn" class="icon-btn" title="Reset to default">↺</button>
</div>
<p id="errorMsg" class="error-message"></p>
</div>
<!-- converted outputs -->
<div class="outputs">
<div class="output-item">
<span class="label">HEX</span>
<code id="hexOutput">#4f46e5</code>
<button class="copy-btn icon-btn small" data-target="hexOutput" title="Copy HEX">📋</button>
</div>
<div class="output-item">
<span class="label">RGB</span>
<code id="rgbOutput">rgb(79,70,229)</code>
<button class="copy-btn icon-btn small" data-target="rgbOutput" title="Copy RGB">📋</button>
</div>
<div class="output-item">
<span class="label">HSL</span>
<code id="hslOutput">hsl(245,75%,59%)</code>
<button class="copy-btn icon-btn small" data-target="hslOutput" title="Copy HSL">📋</button>
</div>
</div>
<p class="hint">✨ All conversions done in real time. Click any copy button.</p>
</div>
</section>
<!-- about / contact -->
<section id="about" class="info-section glass">
<h3>About ColorCraft</h3>
<p>We provide a fast, accurate CSS color converter. No data leaves your browser — completely private.</p>
</section>
<section id="contact" class="info-section glass">
<h3>Contact</h3>
<p>📧 hello@colorcraft.demo · <a href="#">Twitter</a> · <a href="#">GitHub</a></p>
</section>
</main>
<!-- footer -->
<footer class="glass">
<div class="footer-content">
<p>© 2025 ColorCraft — open source color tools</p>
<div class="social-links">
<a href="#" aria-label="Twitter">🐦</a>
<a href="#" aria-label="GitHub">🐙</a>
</div>
</div>
</footer>
<!-- back to top button -->
<button id="backToTop" class="back-to-top" title="Back to top">↑</button>
<!-- main javascript file -->
<script src="script.js"></script>
</body>
</html>