Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==========================================================app.py==========================================================
- from flask import Flask, render_template, request, session, make_response, redirect, jsonify
- app = Flask(__name__)
- @app.route('/')
- def index():
- return render_template("home.html")
- if __name__ == '__main__':
- import os
- HOST = os.environ.get('SERVER_HOST', 'localhost')
- try:
- PORT = int(os.environ.get('SERVER_PORT', '5555'))
- except ValueError:
- PORT = 5555
- app.run(HOST, PORT, debug=True)
- ==========================================================home.html==========================================================
- <!DOCTYPE html>
- <html>
- <head>
- <title>Social APP</title>
- <!-- Bootstrap CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- <!-- add Font Awesome --->
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
- <link rel="stylesheet" type="text/css" href="/static/style.css">
- </head>
- <body>
- <header class="site-header">
- <nav class="navbar navbar-expand-md navbar-dark bg-steel fixed-top">
- <div class="container">
- <a class="navbar-brand mr-4" href="/">Socially</a>
- <div class="navbar-nav mr-auto">
- <a class="nav-item nav-link" href="/">Home</a>
- </div>
- <!-- Navbar Right Side -->
- <div class="navbar-nav">
- <a href="#" class="notification">
- <span>Likes</span>
- <span class="badge"></span>
- </a>
- </div>
- </div>
- </nav>
- </header>
- <main role="main" class="container">
- <div class="row">
- <div class="col-md-8">
- <h1>"Socially" Web App.</h1>
- <i id="likeBtn" class="fa fa-thumbs-up"></i>
- </div>
- </div>
- </main>
- <!-- Optional JavaScript -->
- <!-- jQuery -->
- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
- </body>
- <script src="static/index.js"></script>
- </html>
- ==========================================================style.css====================================================================
- body {
- background: #f0f0f0;
- color: #333333;
- margin-top: 5rem;
- }
- h1, h2, h3, h4, h5, h6 {
- color: #444444;
- }
- .navbar {
- background-color: #ae5a24;
- }
- .navbar-brand {
- font-weight: bolder;
- }
- .site-header .navbar-nav .nav-link {
- color: white;
- }
- .site-header .navbar-nav .nav-link:hover {
- color: #00e1ff;
- }
- .site-header .navbar-nav .nav-link.active {
- font-weight: 500;
- }
- .notification {
- background-color: #555;
- color: white;
- text-decoration: none;
- padding: 5px 5px;
- position: relative;
- display: inline-block;
- border-radius: 50px;
- }
- .notification:hover {
- background: red;
- }
- .notification .badge {
- position: absolute;
- top: -10px;
- right: -10px;
- padding: 5px 10px;
- border-radius: 50%;
- background-color: red;
- color: white;
- }
- .fa {
- font-size: 100px;
- cursor: pointer;
- user-select: none;
- }
- .fa:hover {
- color: darkblue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement