commit 1678e933cb7b912ddfb0dcbb8b3e5099b6bae958 Author: ~keith Date: Sat May 4 15:04:02 2024 -0400 initial upload diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab1f07d --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Public PHP for ~keith's Web site + +This repository contains the core PHP scripts that power [my Web site](https://keithhacks.cyou/). +It's a bit of a spaghetti monster in here - I want to clean this up and turn it into a nice, shiny framework eventually. + +BTW, this is [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) like the rest of my site. I'd be happy to see this help other people make their own Web sites. + +## What The Hell Am I Looking At?! + +Pretty much everything of note is in the `sys/` directory. + +`sys/templating.php` is a simple template system. It lets you define the layout of your site in one place, so you don't have to rewrite all the ` ...` nonsense on every single page. Check out `sys/default_template.php` and `about_copyleft.php` to see how it's used. + +`sys/navbar.php` is the code that renders the navigator. `sys/site.php` holds the sitemap it uses, and a couple other things. + +Outside of `sys/`, there's also: +- SCSS stylesheets in `css/`. Just run `make` in that directory. +- `git-post-receive-hook.sh`, which needs to be placed at `.git/hooks/post-receive` on your Web server if you're using the site changelog. +- Assets which we won't worry about :-) (The icons in `assets/hicolor/` are from KDE 3, though.) diff --git a/about_copyleft.php b/about_copyleft.php new file mode 100644 index 0000000..e0be2fc --- /dev/null +++ b/about_copyleft.php @@ -0,0 +1,29 @@ + +
+
+

The gist

+ +

Almost everything on this Web site is CC BY-NC-SA 4.0.

+ +

Basically, you can do whatever you want with my stuff. I encourage you to repost it, edit it, anything you like! As long as you:

+
    +
  • Allow others to modify and redistribute your version, too.
  • +
  • Don't sell it, monetize it, or otherwise try to make money from it.
  • +
  • Credit me - it's as easy as saying "~keith made the original" and linking to this Web site.
  • +
+
+ +
+

Source code

+

However, any code I publish is licensed under the GNU AGPLv3 instead (unless I say otherwise).

+

Essentially, this means that if you publish a modified version of my software, or a program that uses my software, you have to publish your source code along with it, under the same license. You also have to disclose the source code if you run my software as an online service.

