init
BIN
webarena-homepage/__pycache__/app.cpython-311.pyc
Normal file
27
webarena-homepage/app.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from flask import Flask, render_template
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index() -> str:
|
||||
return render_template("index.html")
|
||||
|
||||
|
||||
@app.route("/scratchpad.html")
|
||||
def scratchpad() -> str:
|
||||
return render_template("scratchpad.html")
|
||||
|
||||
|
||||
@app.route("/calculator.html")
|
||||
def calculator() -> str:
|
||||
return render_template("calculator.html")
|
||||
|
||||
|
||||
@app.route("/password.html")
|
||||
def password() -> str:
|
||||
return render_template("password.html")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=4399)
|
||||
BIN
webarena-homepage/static/figures/calculator.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
webarena-homepage/static/figures/cms.png
Normal file
|
After Width: | Height: | Size: 382 KiB |
BIN
webarena-homepage/static/figures/gitlab.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
webarena-homepage/static/figures/manual1.png
Normal file
|
After Width: | Height: | Size: 174 KiB |
BIN
webarena-homepage/static/figures/manual2.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
BIN
webarena-homepage/static/figures/map.png
Normal file
|
After Width: | Height: | Size: 779 KiB |
BIN
webarena-homepage/static/figures/onestopshop.png
Normal file
|
After Width: | Height: | Size: 220 KiB |
BIN
webarena-homepage/static/figures/password.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
webarena-homepage/static/figures/reddit.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
webarena-homepage/static/figures/scratchpad.png
Normal file
|
After Width: | Height: | Size: 143 KiB |
BIN
webarena-homepage/static/figures/wikipedia.png
Normal file
|
After Width: | Height: | Size: 698 KiB |
109
webarena-homepage/templates/calculator.html
Normal file
@@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Calculator</title>
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
background-color: #f2f2f2;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
#calculator {
|
||||
border: 1px solid #333;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
width: 400px;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
}
|
||||
#calculator h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
align-self: center;
|
||||
}
|
||||
#calculator p {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
color: #666;
|
||||
align-self: center;
|
||||
}
|
||||
#inputExpression {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
font-size: 18px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ddd;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#result {
|
||||
margin-top: 20px;
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
width: 100%;
|
||||
align-self: center;
|
||||
}
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
margin-top: 10px;
|
||||
font-size: 18px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
align-self: flex-end;
|
||||
}
|
||||
#calculate {
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
}
|
||||
#clear {
|
||||
background-color: #f44336;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="calculator">
|
||||
<h1>Calculator</h1>
|
||||
<p>Enter the expression and get the results</p>
|
||||
<input type="text" id="inputExpression" placeholder="Enter expression" />
|
||||
<button id="calculate">=</button>
|
||||
<button id="clear">Clear</button>
|
||||
<div id="result">Result: <span id="calculationResult"></span></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('calculate').addEventListener('click', function() {
|
||||
try {
|
||||
const result = eval(document.getElementById('inputExpression').value);
|
||||
if (!isNaN(result)) {
|
||||
document.getElementById('calculationResult').textContent = result;
|
||||
} else {
|
||||
document.getElementById('calculationResult').textContent = 'Invalid expression';
|
||||
}
|
||||
} catch {
|
||||
document.getElementById('calculationResult').textContent = 'Invalid expression';
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('clear').addEventListener('click', function() {
|
||||
document.getElementById('inputExpression').value = '';
|
||||
document.getElementById('calculationResult').textContent = '';
|
||||
});
|
||||
|
||||
document.getElementById('inputExpression').addEventListener('keypress', function(e) {
|
||||
if (e.key === 'Enter') {
|
||||
document.getElementById('calculate').click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
157
webarena-homepage/templates/index.backup
Normal file
@@ -0,0 +1,157 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Homepage</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: white;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#header {
|
||||
background-color: #f4f7f9;
|
||||
color: #232f34;
|
||||
padding-top: 30px;
|
||||
min-height: 70px;
|
||||
border-bottom: #b1c1c6 3px solid;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
padding: 5px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
width: 200px; /* Changed width */
|
||||
height: 200px; /* Added height */
|
||||
text-align: center;
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
|
||||
display: inline-block;
|
||||
overflow: auto; /* To handle content that might overflow */
|
||||
}
|
||||
|
||||
.card img {
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.card p {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.card a {
|
||||
color: #35424a;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
<h1>Welcome to WebArena</h1>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="OneStopShop">
|
||||
<img src="{{ url_for('static', filename='figures/onestopshop.png') }}" alt="Logo for OneStopShop">
|
||||
<a href="SHOPPING_URL">
|
||||
<h2 id="appName">OneStopShop</h2>
|
||||
</a>
|
||||
<p id="appDescription">An online shopping site</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Merchant Admin Portal">
|
||||
<img src="{{ url_for('static', filename='figures/cms.png') }}" alt="Logo for CMS">
|
||||
<a href="SHOPPING_ADMIN_URL">
|
||||
<h2 id="appName">Merchant Admin Portal</h2>
|
||||
</a>
|
||||
<p id="appDescription">An admin portal to manage E-commerce business (u: admin, p: admin1234)</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Reddit">
|
||||
<img src="{{ url_for('static', filename='figures/reddit.png') }}" alt="Logo for Reddit">
|
||||
<a href="REDDIT_URL">
|
||||
<h2 id="appName">Reddit</h2>
|
||||
</a>
|
||||
<p id="appDescription">A social news aggregation and discussion website</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Gitlab">
|
||||
<img src="{{ url_for('static', filename='figures/gitlab.png') }}" alt="Logo for Gitlab">
|
||||
<a href="GITLAB_URL">
|
||||
<h2 id="appName">Gitlab</h2>
|
||||
</a>
|
||||
<p id="appDescription">a DevOps software</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Map">
|
||||
<img src="{{ url_for('static', filename='figures/map.png') }}" alt="Logo for Map">
|
||||
<a href="MAP_URL">
|
||||
<h2 id="appName">OpenStreetMap</h2>
|
||||
</a>
|
||||
<p id="appDescription">North east US map</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Calculator">
|
||||
<img src="{{ url_for('static', filename='figures/calculator.png') }}" alt="Logo for Calculator">
|
||||
<a href="calculator.html">
|
||||
<h2 id="appName">Calculator</h2>
|
||||
</a>
|
||||
<p id="appDescription">A calculator</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Scratchpad">
|
||||
<img src="{{ url_for('static', filename='figures/scratchpad.png') }}" alt="Logo for Scratchpad">
|
||||
<a href="scratchpad.html">
|
||||
<h2 id="appName">Scratchpad</h2>
|
||||
</a>
|
||||
<p id="appDescription">A scratchpad for taking notes</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Wikipedia">
|
||||
<img src="{{ url_for('static', filename='figures/wikipedia.png') }}" alt="Logo for Wikipedia">
|
||||
<a href="WIKIPEDIA_URL">
|
||||
<h2 id="appName">Wikipedia</h2>
|
||||
</a>
|
||||
<p id="appDescription">An online encyclopedia</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Gitlab Manual">
|
||||
<img src="{{ url_for('static', filename='figures/manual1.png') }}" alt="Logo for Gitlab Manual">
|
||||
<a href="https://docs.gitlab.com/">
|
||||
<h2 id="appName">Gitlab Documentation</h2>
|
||||
</a>
|
||||
<p id="appDescription">Documentation for GitLab</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Admin Manual">
|
||||
<img src="{{ url_for('static', filename='figures/manual2.png') }}" alt="Logo for Admin Manual">
|
||||
<a href="https://experienceleague.adobe.com/docs/commerce-admin/user-guides/home.html?lang=en">
|
||||
<h2 id="appName">Admin Portal Manual</h2>
|
||||
</a>
|
||||
<p id="appDescription">Manual on using the admin portal</p>
|
||||
</div>
|
||||
<!-- Repeat the above card structure for each app -->
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
157
webarena-homepage/templates/index.html
Normal file
@@ -0,0 +1,157 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Homepage</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: white;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#header {
|
||||
background-color: #f4f7f9;
|
||||
color: #232f34;
|
||||
padding-top: 30px;
|
||||
min-height: 70px;
|
||||
border-bottom: #b1c1c6 3px solid;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
padding: 5px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
width: 200px; /* Changed width */
|
||||
height: 200px; /* Added height */
|
||||
text-align: center;
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
|
||||
display: inline-block;
|
||||
overflow: auto; /* To handle content that might overflow */
|
||||
}
|
||||
|
||||
.card img {
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.card p {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.card a {
|
||||
color: #35424a;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
<h1>Welcome to WebArena</h1>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="OneStopShop">
|
||||
<img src="{{ url_for('static', filename='figures/onestopshop.png') }}" alt="Logo for OneStopShop">
|
||||
<a href="http://localhost:28082">
|
||||
<h2 id="appName">OneStopShop</h2>
|
||||
</a>
|
||||
<p id="appDescription">An online shopping site</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Merchant Admin Portal">
|
||||
<img src="{{ url_for('static', filename='figures/cms.png') }}" alt="Logo for CMS">
|
||||
<a href="http://localhost:28083/admin">
|
||||
<h2 id="appName">Merchant Admin Portal</h2>
|
||||
</a>
|
||||
<p id="appDescription">An admin portal to manage E-commerce business (u: admin, p: admin1234)</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Reddit">
|
||||
<img src="{{ url_for('static', filename='figures/reddit.png') }}" alt="Logo for Reddit">
|
||||
<a href="http://localhost:28080/forums/all">
|
||||
<h2 id="appName">Reddit</h2>
|
||||
</a>
|
||||
<p id="appDescription">A social news aggregation and discussion website</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Gitlab">
|
||||
<img src="{{ url_for('static', filename='figures/gitlab.png') }}" alt="Logo for Gitlab">
|
||||
<a href="http://localhost:28084/explore">
|
||||
<h2 id="appName">Gitlab</h2>
|
||||
</a>
|
||||
<p id="appDescription">a DevOps software</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Map">
|
||||
<img src="{{ url_for('static', filename='figures/map.png') }}" alt="Logo for Map">
|
||||
<a href="https://www.openstreetmap.org/">
|
||||
<h2 id="appName">OpenStreetMap</h2>
|
||||
</a>
|
||||
<p id="appDescription">North east US map</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Calculator">
|
||||
<img src="{{ url_for('static', filename='figures/calculator.png') }}" alt="Logo for Calculator">
|
||||
<a href="calculator.html">
|
||||
<h2 id="appName">Calculator</h2>
|
||||
</a>
|
||||
<p id="appDescription">A calculator</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Scratchpad">
|
||||
<img src="{{ url_for('static', filename='figures/scratchpad.png') }}" alt="Logo for Scratchpad">
|
||||
<a href="scratchpad.html">
|
||||
<h2 id="appName">Scratchpad</h2>
|
||||
</a>
|
||||
<p id="appDescription">A scratchpad for taking notes</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Wikipedia">
|
||||
<img src="{{ url_for('static', filename='figures/wikipedia.png') }}" alt="Logo for Wikipedia">
|
||||
<a href="http://localhost:28081/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing">
|
||||
<h2 id="appName">Wikipedia</h2>
|
||||
</a>
|
||||
<p id="appDescription">An online encyclopedia</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Gitlab Manual">
|
||||
<img src="{{ url_for('static', filename='figures/manual1.png') }}" alt="Logo for Gitlab Manual">
|
||||
<a href="https://docs.gitlab.com/">
|
||||
<h2 id="appName">Gitlab Documentation</h2>
|
||||
</a>
|
||||
<p id="appDescription">Documentation for GitLab</p>
|
||||
</div>
|
||||
|
||||
<div class="card" role="region" aria-label="Admin Manual">
|
||||
<img src="{{ url_for('static', filename='figures/manual2.png') }}" alt="Logo for Admin Manual">
|
||||
<a href="https://experienceleague.adobe.com/docs/commerce-admin/user-guides/home.html?lang=en">
|
||||
<h2 id="appName">Admin Portal Manual</h2>
|
||||
</a>
|
||||
<p id="appDescription">Manual on using the admin portal</p>
|
||||
</div>
|
||||
<!-- Repeat the above card structure for each app -->
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
122
webarena-homepage/templates/scratchpad.html
Normal file
@@ -0,0 +1,122 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Note Taking App</title>
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#note-creation {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#note-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#note-input {
|
||||
width: 100%;
|
||||
min-height: 300px;
|
||||
max-height: 900px;
|
||||
min-width: 600px;
|
||||
max-width: 600px;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ddd;
|
||||
overflow-y: auto;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
#note-form button {
|
||||
padding: 10px 20px;
|
||||
margin-top: 10px;
|
||||
color: white;
|
||||
background-color: #007bff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#note-form button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
#notes-display {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: left;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.note {
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
background: #f9f9f9;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>My Notes</h1>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="note-creation">
|
||||
<form id="note-form">
|
||||
<textarea id="note-input" placeholder="Type your note here..."></textarea>
|
||||
<button type="submit">Add Note</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<h2>History</h2>
|
||||
|
||||
<section id="notes-display">
|
||||
<!-- Notes will be dynamically added here -->
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const form = document.querySelector("#note-form");
|
||||
const noteInput = document.querySelector("#note-input");
|
||||
const notesDisplay = document.querySelector("#notes-display");
|
||||
|
||||
form.addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const note = document.createElement("div");
|
||||
note.classList.add("note");
|
||||
note.textContent = noteInput.value;
|
||||
|
||||
note.innerHTML = noteInput.value.replace(/\n/g, '<br>');
|
||||
note.tabIndex = 0;
|
||||
|
||||
notesDisplay.prepend(note);
|
||||
noteInput.value = '';
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||