Rearranged files

So, now it all works standalone without any dependencies on external resources.
This commit is contained in:
Masahiko AMANO 2021-12-11 00:29:21 +03:00
parent f63cb6cb59
commit 309521897b
7 changed files with 18 additions and 10 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
/files
*.log
/counter.txt

7
css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ body {
flex-direction: column;
justify-content: center;
align-items: center;
background-image: url(./images/bg.webp);
background-image: url(../images/bg.webp);
background-size: cover;
}
header {

View File

@ -4,11 +4,11 @@ $file = $_FILES['file'];
if (!is_dir('./files')) {
mkdir('./files');
}
if (!file_exists('./counter.txt')){
file_put_contents('./counter.txt', '0');
if (!file_exists('./files/counter.txt')){
file_put_contents('./files/counter.txt', '0');
}
$id = (int)file_get_contents('./counter.txt');
file_put_contents('./counter.txt', (string)($id+1));
$id = (int)file_get_contents('./files/counter.txt');
file_put_contents('./files/counter.txt', (string)($id+1));
$path = "./files/{$id}__".basename($file['name']);
move_uploaded_file($file['tmp_name'], $path);
$result = json_decode((string)shell_exec(dirname(__file__)."/huffman.py -".($mode == 'compress' ? 'c' : 'd')." \"{$path}\""));

View File

@ -5,9 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HuffPress</title>
<link rel="shortcut icon" href="./favicon.ico" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
<link rel="stylesheet" href="./style.css" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="./css/bootstrap.min.css" />
<link rel="stylesheet" href="./css/style.css" />
<script src="./js/jquery-3.6.0.min.js"></script>
</head>
<body>
<header>
@ -56,6 +56,6 @@
</div>
</div>
</div>
<script src="./script.js"></script>
<script src="./js/script.js"></script>
</body>
</html>

2
js/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long