+
+
+ diff --git a/assets/.htaccess b/assets/.htaccess new file mode 100644 index 0000000..28f26f5 --- /dev/null +++ b/assets/.htaccess @@ -0,0 +1,4 @@ + + # Cache assets for a week + Header set Cache-Control "max-age=604800,public,no-transform" + diff --git a/assets/b_btn.gif b/assets/b_btn.gif new file mode 100644 index 0000000..ba13356 Binary files /dev/null and b/assets/b_btn.gif differ diff --git a/assets/b_btnpush.gif b/assets/b_btnpush.gif new file mode 100644 index 0000000..00628e0 Binary files /dev/null and b/assets/b_btnpush.gif differ diff --git a/assets/b_btnring.gif b/assets/b_btnring.gif new file mode 100644 index 0000000..6fe7733 Binary files /dev/null and b/assets/b_btnring.gif differ diff --git a/assets/b_defbtn.gif b/assets/b_defbtn.gif new file mode 100644 index 0000000..9829823 Binary files /dev/null and b/assets/b_defbtn.gif differ diff --git a/assets/b_frame.gif b/assets/b_frame.gif new file mode 100644 index 0000000..7f1498e Binary files /dev/null and b/assets/b_frame.gif differ diff --git a/assets/b_gen.gif b/assets/b_gen.gif new file mode 100644 index 0000000..f3f7c12 Binary files /dev/null and b/assets/b_gen.gif differ diff --git a/assets/b_genpush.gif b/assets/b_genpush.gif new file mode 100644 index 0000000..a9267a9 Binary files /dev/null and b/assets/b_genpush.gif differ diff --git a/assets/b_keycap.gif b/assets/b_keycap.gif new file mode 100644 index 0000000..b6962ad Binary files /dev/null and b/assets/b_keycap.gif differ diff --git a/assets/b_keycap2.gif b/assets/b_keycap2.gif new file mode 100644 index 0000000..15afa25 Binary files /dev/null and b/assets/b_keycap2.gif differ diff --git a/assets/b_text.gif b/assets/b_text.gif new file mode 100644 index 0000000..3d75621 Binary files /dev/null and b/assets/b_text.gif differ diff --git a/assets/b_textdis.gif b/assets/b_textdis.gif new file mode 100644 index 0000000..350dceb Binary files /dev/null and b/assets/b_textdis.gif differ diff --git a/assets/b_winframe.gif b/assets/b_winframe.gif new file mode 100644 index 0000000..bedd8f9 Binary files /dev/null and b/assets/b_winframe.gif differ diff --git a/assets/b_winframe2.gif b/assets/b_winframe2.gif new file mode 100644 index 0000000..e6c3ad9 Binary files /dev/null and b/assets/b_winframe2.gif differ diff --git a/assets/b_winframe2err.gif b/assets/b_winframe2err.gif new file mode 100644 index 0000000..657eaa5 Binary files /dev/null and b/assets/b_winframe2err.gif differ diff --git a/assets/b_winnote.gif b/assets/b_winnote.gif new file mode 100644 index 0000000..25a6857 Binary files /dev/null and b/assets/b_winnote.gif differ diff --git a/assets/b_wintitle.gif b/assets/b_wintitle.gif new file mode 100644 index 0000000..45c9336 Binary files /dev/null and b/assets/b_wintitle.gif differ diff --git a/assets/b_wintitle2err.gif b/assets/b_wintitle2err.gif new file mode 100644 index 0000000..d131c29 Binary files /dev/null and b/assets/b_wintitle2err.gif differ diff --git a/assets/ball.png b/assets/ball.png new file mode 100644 index 0000000..1d16659 Binary files /dev/null and b/assets/ball.png differ diff --git a/assets/bull_arrow.gif b/assets/bull_arrow.gif new file mode 100644 index 0000000..7f5e83e Binary files /dev/null and b/assets/bull_arrow.gif differ diff --git a/assets/bull_arrow_down.gif b/assets/bull_arrow_down.gif new file mode 100644 index 0000000..0f124d2 Binary files /dev/null and b/assets/bull_arrow_down.gif differ diff --git a/assets/bull_arrow_down_in.gif b/assets/bull_arrow_down_in.gif new file mode 100644 index 0000000..985556c Binary files /dev/null and b/assets/bull_arrow_down_in.gif differ diff --git a/assets/bull_arrow_in.gif b/assets/bull_arrow_in.gif new file mode 100644 index 0000000..6af613e Binary files /dev/null and b/assets/bull_arrow_in.gif differ diff --git a/assets/bull_diamond.gif b/assets/bull_diamond.gif new file mode 100644 index 0000000..e4a7009 Binary files /dev/null and b/assets/bull_diamond.gif differ diff --git a/assets/bull_diamond_blue.gif b/assets/bull_diamond_blue.gif new file mode 100644 index 0000000..49ed8de Binary files /dev/null and b/assets/bull_diamond_blue.gif differ diff --git a/assets/bull_diamond_cyan.gif b/assets/bull_diamond_cyan.gif new file mode 100644 index 0000000..49140e6 Binary files /dev/null and b/assets/bull_diamond_cyan.gif differ diff --git a/assets/bull_diamond_green.gif b/assets/bull_diamond_green.gif new file mode 100644 index 0000000..ba0a17c Binary files /dev/null and b/assets/bull_diamond_green.gif differ diff --git a/assets/bull_diamond_in.gif b/assets/bull_diamond_in.gif new file mode 100644 index 0000000..a5716e1 Binary files /dev/null and b/assets/bull_diamond_in.gif differ diff --git a/assets/bull_diamond_magenta.gif b/assets/bull_diamond_magenta.gif new file mode 100644 index 0000000..7145d13 Binary files /dev/null and b/assets/bull_diamond_magenta.gif differ diff --git a/assets/bull_diamond_red.gif b/assets/bull_diamond_red.gif new file mode 100644 index 0000000..0f614b6 Binary files /dev/null and b/assets/bull_diamond_red.gif differ diff --git a/assets/bull_diamond_yellow.gif b/assets/bull_diamond_yellow.gif new file mode 100644 index 0000000..6da6ce1 Binary files /dev/null and b/assets/bull_diamond_yellow.gif differ diff --git a/assets/canyon.mid b/assets/canyon.mid new file mode 100644 index 0000000..f3eed0c Binary files /dev/null and b/assets/canyon.mid differ diff --git a/assets/checkbox.gif b/assets/checkbox.gif new file mode 100644 index 0000000..3180ba7 Binary files /dev/null and b/assets/checkbox.gif differ diff --git a/assets/coffeebean.gif b/assets/coffeebean.gif new file mode 100644 index 0000000..b724f00 Binary files /dev/null and b/assets/coffeebean.gif differ diff --git a/assets/coffeebean2.gif b/assets/coffeebean2.gif new file mode 100644 index 0000000..69a0015 Binary files /dev/null and b/assets/coffeebean2.gif differ diff --git a/assets/coffeebean_dark.gif b/assets/coffeebean_dark.gif new file mode 100644 index 0000000..8cb01dc Binary files /dev/null and b/assets/coffeebean_dark.gif differ diff --git a/assets/coffeebean_dark2.gif b/assets/coffeebean_dark2.gif new file mode 100644 index 0000000..cae1e95 Binary files /dev/null and b/assets/coffeebean_dark2.gif differ diff --git a/assets/coffeebean_light.gif b/assets/coffeebean_light.gif new file mode 100644 index 0000000..cafb762 Binary files /dev/null and b/assets/coffeebean_light.gif differ diff --git a/assets/coin_bch.png b/assets/coin_bch.png new file mode 100644 index 0000000..cac9458 Binary files /dev/null and b/assets/coin_bch.png differ diff --git a/assets/coin_btc.png b/assets/coin_btc.png new file mode 100644 index 0000000..421bc55 Binary files /dev/null and b/assets/coin_btc.png differ diff --git a/assets/coin_eth.png b/assets/coin_eth.png new file mode 100644 index 0000000..d31029f Binary files /dev/null and b/assets/coin_eth.png differ diff --git a/assets/coin_ltc.png b/assets/coin_ltc.png new file mode 100644 index 0000000..1c66435 Binary files /dev/null and b/assets/coin_ltc.png differ diff --git a/assets/coin_wow.png b/assets/coin_wow.png new file mode 100644 index 0000000..07357b3 Binary files /dev/null and b/assets/coin_wow.png differ diff --git a/assets/coin_xmr.png b/assets/coin_xmr.png new file mode 100644 index 0000000..fa7fd83 Binary files /dev/null and b/assets/coin_xmr.png differ diff --git a/assets/colarrow.png b/assets/colarrow.png new file mode 100644 index 0000000..eba826c Binary files /dev/null and b/assets/colarrow.png differ diff --git a/assets/entry_of_the_gladiators.mp3 b/assets/entry_of_the_gladiators.mp3 new file mode 100644 index 0000000..4434ab3 Binary files /dev/null and b/assets/entry_of_the_gladiators.mp3 differ diff --git a/assets/error.png b/assets/error.png new file mode 100644 index 0000000..f0d16e3 Binary files /dev/null and b/assets/error.png differ diff --git a/assets/error_big.png b/assets/error_big.png new file mode 100644 index 0000000..057efd2 Binary files /dev/null and b/assets/error_big.png differ diff --git a/assets/error_big2.png b/assets/error_big2.png new file mode 100644 index 0000000..d754151 Binary files /dev/null and b/assets/error_big2.png differ diff --git a/assets/favicon.png b/assets/favicon.png new file mode 100644 index 0000000..17daf0e Binary files /dev/null and b/assets/favicon.png differ diff --git a/assets/fonts/IBMPlexSerif-400.woff2 b/assets/fonts/IBMPlexSerif-400.woff2 new file mode 100644 index 0000000..3130c37 Binary files /dev/null and b/assets/fonts/IBMPlexSerif-400.woff2 differ diff --git a/assets/fonts/IBMPlexSerif-400i.woff2 b/assets/fonts/IBMPlexSerif-400i.woff2 new file mode 100644 index 0000000..8c775cb Binary files /dev/null and b/assets/fonts/IBMPlexSerif-400i.woff2 differ diff --git a/assets/fonts/IBMPlexSerif-500.woff2 b/assets/fonts/IBMPlexSerif-500.woff2 new file mode 100644 index 0000000..fc1a56e Binary files /dev/null and b/assets/fonts/IBMPlexSerif-500.woff2 differ diff --git a/assets/fonts/IBMPlexSerif-500i.woff2 b/assets/fonts/IBMPlexSerif-500i.woff2 new file mode 100644 index 0000000..b8dc44d Binary files /dev/null and b/assets/fonts/IBMPlexSerif-500i.woff2 differ diff --git a/assets/fonts/IBMPlexSerif-700.woff2 b/assets/fonts/IBMPlexSerif-700.woff2 new file mode 100644 index 0000000..31fc24c Binary files /dev/null and b/assets/fonts/IBMPlexSerif-700.woff2 differ diff --git a/assets/fonts/IBMPlexSerif-700i.woff2 b/assets/fonts/IBMPlexSerif-700i.woff2 new file mode 100644 index 0000000..f51d6e8 Binary files /dev/null and b/assets/fonts/IBMPlexSerif-700i.woff2 differ diff --git a/assets/fonts/plex-serif.css b/assets/fonts/plex-serif.css new file mode 100644 index 0000000..3eb2ebd --- /dev/null +++ b/assets/fonts/plex-serif.css @@ -0,0 +1,42 @@ +@font-face { + font-family: 'IBM Plex Serif'; + font-style: normal; + font-weight: 400; + src: url(/assets/fonts/IBMPlexSerif-400.woff2) format('woff2'); + font-display: swap; +} +@font-face { + font-family: 'IBM Plex Serif'; + font-style: italic; + font-weight: 400; + src: url(/assets/fonts/IBMPlexSerif-400i.woff2) format('woff2'); + font-display: swap; +} +@font-face { + font-family: 'IBM Plex Serif'; + font-style: normal; + font-weight: 500; + src: url(/assets/fonts/IBMPlexSerif-500.woff2) format('woff2'); + font-display: swap; +} +@font-face { + font-family: 'IBM Plex Serif'; + font-style: italic; + font-weight: 500; + src: url(/assets/fonts/IBMPlexSerif-500i.woff2) format('woff2'); + font-display: swap; +} +@font-face { + font-family: 'IBM Plex Serif'; + font-style: normal; + font-weight: 700; + src: url(/assets/fonts/IBMPlexSerif-700.woff2) format('woff2'); + font-display: swap; +} +@font-face { + font-family: 'IBM Plex Serif'; + font-style: italic; + font-weight: 700; + src: url(/assets/fonts/IBMPlexSerif-700i.woff2) format('woff2'); + font-display: swap; +} diff --git a/assets/hicolor/.htaccess b/assets/hicolor/.htaccess new file mode 100644 index 0000000..d0c78c4 --- /dev/null +++ b/assets/hicolor/.htaccess @@ -0,0 +1,4 @@ + + # Cache icons for 2 months + Header set Cache-Control "max-age=5184000,public,no-transform" + diff --git a/assets/hicolor/applix.png b/assets/hicolor/applix.png new file mode 100644 index 0000000..82e2c91 Binary files /dev/null and b/assets/hicolor/applix.png differ diff --git a/assets/hicolor/binary2.png b/assets/hicolor/binary2.png new file mode 100644 index 0000000..bfb725a Binary files /dev/null and b/assets/hicolor/binary2.png differ diff --git a/assets/hicolor/cdtrack.png b/assets/hicolor/cdtrack.png new file mode 100644 index 0000000..ef34738 Binary files /dev/null and b/assets/hicolor/cdtrack.png differ diff --git a/assets/hicolor/clipboard.png b/assets/hicolor/clipboard.png new file mode 100644 index 0000000..dcd713c Binary files /dev/null and b/assets/hicolor/clipboard.png differ diff --git a/assets/hicolor/colorscm.png b/assets/hicolor/colorscm.png new file mode 100644 index 0000000..6a0d145 Binary files /dev/null and b/assets/hicolor/colorscm.png differ diff --git a/assets/hicolor/core.png b/assets/hicolor/core.png new file mode 100644 index 0000000..766d934 Binary files /dev/null and b/assets/hicolor/core.png differ diff --git a/assets/hicolor/deb.png b/assets/hicolor/deb.png new file mode 100644 index 0000000..cd7eaa9 Binary files /dev/null and b/assets/hicolor/deb.png differ diff --git a/assets/hicolor/document.png b/assets/hicolor/document.png new file mode 100644 index 0000000..40c35a1 Binary files /dev/null and b/assets/hicolor/document.png differ diff --git a/assets/hicolor/document2.png b/assets/hicolor/document2.png new file mode 100644 index 0000000..05a3bfa Binary files /dev/null and b/assets/hicolor/document2.png differ diff --git a/assets/hicolor/dvi.png b/assets/hicolor/dvi.png new file mode 100644 index 0000000..7d43197 Binary files /dev/null and b/assets/hicolor/dvi.png differ diff --git a/assets/hicolor/exec.png b/assets/hicolor/exec.png new file mode 100644 index 0000000..45a0d9d Binary files /dev/null and b/assets/hicolor/exec.png differ diff --git a/assets/hicolor/folder.png b/assets/hicolor/folder.png new file mode 100644 index 0000000..1ef4180 Binary files /dev/null and b/assets/hicolor/folder.png differ diff --git a/assets/hicolor/folder_blue.png b/assets/hicolor/folder_blue.png new file mode 100644 index 0000000..4b03916 Binary files /dev/null and b/assets/hicolor/folder_blue.png differ diff --git a/assets/hicolor/folder_blue_open.png b/assets/hicolor/folder_blue_open.png new file mode 100644 index 0000000..a17d1f4 Binary files /dev/null and b/assets/hicolor/folder_blue_open.png differ diff --git a/assets/hicolor/folder_cyan.png b/assets/hicolor/folder_cyan.png new file mode 100644 index 0000000..fdf3241 Binary files /dev/null and b/assets/hicolor/folder_cyan.png differ diff --git a/assets/hicolor/folder_cyan_open.png b/assets/hicolor/folder_cyan_open.png new file mode 100644 index 0000000..9d42dbf Binary files /dev/null and b/assets/hicolor/folder_cyan_open.png differ diff --git a/assets/hicolor/folder_green.png b/assets/hicolor/folder_green.png new file mode 100644 index 0000000..054b832 Binary files /dev/null and b/assets/hicolor/folder_green.png differ diff --git a/assets/hicolor/folder_green_open.png b/assets/hicolor/folder_green_open.png new file mode 100644 index 0000000..079c1b8 Binary files /dev/null and b/assets/hicolor/folder_green_open.png differ diff --git a/assets/hicolor/folder_grey.png b/assets/hicolor/folder_grey.png new file mode 100644 index 0000000..284572c Binary files /dev/null and b/assets/hicolor/folder_grey.png differ diff --git a/assets/hicolor/folder_grey_open.png b/assets/hicolor/folder_grey_open.png new file mode 100644 index 0000000..f607db4 Binary files /dev/null and b/assets/hicolor/folder_grey_open.png differ diff --git a/assets/hicolor/folder_home.png b/assets/hicolor/folder_home.png new file mode 100644 index 0000000..94699cd Binary files /dev/null and b/assets/hicolor/folder_home.png differ diff --git a/assets/hicolor/folder_html.png b/assets/hicolor/folder_html.png new file mode 100644 index 0000000..748443d Binary files /dev/null and b/assets/hicolor/folder_html.png differ diff --git a/assets/hicolor/folder_image.png b/assets/hicolor/folder_image.png new file mode 100644 index 0000000..0ca4cd3 Binary files /dev/null and b/assets/hicolor/folder_image.png differ diff --git a/assets/hicolor/folder_locked.png b/assets/hicolor/folder_locked.png new file mode 100644 index 0000000..68ace92 Binary files /dev/null and b/assets/hicolor/folder_locked.png differ diff --git a/assets/hicolor/folder_man.png b/assets/hicolor/folder_man.png new file mode 100644 index 0000000..bc6a42d Binary files /dev/null and b/assets/hicolor/folder_man.png differ diff --git a/assets/hicolor/folder_open.png b/assets/hicolor/folder_open.png new file mode 100644 index 0000000..13a332c Binary files /dev/null and b/assets/hicolor/folder_open.png differ diff --git a/assets/hicolor/folder_orange.png b/assets/hicolor/folder_orange.png new file mode 100644 index 0000000..252186d Binary files /dev/null and b/assets/hicolor/folder_orange.png differ diff --git a/assets/hicolor/folder_orange_open.png b/assets/hicolor/folder_orange_open.png new file mode 100644 index 0000000..7e2fd52 Binary files /dev/null and b/assets/hicolor/folder_orange_open.png differ diff --git a/assets/hicolor/folder_print2.png b/assets/hicolor/folder_print2.png new file mode 100644 index 0000000..d0cd38e Binary files /dev/null and b/assets/hicolor/folder_print2.png differ diff --git a/assets/hicolor/folder_red.png b/assets/hicolor/folder_red.png new file mode 100644 index 0000000..18c7c6c Binary files /dev/null and b/assets/hicolor/folder_red.png differ diff --git a/assets/hicolor/folder_red_open.png b/assets/hicolor/folder_red_open.png new file mode 100644 index 0000000..846213f Binary files /dev/null and b/assets/hicolor/folder_red_open.png differ diff --git a/assets/hicolor/folder_sound.png b/assets/hicolor/folder_sound.png new file mode 100644 index 0000000..a2bd8b7 Binary files /dev/null and b/assets/hicolor/folder_sound.png differ diff --git a/assets/hicolor/folder_tar.png b/assets/hicolor/folder_tar.png new file mode 100644 index 0000000..798b5bb Binary files /dev/null and b/assets/hicolor/folder_tar.png differ diff --git a/assets/hicolor/folder_txt.png b/assets/hicolor/folder_txt.png new file mode 100644 index 0000000..56fa7dd Binary files /dev/null and b/assets/hicolor/folder_txt.png differ diff --git a/assets/hicolor/folder_video.png b/assets/hicolor/folder_video.png new file mode 100644 index 0000000..fbc7031 Binary files /dev/null and b/assets/hicolor/folder_video.png differ diff --git a/assets/hicolor/folder_violet.png b/assets/hicolor/folder_violet.png new file mode 100644 index 0000000..7fe47aa Binary files /dev/null and b/assets/hicolor/folder_violet.png differ diff --git a/assets/hicolor/folder_violet_open.png b/assets/hicolor/folder_violet_open.png new file mode 100644 index 0000000..8a4b895 Binary files /dev/null and b/assets/hicolor/folder_violet_open.png differ diff --git a/assets/hicolor/folder_wordprocessing.png b/assets/hicolor/folder_wordprocessing.png new file mode 100644 index 0000000..79e616b Binary files /dev/null and b/assets/hicolor/folder_wordprocessing.png differ diff --git a/assets/hicolor/folder_yellow.png b/assets/hicolor/folder_yellow.png new file mode 100644 index 0000000..e247373 Binary files /dev/null and b/assets/hicolor/folder_yellow.png differ diff --git a/assets/hicolor/folder_yellow_open.png b/assets/hicolor/folder_yellow_open.png new file mode 100644 index 0000000..ce57757 Binary files /dev/null and b/assets/hicolor/folder_yellow_open.png differ diff --git a/assets/hicolor/font_bitmap.png b/assets/hicolor/font_bitmap.png new file mode 100644 index 0000000..7a051ea Binary files /dev/null and b/assets/hicolor/font_bitmap.png differ diff --git a/assets/hicolor/font_truetype.png b/assets/hicolor/font_truetype.png new file mode 100644 index 0000000..97240c4 Binary files /dev/null and b/assets/hicolor/font_truetype.png differ diff --git a/assets/hicolor/font_type1.png b/assets/hicolor/font_type1.png new file mode 100644 index 0000000..e6fd1e3 Binary files /dev/null and b/assets/hicolor/font_type1.png differ diff --git a/assets/hicolor/forward.png b/assets/hicolor/forward.png new file mode 100644 index 0000000..943c761 Binary files /dev/null and b/assets/hicolor/forward.png differ diff --git a/assets/hicolor/ftp.png b/assets/hicolor/ftp.png new file mode 100644 index 0000000..0cf3f0e Binary files /dev/null and b/assets/hicolor/ftp.png differ diff --git a/assets/hicolor/gettext.png b/assets/hicolor/gettext.png new file mode 100644 index 0000000..8664254 Binary files /dev/null and b/assets/hicolor/gettext.png differ diff --git a/assets/hicolor/gf.png b/assets/hicolor/gf.png new file mode 100644 index 0000000..af0ce6d Binary files /dev/null and b/assets/hicolor/gf.png differ diff --git a/assets/hicolor/html.png b/assets/hicolor/html.png new file mode 100644 index 0000000..8d58a8b Binary files /dev/null and b/assets/hicolor/html.png differ diff --git a/assets/hicolor/image.png b/assets/hicolor/image.png new file mode 100644 index 0000000..545d2be Binary files /dev/null and b/assets/hicolor/image.png differ diff --git a/assets/hicolor/info.png b/assets/hicolor/info.png new file mode 100644 index 0000000..8012736 Binary files /dev/null and b/assets/hicolor/info.png differ diff --git a/assets/hicolor/launch.png b/assets/hicolor/launch.png new file mode 100644 index 0000000..120f2ff Binary files /dev/null and b/assets/hicolor/launch.png differ diff --git a/assets/hicolor/log.png b/assets/hicolor/log.png new file mode 100644 index 0000000..ca87a32 Binary files /dev/null and b/assets/hicolor/log.png differ diff --git a/assets/hicolor/make.png b/assets/hicolor/make.png new file mode 100644 index 0000000..780cd6c Binary files /dev/null and b/assets/hicolor/make.png differ diff --git a/assets/hicolor/man.png b/assets/hicolor/man.png new file mode 100644 index 0000000..8a19bd6 Binary files /dev/null and b/assets/hicolor/man.png differ diff --git a/assets/hicolor/message.png b/assets/hicolor/message.png new file mode 100644 index 0000000..af5ff7d Binary files /dev/null and b/assets/hicolor/message.png differ diff --git a/assets/hicolor/midi.png b/assets/hicolor/midi.png new file mode 100644 index 0000000..9337685 Binary files /dev/null and b/assets/hicolor/midi.png differ diff --git a/assets/hicolor/mime_empty.png b/assets/hicolor/mime_empty.png new file mode 100644 index 0000000..8415978 Binary files /dev/null and b/assets/hicolor/mime_empty.png differ diff --git a/assets/hicolor/misc_doc.png b/assets/hicolor/misc_doc.png new file mode 100644 index 0000000..00861f1 Binary files /dev/null and b/assets/hicolor/misc_doc.png differ diff --git a/assets/hicolor/netscape_doc.png b/assets/hicolor/netscape_doc.png new file mode 100644 index 0000000..d5a3fba Binary files /dev/null and b/assets/hicolor/netscape_doc.png differ diff --git a/assets/hicolor/network.png b/assets/hicolor/network.png new file mode 100644 index 0000000..87864fa Binary files /dev/null and b/assets/hicolor/network.png differ diff --git a/assets/hicolor/network_local.png b/assets/hicolor/network_local.png new file mode 100644 index 0000000..d08a2bc Binary files /dev/null and b/assets/hicolor/network_local.png differ diff --git a/assets/hicolor/news.png b/assets/hicolor/news.png new file mode 100644 index 0000000..44e4721 Binary files /dev/null and b/assets/hicolor/news.png differ diff --git a/assets/hicolor/pdf.png b/assets/hicolor/pdf.png new file mode 100644 index 0000000..dd9be30 Binary files /dev/null and b/assets/hicolor/pdf.png differ diff --git a/assets/hicolor/pipe.png b/assets/hicolor/pipe.png new file mode 100644 index 0000000..a8bdace Binary files /dev/null and b/assets/hicolor/pipe.png differ diff --git a/assets/hicolor/postscript.png b/assets/hicolor/postscript.png new file mode 100644 index 0000000..9ee552f Binary files /dev/null and b/assets/hicolor/postscript.png differ diff --git a/assets/hicolor/readme.png b/assets/hicolor/readme.png new file mode 100644 index 0000000..eb6da52 Binary files /dev/null and b/assets/hicolor/readme.png differ diff --git a/assets/hicolor/recycled.png b/assets/hicolor/recycled.png new file mode 100644 index 0000000..20cf777 Binary files /dev/null and b/assets/hicolor/recycled.png differ diff --git a/assets/hicolor/resource.png b/assets/hicolor/resource.png new file mode 100644 index 0000000..1097b8b Binary files /dev/null and b/assets/hicolor/resource.png differ diff --git a/assets/hicolor/shellscript.png b/assets/hicolor/shellscript.png new file mode 100644 index 0000000..3ff2592 Binary files /dev/null and b/assets/hicolor/shellscript.png differ diff --git a/assets/hicolor/shellscript2.png b/assets/hicolor/shellscript2.png new file mode 100644 index 0000000..d8edbef Binary files /dev/null and b/assets/hicolor/shellscript2.png differ diff --git a/assets/hicolor/socket.png b/assets/hicolor/socket.png new file mode 100644 index 0000000..42179e9 Binary files /dev/null and b/assets/hicolor/socket.png differ diff --git a/assets/hicolor/sound.png b/assets/hicolor/sound.png new file mode 100644 index 0000000..b93dd5e Binary files /dev/null and b/assets/hicolor/sound.png differ diff --git a/assets/hicolor/source.png b/assets/hicolor/source.png new file mode 100644 index 0000000..e2a70a8 Binary files /dev/null and b/assets/hicolor/source.png differ diff --git a/assets/hicolor/source_java.png b/assets/hicolor/source_java.png new file mode 100644 index 0000000..366b8e7 Binary files /dev/null and b/assets/hicolor/source_java.png differ diff --git a/assets/hicolor/tar.png b/assets/hicolor/tar.png new file mode 100644 index 0000000..73fde58 Binary files /dev/null and b/assets/hicolor/tar.png differ diff --git a/assets/hicolor/tgz.png b/assets/hicolor/tgz.png new file mode 100644 index 0000000..6817b76 Binary files /dev/null and b/assets/hicolor/tgz.png differ diff --git a/assets/hicolor/trashcan_empty.png b/assets/hicolor/trashcan_empty.png new file mode 100644 index 0000000..c6539d9 Binary files /dev/null and b/assets/hicolor/trashcan_empty.png differ diff --git a/assets/hicolor/trashcan_full.png b/assets/hicolor/trashcan_full.png new file mode 100644 index 0000000..b434fcc Binary files /dev/null and b/assets/hicolor/trashcan_full.png differ diff --git a/assets/hicolor/txt.png b/assets/hicolor/txt.png new file mode 100644 index 0000000..e913392 Binary files /dev/null and b/assets/hicolor/txt.png differ diff --git a/assets/hicolor/unknown.png b/assets/hicolor/unknown.png new file mode 100644 index 0000000..51b5383 Binary files /dev/null and b/assets/hicolor/unknown.png differ diff --git a/assets/hicolor/up.png b/assets/hicolor/up.png new file mode 100644 index 0000000..dc9cb1f Binary files /dev/null and b/assets/hicolor/up.png differ diff --git a/assets/hicolor/vcalendar.png b/assets/hicolor/vcalendar.png new file mode 100644 index 0000000..a49594c Binary files /dev/null and b/assets/hicolor/vcalendar.png differ diff --git a/assets/hicolor/vcard.png b/assets/hicolor/vcard.png new file mode 100644 index 0000000..470915e Binary files /dev/null and b/assets/hicolor/vcard.png differ diff --git a/assets/hicolor/vectorgfx.png b/assets/hicolor/vectorgfx.png new file mode 100644 index 0000000..22366f0 Binary files /dev/null and b/assets/hicolor/vectorgfx.png differ diff --git a/assets/hicolor/video.png b/assets/hicolor/video.png new file mode 100644 index 0000000..7a4c303 Binary files /dev/null and b/assets/hicolor/video.png differ diff --git a/assets/hicolor/widget_doc.png b/assets/hicolor/widget_doc.png new file mode 100644 index 0000000..0707556 Binary files /dev/null and b/assets/hicolor/widget_doc.png differ diff --git a/assets/hicolor/wordprocessing.png b/assets/hicolor/wordprocessing.png new file mode 100644 index 0000000..de7831b Binary files /dev/null and b/assets/hicolor/wordprocessing.png differ diff --git a/assets/hicolor/www.png b/assets/hicolor/www.png new file mode 100644 index 0000000..3dd6c12 Binary files /dev/null and b/assets/hicolor/www.png differ diff --git a/assets/info.png b/assets/info.png new file mode 100644 index 0000000..43b0297 Binary files /dev/null and b/assets/info.png differ diff --git a/assets/info_green.png b/assets/info_green.png new file mode 100644 index 0000000..7e96414 Binary files /dev/null and b/assets/info_green.png differ diff --git a/assets/kns_logo.gif b/assets/kns_logo.gif new file mode 100644 index 0000000..81d2938 Binary files /dev/null and b/assets/kns_logo.gif differ diff --git a/assets/loading.gif b/assets/loading.gif new file mode 100644 index 0000000..7ff1756 Binary files /dev/null and b/assets/loading.gif differ diff --git a/assets/mail_send.png b/assets/mail_send.png new file mode 100644 index 0000000..40610b9 Binary files /dev/null and b/assets/mail_send.png differ diff --git a/assets/mario_explodes.gif b/assets/mario_explodes.gif new file mode 100644 index 0000000..824a5c3 Binary files /dev/null and b/assets/mario_explodes.gif differ diff --git a/assets/mario_relaxing.gif b/assets/mario_relaxing.gif new file mode 100644 index 0000000..854680e Binary files /dev/null and b/assets/mario_relaxing.gif differ diff --git a/assets/mariopaint_hand_gold.cur b/assets/mariopaint_hand_gold.cur new file mode 100644 index 0000000..7cb1563 Binary files /dev/null and b/assets/mariopaint_hand_gold.cur differ diff --git a/assets/mariopaint_hand_white.cur b/assets/mariopaint_hand_white.cur new file mode 100644 index 0000000..52127ab Binary files /dev/null and b/assets/mariopaint_hand_white.cur differ diff --git a/assets/me.png b/assets/me.png new file mode 100644 index 0000000..9498931 Binary files /dev/null and b/assets/me.png differ diff --git a/assets/menu_closed.png b/assets/menu_closed.png new file mode 100644 index 0000000..c8221e0 Binary files /dev/null and b/assets/menu_closed.png differ diff --git a/assets/menu_icons.gif b/assets/menu_icons.gif new file mode 100644 index 0000000..b6a914b Binary files /dev/null and b/assets/menu_icons.gif differ diff --git a/assets/menu_icons.png b/assets/menu_icons.png new file mode 100644 index 0000000..ac726d5 Binary files /dev/null and b/assets/menu_icons.png differ diff --git a/assets/menu_open.png b/assets/menu_open.png new file mode 100644 index 0000000..77fa352 Binary files /dev/null and b/assets/menu_open.png differ diff --git a/assets/msg_error.gif b/assets/msg_error.gif new file mode 100644 index 0000000..eaba704 Binary files /dev/null and b/assets/msg_error.gif differ diff --git a/assets/msg_error2.gif b/assets/msg_error2.gif new file mode 100644 index 0000000..acb6d6d Binary files /dev/null and b/assets/msg_error2.gif differ diff --git a/assets/msg_info.gif b/assets/msg_info.gif new file mode 100644 index 0000000..bb0ba5e Binary files /dev/null and b/assets/msg_info.gif differ diff --git a/assets/msg_info2.gif b/assets/msg_info2.gif new file mode 100644 index 0000000..bbe3f70 Binary files /dev/null and b/assets/msg_info2.gif differ diff --git a/assets/msg_succ.gif b/assets/msg_succ.gif new file mode 100644 index 0000000..ab4416d Binary files /dev/null and b/assets/msg_succ.gif differ diff --git a/assets/msg_succ2.gif b/assets/msg_succ2.gif new file mode 100644 index 0000000..73a51c7 Binary files /dev/null and b/assets/msg_succ2.gif differ diff --git a/assets/msg_warn.gif b/assets/msg_warn.gif new file mode 100644 index 0000000..768a76c Binary files /dev/null and b/assets/msg_warn.gif differ diff --git a/assets/msg_warn2.gif b/assets/msg_warn2.gif new file mode 100644 index 0000000..219ef49 Binary files /dev/null and b/assets/msg_warn2.gif differ diff --git a/assets/p_anarchy.gif b/assets/p_anarchy.gif new file mode 100644 index 0000000..c6ffe22 Binary files /dev/null and b/assets/p_anarchy.gif differ diff --git a/assets/p_antifa.gif b/assets/p_antifa.gif new file mode 100644 index 0000000..62fd4a8 Binary files /dev/null and b/assets/p_antifa.gif differ diff --git a/assets/p_arachnid.png b/assets/p_arachnid.png new file mode 100644 index 0000000..a33510b Binary files /dev/null and b/assets/p_arachnid.png differ diff --git a/assets/p_bunnyhearted.gif b/assets/p_bunnyhearted.gif new file mode 100644 index 0000000..2e1b3e4 Binary files /dev/null and b/assets/p_bunnyhearted.gif differ diff --git a/assets/p_cel.png b/assets/p_cel.png new file mode 100644 index 0000000..ce95ce5 Binary files /dev/null and b/assets/p_cel.png differ diff --git a/assets/p_cocksuckingfaggot.gif b/assets/p_cocksuckingfaggot.gif new file mode 100644 index 0000000..e6ea598 Binary files /dev/null and b/assets/p_cocksuckingfaggot.gif differ diff --git a/assets/p_monero.gif b/assets/p_monero.gif new file mode 100644 index 0000000..7219f6e Binary files /dev/null and b/assets/p_monero.gif differ diff --git a/assets/p_pride.xcf b/assets/p_pride.xcf new file mode 100644 index 0000000..bdc3122 Binary files /dev/null and b/assets/p_pride.xcf differ diff --git a/assets/p_pride_furry.gif b/assets/p_pride_furry.gif new file mode 100644 index 0000000..34f5834 Binary files /dev/null and b/assets/p_pride_furry.gif differ diff --git a/assets/p_pride_furry2.gif b/assets/p_pride_furry2.gif new file mode 100644 index 0000000..2be63e3 Binary files /dev/null and b/assets/p_pride_furry2.gif differ diff --git a/assets/p_pride_polyam.gif b/assets/p_pride_polyam.gif new file mode 100644 index 0000000..83addbf Binary files /dev/null and b/assets/p_pride_polyam.gif differ diff --git a/assets/p_pride_punk.gif b/assets/p_pride_punk.gif new file mode 100644 index 0000000..537023f Binary files /dev/null and b/assets/p_pride_punk.gif differ diff --git a/assets/p_pride_punk2.gif b/assets/p_pride_punk2.gif new file mode 100644 index 0000000..c26e8d7 Binary files /dev/null and b/assets/p_pride_punk2.gif differ diff --git a/assets/p_pride_punk_furry.gif b/assets/p_pride_punk_furry.gif new file mode 100644 index 0000000..601efa3 Binary files /dev/null and b/assets/p_pride_punk_furry.gif differ diff --git a/assets/p_pride_pup.gif b/assets/p_pride_pup.gif new file mode 100644 index 0000000..5eceee6 Binary files /dev/null and b/assets/p_pride_pup.gif differ diff --git a/assets/p_pride_trans_furry.gif b/assets/p_pride_trans_furry.gif new file mode 100644 index 0000000..037d325 Binary files /dev/null and b/assets/p_pride_trans_furry.gif differ diff --git a/assets/p_pride_transspecies.gif b/assets/p_pride_transspecies.gif new file mode 100644 index 0000000..75905c8 Binary files /dev/null and b/assets/p_pride_transspecies.gif differ diff --git a/assets/p_pride_transspecies2.gif b/assets/p_pride_transspecies2.gif new file mode 100644 index 0000000..a52b463 Binary files /dev/null and b/assets/p_pride_transspecies2.gif differ diff --git a/assets/p_pride_transspecies_anim.gif b/assets/p_pride_transspecies_anim.gif new file mode 100644 index 0000000..e1348ad Binary files /dev/null and b/assets/p_pride_transspecies_anim.gif differ diff --git a/assets/p_web_pi.png b/assets/p_web_pi.png new file mode 100644 index 0000000..f3f04dd Binary files /dev/null and b/assets/p_web_pi.png differ diff --git a/assets/p_webb.png b/assets/p_webb.png new file mode 100644 index 0000000..b043f28 Binary files /dev/null and b/assets/p_webb.png differ diff --git a/assets/radiobtn.gif b/assets/radiobtn.gif new file mode 100644 index 0000000..3c9b923 Binary files /dev/null and b/assets/radiobtn.gif differ diff --git a/assets/reload.png b/assets/reload.png new file mode 100644 index 0000000..213abf2 Binary files /dev/null and b/assets/reload.png differ diff --git a/assets/right_arr_big.png b/assets/right_arr_big.png new file mode 100644 index 0000000..63f5e3d Binary files /dev/null and b/assets/right_arr_big.png differ diff --git a/assets/scanline.png b/assets/scanline.png new file mode 100644 index 0000000..4fa1317 Binary files /dev/null and b/assets/scanline.png differ diff --git a/assets/site_button.gif b/assets/site_button.gif new file mode 100644 index 0000000..1ca1c4d Binary files /dev/null and b/assets/site_button.gif differ diff --git a/assets/site_button.xcf b/assets/site_button.xcf new file mode 100644 index 0000000..33467f1 Binary files /dev/null and b/assets/site_button.xcf differ diff --git a/assets/site_favicon.png b/assets/site_favicon.png new file mode 100644 index 0000000..1240792 Binary files /dev/null and b/assets/site_favicon.png differ diff --git a/assets/site_favicon.xcf b/assets/site_favicon.xcf new file mode 100644 index 0000000..57c21f9 Binary files /dev/null and b/assets/site_favicon.xcf differ diff --git a/assets/site_favicon_large.png b/assets/site_favicon_large.png new file mode 100644 index 0000000..7e560e7 Binary files /dev/null and b/assets/site_favicon_large.png differ diff --git a/assets/sorry_nothing.png b/assets/sorry_nothing.png new file mode 100644 index 0000000..24aaf37 Binary files /dev/null and b/assets/sorry_nothing.png differ diff --git a/assets/sorry_nothing_face.png b/assets/sorry_nothing_face.png new file mode 100644 index 0000000..30b5085 Binary files /dev/null and b/assets/sorry_nothing_face.png differ diff --git a/assets/tip.png b/assets/tip.png new file mode 100644 index 0000000..9c87e24 Binary files /dev/null and b/assets/tip.png differ diff --git a/assets/treearr.gif b/assets/treearr.gif new file mode 100644 index 0000000..427df89 Binary files /dev/null and b/assets/treearr.gif differ diff --git a/assets/treearrd.gif b/assets/treearrd.gif new file mode 100644 index 0000000..1d81cfd Binary files /dev/null and b/assets/treearrd.gif differ diff --git a/assets/treearrdi.gif b/assets/treearrdi.gif new file mode 100644 index 0000000..5e75df4 Binary files /dev/null and b/assets/treearrdi.gif differ diff --git a/assets/treearri.gif b/assets/treearri.gif new file mode 100644 index 0000000..8894f3a Binary files /dev/null and b/assets/treearri.gif differ diff --git a/assets/winclose.gif b/assets/winclose.gif new file mode 100644 index 0000000..8b3e1ea Binary files /dev/null and b/assets/winclose.gif differ diff --git a/assets/winclosn.gif b/assets/winclosn.gif new file mode 100644 index 0000000..56e6bb3 Binary files /dev/null and b/assets/winclosn.gif differ diff --git a/assets/winshade.gif b/assets/winshade.gif new file mode 100644 index 0000000..e94b684 Binary files /dev/null and b/assets/winshade.gif differ diff --git a/assets/winshadn.gif b/assets/winshadn.gif new file mode 100644 index 0000000..c6e6ff3 Binary files /dev/null and b/assets/winshadn.gif differ diff --git a/assets/winsize.gif b/assets/winsize.gif new file mode 100644 index 0000000..03b194d Binary files /dev/null and b/assets/winsize.gif differ diff --git a/assets/winstripe.gif b/assets/winstripe.gif new file mode 100644 index 0000000..4a2e894 Binary files /dev/null and b/assets/winstripe.gif differ diff --git a/assets/winstripeerr.gif b/assets/winstripeerr.gif new file mode 100644 index 0000000..2198319 Binary files /dev/null and b/assets/winstripeerr.gif differ diff --git a/assets/www-logo.png b/assets/www-logo.png new file mode 100644 index 0000000..67ad8ae Binary files /dev/null and b/assets/www-logo.png differ diff --git a/css/Makefile b/css/Makefile new file mode 100644 index 0000000..6073251 --- /dev/null +++ b/css/Makefile @@ -0,0 +1,4 @@ +# Sass makefile, as a temporary test + +style_sass.css: main.scss $(wildcard *.scss) + sassc -t nested -m $< $@ diff --git a/css/components.scss b/css/components.scss new file mode 100644 index 0000000..979e247 --- /dev/null +++ b/css/components.scss @@ -0,0 +1,289 @@ +$palettes: ( + "lavender": (#eee, #ccf, #99f, #66c, #339, #008, #005), +); +$palette: map-get($palettes, "lavender"); +$ui-accent: nth($palette, 4); + +$rainbow: #ff4d4f,#ff7a45,#ffa940,#ffc53d,#ffec3d,#bae637,#73d13d,#36cfc9,#40a9ff,#597ef7,#9254de,#f759ab; + +$ui-font-size: calc(max(0.83333rem, min(13.3333px, 1rem))); + +@mixin clearfix($side: both) { + &::before, &::after { + content: " "; + display: table; + } + &::after { + clear: #{$side}; + } +} +.cf { + @include clearfix(); +} + +@mixin window($title-bar: ".title-bar", $content: ".content") { + border: { + width: 0px 6px 6px 6px; + color: #ccc; + style: solid; + image: url('/assets/b_winframe.gif') 6; + } + box-shadow: 2px 2px 0px -1px black; + background-color: #ddd; + margin: 8px 0px; + + clear: both; + + > #{unquote($title-bar)} { + border: { + width: 3px 6px; + color: #ccc; + style: solid; + image: url('/assets/b_wintitle.gif') 3 6; + } + background: { + color: #ccc; + image: url('/assets/winstripe.gif'); + position: center; + repeat: repeat-x; + } + margin: 0px -6px; + padding: 0px 4px; + + font-weight: 500; + text-align: center; + position: relative; + + text-overflow: ellipsis; + overflow: clip; + + > * { + background-color: #ccc; + padding: 0px 8px; + + font-size: 1em; + font-weight: 500; + text-align: center; + border: none; + color: inherit; + display: inline; + margin: 0px 8px; + } + &::before { + content: ''; + display: inline-block; + position: absolute; + left: 0; + top: 0; + bottom: 0; + + width: 16px; + padding-right: 4px; + background: { + color: #ccc; + image: url('/assets/winclose.gif'); + position: left center; + repeat: no-repeat; + } + vertical-align: middle; + } + } + > #{unquote($content)} { + margin: 8px; + } +} +.window { + @include window(); +} + +@mixin note-box() { + border: { + width: 4px 4px 4px 14px; + color: #ccc; + style: solid; + image: url('/assets/b_winnote.gif') 4 4 4 14; + image-repeat: repeat; + } + box-shadow: 2px 2px 0px -1px black; + padding: 8px; + + position: relative; + &::after { + content: ''; + position: absolute; + left: -12px; + top: -2px; + bottom: -2px; + width: 10px; + background: { + image: url("/assets/winclosn.gif"), url("/assets/winshadn.gif"); + position: top, bottom; + repeat: no-repeat, no-repeat; + } + } +} + +@mixin button() { + display: inline-block; + background-clip: padding-box; + background-color: #ddd; + border: { + width: 4px; + image: url('/assets/b_btn.gif') 4; + color: #fff; + style: outset; + } + padding: 1px 6px; + // border: solid 1px black; + // border-radius: 5px; + // box-shadow: 2px 2px 2px 0 #fff inset, -2px -2px 2px 0 #777 inset; + // padding: 4px 9px; + font: inherit; + font-size: $ui-font-size; + font-weight: 500; + text-align: center; + min-width: 5.4em; + margin: 4px; + + cursor: url('/assets/mariopaint_hand_gold.cur'), auto; + user-select: none; + + &:active { + background-color: #666; + color: #fff; + border: { + image: url('/assets/b_btnpush.gif') 4; + color: #888; + style: inset; + } + } + + .toolbar & { + padding: 3px 6px; + min-width: unset; + margin: 4px 0px 4px -1px; + border-width: 2px; + border-image: url('/assets/b_gen.gif') 2; + &:active { + border-image: url('/assets/b_genpush.gif') 2; + } + } + + &.main { // &:default + position: relative; + transform-style: preserve-3d; + &::before { + content: ''; + position: absolute; + left: -7px; + top: -7px; + right: -7px; + bottom: -7px; + border: { + width: 5px; + color: #aaa; + style: ridge; + image: url('/assets/b_btnring.gif') 5; + } + transform: translateZ(-1px); + } + } + + .icon { + vertical-align: middle; + margin-top: -0.25em; + } +} +.icon { + vertical-align: middle; + margin-top: -0.25em; +} +button, input[type=button], input[type=submit], input[type=reset] { + @include button(); +} +input::file-selector-button { + @include button(); +} +a.button, a[href].button, a[href].button:visited { + @include button(); + text-decoration: none; + color: black; +} + +.toolbar { + display: flex; + padding-left: 1px; +} + +@mixin textbox() { + background-color: #fff; + background-clip: padding-box; + border: { + width: 2px; + color: #eee; + style: inset; + image: url('/assets/b_text.gif') 2; + } + + font: inherit; + font-size: $ui-font-size; + + &:disabled { + border: { + color: #ccc; + style: solid; + image: url('/assets/b_textdis.gif') 2; + } + } +} + +@mixin checkbox() { + appearance: none; + width: 16px; + height: 16px; + padding: 0; + margin: 3px; + border: none; + + vertical-align: text-top; + + background: { + color: transparent; + clip: border-box; + image: url('/assets/checkbox.gif'); + position: 0px 0px; + } + + cursor: url('/assets/mariopaint_hand_gold.cur'), auto; + + &:checked { + background-position-x: -16px; + } + &:active { + background-position-y: -16px; + } + &:disabled { + background-position-y: -32px; + } +} + +input { + @include textbox(); +} +input[type=checkbox] { + @include checkbox(); +} +input[type=radio] { + @include checkbox(); + background-image: url('/assets/radiobtn.gif'); +} +textarea { + @include textbox(); + display: block; + resize: none; + width: 100%; + box-sizing: border-box; +} +label { + cursor: url('/assets/mariopaint_hand_gold.cur'), auto; +} diff --git a/css/main.scss b/css/main.scss new file mode 100644 index 0000000..5c29166 --- /dev/null +++ b/css/main.scss @@ -0,0 +1,480 @@ +@import 'components.scss'; + +$small-desktop-width: 959px; +$mobile-width: 719px; + +$medium-width: 720px; +$large-width: 960px; + +// preload stuff +body::after { + content: ''; + visibility: hidden; + position: absolute; + top: 0; + left: 0; + background-image: + url('/assets/b_wintitle.gif'), + url('/assets/b_winframe.gif'), + url('/assets/b_gen.gif'), + url('/assets/b_genpush.gif'), + url('/assets/b_btn.gif'), + url('/assets/b_btnpush.gif'); +} + +body { + min-height: 100vh; + box-sizing: border-box; + margin: 0; + padding: 8px; + + font-family: 'IBM Plex Serif', serif; + cursor: url('/assets/mariopaint_hand_white.cur'), auto; + background-color: white; + background-image: url('/assets/coffeebean.gif'); + + display: grid; + grid-template-columns: auto; + grid-template-rows: auto auto 1fr auto auto; + grid-template-areas: + "header" + "sidebar" + "main" + "footer" + "sidefoot"; + + row-gap: 8px; + column-gap: 8px; + + > header { + grid-area: header; + + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: center; + align-content: flex-start; + + margin: -8px -8px 0; + padding: 8px; + background: linear-gradient(60deg,$rainbow); + + > .mobile-menu { + flex: 0 0 auto; + display: none; + position: relative; + &::before { + content: ''; + display: inline-block; + + background-image: url('/assets/menu_icons.png'); + background-repeat: no-repeat; + background-position: 0px 0px; + + width: 24px; + height: 24px; + margin-right: 0.25rem; + vertical-align: bottom; + } + &.open::before { + background-position: -25px 0px; + } + } + > .site-title { + display: none; + font-size: 1.25em; + text-align: center; + } + > .page-title { + flex: 0 1 auto; + font-size: 2em; + font-weight: 700; + margin: 0 0 0 8px; + padding-left: 6px; + border-left: ridge 2px #444; + border-bottom: none; + padding-right: 2rem; + color: inherit; + } + } + + > #page-sidebar { + grid-area: sidebar; + + ul, ol { + padding-left: 2em; + ul, ol { + padding-left: 1em; + } + } + + nav { + @include window(); + } + details { + background-color: #ddd; + } + + width: 360px; + max-width: calc(100vw - 16px); + justify-self: center; + } + + main { + grid-area: main; + max-width: 1024px; + margin: 0px 8px; + } + + > #page-side-footer { + grid-area: sidefoot; + background-color: #ddd; + padding: 8px 16px; + margin: -8px; + } + + > footer { + @include clearfix(); + grid-area: footer; + + margin: 0 -8px -8px; + padding: 10px 16px 8px; + + background-color: #ddd; + position: relative; + &::before { + content: ''; + display: block; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background: linear-gradient(to right, $rainbow); + } + + .mario { + float: right; + width: auto; + margin-left: 0.25rem; + } + } + + @media screen and (min-width: $medium-width) { + grid-template-columns: 200px 1fr; + grid-template-rows: auto auto auto 1fr auto; + grid-template-areas: + "header header" + "sidebar main" + "sidefoot main" + ". main" + "footer footer"; + + > header { + > .site-title { + flex: 0 0 200px; + display: initial; + } + } + > #page-sidebar { + width: unset; + max-width: unset; + justify-self: stretch; + } + > #page-side-footer { + background: none; + padding: 0; + margin: 0; + } + } + @media screen and (min-width: $large-width) { + grid-template-columns: 300px 1fr; + + > header { + > .site-title { + flex: 0 0 300px; + font-size: 1.5em; + } + > .page-title { + margin-left: 24px; + } + } + main { + margin: 0px 16px; + } + } + + // small only + @media screen and (max-width: $medium-width - 1px) { + > header { + > .mobile-menu { display: inline-block; } + } + > #page-sidebar { + &.mobile:not(.expanded) { + > *:not(.info-box) { display: none; } + } + } + > footer { + .mario > img { height: 72px; } + } + } + // medium only + @media screen and (min-width: $medium-width) and (max-width: $large-width - 1px) { + > #page-sidebar { + font-size: $ui-font-size; + } + } + + @media print { + min-height: auto; + display: block; + background: none; + + > #page-sidebar { display: none; } + > footer, > #page-side-footer { background: none; } + > footer .mario { display: none; } + } +} + +ul, ol { + margin-left: 0; + padding-left: 2.5em; +} +ul:not(.tree) { + list-style-image: url('/assets/bull_diamond_blue.gif'); + $bull-colours: 'magenta', 'red', 'yellow', 'green', 'cyan'; + @for $i from 2 through 6 { + > li:nth-child(6n + #{$i}) { + list-style-image: url("/assets/bull_diamond_#{nth($bull-colours, $i - 1)}.gif"); + } + } +} +ul.tree { + list-style-image: url('/assets/treearr.gif'); + > li.down { + list-style-image: url('/assets/treearrd.gif'); + &.in { + list-style-image: url('/assets/treearrdi.gif'); + } + } + > li.in { + list-style-image: url('/assets/treearri.gif'); + } +} + +h1, h2, h3, h4, h5, h6 { + font-weight: 500; +} +h1, h2, h3 { + padding-left: 6px; + border-left: ridge 2px; + border-bottom: ridge 2px; + overflow: auto; /* prevent borders from overlapping floats */ +} +h1 { + color: #5f51b8; + border-color: mediumslateblue; +} +h2 { + color: crimson; + border-color: #f05c79; +} +h3 { + border-color: black; +} + +h1, :is(article, aside, nav, section) h1 { + font-size: 2em; +} +h2 { + font-size: 1.5em; +} +h3, h4, h5, h6 { + font-size: 1.25em; +} + +a[href] { + cursor: url('/assets/mariopaint_hand_gold.cur'), auto; + color: #1d39c4; + &:hover { + text-decoration-thickness: 2px; + } + &:visited { color: #79277e; } + + nav &:visited { color: #1d39c4; } + nav &.active { + font-weight: bold; + font-style: italic; + color: #061178; + } +} + +details { + @include window($title-bar: "summary"); + background-color: #fff; + > summary, &[open] > summary { + cursor: url('/assets/mariopaint_hand_gold.cur'), auto; + list-style-type: none; + // text-align: inherit; + } + > summary::-webkit-details-marker { display: none; } + > summary::before { + background-image: url('/assets/colarrow.png'); + } + &[open] > summary::before { + background-position: right center; + } + &:not([open]) { + border-width: 0px 6px; + > summary { + border-image: url('/assets/b_gen.gif') 3 6; + } + } +} + +.window-box { + @include window(); + background-color: #fff; +} + +progress { + background-color: #bbb; + border: solid 1px black; + height: 14px; + + &::-moz-progress-bar { + // background: linear-gradient(to bottom, #00669a 0%, #00cdff 25%, #cdffff 50%, #00cdff 75%, #001c38 100%); + background: linear-gradient(to bottom, #339 0%, #66c 11%, #99f 22%, #ccf 33%, #eee 44%, #ccf 56%, #99f 67%, #66c 78%, #339 89%, #005 100%); + background-origin: border-box; + background-clip: border-box; + border: solid 3px transparent; + border-bottom-width: 4px; + border-left-color: #ffffff9a; + border-right-color: #00001c46; + } +} + +kbd > kbd, kbd.key { + background-color: #ccc; + border-color: #ddd; + border-width: 4px; + border-style: outset; + border-image: url('/assets/b_keycap.gif') 4; + padding: 0px 4px; +} + +.info-box { + @include note-box(); + + background-color: #ffffc6; + display: inline-block; + width: auto; + + &::before { + content: ' '; + white-space: pre; + width: 16px; + background: { + image: url("/assets/msg_info.gif"); + position: left center; + repeat: no-repeat; + } + margin-right: 8px; + display: inline-block; + } + + &.error-box { + background-color: #ffcccc; + &::before { + background-image: url("/assets/msg_error.gif"); + } + } + &.tip-box { + &::before { + background-image: url("/assets/tip.png"); + } + } + &.success-box { + background-color: #c6ffc6; + &::before { + background-image: url("/assets/msg_succ.gif"); + } + } + &.warning-box { + &::before { + background-image: url("/assets/msg_warn.gif"); + } + } +} + +main aside { + @include note-box(); + float: right; + margin: 8px 0px 8px 16px; + padding: 0px; + background-color: #fff; + max-width: 300px; + + @media screen and (min-width: $medium-width) and (max-width: $large-width - 1px) { + font-size: $ui-font-size; + max-width: 200px; + } + @media screen and (max-width: $medium-width - 1px) { + float: none; + max-width: max-content; + margin: auto; + } + + > .content { + margin: 8px; + } +} + +img.block { + display: block; +} +img:not(.no-scale), video:not(.no-scale) { + max-width: 100%; +} + +table { + border-collapse: collapse; + border: ridge 2px #bbb; + th, td { + border: ridge 2px #bbb; + } + th { + background-color: #ddd; + } +} + +blockquote { + position: relative; + margin: 1em 1.5em; + &::before { + content: ''; + width: 4px; + position: absolute; + left: -1.5em; + top: 0; + bottom: 0; + background: linear-gradient(to top,$rainbow); + } +} + +form:not(.no-style-form) { + border: { + width: 4px; + color: #eee; + style: outset; + image: url('/assets/b_winframe2.gif') 4; + } + box-shadow: 2px 2px 0px -1px black; + background-color: #ddd; + > .form-wrap { + margin: 8px; + } +} + +.right { float: right; } diff --git a/git-post-receive-hook.sh b/git-post-receive-hook.sh new file mode 100644 index 0000000..6352ab0 --- /dev/null +++ b/git-post-receive-hook.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "Updating log_cache..." +git log --no-merges --pretty='format:%at %s' | head -n 20 >/var/www/localhost/htdocs/sys/log_cache diff --git a/index.php b/index.php new file mode 100644 index 0000000..cb5930d --- /dev/null +++ b/index.php @@ -0,0 +1,268 @@ +outline = [ + "about" => ["_" => "What's wrong with you?", + "pronouns" => ["_" => "Pronouns"], + "furry-code" => ["_" => "Furry code"], + ], + "updates" => ["_" => "Latest updates"], + "links" => ["_" => "Links", + "e-mail" => ["_" => "E-mail"], + "messaging" => ["_" => "Messaging"], + "social" => ["_" => "Social media"], + "other" => ["_" => "Other stuff"], + "services" => ["_" => "Services I host"], + ], + "donate" => ["_" => "Donate"], +]; + +require_once $_SERVER["DOCUMENT_ROOT"]."/sys/semantics.php"; + +require_once $_SERVER["DOCUMENT_ROOT"]."/sys/infobox.php"; +require_once $_SERVER["DOCUMENT_ROOT"]."/sys/default_template.php"; +default_template($page); + +slot_begin("main"); ?> +
+ +

