Skip to content

Commit

Permalink
Implemented Tailwind to add forms, updated GeoJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobby Steckline committed Feb 29, 2024
1 parent 29c70b4 commit be13c53
Show file tree
Hide file tree
Showing 8 changed files with 393 additions and 56 deletions.
20 changes: 10 additions & 10 deletions src/components/CreateAcctForm/CreateAcctForm.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 5rem;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 0.9375rem;
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
padding: 2rem;
margin: 5rem auto 2rem;
width: 90%;
max-width: 25rem;
margin: 3rem auto;
width: calc(100% - 4rem);
max-width: 31.25rem;
font-family: "Abel", sans-serif;
gap: 1.25rem;
}
Expand All @@ -22,17 +21,18 @@ form {
width: 100%;
}


.acct-form-container h2 {
text-align: center;
color: #333;
font-family: "Satisfy", cursive;
font-size: 2rem;

}

.acct-form-container input {
border: 2px solid #82aa9f;
border-radius: 5px;
border: .125rem solid #82aa9f;
border-radius: 0.3125rem;
padding: 0.625rem;
font-size: 1rem;
color: #333;
Expand All @@ -45,11 +45,11 @@ form {
}

.acct-form-container button {
background-color: #82aa9f;
background: #82aa9f;
color: white;
padding: 0.625rem 1.25rem;
border: none;
border-radius: 5px;
border-radius: 3125rem;
cursor: pointer;
transition: background-color 0.5s ease;
width: 100%;
Expand All @@ -64,6 +64,6 @@ form {
@media screen and (min-width: 750px) {
.acct-form-container {
width: 80%;
max-width: 500px;
max-width: 31.25rem;
}
}
70 changes: 41 additions & 29 deletions src/components/CreateAcctForm/CreateAcctForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from "react";
import { NewUser } from "../../apiTypes";
import { useNavigate } from "react-router-dom";
import "./CreateAcctForm.css";

function CreateAcctForm() {
const navigate = useNavigate();
Expand All @@ -22,34 +21,47 @@ function CreateAcctForm() {
};

return (
<div className="acct-form-container">
<h2>Create Account</h2>
<form onSubmit={handleSubmit}>
<input
type="text"
name="name"
placeholder="Name"
value={formData.name}
onChange={handleChange}
required
/>
<input
type="email"
name="email"
placeholder="Email"
value={formData.email}
onChange={handleChange}
required
/>
<input
type="password"
name="password"
placeholder="Password"
value={formData.password}
onChange={handleChange}
required
/>
<button type="submit">Submit</button>
<div className="flex flex-col items-center justify-center bg-white bg-opacity-80 shadow rounded-lg p-8 my-20 mx-auto w-9/12 max-w-2xl lg:w-8/12 lg:max-w-5xl gap-5 font-satisfy">
<h2 className="text-2xl text-center">Create Account</h2>
<form
onSubmit={handleSubmit}
className="flex flex-col items-center justify-center gap-1 w-full"
>
<div className="container mx-auto px-4 item-center">
<input
type="text"
name="name"
placeholder="Name"
className="border-2 border-green rounded px-2.5 py-1.5 text-xl text-gray-800 w-full mb-4"
value={formData.name}
onChange={handleChange}
required
/>
<input
type="email"
name="email"
placeholder="Email"
className="border-2 border-green rounded px-2.5 py-1.5 text-xl text-gray-800 w-full mb-4"
value={formData.email}
onChange={handleChange}
required
/>
<input
type="password"
name="password"
className="border-2 border-green rounded px-2.5 py-1.5 text-xl text-gray-800 w-full mb-4"
placeholder="Password"
value={formData.password}
onChange={handleChange}
required
/>
</div>
<button
type="submit"
className="bg-green rounded text-xl text-black px-5 py-2.5 transition-colors duration-500 ease-in-out hover:text-white"
>
Submit
</button>
</form>
</div>
);
Expand Down
17 changes: 10 additions & 7 deletions src/components/LoginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ function LoginForm() {
};

return (
<div className="login-form-container">
<h2>Login</h2>
<form onSubmit={handleSubmit}>
<div className="flex flex-col items-center justify-center bg-white bg-opacity-80 shadow rounded-lg p-8 my-20 mx-auto w-9/12 max-w-xl lg:w-8/12 lg:max-w-5xl gap-5 font-satisfy">
<h2 className="text-3xl text-center">Login</h2>
<form onSubmit={handleSubmit} className="flex flex-col items-center justify-center gap-1 w-full">
<div className="container mx-auto px-4 item-center">
<input
type="email"
name="email"
placeholder="Email"
className="border-2 border-green rounded px-2.5 py-1.5 text-xl text-gray-800 w-full mb-4"
value={credentials.email}
onChange={handleChange}
required
Expand All @@ -37,16 +39,17 @@ function LoginForm() {
type="password"
name="password"
placeholder="Password"
className="border-2 border-green rounded px-2.5 py-1.5 text-xl text-gray-800 w-full mb-4"
value={credentials.password}
onChange={handleChange}
required
/>
<button type="submit">Submit</button>

</div>
<button type="submit" className="bg-green rounded text-xl text-black w-7/12 px-5 py-2.5 transition-colors duration-500 ease-in-out mb-4 hover:text-white">Submit</button>
<button
type="button"
type="submit"
onClick={() => navigate("/create-account")}
className="sign-up-button"
className="bg-green rounded text-xl text-black px-5 py-2.5 transition-colors duration-500 ease-in-out hover:text-white"
>
New user? Sign up here
</button>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Main/Main.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body, html {
height: 90%;
width: 90%;
align-items: center;
margin-top: -2rem;
margin-top: 3rem;
}

.error-message {
Expand All @@ -32,17 +32,17 @@ body, html {

@media screen and (min-width: 750px) and (max-width: 1024px ) and (orientation: portrait) {
.map-wrapper >h2 {
font-size: xx-large;
font-size: 2rem;
}
}

/* LARGE BREAKPOINT */
@media screen and (min-width: 1025px) {
.map-wrapper {
padding-top: 5rem;
padding-top: 2rem;
}

.map-wrapper >h2 {
font-size: xx-large;
font-size: 2rem;
}
}
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

.navbar a:hover {
text-decoration: underline;
color: #f0a202
color: #ffffff
}

/* RESETTING THE NAV ORIENTATION */
Expand Down
309 changes: 307 additions & 2 deletions src/data/countries.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@import url('https://fonts.googleapis.com/css2?family=Abel&family=Satisfy&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

* {
margin: 0;
padding: 0;
Expand Down
17 changes: 14 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js,jsx,ts,tsx}"],
content: [
"./src/**/*.{html,js,jsx,ts,tsx}",
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
extend: {
fontFamily:{
satisfy:["Satisfy", "cursive"]
}
},
colors: {
green: "#82aa9f",
white: "#ffffff",
},
},
plugins: [],
};

0 comments on commit be13c53

Please sign in to comment.