-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#hello | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
from markupsafe import escape | ||
from flask import render_template | ||
@app.route("/") | ||
def mainpage(): | ||
return render_template('mainpage.html') | ||
@app.route("/user/<name>") | ||
def hello(name): | ||
return f"Hello, {escape(name)}!" | ||
@app.route('/post/<int:post_id>') | ||
def show_post(post_id): | ||
# show the post with the given id, the id is an integer | ||
return f'Post {post_id}' | ||
@app.route("/buycomputer/") | ||
def test(): | ||
return render_template('test.html') | ||
@app.route("/htmltest") | ||
def html1(): | ||
return render_template('test.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
p { | ||
color:palevioletred; | ||
|
||
} | ||
h1 { | ||
text-align: right; | ||
|
||
|
||
|
||
} | ||
.hello{ | ||
font-family: Verdana, Geneva, Tahoma, sans-serif; | ||
|
||
|
||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<html> | ||
<head><link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/styles.css') }}"></head> | ||
<h1> Welcome to Méline Unincorporated.</h1> | ||
<p> Méline Unincorporated is supposed to represent the worst customer service, worst website design and worst UI.</p> | ||
<a href="/buycomputer"><img src="https://github.com/user-attachments/assets/47fb4e3b-f815-4295-801c-18598ce819f5"/></a> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
p { | ||
color:red; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<html> | ||
<head><link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/styles.css') }}"></head> | ||
<div class="hello"> | ||
<h1> Méline Unincorporated - Buy computers!</h1> | ||
</div> | ||
Lap [1] or desk [2] computah? <input id="pctype"> <br> | ||
Big [1] or Small [2] storag <input id="size"> <br> | ||
Enter credit card number <input id="creditcardnumber"> <br> | ||
<a href="/"><button onclick="onButtonClick()"> Checkout and return to main page </button> <br> </a> | ||
<script> | ||
function onButtonClick(){ | ||
console.log("Function passed!") | ||
const input=document.getElementById("pctype").value | ||
const input2=document.getElementById("size").value | ||
const input3=document.getElementById("creditcardnumber").value | ||
alert("You have chosen type " + input + " of computer with type " + input2 + " of storage. Credit card number is " + input3 | ||
)} | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-GB"> | ||
<head> | ||
<title>Countdown Timer</title> | ||
<style> | ||
body { | ||
font-family: Comic Sans MS, sans-serif; | ||
} | ||
#countdown { | ||
font-size: 2em; | ||
text-align: center; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="countdown"></div> | ||
|
||
<script> | ||
const countdownElement = document.getElementById('countdown'); | ||
const targetDateInput = prompt('Enter the target date and time (Format: YYYY-MM-DD HH:MM:SS):'); | ||
const targetDate = new Date(targetDateInput).getTime(); | ||
if (isNaN(targetDate)) { | ||
countdownElement.innerHTML = 'Invalid date format! Please reload the page.'; | ||
} else { | ||
const countdown = setInterval(function () { | ||
const now = new Date().getTime(); | ||
const timeRemaining = targetDate - now; | ||
if (timeRemaining < 0) { | ||
clearInterval(countdown); | ||
countdownElement.innerHTML = 'Timer finished! Reload the page to start again!'; | ||
} else { | ||
const days = Math.floor(timeRemaining / (1000 * 60 * 60 * 24)); | ||
const hours = Math.floor((timeRemaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | ||
const minutes = Math.floor((timeRemaining % (1000 * 60 * 60)) / (1000 * 60)); | ||
const seconds = Math.floor((timeRemaining % (1000 * 60)) / 1000); | ||
countdownElement.innerHTML = `${days}d ${hours}h ${minutes}m ${seconds}s`; | ||
} | ||
}, 1000); | ||
} | ||
</script> | ||
</body> | ||
</html> |