width & height inheritance + support w/h on input tags & button

This commit is contained in:
Face
2025-07-28 19:43:19 +03:00
parent 0f061e4352
commit 8ca3337f56
8 changed files with 210 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ a { text-[#1a0dab] }
pre { text-xl font-mono }
"""
var HTML_CONTENT = "<head>
var HTML_CONTENT2 = "<head>
<title>My cool web</title>
<icon src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Google_%22G%22_logo.svg/768px-Google_%22G%22_logo.svg.png\">
@@ -230,3 +230,68 @@ So
<span style=\"bg-[#ffffaa] w-12 h-8 self-stretch flex items-center justify-center\">Stretch</span>
</div>
</body>".to_utf8_buffer()
var HTML_CONTENT = """<head>
<title>Task Manager</title>
<icon src="https://cdn-icons-png.flaticon.com/512/126/126472.png">
<meta name="theme-color" content="#1e1e2f">
<meta name="description" content="Manage your tasks easily.">
<style>
h1 { text-[#4ade80] text-2xl font-bold text-center }
p { text-[#94a3b8] text-lg text-center }
button { bg-[#4ade80] text-[#ffffff] hover:bg-[#22c55e] }
input { bg-[#f0f0f0] text-[#111111] w-full }
</style>
<script src="logic.lua" />
</head>
<body>
<h1>📝 My Task Manager</h1>
<p>Keep track of your to-do list</p>
<!-- Task List -->
<div style="flex flex-col gap-2 w-64 bg-[#f8fafc] items-center justify-center">
<span style="flex justify-between items-center bg-[#e2e8f0] w-full h-8">
<span>✅ Finish homework</span>
<button>Delete</button>
</span>
<span style="flex justify-between items-center bg-[#e2e8f0] w-full h-8">
<span>✍️ Write blog post</span>
<button>Delete</button>
</span>
<span style="flex justify-between items-center bg-[#e2e8f0] w-full h-8">
<span>💪 Gym workout</span>
<button>Delete</button>
</span>
</div>
<separator direction="horizontal" />
<!-- Add Task Form -->
<h2 style="text-center">Add a New Task</h2>
<form action="/add-task" method="POST" style="flex flex-col gap-2 items-center justify-center w-xl">
<input type="text" placeholder="Enter text..." />
<input type="password" placeholder="Enter password..." />
<input type="date" />
<input type="color" />
<input type="number" min="0" max="100" />
<input type="range" min="0" max="100" />
<input type="checkbox" />
<input type="radio" name="test" />
<input type="file" />
<button type="submit">Add Task</button>
</form>
<separator direction="horizontal" />
<!-- Categories Section -->
<h2 style="text-center">Task Categories</h2>
<div style="flex flex-row gap-2 justify-center items-center w-64">
<span style="bg-[#fef3c7] w-32 h-8 flex items-center justify-center">📚 Study</span>
<span style="bg-[#d1fae5] w-32 h-8 flex items-center justify-center">💼 Work</span>
<span style="bg-[#e0e7ff] w-32 h-8 flex items-center justify-center">🏋️ Health</span>
</div>
</body>
""".to_utf8_buffer()