make flex design to use on android
Browse files- README.md +8 -5
- components/footer.js +73 -0
- components/navbar.js +79 -0
- index.html +225 -19
- script.js +98 -0
- style.css +27 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: FlexDroid - Android Flex Design Studio 🎨
|
| 3 |
+
colorFrom: yellow
|
| 4 |
+
colorTo: yellow
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/footer.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
footer {
|
| 7 |
+
background: white;
|
| 8 |
+
color: #4b5563;
|
| 9 |
+
padding: 2rem;
|
| 10 |
+
text-align: center;
|
| 11 |
+
margin-top: 2rem;
|
| 12 |
+
box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
|
| 13 |
+
}
|
| 14 |
+
.footer-content {
|
| 15 |
+
max-width: 1200px;
|
| 16 |
+
margin: 0 auto;
|
| 17 |
+
display: flex;
|
| 18 |
+
flex-direction: column;
|
| 19 |
+
gap: 1rem;
|
| 20 |
+
}
|
| 21 |
+
.footer-links {
|
| 22 |
+
display: flex;
|
| 23 |
+
justify-content: center;
|
| 24 |
+
gap: 1.5rem;
|
| 25 |
+
flex-wrap: wrap;
|
| 26 |
+
}
|
| 27 |
+
.footer-links a {
|
| 28 |
+
color: #4b5563;
|
| 29 |
+
text-decoration: none;
|
| 30 |
+
transition: color 0.2s;
|
| 31 |
+
}
|
| 32 |
+
.footer-links a:hover {
|
| 33 |
+
color: #4f46e5;
|
| 34 |
+
}
|
| 35 |
+
.footer-copyright {
|
| 36 |
+
font-size: 0.875rem;
|
| 37 |
+
color: #6b7280;
|
| 38 |
+
}
|
| 39 |
+
.social-icons {
|
| 40 |
+
display: flex;
|
| 41 |
+
justify-content: center;
|
| 42 |
+
gap: 1rem;
|
| 43 |
+
}
|
| 44 |
+
.social-icons a {
|
| 45 |
+
color: #6b7280;
|
| 46 |
+
transition: color 0.2s;
|
| 47 |
+
}
|
| 48 |
+
.social-icons a:hover {
|
| 49 |
+
color: #4f46e5;
|
| 50 |
+
}
|
| 51 |
+
</style>
|
| 52 |
+
<footer>
|
| 53 |
+
<div class="footer-content">
|
| 54 |
+
<div class="footer-links">
|
| 55 |
+
<a href="/about.html">About</a>
|
| 56 |
+
<a href="/privacy.html">Privacy</a>
|
| 57 |
+
<a href="/terms.html">Terms</a>
|
| 58 |
+
<a href="/contact.html">Contact</a>
|
| 59 |
+
</div>
|
| 60 |
+
<div class="social-icons">
|
| 61 |
+
<a href="#"><i data-feather="github"></i></a>
|
| 62 |
+
<a href="#"><i data-feather="twitter"></i></a>
|
| 63 |
+
<a href="#"><i data-feather="linkedin"></i></a>
|
| 64 |
+
</div>
|
| 65 |
+
<div class="footer-copyright">
|
| 66 |
+
© ${new Date().getFullYear()} FlexDroid. All rights reserved.
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
</footer>
|
| 70 |
+
`;
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
customElements.define('custom-footer', CustomFooter);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
nav {
|
| 7 |
+
background: white;
|
| 8 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 9 |
+
padding: 1rem;
|
| 10 |
+
display: flex;
|
| 11 |
+
justify-content: space-between;
|
| 12 |
+
align-items: center;
|
| 13 |
+
position: relative;
|
| 14 |
+
z-index: 10;
|
| 15 |
+
}
|
| 16 |
+
.logo {
|
| 17 |
+
color: #4f46e5;
|
| 18 |
+
font-weight: bold;
|
| 19 |
+
font-size: 1.25rem;
|
| 20 |
+
display: flex;
|
| 21 |
+
align-items: center;
|
| 22 |
+
gap: 0.5rem;
|
| 23 |
+
}
|
| 24 |
+
.logo-icon {
|
| 25 |
+
color: #4f46e5;
|
| 26 |
+
}
|
| 27 |
+
ul {
|
| 28 |
+
display: flex;
|
| 29 |
+
gap: 1rem;
|
| 30 |
+
list-style: none;
|
| 31 |
+
margin: 0;
|
| 32 |
+
padding: 0;
|
| 33 |
+
}
|
| 34 |
+
a {
|
| 35 |
+
color: #4b5563;
|
| 36 |
+
text-decoration: none;
|
| 37 |
+
transition: color 0.2s;
|
| 38 |
+
font-weight: 500;
|
| 39 |
+
padding: 0.5rem 1rem;
|
| 40 |
+
border-radius: 0.375rem;
|
| 41 |
+
}
|
| 42 |
+
a:hover {
|
| 43 |
+
color: #4f46e5;
|
| 44 |
+
background-color: #f5f3ff;
|
| 45 |
+
}
|
| 46 |
+
a.active {
|
| 47 |
+
color: #4f46e5;
|
| 48 |
+
background-color: #eef2ff;
|
| 49 |
+
}
|
| 50 |
+
@media (max-width: 640px) {
|
| 51 |
+
nav {
|
| 52 |
+
flex-direction: column;
|
| 53 |
+
gap: 1rem;
|
| 54 |
+
}
|
| 55 |
+
ul {
|
| 56 |
+
width: 100%;
|
| 57 |
+
justify-content: space-around;
|
| 58 |
+
}
|
| 59 |
+
a {
|
| 60 |
+
padding: 0.5rem;
|
| 61 |
+
font-size: 0.875rem;
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
</style>
|
| 65 |
+
<nav>
|
| 66 |
+
<a href="/" class="logo">
|
| 67 |
+
<i data-feather="layout" class="logo-icon"></i>
|
| 68 |
+
FlexDroid
|
| 69 |
+
</a>
|
| 70 |
+
<ul>
|
| 71 |
+
<li><a href="/" class="active">Designer</a></li>
|
| 72 |
+
<li><a href="/docs.html">Docs</a></li>
|
| 73 |
+
<li><a href="/examples.html">Examples</a></li>
|
| 74 |
+
</ul>
|
| 75 |
+
</nav>
|
| 76 |
+
`;
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
customElements.define('custom-navbar', CustomNavbar);
|
index.html
CHANGED
|
@@ -1,19 +1,225 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>FlexDroid - Android Flex Design Studio</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.cells.min.js"></script>
|
| 12 |
+
</head>
|
| 13 |
+
<body class="bg-gray-100">
|
| 14 |
+
<custom-navbar></custom-navbar>
|
| 15 |
+
|
| 16 |
+
<main class="container mx-auto px-4 py-8">
|
| 17 |
+
<div class="flex flex-col md:flex-row gap-8">
|
| 18 |
+
<!-- Preview Section -->
|
| 19 |
+
<div class="md:w-1/3 bg-white rounded-xl shadow-lg overflow-hidden">
|
| 20 |
+
<div class="bg-indigo-600 p-4 text-white">
|
| 21 |
+
<h2 class="text-xl font-bold flex items-center gap-2">
|
| 22 |
+
<i data-feather="smartphone"></i> Device Preview
|
| 23 |
+
</h2>
|
| 24 |
+
</div>
|
| 25 |
+
<div class="p-4">
|
| 26 |
+
<div class="border-2 border-gray-300 rounded-3xl p-2 mx-auto" style="width: 300px; height: 600px;">
|
| 27 |
+
<div class="h-full bg-gray-50 rounded-2xl overflow-hidden flex flex-col">
|
| 28 |
+
<!-- Status Bar -->
|
| 29 |
+
<div class="bg-indigo-600 text-white p-2 flex justify-between items-center">
|
| 30 |
+
<span class="text-xs">9:41</span>
|
| 31 |
+
<div class="flex gap-1">
|
| 32 |
+
<i data-feather="signal" class="w-3 h-3"></i>
|
| 33 |
+
<i data-feather="wifi" class="w-3 h-3"></i>
|
| 34 |
+
<i data-feather="battery" class="w-3 h-3"></i>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
+
|
| 38 |
+
<!-- Preview Content -->
|
| 39 |
+
<div id="previewContent" class="flex-grow p-4 flex flex-col gap-4">
|
| 40 |
+
<div class="bg-indigo-100 p-4 rounded-lg flex items-center justify-center">
|
| 41 |
+
<p class="text-indigo-800">Flex Item 1</p>
|
| 42 |
+
</div>
|
| 43 |
+
<div class="bg-indigo-100 p-4 rounded-lg flex items-center justify-center">
|
| 44 |
+
<p class="text-indigo-800">Flex Item 2</p>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
</div>
|
| 51 |
+
|
| 52 |
+
<!-- Controls Section -->
|
| 53 |
+
<div class="md:w-2/3">
|
| 54 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden mb-6">
|
| 55 |
+
<div class="bg-indigo-600 p-4 text-white">
|
| 56 |
+
<h2 class="text-xl font-bold flex items-center gap-2">
|
| 57 |
+
<i data-feather="sliders"></i> Flex Controls
|
| 58 |
+
</h2>
|
| 59 |
+
</div>
|
| 60 |
+
<div class="p-4">
|
| 61 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 62 |
+
<!-- Flex Direction -->
|
| 63 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 64 |
+
<h3 class="font-medium mb-2 flex items-center gap-1">
|
| 65 |
+
<i data-feather="columns" class="w-4 h-4"></i> Direction
|
| 66 |
+
</h3>
|
| 67 |
+
<div class="flex flex-wrap gap-2">
|
| 68 |
+
<button onclick="updateFlex('flex-row')" class="flex-btn bg-indigo-100 text-indigo-800 px-3 py-1 rounded">
|
| 69 |
+
Row
|
| 70 |
+
</button>
|
| 71 |
+
<button onclick="updateFlex('flex-row-reverse')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 72 |
+
Row Reverse
|
| 73 |
+
</button>
|
| 74 |
+
<button onclick="updateFlex('flex-col')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 75 |
+
Column
|
| 76 |
+
</button>
|
| 77 |
+
<button onclick="updateFlex('flex-col-reverse')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 78 |
+
Column Reverse
|
| 79 |
+
</button>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
+
<!-- Justify Content -->
|
| 84 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 85 |
+
<h3 class="font-medium mb-2 flex items-center gap-1">
|
| 86 |
+
<i data-feather="align-center" class="w-4 h-4"></i> Justify
|
| 87 |
+
</h3>
|
| 88 |
+
<div class="flex flex-wrap gap-2">
|
| 89 |
+
<button onclick="updateFlex('justify-start')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 90 |
+
Start
|
| 91 |
+
</button>
|
| 92 |
+
<button onclick="updateFlex('justify-end')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 93 |
+
End
|
| 94 |
+
</button>
|
| 95 |
+
<button onclick="updateFlex('justify-center')" class="flex-btn bg-indigo-100 text-indigo-800 px-3 py-1 rounded">
|
| 96 |
+
Center
|
| 97 |
+
</button>
|
| 98 |
+
<button onclick="updateFlex('justify-between')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 99 |
+
Between
|
| 100 |
+
</button>
|
| 101 |
+
<button onclick="updateFlex('justify-around')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 102 |
+
Around
|
| 103 |
+
</button>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<!-- Align Items -->
|
| 108 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 109 |
+
<h3 class="font-medium mb-2 flex items-center gap-1">
|
| 110 |
+
<i data-feather="align-left" class="w-4 h-4"></i> Align
|
| 111 |
+
</h3>
|
| 112 |
+
<div class="flex flex-wrap gap-2">
|
| 113 |
+
<button onclick="updateFlex('items-start')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 114 |
+
Start
|
| 115 |
+
</button>
|
| 116 |
+
<button onclick="updateFlex('items-end')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 117 |
+
End
|
| 118 |
+
</button>
|
| 119 |
+
<button onclick="updateFlex('items-center')" class="flex-btn bg-indigo-100 text-indigo-800 px-3 py-1 rounded">
|
| 120 |
+
Center
|
| 121 |
+
</button>
|
| 122 |
+
<button onclick="updateFlex('items-baseline')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 123 |
+
Baseline
|
| 124 |
+
</button>
|
| 125 |
+
<button onclick="updateFlex('items-stretch')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 126 |
+
Stretch
|
| 127 |
+
</button>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<!-- Flex Wrap -->
|
| 132 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 133 |
+
<h3 class="font-medium mb-2 flex items-center gap-1">
|
| 134 |
+
<i data-feather="wrap-text" class="w-4 h-4"></i> Wrap
|
| 135 |
+
</h3>
|
| 136 |
+
<div class="flex flex-wrap gap-2">
|
| 137 |
+
<button onclick="updateFlex('flex-nowrap')" class="flex-btn bg-indigo-100 text-indigo-800 px-3 py-1 rounded">
|
| 138 |
+
No Wrap
|
| 139 |
+
</button>
|
| 140 |
+
<button onclick="updateFlex('flex-wrap')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 141 |
+
Wrap
|
| 142 |
+
</button>
|
| 143 |
+
<button onclick="updateFlex('flex-wrap-reverse')" class="flex-btn bg-gray-100 text-gray-800 px-3 py-1 rounded">
|
| 144 |
+
Wrap Reverse
|
| 145 |
+
</button>
|
| 146 |
+
</div>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<!-- Item Controls -->
|
| 151 |
+
<div class="mt-6 bg-gray-50 p-4 rounded-lg">
|
| 152 |
+
<h3 class="font-medium mb-2 flex items-center gap-1">
|
| 153 |
+
<i data-feather="layout" class="w-4 h-4"></i> Item Controls
|
| 154 |
+
</h3>
|
| 155 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 156 |
+
<div>
|
| 157 |
+
<label class="block text-sm font-medium mb-1">Number of Items</label>
|
| 158 |
+
<input type="range" min="1" max="6" value="2" class="w-full" oninput="updateItemCount(this.value)">
|
| 159 |
+
</div>
|
| 160 |
+
<div>
|
| 161 |
+
<label class="block text-sm font-medium mb-1">Item Height</label>
|
| 162 |
+
<select class="w-full p-2 border rounded" onchange="updateItemHeight(this.value)">
|
| 163 |
+
<option value="h-16">Small</option>
|
| 164 |
+
<option value="h-24" selected>Medium</option>
|
| 165 |
+
<option value="h-32">Large</option>
|
| 166 |
+
</select>
|
| 167 |
+
</div>
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<!-- Code Output -->
|
| 174 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
| 175 |
+
<div class="bg-indigo-600 p-4 text-white">
|
| 176 |
+
<h2 class="text-xl font-bold flex items-center gap-2">
|
| 177 |
+
<i data-feather="code"></i> Generated Code
|
| 178 |
+
</h2>
|
| 179 |
+
</div>
|
| 180 |
+
<div class="p-4">
|
| 181 |
+
<div class="bg-gray-800 rounded-lg p-4 overflow-x-auto">
|
| 182 |
+
<pre id="codeOutput" class="text-green-400 text-sm">
|
| 183 |
+
<div class="flex flex-col items-center justify-center gap-4">
|
| 184 |
+
<div class="bg-indigo-100 p-4 rounded-lg h-24 flex items-center justify-center">
|
| 185 |
+
<p class="text-indigo-800">Flex Item 1</p>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="bg-indigo-100 p-4 rounded-lg h-24 flex items-center justify-center">
|
| 188 |
+
<p class="text-indigo-800">Flex Item 2</p>
|
| 189 |
+
</div>
|
| 190 |
+
</div></pre>
|
| 191 |
+
</div>
|
| 192 |
+
<button onclick="copyCode()" class="mt-4 bg-indigo-600 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 193 |
+
<i data-feather="copy"></i> Copy Code
|
| 194 |
+
</button>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
</main>
|
| 200 |
+
|
| 201 |
+
<custom-footer></custom-footer>
|
| 202 |
+
|
| 203 |
+
<script src="components/navbar.js"></script>
|
| 204 |
+
<script src="components/footer.js"></script>
|
| 205 |
+
<script src="script.js"></script>
|
| 206 |
+
<script>
|
| 207 |
+
feather.replace();
|
| 208 |
+
// Initialize Vanta.js background
|
| 209 |
+
VANTA.CELLS({
|
| 210 |
+
el: "body",
|
| 211 |
+
mouseControls: true,
|
| 212 |
+
touchControls: true,
|
| 213 |
+
gyroControls: false,
|
| 214 |
+
minHeight: 200.00,
|
| 215 |
+
minWidth: 200.00,
|
| 216 |
+
scale: 1.00,
|
| 217 |
+
color1: 0x9fa8da,
|
| 218 |
+
color2: 0x7986cb,
|
| 219 |
+
size: 1.20,
|
| 220 |
+
speed: 1.10
|
| 221 |
+
});
|
| 222 |
+
</script>
|
| 223 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 224 |
+
</body>
|
| 225 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// FlexDroid - Android Flex Design Studio
|
| 2 |
+
|
| 3 |
+
let currentClasses = ['flex', 'flex-col', 'items-center', 'justify-center', 'gap-4'];
|
| 4 |
+
let itemCount = 2;
|
| 5 |
+
let itemHeight = 'h-24';
|
| 6 |
+
|
| 7 |
+
function updateFlex(className) {
|
| 8 |
+
// Remove existing flex classes
|
| 9 |
+
const flexPrefixes = ['flex-', 'justify-', 'items-', 'gap-'];
|
| 10 |
+
currentClasses = currentClasses.filter(cls =>
|
| 11 |
+
!flexPrefixes.some(prefix => cls.startsWith(prefix))
|
| 12 |
+
);
|
| 13 |
+
|
| 14 |
+
// Add new class
|
| 15 |
+
currentClasses.push(className);
|
| 16 |
+
|
| 17 |
+
// Update preview
|
| 18 |
+
updatePreview();
|
| 19 |
+
|
| 20 |
+
// Update active buttons
|
| 21 |
+
document.querySelectorAll('.flex-btn').forEach(btn => {
|
| 22 |
+
btn.classList.remove('bg-indigo-100', 'text-indigo-800');
|
| 23 |
+
btn.classList.add('bg-gray-100', 'text-gray-800');
|
| 24 |
+
});
|
| 25 |
+
|
| 26 |
+
const activeBtn = document.querySelector(`.flex-btn[onclick="updateFlex('${className}')"]`);
|
| 27 |
+
if (activeBtn) {
|
| 28 |
+
activeBtn.classList.remove('bg-gray-100', 'text-gray-800');
|
| 29 |
+
activeBtn.classList.add('bg-indigo-100', 'text-indigo-800');
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
function updateItemCount(count) {
|
| 34 |
+
itemCount = parseInt(count);
|
| 35 |
+
updatePreview();
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
function updateItemHeight(height) {
|
| 39 |
+
itemHeight = height;
|
| 40 |
+
updatePreview();
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
function updatePreview() {
|
| 44 |
+
const previewContent = document.getElementById('previewContent');
|
| 45 |
+
previewContent.className = currentClasses.join(' ');
|
| 46 |
+
|
| 47 |
+
// Generate items
|
| 48 |
+
let itemsHTML = '';
|
| 49 |
+
for (let i = 0; i < itemCount; i++) {
|
| 50 |
+
itemsHTML += `
|
| 51 |
+
<div class="bg-indigo-100 p-4 rounded-lg ${itemHeight} flex items-center justify-center">
|
| 52 |
+
<p class="text-indigo-800">Flex Item ${i+1}</p>
|
| 53 |
+
</div>
|
| 54 |
+
`;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
previewContent.innerHTML = itemsHTML;
|
| 58 |
+
|
| 59 |
+
// Update code output
|
| 60 |
+
updateCodeOutput();
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
function updateCodeOutput() {
|
| 64 |
+
const codeOutput = document.getElementById('codeOutput');
|
| 65 |
+
let itemsCode = '';
|
| 66 |
+
|
| 67 |
+
for (let i = 0; i < itemCount; i++) {
|
| 68 |
+
itemsCode += `
|
| 69 |
+
<div class="bg-indigo-100 p-4 rounded-lg ${itemHeight} flex items-center justify-center">
|
| 70 |
+
<p class="text-indigo-800">Flex Item ${i+1}</p>
|
| 71 |
+
</div>`;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
const classesStr = currentClasses.map(c => c.replace(/-/g, '\\-')).join(' ');
|
| 75 |
+
codeOutput.textContent = `<div class="${classesStr}">${itemsCode}
|
| 76 |
+
</div>`;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
function copyCode() {
|
| 80 |
+
const code = document.getElementById('codeOutput').textContent;
|
| 81 |
+
navigator.clipboard.writeText(code.replace(/</g, '<').replace(/>/g, '>'));
|
| 82 |
+
|
| 83 |
+
// Show copied notification
|
| 84 |
+
const btn = document.querySelector('[onclick="copyCode()"]');
|
| 85 |
+
const originalText = btn.innerHTML;
|
| 86 |
+
btn.innerHTML = '<i data-feather="check"></i> Copied!';
|
| 87 |
+
feather.replace();
|
| 88 |
+
|
| 89 |
+
setTimeout(() => {
|
| 90 |
+
btn.innerHTML = originalText;
|
| 91 |
+
feather.replace();
|
| 92 |
+
}, 2000);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
// Initialize
|
| 96 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 97 |
+
updatePreview();
|
| 98 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
font-size: 15px;
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Custom styles for Android flex design */
|
| 2 |
body {
|
| 3 |
+
font-family: 'Roboto', system-ui, -apple-system, sans-serif;
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
+
.flex-btn.active {
|
| 7 |
+
background-color: #818cf8;
|
| 8 |
+
color: white;
|
| 9 |
}
|
| 10 |
|
| 11 |
+
#previewContent {
|
| 12 |
+
transition: all 0.3s ease;
|
|
|
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
|
| 15 |
+
/* Android-like shadows */
|
| 16 |
+
.shadow-android {
|
| 17 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
|
| 20 |
+
.shadow-android-lg {
|
| 21 |
+
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
|
| 22 |
}
|
| 23 |
+
|
| 24 |
+
/* Custom scrollbar for code output */
|
| 25 |
+
pre::-webkit-scrollbar {
|
| 26 |
+
height: 8px;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
pre::-webkit-scrollbar-track {
|
| 30 |
+
background: #1a1a1a;
|
| 31 |
+
border-radius: 4px;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
pre::-webkit-scrollbar-thumb {
|
| 35 |
+
background: #4f46e5;
|
| 36 |
+
border-radius: 4px;
|
| 37 |
+
}
|