Skip to content

Commit

Permalink
JA: homepage commit 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshandrews43 committed Dec 4, 2018
1 parent fd0cefc commit 371b3d0
Show file tree
Hide file tree
Showing 32 changed files with 418 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target/
*.class
*~

*.css.map
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 23 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# ucsb-cs56-anon-search-engine-2
# ucsb-cs56-anon-search-engine

# FALL 2018


Members:

Joshua Andrews, joshandrews43

Kevin Mata, Mata17

Michael Zhou, MichaelZyh

Kevin Villanueva, VillanuevaK

Thomas Parker, tparker48

Kyle Stanfield, kylejstanfield

Matt Moss, matthewmoss

Summary:
A web app that allows users to interact with well known search engines anonymously, which maintains their privacy and prevents search engines from collecting their data.
1 change: 1 addition & 0 deletions images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Images go in this folder
Binary file added images/localhost_8080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.springframework</groupId>
<artifactId>gs-spring-boot</artifactId>
<version>0.1.0</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
</dependencies>

<properties>
<java.version>1.8</java.version>
</properties>


<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>2.0.3</version>
<configuration>
<jdkVersion>1.8</jdkVersion>
<!-- Use your own application name -->
<!-- at Heroku CLI, use heroku apps to list, or use Heroku Dashboard -->
<appName>ucsb-cs56-f18-anonsearchengine</appName>
<processTypes>
<!-- Tell Heroku how to launch your application -->
<!-- You might have to remove the ./ in front -->
<web>java $JAVA_OPTS -jar target/gs-spring-boot-0.1.0.jar edu.ucsb.cs56.pconrad.springboot.HelloController --server.port=$PORT</web>

</processTypes>
</configuration>
</plugin>
</plugins>
</build>

</project>
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/main/.DS_Store
Binary file not shown.
Binary file added src/main/java/.DS_Store
Binary file not shown.
Binary file added src/main/java/edu/.DS_Store
Binary file not shown.
Binary file added src/main/java/edu/ucsb/.DS_Store
Binary file not shown.
Binary file added src/main/java/edu/ucsb/cs56/.DS_Store
Binary file not shown.
Binary file added src/main/java/edu/ucsb/cs56/pconrad/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package edu.ucsb.cs56.pconrad.springboot.hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package edu.ucsb.cs56.pconrad.springboot.hello;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HelloController {

@RequestMapping("/")
public String index() {
return "index";
}

@RequestMapping("/search")
public String page1() {
return "search";
}

@RequestMapping("/chooseSearchEngines")
public String page2() {
return "chooseSearchEngines";
}

@RequestMapping("/page3")
public String page3() {
return "page3";
}


}
Binary file added src/main/resources/.DS_Store
Binary file not shown.
Binary file added src/main/resources/static/.DS_Store
Binary file not shown.
Binary file added src/main/resources/static/assets/.DS_Store
Binary file not shown.
Binary file added src/main/resources/static/assets/bing_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/static/assets/ddg_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/static/assets/google_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions src/main/resources/static/css/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions src/main/resources/static/css/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.flex-column {
display: flex;
flex-direction: column;
}

.flex-row {
display: flex;
flex-direction: row;
}

.flex-center {
display: flex;
justify-content: center;
align-items: center;
}

.clickable {
cursor: pointer;
}

#title-text {
align-items: center;
margin-top: 40px;
margin-bottom: 200px;
}

#search-section {
margin-bottom: 100px;
display: flex;
justify-content: center;

#searchbar {
width: 33%;
height: 46px;
display: flex;
align-items: center;
padding: 0 10px 0 10px;
border-radius: 5px;
outline: 0;
margin-right: 20px;
}

#search-button {
border-radius: 5px;
width: 100px;
background-color: lightgray;
}
}

.selected {
border: 3px solid blue;
}

#engine-buttons {
justify-content: space-around;

.logo-container {
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
padding: 3px;

.logo {
max-width: 150px;
max-height: 150px;
}
}

}
38 changes: 38 additions & 0 deletions src/main/resources/static/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//index.js

$(document).ready(function() {
$('.logo-container').click(function(event) {
$('.selected').removeClass("selected");
$(this).addClass("selected");
});

$('#searchbar').keypress(function(e){
if(e.which == 13){ //Enter key pressed
performSearch();
}
});

$('#search-button').on('click', performSearch);
});



function performSearch() {
console.log("Performing Search:");
const engine = getEngineType();
const query = document.getElementById('searchbar').value;


//make backend call here.
}

function getEngineType() {
const engine = $('.selected').attr('id');

if (engine == "duckduckgo-search-button")
return "DuckDuckGo";
else if (engine == "google-search-button")
return "Google";
else
return "Bing";
}
18 changes: 18 additions & 0 deletions src/main/resources/templates/chooseSearchEngines.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Choose Search Engines</title>
<#include "head.ftl" />
</head>
<body>
<#include "navbar.ftl" />
<h1>Choose your search engines:</h1>
<h5>Below, the user will be able to check the following search engines as check boxes, and then when they use the search feature,
only the selected search engines will be used.</h5>
<p>Google</p>
<br />
<p>Bing</p>
<br />
<p>Yahoo</p>
</body>
</html>
19 changes: 19 additions & 0 deletions src/main/resources/templates/head.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">

<link rel="stylesheet" href="/css/index.css" />

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- Import JS for index.ftl -->
<script src="/js/index.js"></script>

<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
24 changes: 24 additions & 0 deletions src/main/resources/templates/index.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Anonymous Searcher!</title>
<#include "head.ftl" />
</head>
<body>
<div class="body-container">
<div id="title-text" class="flex-column">
<h1 id="title">Anonymous Search Engine</h1>
<h5 id="subtitle">Search the web anonymously by making the network requests through a third party that obscures your requests.</h5>
</div>
<div id="search-section" class="flex-row">
<input type="text" id="searchbar" placeholder="Enter Search Here"></input>
<button id="search-button">Search</button>
</div>
<div id="engine-buttons" class="flex-row">
<div id="google-search-button" class="logo-container clickable selected"><img class="logo" src="/assets/google_logo.png"></div>
<div id="duckduckgo-search-button" class="logo-container clickable"><img class="logo" src="/assets/ddg_logo.png"></div>
<div id="bing-search-button" class="logo-container clickable"><img class="logo" src="/assets/bing_logo.png"></div>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 371b3d0

Please sign in to comment.