Compare commits
3 Commits
main
...
c++-crow-b
| Author | SHA1 | Date | |
|---|---|---|---|
| 6360b41e9a | |||
| 217adf91e9 | |||
| a7404fed3d |
9
.gitignore
vendored
@@ -1,7 +1,2 @@
|
|||||||
.venv
|
build/
|
||||||
.env
|
.vscode/
|
||||||
flask_session
|
|
||||||
__pycache__
|
|
||||||
.vscode
|
|
||||||
db
|
|
||||||
app.log
|
|
||||||
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[submodule "thirdparty/inja"]
|
||||||
|
path = thirdparty/inja
|
||||||
|
url = https://github.com/pantor/inja
|
||||||
|
[submodule "thirdparty/nlohmann"]
|
||||||
|
path = thirdparty/nlohmann
|
||||||
|
url = https://github.com/nlohmann/json
|
||||||
22
dockerfile
@@ -1,22 +0,0 @@
|
|||||||
FROM python:alpine
|
|
||||||
|
|
||||||
# Set the working directory
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy the requirements file into the container
|
|
||||||
COPY requirements.txt .
|
|
||||||
|
|
||||||
# Install the required packages
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
||||||
RUN pip install gunicorn
|
|
||||||
|
|
||||||
# Copy the rest of the application code into the container
|
|
||||||
COPY src src
|
|
||||||
COPY templates templates
|
|
||||||
COPY static static
|
|
||||||
|
|
||||||
# Expose the port the app runs on
|
|
||||||
EXPOSE 5000
|
|
||||||
|
|
||||||
# run the application
|
|
||||||
ENTRYPOINT [ "gunicorn", "-b", ":5000", "--access-logfile", "-", "--error-logfile", "-", "src.wsgi:app" ]
|
|
||||||
15
include/errors.hpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef ERRORS_HPP
|
||||||
|
#define ERRORS_HPP
|
||||||
|
|
||||||
|
#include <crow.h>
|
||||||
|
#include "templating.hpp"
|
||||||
|
|
||||||
|
extern Templating templating;
|
||||||
|
|
||||||
|
struct CustomErrorHandler {
|
||||||
|
struct context {};
|
||||||
|
void before_handle(crow::request& req, crow::response& res, context&) {}
|
||||||
|
void after_handle(crow::request& req, crow::response& res, context&);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
25
include/templating.hpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef TEMPLATING_HPP
|
||||||
|
#define TEMPLATING_HPP
|
||||||
|
|
||||||
|
#include <inja/inja.hpp>
|
||||||
|
#include <crow.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Templating {
|
||||||
|
public:
|
||||||
|
explicit Templating(const std::string& template_dir);
|
||||||
|
|
||||||
|
crow::response render_template(const std::string& template_name, const inja::json& data);
|
||||||
|
crow::response render_template(const std::string& template_name);
|
||||||
|
|
||||||
|
std::string render_template_string(const std::string& template_name, const inja::json& data);
|
||||||
|
std::string render_template_string(const std::string& template_name);
|
||||||
|
|
||||||
|
private:
|
||||||
|
inja::Environment inja_env;
|
||||||
|
std::string template_dir; // absolute path to templates
|
||||||
|
|
||||||
|
std::string preprocess_template(const std::string& template_name);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
51
makefile
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Directories
|
||||||
|
INCLUDE_DIRS = include thirdparty/inja/include thirdparty/nlohmann/include
|
||||||
|
SRC_DIR = src
|
||||||
|
BUILD_DIR = build
|
||||||
|
|
||||||
|
# Compiler and linker settings
|
||||||
|
CXX = g++
|
||||||
|
LIBS =
|
||||||
|
CXXFLAGS = -std=c++17 $(foreach dir,$(INCLUDE_DIRS),-I$(dir))
|
||||||
|
|
||||||
|
# Source and object files
|
||||||
|
SRC = $(wildcard $(SRC_DIR)/*.cpp)
|
||||||
|
|
||||||
|
# Target executable
|
||||||
|
UNAME := $(shell uname -s)
|
||||||
|
BUILD_DIR := $(BUILD_DIR)/$(UNAME)
|
||||||
|
OBJ_DIR := $(BUILD_DIR)/objs
|
||||||
|
BIN = $(BUILD_DIR)/main
|
||||||
|
|
||||||
|
# Object files corresponding to the source files (now in obj directory)
|
||||||
|
OBJS = $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(basename $(notdir $(SRC)))))
|
||||||
|
|
||||||
|
# development target with debugging
|
||||||
|
dev: CXXFLAGS += -g -Wall -Wformat
|
||||||
|
dev: all
|
||||||
|
|
||||||
|
# Release target
|
||||||
|
release: CXXFLAGS += -O3
|
||||||
|
release: all
|
||||||
|
|
||||||
|
# Create directories for build output
|
||||||
|
dirs:
|
||||||
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
@mkdir -p $(OBJ_DIR)
|
||||||
|
|
||||||
|
# Clear build directory
|
||||||
|
clear:
|
||||||
|
@find $(OBJ_DIR) -type f -name '*.o' -exec rm -f {} +
|
||||||
|
|
||||||
|
# Pattern rule for source files in src directory
|
||||||
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
all: dirs clear $(BIN)
|
||||||
|
@echo Build complete
|
||||||
|
|
||||||
|
$(BIN): $(OBJS)
|
||||||
|
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BUILD_DIR)
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
psycopg2-binary
|
|
||||||
python-dotenv
|
|
||||||
flask-session
|
|
||||||
requests
|
|
||||||
flask
|
|
||||||
markdown
|
|
||||||
5
run.sh
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
[ ! -f .env ] || export $(grep -v '^#' .env | xargs)
|
|
||||||
|
|
||||||
flask --app src.wsgi.py --debug run
|
|
||||||
13
src/errors.cpp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#include "errors.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
std::string render_404_template(const crow::request& req) {
|
||||||
|
return templating.render_template_string("errors/404.html", {{"requested_url", req.url}});
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomErrorHandler::after_handle(crow::request& req, crow::response& res, context&) {
|
||||||
|
if (res.code == 404 && res.body.empty()) {
|
||||||
|
res.set_header("Content-Type", "text/html");
|
||||||
|
res.body = render_404_template(req);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/main.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#define CROW_STATIC_DIRECTORY "../static"
|
||||||
|
#include "templating.hpp"
|
||||||
|
#include "errors.hpp"
|
||||||
|
#include <crow.h>
|
||||||
|
|
||||||
|
|
||||||
|
Templating templating{"../templates"};
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
crow::App<CustomErrorHandler> app;
|
||||||
|
|
||||||
|
CROW_ROUTE(app, "/")([]() {
|
||||||
|
return templating.render_template("index.html");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.port(8080).multithreaded().run();
|
||||||
|
}
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
# Imports
|
|
||||||
from flask import Blueprint, render_template, abort
|
|
||||||
from os import getenv as env
|
|
||||||
import logging, os, re, markdown
|
|
||||||
|
|
||||||
# Create blueprint
|
|
||||||
bp = Blueprint(
|
|
||||||
'dynamic_routes',
|
|
||||||
__name__,
|
|
||||||
template_folder=env('TEMPLATE_FOLDER', default='../templates'),
|
|
||||||
static_folder=env('STATIC_FOLDER', default='../static')
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create logger
|
|
||||||
log = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
# Get all files in folder
|
|
||||||
def ListFiles(path):
|
|
||||||
path = os.path.join(bp.template_folder, 'pages', path)[3:]
|
|
||||||
files = []
|
|
||||||
for root, dirs, files_in_dir in os.walk(path):
|
|
||||||
for file in files_in_dir:
|
|
||||||
files.append(os.path.relpath(os.path.join(root, file), path))
|
|
||||||
for dir in dirs:
|
|
||||||
files.append(os.path.relpath(os.path.join(root, dir), path) + '/')
|
|
||||||
return files
|
|
||||||
|
|
||||||
# Catch-all route for generic pages
|
|
||||||
@bp.route('/<path:filename>')
|
|
||||||
def catch_all(filename):
|
|
||||||
if os.path.exists(os.path.join(bp.template_folder, 'pages', filename)[3:]):
|
|
||||||
return render_template(f'pages/{filename}')
|
|
||||||
|
|
||||||
elif os.path.exists(os.path.join(bp.template_folder, 'pages', filename + '.html')[3:]):
|
|
||||||
return render_template(f'pages/{filename}.html')
|
|
||||||
|
|
||||||
elif os.path.exists(os.path.join(bp.template_folder, 'pages', filename + '.md')[3:]):
|
|
||||||
print("yay")
|
|
||||||
print(markdown.markdownFromFile("../templates/pages/test.md"))
|
|
||||||
return render_template(
|
|
||||||
f'bases/md.html',
|
|
||||||
title = filename.split("/")[-1],
|
|
||||||
markdown = markdown.markdownFromFile(os.path.join(bp.template_folder, 'pages', filename + '.md'))
|
|
||||||
)
|
|
||||||
|
|
||||||
elif os.path.isdir(os.path.join(bp.template_folder, 'pages', filename)[3:]):
|
|
||||||
return render_template(
|
|
||||||
'bases/directory.html',
|
|
||||||
directory=filename + "/" if not filename.endswith('/') else filename,
|
|
||||||
pages=ListFiles(filename)
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
|
||||||
abort(404, f"'{filename}' not found")
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
# Imports
|
|
||||||
from flask import Blueprint, render_template
|
|
||||||
from werkzeug.exceptions import HTTPException
|
|
||||||
from os import getenv as env
|
|
||||||
import logging
|
|
||||||
|
|
||||||
# Create blueprint
|
|
||||||
bp = Blueprint(
|
|
||||||
'error_handlers',
|
|
||||||
__name__,
|
|
||||||
template_folder=env('TEMPLATE_FOLDER', default='../templates'),
|
|
||||||
static_folder=env('STATIC_FOLDER', default='../static')
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create logger
|
|
||||||
log = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
# Route for 500 error
|
|
||||||
@bp.route('/500')
|
|
||||||
@bp.app_errorhandler(500)
|
|
||||||
def internal_server_error(error:HTTPException=None):
|
|
||||||
return render_template('errors/500.html', error=error), 500
|
|
||||||
|
|
||||||
# Route for 404 error
|
|
||||||
@bp.route('/404')
|
|
||||||
@bp.app_errorhandler(404)
|
|
||||||
def not_found(error:HTTPException=None):
|
|
||||||
return render_template('errors/404.html', error=error), 404
|
|
||||||
|
|
||||||
# Route for 400 error
|
|
||||||
@bp.route('/400')
|
|
||||||
@bp.app_errorhandler(400)
|
|
||||||
def bad_request(error:HTTPException=None):
|
|
||||||
return render_template('errors/400.html', error=error), 400
|
|
||||||
|
|
||||||
# Route for all other errors
|
|
||||||
@bp.route('/error')
|
|
||||||
@bp.app_errorhandler(Exception)
|
|
||||||
def unauthorized(error:HTTPException=None):
|
|
||||||
if isinstance(error, HTTPException):
|
|
||||||
return render_template(
|
|
||||||
'errors/error.html',
|
|
||||||
code = error.code,
|
|
||||||
description = error.description,
|
|
||||||
name = error.name
|
|
||||||
), error.code
|
|
||||||
return render_template(
|
|
||||||
'errors/error.html',
|
|
||||||
code=418,
|
|
||||||
description="meow :3",
|
|
||||||
name="I'm a teapot"
|
|
||||||
), 418
|
|
||||||
76
src/templating.cpp
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#include "templating.hpp"
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
#include <regex>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
Templating::Templating(const std::string& template_dir)
|
||||||
|
: inja_env(std::filesystem::canonical(template_dir).string()),
|
||||||
|
template_dir(std::filesystem::canonical(template_dir).string())
|
||||||
|
{
|
||||||
|
inja_env.set_search_included_templates_in_files(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Templating::preprocess_template(const std::string& template_name) {
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
fs::path abs_template_dir = fs::path(template_dir);
|
||||||
|
fs::path abs_template_file = fs::canonical(abs_template_dir / template_name);
|
||||||
|
|
||||||
|
std::ifstream file(abs_template_file);
|
||||||
|
if (!file.is_open()) {
|
||||||
|
throw std::runtime_error("Failed to open template file: " + abs_template_file.string());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string content((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
||||||
|
|
||||||
|
std::regex extends_regex(R"(\{\%\s*extends\s*(['"])(.+?)\1\s*\%\})");
|
||||||
|
std::smatch match;
|
||||||
|
|
||||||
|
if (std::regex_search(content, match, extends_regex)) {
|
||||||
|
std::string quote = match[1].str();
|
||||||
|
std::string original_path = match[2].str();
|
||||||
|
|
||||||
|
if (original_path.find("/") == std::string::npos &&
|
||||||
|
!original_path.empty() &&
|
||||||
|
original_path.front() != '/') {
|
||||||
|
|
||||||
|
fs::path abs_extended_template = fs::canonical(abs_template_dir / original_path);
|
||||||
|
fs::path rel_path = fs::relative(abs_extended_template, abs_template_file.parent_path());
|
||||||
|
|
||||||
|
std::string new_path = rel_path.generic_string();
|
||||||
|
|
||||||
|
content = std::regex_replace(content, extends_regex,
|
||||||
|
"{% extends " + quote + new_path + quote + " %}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
crow::response Templating::render_template(const std::string& template_name, const inja::json& data) {
|
||||||
|
try {
|
||||||
|
std::string preprocessed = preprocess_template(template_name);
|
||||||
|
inja::Template tpl = inja_env.parse(preprocessed);
|
||||||
|
std::string rendered = inja_env.render(tpl, data);
|
||||||
|
return crow::response(rendered);
|
||||||
|
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
return crow::response(500, e.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
crow::response Templating::render_template(const std::string& template_name) {
|
||||||
|
return render_template(template_name, inja::json{});
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Templating::render_template_string(const std::string& template_name, const inja::json& data) {
|
||||||
|
std::string preprocessed = preprocess_template(template_name);
|
||||||
|
inja::Template tpl = inja_env.parse(preprocessed);
|
||||||
|
return inja_env.render(tpl, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Templating::render_template_string(const std::string& template_name) {
|
||||||
|
return render_template_string(template_name, inja::json{});
|
||||||
|
}
|
||||||
63
src/wsgi.py
@@ -1,63 +0,0 @@
|
|||||||
# Imports
|
|
||||||
from flask import Flask, render_template, send_file
|
|
||||||
from flask_session import Session
|
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
|
||||||
from os import getenv as env
|
|
||||||
import logging
|
|
||||||
|
|
||||||
import src.routes.error_handlers
|
|
||||||
import src.routes.dynamic_routes
|
|
||||||
|
|
||||||
# Load env
|
|
||||||
load_dotenv()
|
|
||||||
|
|
||||||
# Create logger
|
|
||||||
stream_handler = logging.StreamHandler()
|
|
||||||
stream_handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
|
|
||||||
stream_handler.setLevel(logging.INFO)
|
|
||||||
|
|
||||||
file_handler = logging.FileHandler(filename='app.log')
|
|
||||||
file_handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
|
|
||||||
file_handler.setLevel(logging.DEBUG)
|
|
||||||
|
|
||||||
# Add handlers to the logger
|
|
||||||
log = logging.getLogger()
|
|
||||||
log.setLevel(logging.DEBUG)
|
|
||||||
log.addHandler(stream_handler)
|
|
||||||
log.addHandler(file_handler)
|
|
||||||
log.info("Logging initialized")
|
|
||||||
|
|
||||||
# Create flask app
|
|
||||||
app = Flask(
|
|
||||||
__name__,
|
|
||||||
template_folder=env('TEMPLATE_FOLDER', default='../templates'),
|
|
||||||
static_folder=env('STATIC_FOLDER', default='../static')
|
|
||||||
)
|
|
||||||
|
|
||||||
# Configure sessions
|
|
||||||
app.config["SESSION_PERMANENT"] = True
|
|
||||||
app.config["SESSION_TYPE"] = "filesystem"
|
|
||||||
Session(app)
|
|
||||||
|
|
||||||
# Load routes
|
|
||||||
app.register_blueprint(src.routes.error_handlers.bp, url_prefix='/error')
|
|
||||||
app.register_blueprint(src.routes.dynamic_routes.bp, url_prefix='/')
|
|
||||||
|
|
||||||
# Generic routes
|
|
||||||
@app.route('/')
|
|
||||||
def index():
|
|
||||||
return render_template('index.html')
|
|
||||||
|
|
||||||
@app.route('/favicon.ico')
|
|
||||||
def favicon():
|
|
||||||
return send_file('../static/content/other/favicon.ico')
|
|
||||||
|
|
||||||
@app.route('/robots.txt')
|
|
||||||
def robots():
|
|
||||||
return send_file('../static/content/other/robots.txt')
|
|
||||||
|
|
||||||
# Route for sitemap.xml
|
|
||||||
@app.route('/sitemap.xml')
|
|
||||||
def sitemap():
|
|
||||||
return send_file('../static/content/other/sitemap.xml')
|
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 965 B |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 4.4 MiB |
|
Before Width: | Height: | Size: 4.9 MiB |
|
Before Width: | Height: | Size: 5.1 MiB |
@@ -3,6 +3,7 @@ https://cyber.dabamos.de/88x31/anythingbut.gif
|
|||||||
https://cyber.dabamos.de/88x31/bestdesktop.gif
|
https://cyber.dabamos.de/88x31/bestdesktop.gif
|
||||||
https://kopawz.neocities.org/buttonhoard/buttonsfldr2/diagnosedwithGAY.gif
|
https://kopawz.neocities.org/buttonhoard/buttonsfldr2/diagnosedwithGAY.gif
|
||||||
https://kopawz.neocities.org/indexgraphics/buttondecor/ilikecomputer.png
|
https://kopawz.neocities.org/indexgraphics/buttondecor/ilikecomputer.png
|
||||||
|
https://identity-crisis.carrd.co/assets/images/gallery04/ad4f8d52.jpg?v=4e55d939
|
||||||
https://anlucas.neocities.org/best_viewed_with_eyes.gif
|
https://anlucas.neocities.org/best_viewed_with_eyes.gif
|
||||||
https://anlucas.neocities.org/html_learn_it_today.gif
|
https://anlucas.neocities.org/html_learn_it_today.gif
|
||||||
https://highway.eightyeightthirty.one/badge/5d58a8f32b007d4897db6f862a895a81674fb35f5cc3947fc66595817ca174db
|
https://highway.eightyeightthirty.one/badge/5d58a8f32b007d4897db6f862a895a81674fb35f5cc3947fc66595817ca174db
|
||||||
|
Before Width: | Height: | Size: 830 KiB |
@@ -5,12 +5,6 @@
|
|||||||
font-weight:normal;
|
font-weight:normal;
|
||||||
font-style:normal;
|
font-style:normal;
|
||||||
}
|
}
|
||||||
@font-face {
|
|
||||||
font-family:"Scratch";
|
|
||||||
src:url("/static/content/fonts/avali-scratch.otf.woff2") format("woff2");
|
|
||||||
font-weight:normal;
|
|
||||||
font-style:normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--primary-color: #5cdd8b;
|
--primary-color: #5cdd8b;
|
||||||
@@ -23,7 +17,6 @@
|
|||||||
--font-family: "Space Mono", "serif";
|
--font-family: "Space Mono", "serif";
|
||||||
--title-font: 'Roboto Mono', sans-serif;
|
--title-font: 'Roboto Mono', sans-serif;
|
||||||
--irken-font: 'Irken';
|
--irken-font: 'Irken';
|
||||||
--scratch-font: 'Scratch';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -251,10 +244,6 @@ main section a {
|
|||||||
font-family: var(--irken-font);
|
font-family: var(--irken-font);
|
||||||
}
|
}
|
||||||
|
|
||||||
.scratch {
|
|
||||||
font-family: var(--scratch-font);
|
|
||||||
}
|
|
||||||
|
|
||||||
#alt-nav {
|
#alt-nav {
|
||||||
display: none;
|
display: none;
|
||||||
backdrop-filter: blur(2px) brightness(0.6);
|
backdrop-filter: blur(2px) brightness(0.6);
|
||||||
@@ -319,26 +308,6 @@ a {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
|
||||||
background-color: var(--secondary-background-color-but-slightly-transparent);
|
|
||||||
padding: 4px 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
#toaster-wave {
|
|
||||||
position: absolute;
|
|
||||||
left: -145px;
|
|
||||||
top: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 1240px) {
|
|
||||||
#toaster-wave {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 1000px) {
|
@media screen and (max-width: 1000px) {
|
||||||
body {
|
body {
|
||||||
background-color: var(--background-color);
|
background-color: var(--background-color);
|
||||||
@@ -1,23 +1,17 @@
|
|||||||
.gallery {
|
.gallery {
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gallery .gallery-images {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery .gallery-images img {
|
.gallery img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery h2.gallery-date {
|
.gallery-date {
|
||||||
position: relative;
|
margin: 1rem 0 .25rem 0;
|
||||||
top: 0;
|
font-size: 2rem;
|
||||||
left: 0;
|
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,3 @@ ul#toaster-specs li {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#toaster-wave {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
@@ -72,33 +72,25 @@ typing();
|
|||||||
|
|
||||||
// HIDDEN STUFF (shh don't tell anyone >:3)
|
// HIDDEN STUFF (shh don't tell anyone >:3)
|
||||||
|
|
||||||
let last15Chars = "";
|
let last5Chars = "";
|
||||||
|
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
last15Chars += event.key;
|
last5Chars += event.key;
|
||||||
if (last15Chars.includes("furry")) {
|
if (last5Chars == "furry") {
|
||||||
console.log("owo, whats this?");
|
console.log("owo, whats this?");
|
||||||
document.getElementById('furry').style.display = 'block';
|
document.getElementById('furry').style.display = 'block';
|
||||||
last15Chars = "";
|
|
||||||
}
|
}
|
||||||
if (last15Chars.includes("irken")) {
|
if (last5Chars == "irken") {
|
||||||
console.log("doom doom doom!");
|
console.log("doom doom doom!");
|
||||||
document.querySelector(":root").style.setProperty('--font-family', 'Irken');
|
document.querySelector(":root").style.setProperty('--font-family', 'Irken');
|
||||||
document.querySelector(":root").style.setProperty('--title-font', '1.5em');
|
document.querySelector(":root").style.setProperty('--title-font', '1.5em');
|
||||||
last15Chars = "";
|
|
||||||
}
|
}
|
||||||
if (last15Chars.includes("scratch")) {
|
while (last5Chars.length >= 5) {
|
||||||
console.log("space chicken");
|
last5Chars = last5Chars.slice(1);
|
||||||
document.querySelector(":root").style.setProperty('--font-family', 'Scratch');
|
|
||||||
document.querySelector(":root").style.setProperty('--title-font', '1em');
|
|
||||||
last15Chars = "";
|
|
||||||
}
|
|
||||||
while (last15Chars.length >= 15) {
|
|
||||||
last15Chars = last15Chars.slice(1);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Spotify API (now lastfm)
|
// Spotify API
|
||||||
|
|
||||||
function getSpotify() {
|
function getSpotify() {
|
||||||
fetch('https://api.alfieking.dev/spotify/nowplaying/xz02oolstlvwxqu1pfcua9exz').then(response => {
|
fetch('https://api.alfieking.dev/spotify/nowplaying/xz02oolstlvwxqu1pfcua9exz').then(response => {
|
||||||
@@ -123,11 +115,10 @@ if (document.getElementById('spotify')) {
|
|||||||
setInterval(getSpotify, 15000);
|
setInterval(getSpotify, 15000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// load buttons
|
// load buttons
|
||||||
|
|
||||||
function loadButtons() {
|
function loadButtons() {
|
||||||
fetch('/static/content/buttons/non_link_buttons.txt').then(response => {
|
fetch('/static/content/other/buttons.txt').then(response => {
|
||||||
return response.text();
|
return response.text();
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
container = document.getElementById('button-collection');
|
container = document.getElementById('button-collection');
|
||||||
|
|||||||
174
static/js/snake.js
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
const canvas = document.getElementById('snakeCanvas');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
const gridSize = 20;
|
||||||
|
const tileSize = 100;
|
||||||
|
const snakeSize = 60;
|
||||||
|
const foodSize = 80;
|
||||||
|
canvas.width = gridSize * tileSize;
|
||||||
|
canvas.height = gridSize * tileSize;
|
||||||
|
|
||||||
|
let snake = [{ x: 10, y: 10 }, { x: 10, y: 11 }, { x: 10, y: 12 }];
|
||||||
|
let direction = { x: 0, y: 0 };
|
||||||
|
let food = { x: Math.floor(Math.random() * gridSize), y: Math.floor(Math.random() * gridSize) };
|
||||||
|
let score = 0;
|
||||||
|
let gameOver = false;
|
||||||
|
|
||||||
|
function draw() {
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
// draw grid of checkerboard pattern
|
||||||
|
for (let x = 0; x < gridSize; x++) {
|
||||||
|
for (let y = 0; y < gridSize; y++) {
|
||||||
|
ctx.fillStyle = (x + y) % 2 === 0 ?
|
||||||
|
getComputedStyle(document.documentElement).getPropertyValue('--background-color') :
|
||||||
|
getComputedStyle(document.documentElement).getPropertyValue('--secondary-background-color');
|
||||||
|
ctx.fillRect(x * tileSize, y * tileSize, tileSize, tileSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw snake
|
||||||
|
snake.forEach(segment => {
|
||||||
|
let nextVec = { x: 0, y: 0 };
|
||||||
|
// if there is a segment after the current segment
|
||||||
|
if (snake.indexOf(segment) < snake.length - 1) {
|
||||||
|
const nextSegment = snake[snake.indexOf(segment) + 1];
|
||||||
|
nextVec.x = nextSegment.x - segment.x;
|
||||||
|
nextVec.y = nextSegment.y - segment.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--primary-color');
|
||||||
|
if (nextVec.x === 0 && nextVec.y === 0) {
|
||||||
|
ctx.fillRect(
|
||||||
|
segment.x * tileSize + (tileSize - snakeSize) / 2,
|
||||||
|
segment.y * tileSize + (tileSize - snakeSize) / 2,
|
||||||
|
snakeSize,
|
||||||
|
snakeSize
|
||||||
|
);
|
||||||
|
} else if (nextVec.x > 0 || nextVec.y > 0) {
|
||||||
|
ctx.fillRect(
|
||||||
|
segment.x * tileSize + (tileSize - snakeSize) / 2,
|
||||||
|
segment.y * tileSize + (tileSize - snakeSize) / 2,
|
||||||
|
snakeSize + nextVec.x * (tileSize - snakeSize),
|
||||||
|
snakeSize + nextVec.y * (tileSize - snakeSize)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ctx.fillRect(
|
||||||
|
segment.x * tileSize + (tileSize - snakeSize) / 2 + nextVec.x * (tileSize - snakeSize),
|
||||||
|
segment.y * tileSize + (tileSize - snakeSize) / 2 + nextVec.y * (tileSize - snakeSize),
|
||||||
|
snakeSize + Math.abs(nextVec.x) * (tileSize - snakeSize),
|
||||||
|
snakeSize + Math.abs(nextVec.y) * (tileSize - snakeSize)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Draw food
|
||||||
|
ctx.fillStyle = '#ff4d4d';
|
||||||
|
ctx.fillRect(
|
||||||
|
food.x * tileSize + (tileSize - foodSize) / 2,
|
||||||
|
food.y * tileSize + (tileSize - foodSize) / 2,
|
||||||
|
foodSize,
|
||||||
|
foodSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
if (gameOver) return;
|
||||||
|
|
||||||
|
// Move snake
|
||||||
|
const head = { x: snake[0].x + direction.x, y: snake[0].y + direction.y };
|
||||||
|
|
||||||
|
// Add new head
|
||||||
|
snake.unshift(head);
|
||||||
|
|
||||||
|
// Check for food collision
|
||||||
|
if (head.x === food.x && head.y === food.y) {
|
||||||
|
score += 10; // Increase score
|
||||||
|
placeFood();
|
||||||
|
} else {
|
||||||
|
snake.pop(); // Remove tail if no food eaten
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for wall collision
|
||||||
|
if (head.x < 0 || head.x >= gridSize || head.y < 0 || head.y >= gridSize) {
|
||||||
|
gameOver = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for self collision
|
||||||
|
for (let i = 1; i < snake.length; i++) {
|
||||||
|
if (head.x === snake[i].x && head.y === snake[i].y) {
|
||||||
|
gameOver = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function placeFood() {
|
||||||
|
do {
|
||||||
|
food.x = Math.floor(Math.random() * gridSize);
|
||||||
|
food.y = Math.floor(Math.random() * gridSize);
|
||||||
|
} while (snake.some(segment => segment.x === food.x && segment.y === food.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeDirection(event) {
|
||||||
|
switch (event.key) {
|
||||||
|
case 'w':
|
||||||
|
if (direction.y === 0) direction = { x: 0, y: -1 };
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
if (direction.y === 0) direction = { x: 0, y: 1 };
|
||||||
|
break;
|
||||||
|
case 'a':
|
||||||
|
if (direction.x === 0) direction = { x: -1, y: 0 };
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
if (direction.x === 0) direction = { x: 1, y: 0 };
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Menu to start the game
|
||||||
|
function menu() {
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
ctx.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--background-color');
|
||||||
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
ctx.textAlign = 'center';
|
||||||
|
ctx.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--text-color');
|
||||||
|
ctx.font = '200px Arial';
|
||||||
|
ctx.fillText('Snake Game', canvas.width / 2, canvas.height / 2);
|
||||||
|
ctx.font = '100px Arial';
|
||||||
|
ctx.fillText('Press W/A/S/D to move', canvas.width / 2, canvas.height / 2 + 100);
|
||||||
|
ctx.fillText('Click to start', canvas.width / 2, canvas.height / 2 + 200);
|
||||||
|
|
||||||
|
canvas.addEventListener('click', startGame);
|
||||||
|
}
|
||||||
|
|
||||||
|
function gameLoop() {
|
||||||
|
if (!gameOver) {
|
||||||
|
update();
|
||||||
|
draw();
|
||||||
|
setTimeout(gameLoop, 100);
|
||||||
|
} else {
|
||||||
|
document.removeEventListener('keydown', changeDirection);
|
||||||
|
document.getElementById('score').value = score;
|
||||||
|
alert(`Game Over! Your score: ${score}`);
|
||||||
|
menu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function startGame() {
|
||||||
|
snake = [{ x: 10, y: 10 }, { x: 10, y: 11 }, { x: 10, y: 12 }];
|
||||||
|
direction = { x: 1, y: 0 };
|
||||||
|
food = { x: Math.floor(Math.random() * gridSize), y: Math.floor(Math.random() * gridSize) };
|
||||||
|
score = 0;
|
||||||
|
gameOver = false;
|
||||||
|
canvas.removeEventListener('click', startGame);
|
||||||
|
document.addEventListener('keydown', changeDirection);
|
||||||
|
gameLoop();
|
||||||
|
}
|
||||||
|
|
||||||
|
menu();
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{% block title %}Alfie's basement{% endblock %}</title>
|
<title>{% block title %}Alfie's basement{% endblock %}</title>
|
||||||
<link rel="icon" href="/static/content/general_images/icon.webp">
|
<link rel="icon" href="/static/content/general_images/icon.webp">
|
||||||
<link rel="stylesheet" href="/static/css/bases/base.css">
|
<link rel="stylesheet" href="/static/css/base.css">
|
||||||
<meta name="description" content="{% block description %}server backend survivor{% endblock %}">
|
<meta name="description" content="{% block description %}server backend survivor{% endblock %}">
|
||||||
<meta name="keywords" content="{% block keywords %}Alfie King, Alfie, King, Alfieking, Alfieking.dev, dev, server, developer, backend, selfhost, homelab{% endblock %}">
|
<meta name="keywords" content="{% block keywords %}Alfie King, Alfie, King, Alfieking, Alfieking.dev, dev, server, developer, backend, selfhost, homelab{% endblock %}">
|
||||||
<meta name="author" content="Alfie King">
|
<meta name="author" content="Alfie King">
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
<meta name="theme-color" content="#63de90" data-react-helmet="true">
|
<meta name="theme-color" content="#63de90" data-react-helmet="true">
|
||||||
<meta property="og:site_name" content="Alfieking.dev">
|
<meta property="og:site_name" content="Alfieking.dev">
|
||||||
<meta property="og:url" content="https://alfieking.dev/">
|
<meta property="og:url" content="https://alfieking.dev/">
|
||||||
<meta property="og:title" content="{{ self.title() }}">
|
<meta property="og:title" content="{% block og-title %}Home - Alfie's basement{% endblock %}">
|
||||||
<meta property="og:description" content="{{ self.description() }}">
|
<meta property="og:description" content="{% block og-description %}server backend survivor{% endblock %}">
|
||||||
<meta property="og:image" content="{% block og_image %}/static/content/general_images/icon.webp{% endblock %}">
|
<meta property="og:image" content="{% block og_image %}/static/content/general_images/icon.webp{% endblock %}">
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -41,33 +41,24 @@
|
|||||||
</section>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
<section>
|
<section>
|
||||||
<h6 class="irken">heya, try typing "furry", "irken" or <span class="scratch">scratch</span> into this page!</h6>
|
<h6 class="irken">heya, try typing "furry" and "irken" into this page!</h6>
|
||||||
</section>
|
</section>
|
||||||
<section id="buttons">
|
<section id="buttons">
|
||||||
<h1>BUTTONS</h1>
|
<h1>BUTTONS</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a herf="https://hijpixel.nekoweb.org/"><img src="/static/content/buttons/hijpixel.gif" alt="hijpixel"></a></li>
|
<li><a href="https://dimden.dev/"><img src="https://dimden.dev/services/images/88x31.gif" alt="dimden"></a></li>
|
||||||
<li><a href="https://lensdeer.neocities.org/"><img src="/static/content/buttons/lensdeer.gif" alt="lensdeer"></a></li>
|
<li><a href="https://ne0nbandit.neocities.org/"><img src="https://ne0nbandit.github.io/assets/img/btn/mine/nbbanner.png" alt="ne0nbandit"></a></li>
|
||||||
<li><a href="https://emmixis.net/"><img src="/static/content/buttons/emmixis.gif" alt="emmixis"></a></li>
|
<li><a href="https://thinliquid.dev"><img src="https://thinliquid.dev/thnlqd.png" alt="thinliquid"></a></li>
|
||||||
<li><a href="https://dimden.dev/"><img src="https://dimden.dev/services/images/88x31.gif" alt="dimden"></a></li><!-- hotlink on purpose -->
|
<li><a href="https://nekoweb.org/"><img src="https://nekoweb.org/assets/buttons/button6.gif" alt="nekoweb"></a><!-- button by s1nez.nekoweb.org --></li>
|
||||||
<li><a href="https://ne0nbandit.neocities.org/"><img src="/static/content/buttons/ne0nbandit.png" alt="ne0nbandit"></a></li>
|
<li><a href="https://s1nez.nekoweb.org/"><img src="https://s1nez.nekoweb.org/BUTTON.gif" alt="s1nez"></a></li>
|
||||||
<li><a href="https://thinliquid.dev"><img src="/static/content/buttons/thnlqd.png" alt="thinliquid"></a></li>
|
<li><a href="https://beeps.website"><img src="https://beeps.website/assets/images/88x31-d.gif" alt="beeps"></a></li>
|
||||||
<li><a href="https://nekoweb.org/"><img src="/static/content/buttons/nekoweb.gif" alt="nekoweb"></a><!-- button by s1nez.nekoweb.org --></li>
|
<li><a href="https://itsnotstupid.com"><img src="https://itsnotstupid.com/pics/button1.gif" alt="itsnotstupid"></a></li>
|
||||||
<li><a href="https://s1nez.nekoweb.org/"><img src="/static/content/buttons/s1nez.gif" alt="s1nez"></a></li>
|
<li><a href='https://blinkies.cafe'><img src='https://blinkies.cafe/b/display/blinkiesCafe-badge.gif' alt='blinkies.cafe | make your own blinkies!'></a></li>
|
||||||
<li><a href="https://beeps.website"><img src="/static/content/buttons/beeps.gif" alt="beeps"></a></li>
|
<li><a href="https://eightyeightthirty.one"><img src="https://eightyeightthirty.one/88x31.png" alt="88x31"></a></li>
|
||||||
<li><a href="https://itsnotstupid.com"><img src="/static/content/buttons/insia.gif" alt="itsnotstupid"></a></li>
|
<li><a href="https://neocities.org"><img src="https://cyber.dabamos.de/88x31/neocities-now.gif" alt="neocities"></a></li>
|
||||||
<li><a href='https://blinkies.cafe'><img src='/static/content/buttons/blinkiescafe.gif' alt='blinkies.cafe | make your own blinkies!'></a></li>
|
<li><a href="https://tuxedodragon.art"><img src="https://tuxedodragon.art/tuxedodragon%2088x31.gif" alt="tuxedodragon"></a></li>
|
||||||
<li><a href="https://eightyeightthirty.one"><img src="/static/content/buttons/8831.png" alt="88x31"></a></li>
|
|
||||||
<li><a href="https://neocities.org"><img src="/static/content/buttons/neocities.gif" alt="neocities"></a></li>
|
|
||||||
<li><a href="https://tuxedodragon.art"><img src="/static/content/buttons/tuxedodragon.gif" alt="tuxedodragon"></a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
|
||||||
<div id='furryring'>
|
|
||||||
<script type="text/javascript" src="https://furryring.neocities.org/onionring-variables.js"></script>
|
|
||||||
<script type="text/javascript" src="https://furryring.neocities.org/onionring-widget.js"></script>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section>
|
<section>
|
||||||
<pre class="vsmoltext"> |\ _,,,---,,_<br>ZZZzz /,`.-'`' -. ;-;;,_<br> |,4- ) )-,_. ,\ ( `'-'<br> '---''(_/--' `-'\_)</pre>
|
<pre class="vsmoltext"> |\ _,,,---,,_<br>ZZZzz /,`.-'`' -. ;-;;,_<br> |,4- ) )-,_. ,\ ( `'-'<br> '---''(_/--' `-'\_)</pre>
|
||||||
</section>
|
</section>
|
||||||
@@ -82,9 +73,6 @@
|
|||||||
<h2 id="typing">server backend survivor</h2>
|
<h2 id="typing">server backend survivor</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="/toaster" id="toaster-wave">
|
|
||||||
<img src="/static/content/toaster/Toaster_v1.1.png" alt="toaster">
|
|
||||||
</a>
|
|
||||||
</header>
|
</header>
|
||||||
<nav id="alt-nav">
|
<nav id="alt-nav">
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{% extends "bases/base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block title %}/{{ directory }} - Alfie's basement{% endblock %}
|
{% block title %}/{{ directory }} - Alfie's basement{% endblock %}
|
||||||
{% block description %}server backend survivor{% endblock %}
|
{% block description %}server backend survivor{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<link rel="stylesheet" href="/static/css/bases/directory.css">
|
<link rel="stylesheet" href="/static/css/directory.css">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
{% extends "bases/base.html" %}
|
|
||||||
|
|
||||||
{% block title %}{{ title }} - Alfie's basement{% endblock %}
|
|
||||||
{% block description %}server backend survivor{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<section>
|
|
||||||
{{ markdown }}
|
|
||||||
</section>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
{% block description %}Bad request. The server could not understand the request due to invalid syntax.{% endblock %}
|
{% block description %}Bad request. The server could not understand the request due to invalid syntax.{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<link rel="stylesheet" href="/static/css/errors/400.css">
|
<link rel="stylesheet" href="/static/css/400.css">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|||||||
@@ -7,13 +7,14 @@
|
|||||||
<section>
|
<section>
|
||||||
<h1>404</h1>
|
<h1>404</h1>
|
||||||
<p>
|
<p>
|
||||||
It seems like the thing you are looking for does not exist or <code>rm -rf</code> itself out of exsistance.
|
Hey so you know that thing you were looking for? Yeah, it doesn't exist. :P
|
||||||
|
<br><br>
|
||||||
|
So why not try going back to the <a href="/">homepage</a>?
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h2>Actual error</h2>
|
<h2>The actual error for the 2 ppl who care</h2>
|
||||||
<p>
|
<p>
|
||||||
{{ error }}
|
404: {{ requested_url }} not found :3
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
{% block description %}An unexpected error occurred on the server.{% endblock %}
|
{% block description %}An unexpected error occurred on the server.{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<link rel="stylesheet" href="/static/css/errors/500.css">
|
<link rel="stylesheet" href="/static/css/500.css">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@@ -14,10 +14,4 @@
|
|||||||
Oopsie Woopsie! Uwu We made a fucky wucky!! A wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this!
|
Oopsie Woopsie! Uwu We made a fucky wucky!! A wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this!
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
|
||||||
<h2>Actual error</h2>
|
|
||||||
<p>
|
|
||||||
{{ error }}
|
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{% extends "bases/base.html" %}
|
|
||||||
|
|
||||||
{% block title %}{{ code }} - {{ name }}{% endblock %}
|
|
||||||
{% block description %}The page you are looking for does not exist.{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<section>
|
|
||||||
<img src="https://http.cat/images/{{ code }}.jpg" alt="">
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<h2>Actual error</h2>
|
|
||||||
<p>
|
|
||||||
{{ description }}
|
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
{% block title %}Home - Alfie's basement{% endblock %}
|
{% block title %}Home - Alfie's basement{% endblock %}
|
||||||
{% block description %}server backend survivor{% endblock %}
|
{% block description %}server backend survivor{% endblock %}
|
||||||
|
{% block og-title %}Home - Alfie's basement{% endblock %}
|
||||||
|
{% block og-description %}server backend survivor{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<link rel="stylesheet" href="/static/css/index.css">
|
<link rel="stylesheet" href="/static/css/index.css">
|
||||||
@@ -11,7 +14,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<h1>A lil bit abt me</h1>
|
<h1>A lil bit abt me</h1>
|
||||||
<p>
|
<p>
|
||||||
Im not good with writing so dont expect much here. I was a student learning c++ and python. I've Done a few projects that i think
|
Im not good with writing so dont expect much here. I am a student who is learning c++ and python. I've Done a few projects that i think
|
||||||
are decent enough to show off, so I have put them on this website. I like to mess around with linux and have a few servers that I run. I've
|
are decent enough to show off, so I have put them on this website. I like to mess around with linux and have a few servers that I run. I've
|
||||||
been running a server for a few years now, and I have learned a lot from it. I have also switched to linux on my main computer, which has been
|
been running a server for a few years now, and I have learned a lot from it. I have also switched to linux on my main computer, which has been
|
||||||
slightly annoying at times (mainly because one of my most played games' anticheat doesn't support on linux atm. Also, the lack of photoshop is
|
slightly annoying at times (mainly because one of my most played games' anticheat doesn't support on linux atm. Also, the lack of photoshop is
|
||||||
@@ -37,7 +40,7 @@
|
|||||||
<img src="https://s1nez.nekoweb.org/img/7dcd20d4.gif" alt="">
|
<img src="https://s1nez.nekoweb.org/img/7dcd20d4.gif" alt="">
|
||||||
</section>
|
</section>
|
||||||
<div class="flex-row">
|
<div class="flex-row">
|
||||||
<a href="https://www.last.fm/user/acetheking987" id="spotify-link">
|
<a href="" id="spotify-link">
|
||||||
<div id="spotify">
|
<div id="spotify">
|
||||||
<h1 id="spotify-title"></h1>
|
<h1 id="spotify-title"></h1>
|
||||||
<h2 id="spotify-artist"></h2>
|
<h2 id="spotify-artist"></h2>
|
||||||
@@ -104,15 +107,6 @@
|
|||||||
<h1>Some News</h1>
|
<h1>Some News</h1>
|
||||||
<h6>(dont expect this to be updated often tho :P)</h6>
|
<h6>(dont expect this to be updated often tho :P)</h6>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
|
||||||
<h2>18-01-2026</h2>
|
|
||||||
<p>
|
|
||||||
:O an update! thats unheard of on this site (aleast its more often than tf2 gets updates). finding motivation to work on things has been painful
|
|
||||||
recently, but im wokring on my mental state a bit so hopefully there will be more updates. I am writing this before i make any major changes but
|
|
||||||
i hope to add a blog or something, or maybe a daily thoughts thing that pings my phone to get me to write something. I also need to rewrite most
|
|
||||||
of the home page as well since its kinda out of date :P
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<h2>28-06-2025</h2>
|
<h2>28-06-2025</h2>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -34,22 +34,12 @@ protogen v1.0, toaster v1.0
|
|||||||
<p>
|
<p>
|
||||||
Here are some photos from the meets I have attended. I will add more as I attend more meets.
|
Here are some photos from the meets I have attended. I will add more as I attend more meets.
|
||||||
</p>
|
</p>
|
||||||
<div class="gallery">
|
|
||||||
<h2 class="gallery-date">26th July 2025</h2>
|
<h2 class="gallery-date">26th July 2025</h2>
|
||||||
<div class="gallery-images">
|
<div class="gallery">
|
||||||
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_152110445.jpg" alt="Critters MK">
|
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_152110445.jpg" alt="Critters MK">
|
||||||
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_155134418.jpg" alt="Critters MK">
|
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_155134418.jpg" alt="Critters MK">
|
||||||
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_155226274.jpg" alt="Critters MK">
|
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_155226274.jpg" alt="Critters MK">
|
||||||
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_155434701.jpg" alt="Critters MK">
|
<img src="/static/content/fur_meets/26-07-2025_critters_mk/PXL_20250726_155434701.jpg" alt="Critters MK">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="gallery">
|
|
||||||
<h2 class="gallery-date">23rd Aug 2025</h2>
|
|
||||||
<div class="gallery-images">
|
|
||||||
<img src="/static/content/fur_meets/23-08-2025_critters_mk/PXL_20250823_130640362.jpg" alt="Critters MK">
|
|
||||||
<img src="/static/content/fur_meets/23-08-2025_critters_mk/PXL_20250823_130648109.jpg" alt="Critters MK">
|
|
||||||
<img src="/static/content/fur_meets/23-08-2025_critters_mk/PXL_20250823_130659800.jpg" alt="Critters MK">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -49,9 +49,8 @@ protogen v1.0, toaster v1.0
|
|||||||
<p>
|
<p>
|
||||||
Here are some photos from the meets I have attended. I will add more as I attend more meets.
|
Here are some photos from the meets I have attended. I will add more as I attend more meets.
|
||||||
</p>
|
</p>
|
||||||
<div class="gallery">
|
|
||||||
<h2 class="gallery-date">3rd Aug 2025</h2>
|
<h2 class="gallery-date">3rd Aug 2025</h2>
|
||||||
<div class="gallery-images">
|
<div class="gallery">
|
||||||
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_141943558.jpg" alt="Paws'N'Pistons">
|
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_141943558.jpg" alt="Paws'N'Pistons">
|
||||||
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_150138054.jpg" alt="Paws'N'Pistons">
|
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_150138054.jpg" alt="Paws'N'Pistons">
|
||||||
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_150249916.jpg" alt="Paws'N'Pistons">
|
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_150249916.jpg" alt="Paws'N'Pistons">
|
||||||
@@ -61,6 +60,5 @@ protogen v1.0, toaster v1.0
|
|||||||
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_182023562.jpg" alt="Paws'N'Pistons">
|
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_182023562.jpg" alt="Paws'N'Pistons">
|
||||||
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_184321576.jpg" alt="Paws'N'Pistons">
|
<img src="/static/content/fur_meets/03-08-2025_paws_n_pistons/PXL_20250803_184321576.jpg" alt="Paws'N'Pistons">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# hello
|
|
||||||
this is a test
|
|
||||||