-
Notifications
You must be signed in to change notification settings - Fork 20
Feature/week2 frontend/will #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MRW6217
wants to merge
2
commits into
distinctioncoding:main
Choose a base branch
from
MRW6217:feature/week2-frontend/will
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Document</title> | ||
| <script src="https://cdn.tailwindcss.com"></script> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div class="bg-image sm"> | ||
| <img src="bgi.png" alt="" /> | ||
| <!--覆盖层--> | ||
| <div | ||
| class="cover flex flex-col md:flex-row items-center justify-center gap-6 md:gap-10 p-4 md:p-8" | ||
| > | ||
| <div | ||
| class="left-section max-w-[500px] md:mr-[70px] md:mb-20 mb-6 px-2 md:px-0" | ||
| > | ||
| <h1 class="font-bold">Welcome to Paint Quote System</h1> | ||
| <p class="whitespace-normal text-[17px]"> | ||
| Consequat adipisicing ea do labore irrure adipisicing<br> occaecat | ||
| cupidatat excepteur duis mo | ||
| </p> | ||
| </div> | ||
| <div class="max-w-[150px]"></div> | ||
| <div class="right-section w-full max-w-[500px] md:mr-[100px]"> | ||
| <h1>Sign Up</h1> | ||
| <p>Enter details to create your account</p> | ||
| <div class="input-group"> | ||
| <label for="name">Your name</label> | ||
| <input type="text" id="name" placeholder="Enter your name" /> | ||
| </div> | ||
| <div class="input-group"> | ||
| <label for="phone">Phone number</label> | ||
| <input | ||
| type="text" | ||
| id="phone" | ||
| placeholder="Enter your phone number" | ||
| /> | ||
| </div> | ||
| <div class="input-group"> | ||
| <label for="dulux">Dulux account</label> | ||
| <input | ||
| type="text" | ||
| id="dulux" | ||
| placeholder="Enter your Dulux account" | ||
| /> | ||
| </div> | ||
| <div id="btn-group"> | ||
| <button>Sign up</button> | ||
| </div> | ||
| <div id="sign-in"> | ||
| <p>Already have an account?<a href="" id="sign-in-link">Sign in</a></p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </body> | ||
|
|
||
| <script src="index.js"></script> | ||
| </html> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try to use toast or put the error message near the input fields, should not use window.alert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| document.querySelector("#btn-group").addEventListener("click", () => { | ||
| const name = document.querySelector("#name").value.trim(); | ||
| const phone = document.querySelector("#phone").value.trim(); | ||
| const dulux = document.querySelector("#dulux").value.trim(); | ||
|
|
||
|
|
||
| if (name === "") { | ||
| alert("Name is required"); | ||
| return; | ||
| } | ||
| if (phone === "") { | ||
| alert("Phone number is required"); | ||
| return; | ||
| } else if (!/^\d{10,11}$/.test(phone)) { | ||
| alert("Phone number is invalid"); | ||
| return; | ||
| } | ||
|
|
||
| if (dulux === "") { | ||
| alert("Dulux account is required"); | ||
| return; | ||
| } else if (!/^[a-zA-Z0-9]{5,15}$/.test(dulux)) { | ||
| alert("Dulux account is invalid"); | ||
| return; | ||
| } | ||
|
|
||
| alert("Form submitted successfully!"); | ||
| }); | ||
|
|
||
| document.querySelector("#sign-in-link").addEventListener("click", (e) => { | ||
| e.preventDefault(); | ||
| alert("Redirecting to sign in page..."); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| * { | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| html, | ||
| body { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .bg-image { | ||
| position: relative; | ||
| display: inline-block; | ||
| height: 100%; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .bg-image img { | ||
| width: 100%; | ||
| display: block; | ||
| height: 100% | ||
| } | ||
|
|
||
| .cover { | ||
| font-family: "Inter", sans-serif; | ||
| position: absolute; | ||
| top: 0; | ||
| left: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .left-section h1 { | ||
| color: rgb(9, 64, 90); | ||
| font-size: 25px; | ||
| } | ||
|
|
||
| .left-section h1::after { | ||
| content: ""; | ||
| display: block; | ||
| width: 400px; | ||
| height: 2px; | ||
| background-color: rgb(9, 64, 90); | ||
| margin-top: 8px; | ||
| border-radius: 2px; | ||
| } | ||
|
|
||
| .left-section p { | ||
| color: rgb(9, 64, 90); | ||
| font-size: 15px; | ||
| margin-top: 20px; | ||
| } | ||
|
|
||
| .right-section { | ||
| background-color: rgba(255, 255, 255, 0.877); | ||
| height: 470px; | ||
| border-radius: 12px; | ||
| border: none; | ||
| box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); | ||
| } | ||
|
|
||
| .right-section h1 { | ||
| color: #4c4c4c; | ||
| text-align: center; | ||
| margin-bottom: 5px; | ||
| font-size: 28px; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .right-section p { | ||
| color: #7e7e7e; | ||
| text-align: center; | ||
| margin-top: auto; | ||
| margin-bottom: 25px; | ||
| font-size: 15px; | ||
| } | ||
|
|
||
| .input-group { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .input-group label { | ||
| margin-bottom: 6px; | ||
| font-size: 17px; | ||
| align-self: flex-start; | ||
| margin-left: 7.5%; | ||
| color: #7e7e7e; | ||
| } | ||
|
|
||
| .input-group input { | ||
| height: 40px; | ||
| width: 80%; | ||
| padding: 0 12px; | ||
| font-size: 15px; | ||
| border: 2px solid #dfdede; | ||
| border-radius: 6px; | ||
| outline: none; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| #btn-group { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| } | ||
|
|
||
| #btn-group button { | ||
| width: 85.5%; | ||
| display: block; | ||
| margin: 0 auto; | ||
| height: 45px; | ||
| background: rgb(27, 106, 175); | ||
| color: white; | ||
| border: none; | ||
| border-radius: 6px; | ||
| font-size: 16px; | ||
| margin-bottom: 20px; | ||
| } | ||
| #btn-group button:hover { | ||
| background-color: rgb(11, 83, 137); | ||
| } | ||
|
|
||
| #sign-in { | ||
| text-align: center; | ||
| font-size: 16px; | ||
| font-weight: 400; | ||
| margin-bottom: 20px; | ||
| } | ||
| #sign-in p { | ||
| margin: 0; | ||
| color: #7e7e7e; | ||
| } | ||
|
|
||
| #sign-in a { | ||
| color: rgb(100, 117, 225); | ||
| text-decoration-line: none; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input fields缺少表单包裹