+Hi, I'm ~keith, a mysterious gay dog prowling the dark, unexplored corners of the Internet. Welcome to my Web site! Please excuse the mess, I haven't been able to update it as often as I'd like. Hopefully that'll change soon. +

+ +

What's wrong with you?

+

+ I'm a queer, trans, polyamorous anarchist hackerpunk mutt. (Wruff~ :3) My interests include tinkering with old computers, kissing men, working on programming & electronics projects, violating copyright law, and playing video games. +

+ +

Pronouns

+

I use it/its and punk/punks pronouns. Here's an example of how to use them:

+
+ This morning, punk went to the park.
+ I went with punk.
+ And punk brought punks frisbee.
+ At least I think it was punks.
+ By the end of the day, punk started throwing the frisbee to punkself. +
+ +

Furry code

+ FCM A--> C->++ D>m+++ H+++ M->+ P+ R T+++ W--> S+++ RLCT* cl+++ d+ f++++ i+++ +
+ Translation +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpeciesFCMDomestic mutt
ArtA-->No experience, but would like to try
ConventionsC->++Never gone, but would like to become a regular
FursuitingD>m+++Would like to make my own fursuit and wear it regularly
HugsH+++If it moves, I'll hug it (if it doesn't move, I'll hug it until it moves)
MUDsM->+Never tried it, but would like to
PlushiesP+I have been known to cuddle a few
RealismRNo particular preference
TransformationT+++Definitely! (as long as I get to choose the species)
WritingW-->No experience, but would like to try
Furry sexS+++What do you mean there are other things to do?
Real LifeRLCT*Computers/information technology (no job yet)
Computerscl+++Linux user. If there was anything else to life, there'd be a newsgroup about it! + laughing face
DOOMd+I've played it and I like it, but I'm not a huge fan
Furrinessf++++I am not a human, I am a furry
Interneti+++I'm a Webmaster/site administrator
+
+
+ +

