feat: Replace Bulma with Tailwind CSS in submit.html
This commit is contained in:
1 parent
050b92896c
commit
d9ec5267d9
1 file changed
+93
-127
+93
-127
@@ -1,164 +1,130 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="en" class="bg-bg-light">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="node_modules/bulma/css/bulma.min.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>Submit - Behind the Desk</title>
|
||||
<style>
|
||||
/* Add specific styles for submit page if needed */
|
||||
.submit-container {
|
||||
max-width: 450px; /* Increased width for longer fields */
|
||||
margin-top: 2rem;
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
'primary': '#38315f',
|
||||
'primary-dark': '#2c264a',
|
||||
'bg-light': '#f8f9fa',
|
||||
'text-default': '#343a40',
|
||||
'text-title': '#212529',
|
||||
'text-muted': '#6c757d',
|
||||
'border-light': '#dee2e6',
|
||||
'link-hover': '#ff6600',
|
||||
'rules-bg': '#eef6f6',
|
||||
'navbar-bg': '#e5fa70',
|
||||
'navbar-border': '#cddb60'
|
||||
},
|
||||
spacing: {
|
||||
'navbar-height': '3.25rem'
|
||||
}
|
||||
.submit-container h2 {
|
||||
font-size: 1.2rem;
|
||||
margin-bottom: 1rem;
|
||||
color: #38315f; /* Updated text color */
|
||||
},
|
||||
fontFamily: {
|
||||
'sans': ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', 'Helvetica', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"']
|
||||
}
|
||||
.submit-container .field {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.submit-container .label {
|
||||
font-size: 0.9rem;
|
||||
font-weight: normal;
|
||||
color: #38315f; /* Updated text color */
|
||||
margin-bottom: 0.25rem;
|
||||
display: inline-block; /* HN style labels */
|
||||
width: 100px; /* Align inputs */
|
||||
}
|
||||
.submit-container .input,
|
||||
.submit-container .textarea,
|
||||
.submit-container .select select {
|
||||
font-size: 0.9rem;
|
||||
max-width: 250px; /* Increased max-width for longer fields */
|
||||
display: inline-block; /* Align with label */
|
||||
width: calc(100% - 110px); /* Adjust width */
|
||||
background-color: #ffffff; /* Ensure white background */
|
||||
color: #363636; /* Default input text color */
|
||||
border: 1px solid #dbdbdb; /* Standard Bulma border */
|
||||
}
|
||||
.submit-container .input:focus,
|
||||
.submit-container .textarea:focus,
|
||||
.submit-container .select select:focus {
|
||||
border-color: #38315f; /* Highlight focus */
|
||||
box-shadow: 0 0 0 0.125em rgba(56, 49, 95, 0.25);
|
||||
}
|
||||
.submit-container .button.is-primary { /* Target the specific button */
|
||||
font-size: 0.9rem;
|
||||
margin-left: auto; /* Align button to the right */
|
||||
margin-top: 0.5rem;
|
||||
background-color: #38315f; /* Updated button color */
|
||||
color: #ffffff; /* White text for contrast */
|
||||
border-color: transparent; /* Remove default border */
|
||||
}
|
||||
.submit-container .button.is-primary:hover {
|
||||
background-color: #2d274a; /* Slightly darker on hover */
|
||||
}
|
||||
.submit-container .select {
|
||||
margin-left: auto; /* Align dropdown to the right */
|
||||
}
|
||||
</style>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item has-text-weight-bold" href="/">
|
||||
<body class="font-sans text-text-default pt-navbar-height">
|
||||
<nav class="fixed top-0 left-0 right-0 bg-navbar-bg border-b border-navbar-border z-10" role="navigation" aria-label="main navigation">
|
||||
<div class="max-w-screen-lg mx-auto px-4">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex">
|
||||
<a class="py-4 px-3 font-bold text-primary" href="/">
|
||||
Behind the Desk
|
||||
</a>
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div id="navbarBasicExample" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/">
|
||||
top 🔥
|
||||
</a>
|
||||
<a class="navbar-item" href="#">
|
||||
new
|
||||
</a>
|
||||
<a class="navbar-item" href="#">
|
||||
nearby
|
||||
</a>
|
||||
<a class="navbar-item" href="#">
|
||||
past
|
||||
</a>
|
||||
<a class="navbar-item" href="#">
|
||||
ask
|
||||
</a>
|
||||
<a class="navbar-item" href="#">
|
||||
show
|
||||
</a>
|
||||
<a class="navbar-item" href="#">
|
||||
submit
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<a href="/login.html">login</a>
|
||||
<div class="hidden md:flex">
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="/">top 🔥</a>
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">new</a>
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">nearby</a>
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">past</a>
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">ask</a>
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">show</a>
|
||||
<a class="py-4 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="py-4 px-3">
|
||||
<a href="/login.html" class="text-primary hover:bg-opacity-5 hover:bg-primary">login</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md:hidden flex items-center">
|
||||
<button id="menuButton" class="text-primary p-3" aria-label="menu" aria-expanded="false">
|
||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mobileMenu" class="hidden md:hidden">
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="/">top 🔥</a>
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">new</a>
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">nearby</a>
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">past</a>
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">ask</a>
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">show</a>
|
||||
<a class="block py-2 px-3 text-primary hover:bg-opacity-5 hover:bg-primary" href="#">submit</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="section main-content">
|
||||
<div class="container submit-container">
|
||||
<h2>Submit a Post</h2>
|
||||
<main class="py-4 pb-16">
|
||||
<div class="max-w-md mx-auto px-4 mt-8">
|
||||
<div class="mb-8">
|
||||
<h2 class="text-lg mb-4 text-primary">Submit a Post</h2>
|
||||
<form>
|
||||
<div class="field">
|
||||
<label class="label" for="submit-title">Title:</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" id="submit-title" name="title" required>
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-medium mb-1" for="submit-title">Title:</label>
|
||||
<input class="w-full px-3 py-2 border border-gray-300 rounded" type="text" id="submit-title" name="title" required>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-medium mb-1" for="submit-body">Body:</label>
|
||||
<textarea class="w-full px-3 py-2 border border-gray-300 rounded" id="submit-body" name="body" required></textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="submit-body">Body:</label>
|
||||
<div class="control">
|
||||
<textarea class="textarea" id="submit-body" name="body" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="submit-category">Category:</label>
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select id="submit-category" name="category" required>
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-medium mb-1" for="submit-category">Category:</label>
|
||||
<select class="w-full px-3 py-2 border border-gray-300 rounded" id="submit-category" name="category" required>
|
||||
<option value="ask">Ask</option>
|
||||
<option value="show">Show</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<button class="button is-primary" type="submit">Submit</button>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<button class="px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark" type="submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Simple script to toggle mobile menu -->
|
||||
<footer class="bg-gray-200 py-8 px-6 text-text-muted">
|
||||
<div class="max-w-screen-lg mx-auto">
|
||||
<div class="mt-4 text-sm">
|
||||
<a href="#" class="text-text-muted mx-2 no-underline hover:underline">Privacy</a>
|
||||
<a href="#" class="text-text-muted mx-2 no-underline hover:underline">Terms</a>
|
||||
<a href="#" class="text-text-muted mx-2 no-underline hover:underline">Contact</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
|
||||
if ($navbarBurgers.length > 0) {
|
||||
$navbarBurgers.forEach( el => {
|
||||
el.addEventListener('click', () => {
|
||||
const target = el.dataset.target;
|
||||
const $target = document.getElementById(target);
|
||||
el.classList.toggle('is-active');
|
||||
$target.classList.toggle('is-active');
|
||||
const menuButton = document.getElementById('menuButton');
|
||||
const mobileMenu = document.getElementById('mobileMenu');
|
||||
|
||||
menuButton.addEventListener('click', () => {
|
||||
mobileMenu.classList.toggle('hidden');
|
||||
const expanded = menuButton.getAttribute('aria-expanded') === 'true';
|
||||
menuButton.setAttribute('aria-expanded', !expanded);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user