|
1 |
| -import React from 'react'; |
| 1 | +import React, { useState} from 'react'; |
2 | 2 | import { Link } from 'react-router-dom';
|
3 | 3 | //import "assets/css/Login.css";
|
4 | 4 |
|
5 | 5 | export default function LoginP() {
|
6 |
| - function ButtonLink({ to, children }) { |
7 |
| - return <Link to={to}> |
8 |
| - <button className="btn btn-primary btn-block">{children} |
9 |
| - </button> |
10 |
| - </Link>; |
11 |
| - } |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + function handleLoginClick() { |
| 10 | + const halfCircleButtons = document.querySelectorAll('.half-circle-button'); |
| 11 | + const login = document.getElementById('plog') |
| 12 | + const logo = document.getElementById('logo') |
| 13 | + const logoCaption = document.querySelector('.landing-page-logo-caption') |
| 14 | + console.log("HELLO") |
| 15 | + console.log(halfCircleButtons) |
| 16 | + login.style.transition = "opacity 0.5s ease-in-out" |
| 17 | + login.style.opacity = '0'; |
| 18 | + halfCircleButtons.forEach(button => { |
| 19 | + button.style.opacity = '0.8'; |
| 20 | + }); |
| 21 | + // wait 0.5s for fade in and then sent tranzition back to width |
| 22 | + setTimeout(() => { |
| 23 | + login.style.display = 'none'; |
| 24 | + halfCircleButtons.forEach(button => { |
| 25 | + button.style.transition = 'width 0.3s ease'; |
| 26 | + }); |
| 27 | + logo.classList.add('expand'); |
| 28 | + logoCaption.style.transform = 'translate(0%, 220%)'; |
| 29 | + |
| 30 | + } , 500); |
| 31 | + setTimeout(() => { |
| 32 | + logoCaption.style.opacity = '1'; |
| 33 | + }, 1500); |
| 34 | + } |
| 35 | + |
12 | 36 | return (
|
13 |
| - <div className="container mt-5" style={{ backgroundColor: '#E0F1EF' }}> |
| 37 | + <div id="plog" className="container mt-5" style={{ backgroundColor: '#FFF' }}> |
14 | 38 | <div className="row justify-content-center">
|
15 | 39 | <div className="col-md-6">
|
16 | 40 | <div className="card">
|
@@ -39,12 +63,19 @@ export default function LoginP() {
|
39 | 63 | />
|
40 | 64 | </div>
|
41 | 65 | <div className="form-group">
|
42 |
| - <ButtonLink to="/Chatbot">Login</ButtonLink> |
| 66 | + <button |
| 67 | + type="button" |
| 68 | + className="btn btn-primary" |
| 69 | + id="loginButton" |
| 70 | + onClick={handleLoginClick} |
| 71 | + > |
| 72 | + Login |
| 73 | + </button> |
43 | 74 | </div>
|
44 | 75 | </form>
|
45 | 76 | <footer className="mt-4">
|
46 | 77 | <p className="text-center">
|
47 |
| - First time? <Link to="/register">Create an account</Link>. |
| 78 | + First time? <a>Create an account</a>. |
48 | 79 | </p>
|
49 | 80 | <p className="text-center">
|
50 | 81 | <Link to="/">Back to Homepage</Link>.
|
|
0 commit comments