Skip to content

Commit

Permalink
ééééé
Browse files Browse the repository at this point in the history
  • Loading branch information
Okmeque1 authored Jul 20, 2024
1 parent 1e40e6a commit bf054a1
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 0 deletions.
Binary file not shown.
23 changes: 23 additions & 0 deletions PythonSoft/flask/Méline/flask1.py
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')
16 changes: 16 additions & 0 deletions PythonSoft/flask/Méline/static/styles/styles.css
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;



}
Binary file added PythonSoft/flask/Méline/templates/Y00.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions PythonSoft/flask/Méline/templates/mainpage.html
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>
4 changes: 4 additions & 0 deletions PythonSoft/flask/Méline/templates/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
p {
color:red;

}
19 changes: 19 additions & 0 deletions PythonSoft/flask/Méline/templates/test.html
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>
42 changes: 42 additions & 0 deletions PythonSoft/flask/Méline/templates/timer.html
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>

0 comments on commit bf054a1

Please sign in to comment.