Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ABÖYT
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" type="text/css" href="css/css.css">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script>
- // Checking the cookie
- $(document).ready(function () {
- <%
- boolean valid = true;
- String userName = null;
- Cookie[] cookies = request.getCookies();
- if (cookies != null) {
- for (Cookie cookie : cookies) {
- if (cookie.getName().equals("user")) {
- userName = cookie.getValue();
- }
- }
- }
- if (userName == null) {
- valid = false;
- }
- %>
- // If you are logged in, you will see the buttons to navigate the page
- var show = <%= valid%>;
- if (show) {
- document.getElementById("edit").style.display = "block";
- document.getElementById("user").style.display = "block";
- document.getElementById("logout").style.display = "block";
- document.getElementById("landing").style.display = "none";
- console.log(show);
- } else {
- document.getElementById("edit").style.display = "none";
- document.getElementById("user").style.display = "none";
- document.getElementById("logout").style.display = "none";
- document.getElementById("landing").style.display = "block";
- console.log(show);
- }
- });
- </script>
- <title>NotMalware</title>
- </head>
- <body>
- <div id="header">
- <img src="css/img/logo.png" alt="Masterful design" id="logo">
- <form action="LogoutServlet" method="post">
- <input type="submit" role="button" value="Logout" id="logout" class="form-control btn btn-info note-input">
- </form>
- <a href="EditProfile.jsp" id="edit" role="button" class="form-control btn btn-info note-input" >Edit profile</a>
- <a href="AboutUs.jsp" id="about" role="button" type="button" class="form-control btn btn-info note-input" >About us</a>
- <a href="User.jsp" id="user" role="button" class="form-control btn btn-info note-input" >User</a>
- <a href="Landing.jsp" id="landing" role="button" class="form-control btn btn-info note-input" >Home</a>
- <br style="clear: both;" />
- </div>
- <div id="mainaboutus">
- <h2>Welcome to The Factory!</h2>
- <p id="abouttext1">
- This is the official page for Freddie’s Fish Nugget Factory. We have been the leading fish nugget supplier for Sodexo restaurants since our foundation in 1966. Our factory works day and night to provide you with top quality nuggets. Bon appétit!
- </p>
- <p id="abouttext2">
- <br><br><q>Best nuggets I have ever eaten!</q><br>-Made up person
- </div>
- <div id="footer">
- <p>Copyrights © NotMalware</p>
- </div>
- </body>
- </html>
- ----------------------------------------------------------
- LÄNDING
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" type="text/css" href="css/css.css">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script>
- function validate() {
- var user = document.getElementById("fuser").value;
- var pass = document.getElementById("fpass").value;
- if (user.length <= 0 || pass.length <= 0) {
- alert("Fill up the form");
- return false;
- }
- return true;
- }
- </script>
- <script>
- $(document).ready(function () {
- // Get the modal
- var modal = document.getElementById('loginmodal');
- // Get the <span> element that closes the modal
- var span = document.getElementsByClassName("close")[0];
- // When the user clicks on <span> (x), close the modal
- span.onclick = function () {
- modal.style.display = "none";
- };
- // When the user clicks anywhere outside of the modal, close it
- window.onclick = function (event) {
- if (event.target === modal) {
- modal.style.display = "none";
- }
- };
- $("button[name='openloginmodal']").click(function () {
- modal.style.display = "block";
- });
- });
- </script>
- <title>NotMalware</title>
- </head>
- <body>
- <div id="header">
- <img src="css/img/logo.png" alt="Masterful design" id="logo">
- <img src="css/img/NuggetLogo.png" id="logofreddies">
- <a href="AboutUs.jsp" id="about" role="button" type="button" class="form-control btn btn-info note-input" >About us</a>
- <br style="clear: both;" />
- </div>
- <div id="mascotdiv">
- <img src="css/img/mascotfish.png" alt="Masterful mascot" id="mascot">
- </div>
- <div style="text-align: center; margin-left:40%; margin-top: 5%; position: fixed">
- <button name="openloginmodal" class="form-control btn btn-info" style="width:160px;">Log in</button>
- <div id="loginmodal" class="modal">
- <div class="modal-content">
- <span class="close">×</span>
- <form role="form" method="post" class="login-form" action="LoginServlet" onsubmit="return validate()">
- <div class="form-group">
- <label class="sr-only" for="username">Username</label>
- <input type="text" name="username" placeholder="Username..." class="form-username" id="fuser">
- </div>
- <div class="form-group">
- <label class="sr-only" for="password">Password</label>
- <input type="password" name="password" placeholder="Password..." class="form-password" id="fpass">
- </div>
- <button type="submit" value="Login" class="form-control btn btn-info note-input" style="width:160px;">Log in</button>
- </form>
- </div>
- </div>
- <form action="/NotMalware/SignIn.jsp" style="margin-top: 10px">
- <button type="submit" class="form-control btn btn-info" style="width:160px;">Sign up</button>
- </form>
- </div>
- <div id="footer">
- <p>Copyrights © NotMalware</p>
- </div>
- </body>
- </html>
- ---------------------------------------------------------------
- CSS
- #mascot {
- margin-top: 5px;
- height: 70px;
- opacity: 0.35;
- }
- #mascotdiv {
- margin-top: 15%;
- width: 32%;
- margin-left: 40%;
- padding-top: 20px;
- }
- #logofreddies {
- margin-top: 5px;
- margin-left: 30%;
- width:220px;
- height:70px;
- opacity: 0.5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement