Skip to content

Commit

Permalink
added text to speech and delete page function
Browse files Browse the repository at this point in the history
jehovahsays committed Jun 19, 2024
1 parent c6234a2 commit f6a34c2
Showing 618 changed files with 311,564 additions and 403 deletions.
14 changes: 12 additions & 2 deletions action.php
Original file line number Diff line number Diff line change
@@ -220,14 +220,24 @@
. "form-group"
. "\""
. ">"
. "</form>"
. "<a href="
. "\""
. "../index.html"
. "\""
. ">return to homepage</a>"
. "</button>"
. "</form> "
. "<br><br><a href="
. "\""
. "../delete.php?action=delete&filename=./en/"
. $value
. ".html"
. "\""
. ">delete this page</a>"
. "</center>"
. "<script> var msg = new SpeechSynthesisUtterance('"
. $value
. "'); window.speechSynthesis.speak(msg); </script>"
. "\n"
. "\r\n");
$handle = fopen("./index.html", "a");
@@ -255,7 +265,7 @@
. "\""
. ">"
. $value
. "</a></br>"
. "</a></br>"
. "\r\n");
echo "<meta name='viewport' content='width=device-width'>successfully created <a href='./en/$value.html'>$value</a>";
}
9 changes: 9 additions & 0 deletions delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
// user has clicked a delete hyperlink
if($_GET['action'] && $_GET['action'] == 'delete') {
unlink($_GET['filename']);
header("Location: ./index.html");
exit();
}
?>

108 changes: 108 additions & 0 deletions en/2d.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!DOCTYPE
html>
<html
lang="en">
<head>
<meta
charset="utf-8">
<title>
2d
</title>
<meta
name="viewport"
content="width=device-width"/>
<style>
/* mobile */
canvas {
padding: 0;
margin: 0;
position: fixed;
top: 0;
left: 0;
border: 1px solid #d3d3d3;
background-color: #f1f1f1;
}
</style>
<link
rel="stylesheet"
type="text/css"
href="./server/files/main.css">
</head>
<body>
<br><br><br><br>
<br><br><br><br>
<br><br><br>
<body onload="startGame()">
<script>

var myGamePiece;

function startGame() {
myGamePiece = new component(30, 30, "red", 10, 120);
myGameArea.start();
}

var myGameArea = {
canvas : document.createElement("canvas"),
start : function() {
this.canvas.width = 320;
this.canvas.height = 200;
this.context = this.canvas.getContext("2d");
document.body.insertBefore(this.canvas, document.body.childNodes[0]);
this.interval = setInterval(updateGameArea, 20);
},
clear : function() {
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
}
}

function component(width, height, color, x, y) {
this.width = width;
this.height = height;
this.speedX = 0;
this.speedY = 0;
this.x = x;
this.y = y;
this.update = function() {
ctx = myGameArea.context;
ctx.fillStyle = color;
ctx.fillRect(this.x, this.y, this.width, this.height);
}
this.newPos = function() {
this.x += this.speedX;
this.y += this.speedY;
}
}

function updateGameArea() {
myGameArea.clear();
myGamePiece.newPos();
myGamePiece.update();
}

function moveup() {
myGamePiece.speedY -= 1;
}

function movedown() {
myGamePiece.speedY += 1;
}

function moveleft() {
myGamePiece.speedX -= 1;
}

function moveright() {
myGamePiece.speedX += 1;
}
</script>
<div style="text-align:center;width:320px;">
<button onclick="moveup()">UP</button><br><br>
<button onclick="moveleft()">LEFT</button>
<button onclick="moveright()">RIGHT</button><br><br>
<button onclick="movedown()">DOWN</button>
</div>
<center>
<br>
<br>
<a href="../index.html">return to homepage</a>
Loading

0 comments on commit f6a34c2

Please sign in to comment.