Latest updates

+ error()->text("Could not get commit log.")->html(); + } else { + $output = file($_SERVER["DOCUMENT_ROOT"]."/sys/log_cache"); + ?> + + + +

Links

+

E-mail

+

+My e-mail address is keith@keithhacks.cyou, and my PGP key is below. Please feel free to e-mail me about anything at all! +

+ + +

Messaging

+

You can contact me using XMPP or Matrix.

+ + +

Social media

+

+I'm active on the Fediverse, where you can find me at @keith@anarchism.space. I no longer have a Twitter account. +

+ +

Other stuff

+ + +

Services I host

+

I currently run the following public-facing Internet services. You're welcome to use them!

+ + +

Donate

+ ', str_split($address, 5)); + } + ?> +

I can't sign up for PayPal or any similar service, so I can only accept Monero:

+ +

You can still send me Monero even if you don't use it - just go to any "buy monero online" website and put my address in.

+
+ diff --git a/js/nav-toggle.js b/js/nav-toggle.js new file mode 100644 index 0000000..05b44bb --- /dev/null +++ b/js/nav-toggle.js @@ -0,0 +1,34 @@ +function navToggle() { + if (document.getElementById("page-sidebar").classList.toggle("expanded")) { + document.querySelector("header > .mobile-menu").classList.add("open"); + } else { + document.querySelector("header > .mobile-menu").classList.remove("open"); + } +} +function mobileView(e) { + if (e.matches) { + document.getElementById("page-sidebar").classList.add("mobile"); + } else { + document.getElementById("page-sidebar").classList.remove("mobile"); + } +} +var mobileQuery = window.matchMedia("only screen and (max-width: 719px)"); +mobileQuery.addEventListener("change", mobileView); +mobileView(mobileQuery); +// sometimes it decides not to work on mobile. this should fix it probably. +window.addEventListener('load', function() {mobileView(mobileQuery);}); + +// Dark mode debugging function +function debugEnableDarkMode() { + var sheet = document.styleSheets[1]; + for (var rule of sheet.cssRules) { + if (rule instanceof CSSMediaRule && rule.conditionText.includes("(prefers-color-scheme: dark)")) { + var newRuleText = "@media only screen {"; + for (var childRule of rule.cssRules) { + newRuleText += childRule.cssText; + } + newRuleText += "}"; + sheet.insertRule(newRuleText, sheet.cssRules.length); + } + } +} diff --git a/sys/.htaccess b/sys/.htaccess new file mode 100644 index 0000000..7d3aaf1 --- /dev/null +++ b/sys/.htaccess @@ -0,0 +1,2 @@ +Order allow,deny +Deny from all \ No newline at end of file diff --git a/sys/default_template.php b/sys/default_template.php new file mode 100644 index 0000000..cf5222f --- /dev/null +++ b/sys/default_template.php @@ -0,0 +1,104 @@ + + + + + + + +
+ + +

title;?>

+
+
+ +
Warning: + You are using a harmful browser. +

+ Chrome and Chrome-based browsers threaten the open Web, as they give Google an effective monopoly over browser technology. Currently, Google is using this power to push "Web Environment Integrity", an API that will prevent you from accessing Web sites if your browser is not approved by Google, or has been modified in any way. This is incredibly dangerous. (Read more on the FSF and Vivaldi blogs.) +

+

+ Please don't contribute to Google's market share. Switch to a non-Chrome browser like Firefox, LibreWolf, Falkon, or Safari. +

+
+ outline)): + ?> +
+

