Skip to content
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

Form with Flask by Anmol Jain #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed __pycache__/funcs.cpython-36.pyc
Binary file not shown.
36 changes: 12 additions & 24 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,17 @@

app = Flask(__name__)

# If not working
# windows (Run as Administrator)
# pip install flask
# linux
# sudo apt install python3-pip
# pip3 install flask
# else
# In terminal
# windows (Run as Administrator)
# python app.py
# linux or mac
# python3 app.py
@app.route('/', methods=["GET"])
def index():
return render_template('form.html')

@app.route('/<name>', methods=["GET"])
def index(name):
print(name)
return render_template('index.html', name=name)
@app.route('/thanks', methods=["POST"])
def thanks():
name = request.form['name']
email = request.form['email']
message = request.form['message']
print(name + ' | ' + email)
print(message)
return render_template('ok.html')

# http://localhost:2000/get?name=lol&section=b
@app.route('/get')
def get():
name = request.args['name']
section = request.args['section']
return name

app.run(port=2000)
app.run()
6 changes: 0 additions & 6 deletions funcs.py

This file was deleted.

72 changes: 0 additions & 72 deletions prac.py

This file was deleted.

Binary file added static/fonts/poppins/Poppins-Black.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-BlackItalic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-Bold.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-BoldItalic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-ExtraBold.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-ExtraBoldItalic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-ExtraLight.ttf
Binary file not shown.
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-Italic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-Light.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-LightItalic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-Medium.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-MediumItalic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-Regular.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-SemiBold.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-SemiBoldItalic.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-Thin.ttf
Binary file not shown.
Binary file added static/fonts/poppins/Poppins-ThinItalic.ttf
Binary file not shown.
148 changes: 148 additions & 0 deletions static/styles/mainpage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
@font-face {
font-family: Poppins-Regular;
src: url('../fonts/poppins/Poppins-Regular.ttf');
}

@font-face {
font-family: Poppins-Medium;
src: url('../fonts/poppins/Poppins-Medium.ttf');
}

@font-face {
font-family: Poppins-Bold;
src: url('../fonts/poppins/Poppins-Bold.ttf');
}

@font-face {
font-family: Poppins-SemiBold;
src: url('../fonts/poppins/Poppins-SemiBold.ttf');
}

* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}

body, html {
height: 100%;
font-family: Poppins-Regular, sans-serif;
}

input {
outline: none;
border: none;
}

textarea {
outline: none;
border: none;
}

textarea:focus, input:focus {
border-color: transparent !important;
}

button {
outline: none !important;
border: none;
background: transparent;
}

.main-container {
width: 100%;
min-height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 15px;
background: linear-gradient(45deg, #00dbde, #fc00ff);
}

.box {
width: 500px;
background: #fff;
border-radius: 10px;
overflow: hidden;
padding: 42px 55px 45px 55px;
}

.form-title {
display: block;
font-family: Poppins-Bold;
font-size: 39px;
color: #333333;
line-height: 1.2;
text-align: center;
padding-bottom: 44px;
}

.input-wrap {
width: 100%;
position: relative;
border-bottom: 2px solid #d9d9d9;
padding-bottom: 13px;
margin-bottom: 27px;
}

.input-label {
color: #666666;
line-height: 1.5;
padding-left: 5px;
}

.input {
display: block;
width: 100%;
background: transparent;
font-family: Poppins-Medium;
font-size: 18px;
color: #333333;
line-height: 1.2;
padding: 0 5px;
}

input.input {
height: 40px;
}


textarea.input {
min-height: 110px;
padding-top: 9px;
padding-bottom: 13px;
}

.button-wrap {
width: 100%;
display: block;
position: relative;
z-index: 1;
border-radius: 25px;
overflow: hidden;
margin: 0 auto;
}

.button-bg {
position: absolute;
z-index: -1;
width: 300%;
height: 100%;
background: #a64bf4;
top: 0;
left: -100%;
}

.form-button {
justify-content: center;
align-items: center;
padding: 0 20px;
width: 100%;
height: 50px;

font-family: Poppins-Medium;
font-size: 16px;
color: #fff;
line-height: 1.2;
}
43 changes: 43 additions & 0 deletions templates/form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ACE Form | DefinitelyNotAnmol</title>
<meta charset="UTF-8">
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/mainpage.css') }}">
</head>
<body>


<div class="main-container">
<div class="box">
<form class="form" action="{{ url_for('thanks') }}" method="POST">
<span class="form-title">
Wassssssup!
</span>

<div class="input-wrap" data-validate="Name is required">
<span class="input-label">Your Name</span>
<input class="input" type="text" name="name" placeholder="Enter your name">
</div>

<div class="input-wrap" data-validate = "Valid email is required: [email protected]">
<span class="input-label">Email</span>
<input class="input" type="text" name="email" placeholder="Enter your email addess">
</div>

<div class="input-wrap" data-validate = "Message is required">
<span class="input-label">Message</span>
<textarea class="input" name="message" placeholder="Your message here..."></textarea>
</div>

<div class="button-wrap">
<div class="button-bg"></div>
<button class="form-button">
<span>Submit</span>
</button>
</div>
</form>
</div>
</div>
</body>
</html>
9 changes: 0 additions & 9 deletions templates/index.html

This file was deleted.

19 changes: 19 additions & 0 deletions templates/ok.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Arigatō</title>
<meta charset="UTF-8">
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/mainpage.css') }}">
</head>
<body>


<div class="main-container">
<div class="box">
<span class="form-title">
Muchas Gracias
</span>
</div>
</div>
</body>
</html>