Repository navigation
Expand file tree
/
Copy pathforsale.html
More file actions
187 lines (184 loc) · 6.89 KB
/
Copy pathforsale.html
File metadata and controls
187 lines (184 loc) · 6.89 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com?plugins=forms,typography"></script>
<script src="https://unpkg.com/unlazy@0.11.3/dist/unlazy.with-hashing.iife.js" defer init></script>
<script type="text/javascript">
window.tailwind.config = {
darkMode: ['class'],
theme: {
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
},
}
}
}
</script>
<style type="text/tailwindcss">
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 142.1 76.2% 36.3%;
--primary-foreground: 355.7 100% 97.3%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 142.1 76.2% 36.3%;
}
.dark {
--background: 20 14.3% 4.1%;
--foreground: 0 0% 95%;
--popover: 0 0% 9%;
--popover-foreground: 0 0% 95%;
--card: 24 9.8% 10%;
--card-foreground: 0 0% 95%;
--primary: 142.1 70.6% 45.3%;
--primary-foreground: 144.9 80.4% 10%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 15%;
--muted-foreground: 240 5% 64.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 85.7% 97.3%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 142.4 71.8% 29.2%;
}
}
</style>
</head>
<body>
<div class="container mx-auto py-8 px-4">
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4">
<a href="jobs.html" class="bg-card p-4 rounded-lg text-card-foreground flex items-center justify-center">
<img src="https://placehold.co/50?text=Jobs" alt="Jobs" />
<span class="ml-2">Jobs</span>
</a>
<a href="gigs.html" class="bg-card p-4 rounded-lg text-card-foreground flex items-center justify-center">
<img src="https://placehold.co/50?text=Gigs" alt="Gigs" />
<span class="ml-2">Gigs</span>
</a>
<a href="forsale.html" class="bg-card p-4 rounded-lg text-card-foreground flex items-center justify-center">
<img src="https://placehold.co/50?text=For Sale" alt="For Sale" />
<span class="ml-2">For Sale</span>
</a>
<a href="trade.html" class="bg-card p-4 rounded-lg text-card-foreground flex items-center justify-center">
<img src="https://placehold.co/50?text=Trade" alt="Trade" />
<span class="ml-2">Trade</span>
</a>
<a href="#" class="bg-card p-4 rounded-lg text-card-foreground flex items-center justify-center">
<img src="https://placehold.co/50?text=Services" alt="Services" />
<span class="ml-2">Services</span>
</a>
<a href="community.html" class="bg-card p-4 rounded-lg text-card-foreground flex items-center justify-center">
<img src="https://placehold.co/50?text=Community" alt="Community" />
<span class="ml-2">Community</span>
</a>
</div>
<div class="mt-8 text-center">
<h2 class="text-xl font-bold mb-4">Sign In or Sign Up</h2>
<div class="flex justify-center">
<a href="#" class="bg-primary text-primary-foreground px-4 py-2 rounded-lg mr-4">Sign In</a>
<a href="#" class="bg-secondary text-secondary-foreground px-4 py-2 rounded-lg">Sign Up</a>
<a href="Feedback.html" class="bg-secondary text-secondary-foreground px-4 py-2 rounded-lg">Feedback</a>
</div>
</div>
</div>
<div class="container mx-auto py-8 px-4">
<h2 class="text-2xl font-bold mb-4">For Sale</h2>
<form id="postForm" class="mb-8">
<div class="flex flex-col md:flex-row md:items-center md:space-x-4">
<input type="text" id="itemTitle" placeholder="Item Title" class="bg-input text-foreground p-2 rounded-lg mb-4 md:mb-0" required />
<input type="text" id="itemDescription" placeholder="Item Description" class="bg-input text-foreground p-2 rounded-lg mb-4 md:mb-0" required />
<button type="submit" class="bg-primary text-primary-foreground px-4 py-2 rounded-lg">Post</button>
</div>
</form>
<div id="itemsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"></div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const postForm = document.getElementById('postForm');
const itemsContainer = document.getElementById('itemsContainer');
let items = [];
postForm.addEventListener('submit', (e) => {
e.preventDefault();
const title = document.getElementById('itemTitle').value;
const description = document.getElementById('itemDescription').value;
const id = Date.now();
const item = { id, title, description, user: 'currentUser' };
items.push(item);
renderItems();
postForm.reset();
});
const renderItems = () => {
itemsContainer.innerHTML = '';
items.forEach(item => {
const itemElement = document.createElement('div');
itemElement.classList.add('bg-card', 'p-4', 'rounded-lg', 'text-card-foreground', 'flex', 'flex-col', 'justify-between');
itemElement.innerHTML = `
<div>
<h3 class="text-lg font-bold">${item.title}</h3>
<p>${item.description}</p>
</div>
${item.user === 'currentUser' ? `<button class="bg-destructive text-destructive-foreground px-4 py-2 rounded-lg mt-4" onclick="deleteItem(${item.id})">Delete</button>` : ''}
`;
itemsContainer.appendChild(itemElement);
});
};
window.deleteItem = (id) => {
items = items.filter(item => item.id !== id);
renderItems();
};
});
</script>
</body>
</html>