Page contents

+ outline); ?> +
+ +
+ + + + + diff --git a/sys/footer.php b/sys/footer.php new file mode 100644 index 0000000..f2cbb07 --- /dev/null +++ b/sys/footer.php @@ -0,0 +1,40 @@ +url))['mtime']; + ?> + + diff --git a/sys/increment.php b/sys/increment.php new file mode 100644 index 0000000..af3a4ef --- /dev/null +++ b/sys/increment.php @@ -0,0 +1,76 @@ +mysqli = new mysqli("localhost", "increment", apache_getenv("INCREMENT_PASS"), "www_increment"); + $this->mysqli->set_charset("utf8mb4"); + $this->page = $page->url; + } + function get_count() : int { + $query = $this->mysqli->prepare("SELECT count FROM increments WHERE page=?"); + $query->bind_param('s', $this->page); + $query->execute(); + $result = $query->get_result(); + if ($result->num_rows >= 1) { + $row = $result->fetch_assoc(); + return intval($row['count']); + } else { + $query = $this->mysqli->prepare("INSERT INTO increments (page,count) VALUES (?,0)"); + $query->bind_param('s', $this->page); + $query->execute(); + return 0; + } + } + function increment() { + $query = $this->mysqli->prepare("UPDATE increments SET count=count+1 WHERE page=?"); + $query->bind_param('s', $this->page); + $query->execute(); + } + function handle_increment() { + if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (isset($_POST['increment'])) { + $this->get_count(); + $this->increment(); + } + } + } +} + +class IncrementButton implements Widget { + private int $_count; + + function __construct() { + $this->_count = 0; + } + + static function new() { + return new IncrementButton(); + } + + function count($count) { + $this->_count = $count; + return $this; + } + + public function html() : string { + $increments = strval($this->_count) . " increment"; + if ($this->_count != 1) + $increments .= "s"; + + return << + + + + EOF; + } +} +?> diff --git a/sys/infobox.php b/sys/infobox.php new file mode 100644 index 0000000..345345c --- /dev/null +++ b/sys/infobox.php @@ -0,0 +1,88 @@ +_label = null; + $this->_text = ""; + $this->_content = null; + $this->_type = null; + } + + static function new() { + return new InfoBox(); + } + + static function under_construction() { + return (new InfoBox())->label("Caution")->text("Page currently under construction."); + } + + static function javascript() { + return (new InfoBox())->text("This page uses JavaScript for its main functionality."); + } + + // Bold text displayed beside the icon. + function label($label) { + $this->_label = $label; + return $this; + } + // A line of text displayed beside the icon, after the label. + function text($text) { + $this->_text = $text; + return $this; + } + // HTML content. + function content($content) { + $this->_content = $content; + return $this; + } + + function tip() { + $this->_type = "tip-box"; + if ($this->_label == null) + $this->_label = "Tip"; + return $this; + } + function error() { + $this->_type = "error-box"; + if ($this->_label == null) + $this->_label = "Error"; + return $this; + } + function success() { + $this->_type = "success-box"; + return $this; + } + function warning() { + $this->_type = "warning-box"; + if ($this->_label == null) + $this->_label = "Warning"; + return $this; + } + + public function html() : string { + $class = "info-box"; + if ($this->_type != null) + $class .= " $this->_type"; + if ($this->_content != null) + $class .= "\" style=\"padding-bottom: 0px;"; + + $html = "
"; + if ($this->_label != null) + $html .= "" . htmlspecialchars($this->_label, ENT_NOQUOTES, null, false) . ": "; + + // $html .= htmlspecialchars($this->_text, ENT_NOQUOTES, null, false); + $html .= $this->_text; + if ($this->_content != null) + $html .= "\n$this->_content\n"; + $html .= "
"; + + return $html; + } +} +?> diff --git a/sys/navbar.php b/sys/navbar.php new file mode 100644 index 0000000..423bb39 --- /dev/null +++ b/sys/navbar.php @@ -0,0 +1,67 @@ + + + + + diff --git a/sys/semantics.php b/sys/semantics.php new file mode 100644 index 0000000..3d14f32 --- /dev/null +++ b/sys/semantics.php @@ -0,0 +1,15 @@ +" . gmdate($format, $time) . ""; +} +function html_datetime($format, $time) { + return ""; +} + +function html_date_const($format, $year, $month, $day) { + return html_date($format, gmmktime(0, 0, 0, $month, $day, $year)); +} +function html_datetime_const($format, $year, $month, $day, $hour, $minute, $second) { + return html_datetime($format, gmmktime($hour, $minute, $second, $month, $day, $year)); +} +?> diff --git a/sys/site.php b/sys/site.php new file mode 100644 index 0000000..ca9570f --- /dev/null +++ b/sys/site.php @@ -0,0 +1,121 @@ +url = $url; + $this->title = $title; + $this->subpages = $subpages; + $this->icon = $icon; + $this->outline = []; + } + static function this($title, $icon=NULL) { + $url = $_SERVER['PHP_SELF']; + $path_info = pathinfo($url); + if ($path_info['basename'] == "index.php") { + $url = $path_info['dirname']; + } + return new Page($url, $title, [], $icon); + } +} + +class Site { + static $_sitemap = null; + + static $sitename = "~keith's Web site"; + + static function sitemap() { + + if (Site::$_sitemap != NULL) { + return Site::$_sitemap; + } + + $sitemap = [ + "/" => new Page("/", "Home", [], "folder_home"), + "/about_copyleft.php" => new Page("/about_copyleft.php", "Copyleft", [], NULL), + "/furryring.php" => new Page("/furryring.php", "Furryring", [], "network"), + + "/anarchism" => new Page("/anarchism", "Anarchism", [ + "gsa.php" => new Page("/anarchism/gsa.php", "Institutional Queerphobia in the GSA", [], "wordprocessing"), + // "horny.php" => new Page("/anarchism/horny.php", "Anarcho-hornyism", [], NULL), + ], "folder_red"), + + "/privacy" => new Page("/privacy", "Privacy", [ + "apprank.php" => new Page("/privacy/apprank.php", "Privacy-focused software", [], NULL), + ], "folder_grey"), + + "/projects" => new Page("/projects", "Projects", [ + "twitter-cw.php" => new Page("/projects/twitter-cw.php", "Better Twitter CWs", [], "www"), + "mc-log4j.php" => new Page("/projects/mc-log4j.php", "Minecraft Log4j patcher", [], "source_java"), + "emacs.php" => new Page("/projects/emacs.php", "Emacs stuff", [], NULL), + "gentoo-rpi4" => new Page("/projects/gentoo-rpi4", "Gentoo on Raspberry Pi 4", [], NULL), + "pride-flags" => new Page("/projects/pride-flags", "Pride Flags Mod", [], "source_java"), + "website.php" => new Page("/projects/website.php", "Web site", [], NULL), + ], NULL), + + "/videos" => new Page("/videos", "Videos", [ + ], "folder_video"), + + "/mail.php" => new Page("/mail.php", "Anonymous mailbox", [], "message"), + ]; + + Site::$_sitemap = $sitemap; + + return $sitemap; + } + + static function path_join($path_a, $path_b) { + return join('/', array(rtrim($path_a, '/'), ltrim($path_b, '/'))); + } + + // Add the internal document root if it's not there + static function intpath($path) { + if (substr($path, 0, strlen($_SERVER['DOCUMENT_ROOT'])) == $_SERVER['DOCUMENT_ROOT']) { + return $path; + } + return Site::path_join($_SERVER['DOCUMENT_ROOT'], $path); + } +} + +class PageHead { + function __construct($page, $description=NULL, $custom_css=NULL, $extra=NULL, $refresh_post=true) { + ?> + + + <?=$page->title?> - <?=Site::$sitename?> + + + + + + + + + url)?>" /> + + + + + + + + "; + } + if ($extra !== NULL) { + echo $extra; + } + ?> + + diff --git a/sys/templating.php b/sys/templating.php new file mode 100644 index 0000000..1e33e13 --- /dev/null +++ b/sys/templating.php @@ -0,0 +1,200 @@ + $buffer, 'slot' => $next_flush_slot); + $next_flush_slot = null; + + return ''; +} + +// Add a slot to the template being baked. +function bake_slot(string $slot) { + global $baking, $next_flush_slot; + + if (!$baking) + throw new Exception('bake_slot() called outside of baking'); + + $next_flush_slot = $slot; + ob_clean(); +} + +// Finish baking the template. +function template_end() { + global $baking, $baked_template; + + if (!$baking) + throw new Exception('template_end() called outside of baking'); + + ob_end_clean(); + $baking = false; +} + +$slots = array(); + +// Output template content until the next missing slot. +function to_next_missing_slot(): ?string { + global $slots, $baked_template; + + if ($baked_template == null) + throw new Exception('cannot output, no baked template'); + + while (count($baked_template) > 0) { + $next = array_shift($baked_template); + echo $next['content']; + + if ($next['slot'] == null) + continue; + + if (array_key_exists($next['slot'], $slots)) { + echo $slots[$next['slot']]; + } else { + array_unshift($baked_template, array('content' => '', 'slot' => $next['slot'])); + return $next['slot']; + } + } + + return null; +} + +$buffering_slot = null; +function slot_begin(string $slot) { + global $buffering_slot, $baked_template; + + $next_slot = to_next_missing_slot(); + + if ($next_slot != $slot) { + if (!ob_start()) + throw new Exception('failed to start output buffer'); + $buffering_slot = $slot; + } else { + array_shift($baked_template); + } +} + +function slot_end() { + global $buffering_slot, $slots; + + if ($buffering_slot != null) { + $content = ob_get_clean(); + $slots[$buffering_slot] = $content; + $buffering_slot = null; + } + + to_next_missing_slot(); +} + +function slot_set_empty(string $slot) { + global $slots; + $slots[$slot] = ''; +} + +function slot_unset(string $slot) { + global $slots; + unset($slots[$slot]); +} + +function mail_exception_trace(Throwable $ex): string { + $output = ""; + while ($ex != null) { + $output .= get_class($ex) . ": " . $ex->getMessage() . "\r\n"; + $output .= "-- " . $ex->getFile() . "(" . $ex->getLine() . ") Code=" . $ex->getCode() . "\r\n"; + $output .= $ex->getTraceAsString() . "\r\n"; + $ex = $ex->getPrevious(); + } + return $output; +} + +function html_exception_trace(Throwable $ex) { + $count = 0; + while ($ex != null) { + echo "
"; + echo "

" . htmlspecialchars(get_class($ex)) . ": " . htmlspecialchars($ex->getMessage()) . "

"; + echo "
    "; + + foreach (array_reverse($ex->getTrace()) as $trace) { + $func = htmlspecialchars(($trace['class'] ?? '') . ($trace['type'] ?? '') . $trace['function']); + $file = htmlspecialchars($trace['file'] ?? '?'); + $line = htmlspecialchars($trace['line'] ?? '?'); + echo "
  • $func() called
    $file, line $line
  • "; + } + + $file = htmlspecialchars($ex->getFile()); + $line = htmlspecialchars($ex->getLine()); + echo "
  • Exception thrown
    $file, line $line
"; + + $ex = $ex->getPrevious(); + $count += 1; + } + for ($i = 0; $i < $count; $i++) { + echo "
"; + } +} + +function display_exception(Throwable $ex) { + $page_name = $_SERVER["PHP_SELF"] ?? "(unknown page)"; + + $mail_body = "An uncaught exception was encountered on $page_name.\r\n"; + $mail_body .= "\r\nException details:\r\n"; + $mail_body .= "Type: " . get_class($ex) . ", Code: " . $ex->getCode() . ", Message: " . $ex->getMessage() . "\r\n"; + $mail_body .= "File: " . $ex->getFile() . ", Line: " . $ex->getLine() . "\r\n"; + $mail_body .= "\r\nTrace:\r\n"; + $mail_body .= mail_exception_trace($ex); + $mail_body .= "\r\nRequest details:\r\n"; + $mail_body .= $_SERVER['REQUEST_METHOD'] . " " . $_SERVER['REQUEST_URI'] . "\r\n"; + foreach (getallheaders() as $name => $value) { + $mail_body .= "$name: $value\r\n"; + } + foreach ($_REQUEST as $key => $value) { + $mail_body .= "\$_REQUEST[$key]: $value\r\n"; + } + + mail("webmaster@keithhacks.cyou", "Exception on $page_name", $mail_body); + for ($i = ob_get_level(); $i > 0; $i--) { + ob_end_flush(); + } + if (!headers_sent()) + http_response_code(500); + + $display_trace = true; + ?> +
+ +

Internal Server Error

+

An uncaught exception was encountered on this page.

+

: getMessage()?>

+

Please contact webmaster@keithhacks.cyou if this problem persists.

+ Exception details"; + html_exception_trace($ex); + } + ?> +
+ diff --git a/sys/widget.php b/sys/widget.php new file mode 100644 index 0000000..3f5f87e --- /dev/null +++ b/sys/widget.php @@ -0,0 +1,29 @@ +