diff --git a/.gitignore b/.gitignore index 001d178..4d1551b 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ tools/items/formula-wizard/src/*.js # Temporary articles/*.txt commons/strings/_*/ +*.ogg diff --git a/commons/DOM/head-preloads.php b/commons/DOM/head-preloads.php new file mode 100644 index 0000000..ea3abfe --- /dev/null +++ b/commons/DOM/head-preloads.php @@ -0,0 +1,6 @@ +'); + echo(''); +} +?> diff --git a/commons/DOM/scripts.php b/commons/DOM/scripts.php index a6dee74..9095ea8 100644 --- a/commons/DOM/scripts.php +++ b/commons/DOM/scripts.php @@ -23,4 +23,7 @@ if($enable_glider) { if($enable_code_highlight) { echo(''); } +if($enable_kitty_and_doggo_sounds) { + echo(''); +} ?> \ No newline at end of file diff --git a/commons/DOM/sidebar.php b/commons/DOM/sidebar.php index d5c9320..76197af 100644 --- a/commons/DOM/sidebar.php +++ b/commons/DOM/sidebar.php @@ -62,6 +62,7 @@ function printSidebarEntry($url, $title, $icon, $activeId) {
diff --git a/commons/config.php b/commons/config.php index ceb1e67..267e0ab 100644 --- a/commons/config.php +++ b/commons/config.php @@ -6,14 +6,17 @@ if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) { // Used for opengraph head tags. switch($_SERVER['SERVER_NAME']) { + case "192.168.1.85": case "localhost": case "nibblepoker.lu": $host = "nibblepoker.lu"; $host_uri = "https://nibblepoker.lu"; + $host_tld = "lu"; break; case "nibblepoker.com": $host = "nibblepoker.com"; $host_uri = "https://nibblepoker.com"; + $host_tld = "com"; break; default: http_response_code(400); @@ -29,6 +32,7 @@ $config_dir_tools = realpath($dir_commons . "/../" . "tools/"); $enable_grids = false; $enable_code_highlight = false; $enable_glider = false; +$enable_kitty_and_doggo_sounds = false; // Easter-egg optional features // > Belgium's independence day. diff --git a/commons/langs.php b/commons/langs.php index b90fb6f..588bcbd 100644 --- a/commons/langs.php +++ b/commons/langs.php @@ -100,9 +100,19 @@ function localize_private(string $string_key, array $private_lang_data, bool $fa return $string_key; } -function localize($string_key) : string { +function localize($string_key, ?array $param_values = null) : string { global $lang_data; - return localize_private($string_key, $lang_data, false); + if(is_null($param_values)) { + return localize_private($string_key, $lang_data, false); + } else { + $localized_string = localize_private($string_key, $lang_data, false); + + for($iStrParam = 0; $iStrParam < sizeof($param_values); $iStrParam++) { + $localized_string = str_replace("%" . $iStrParam, $param_values[$iStrParam], $localized_string); + } + + return $localized_string; + } } function l10n_url_abs($url) : string { diff --git a/commons/strings/en/contributors.json b/commons/strings/en/contributors.json new file mode 100644 index 0000000..b9da8b3 --- /dev/null +++ b/commons/strings/en/contributors.json @@ -0,0 +1,12 @@ +{ + "contributors.head.title": "Contributors - NibblePoker", + "contributors.head.description": "TODO: description", + "contributors.og.title": "NibblePoker - Contributors", + "contributors.og.description": "TODO: description", + "contributors.header.title": "Contributors", + + "contributors.intro.title": "???", + "contributors.sponsors.title": "Sponsors", + "contributors.code.title": "???", + "contributors.spiritualis.title": "Spiritual support" +} diff --git a/commons/strings/en/home.json b/commons/strings/en/home.json index d8f0ae3..02919db 100644 --- a/commons/strings/en/home.json +++ b/commons/strings/en/home.json @@ -6,9 +6,9 @@ "home.header.title": "Homepage", - "home.intro.title": "", - "home.intro.text.1": "", - "home.intro.text.2": "", + "home.intro.title": "Welcome to %0", + "home.intro.text.1": "This website contains a collection of my personal work through blog posts, software releases and other forms of media, all of which is accessible for free and under open-source friendly licenses.", + "home.intro.text.2": "If you wish to contact me, you can do so through the contact form linked in the sidebar or via the email address present on that page.", "home.showcase.title": "Showcase", diff --git a/commons/strings/en/sidebar.json b/commons/strings/en/sidebar.json index c32605f..56b959d 100644 --- a/commons/strings/en/sidebar.json +++ b/commons/strings/en/sidebar.json @@ -13,5 +13,6 @@ "sidebar.text.gitea": "Git Repos.", "sidebar.text.wiki": "Wiki", "sidebar.text.about": "About", + "sidebar.text.contributors": "Contributors", "sidebar.text.contact": "Contact" } \ No newline at end of file diff --git a/commons/strings/fr/contributors.json b/commons/strings/fr/contributors.json new file mode 100644 index 0000000..0484adc --- /dev/null +++ b/commons/strings/fr/contributors.json @@ -0,0 +1,12 @@ +{ + "contributors.head.title": "Contributeurs - NibblePoker", + "contributors.head.description": "TODO: description", + "contributors.og.title": "NibblePoker - Contributeurs", + "contributors.og.description": "TODO: description", + "contributors.header.title": "Contributeurs", + + "contributors.intro.title": "???", + "contributors.sponsors.title": "Sponsors", + "contributors.code.title": "???", + "contributors.spiritualis.title": "Support spirituel" +} diff --git a/commons/strings/fr/home.json b/commons/strings/fr/home.json index e50f460..74f128e 100644 --- a/commons/strings/fr/home.json +++ b/commons/strings/fr/home.json @@ -6,9 +6,10 @@ "home.header.title": "Page d'accueil", - "home.intro.title": "", - "home.intro.text.1": "", - "home.intro.text.2": "", + "_home.intro.title": "Bienvenue sur '%0'", + "home.intro.title": "Bienvenue sur %0", + "home.intro.text.1": "Ce site web contient une collection de mes travaux personnels tels que des articles de blog, des logiciels utilitaires ou d'autres formes de médias.
Tout est accessible gratuitement et sous des licences à l'open source.", + "home.intro.text.2": "Si vous souhaitez me contacter, vous pouvez le faire via la page de contact lié dans la barre de navigation latérale.", "home.showcase.title": "Vitrine", @@ -19,7 +20,7 @@ "home.updates.text.privacy": "●  Mise-à-jour de notre politique de confidentialité.", "home.updates.3.date": "12 novembre 2023", - "home.updates.3.text.1": "●  Les services annexes sont complètement disponibles.", + "home.updates.3.text.1": "●  Les services annexes sont disponibles.", "home.updates.3.text.2": "●  Changement d'hébergeur vers IONOS.", "home.updates.3.text.3": "●  Finition des pages annexes.", diff --git a/commons/strings/fr/sidebar.json b/commons/strings/fr/sidebar.json index 0c75995..b6550f8 100644 --- a/commons/strings/fr/sidebar.json +++ b/commons/strings/fr/sidebar.json @@ -13,5 +13,6 @@ "sidebar.text.gitea": "Dépôts Git", "sidebar.text.wiki": "Wiki", "sidebar.text.about": "À-propos", + "sidebar.text.contributors": "Contributeurs", "sidebar.text.contact": "Contact" } \ No newline at end of file diff --git a/compile.bat b/compile.bat index 2127b2a..c7b6bfe 100644 --- a/compile.bat +++ b/compile.bat @@ -51,6 +51,8 @@ echo ^> resources\NibblePoker\js\nibblepoker.js call "%~dp0node_modules\.bin\terser" nibblepoker.js -c -m -o nibblepoker.min.js echo ^> resources\NibblePoker\js\nibblepoker-code.js call "%~dp0node_modules\.bin\terser" nibblepoker-code.js -c -m -o nibblepoker-code.min.js +echo ^> resources\NibblePoker\js\nibblepoker-contributors.js +call "%~dp0node_modules\.bin\terser" nibblepoker-contributors.js -c -m -o nibblepoker-contributors.min.js echo ^> resources\NibblePoker\js\nibblepoker-glider.js call "%~dp0node_modules\.bin\terser" nibblepoker-glider.js -c -m -o nibblepoker-glider.min.js popd diff --git a/contributors/index.php b/contributors/index.php new file mode 100644 index 0000000..9b084fb --- /dev/null +++ b/contributors/index.php @@ -0,0 +1,65 @@ + + + + + + <?php print(localize('contributors.head.title')); ?> + + + + + + + + + + + +
+

+ +

+ +
+
+ + + + + + + + +
+
+ + +
+
+ + +
+
+
+ + + +"); +} +?> \ No newline at end of file diff --git a/index.php b/index.php index ffc0b47..2e67435 100644 --- a/index.php +++ b/index.php @@ -3,9 +3,6 @@ $start_time = microtime(true); set_include_path('./'); include_once 'commons/config.php'; include_once 'commons/langs.php'; - -// Page-specific config -$enable_glider = true; ?> @@ -34,19 +31,13 @@ include 'commons/DOM/sidebar.php';
- -

-

+ NibblePoker." . $host_tld . ""])); ?> +

+

+ -
-
- test123 - test123 - test123 - test123 -
-
+

TODO

@@ -56,7 +47,7 @@ include 'commons/DOM/sidebar.php';

-

+



diff --git a/resources/NibblePoker/images/contributors/kiki-02.jpg b/resources/NibblePoker/images/contributors/kiki-02.jpg new file mode 100644 index 0000000..a7f494f Binary files /dev/null and b/resources/NibblePoker/images/contributors/kiki-02.jpg differ diff --git a/resources/NibblePoker/images/contributors/kiki-03.jpg b/resources/NibblePoker/images/contributors/kiki-03.jpg new file mode 100644 index 0000000..57a5552 Binary files /dev/null and b/resources/NibblePoker/images/contributors/kiki-03.jpg differ diff --git a/resources/NibblePoker/images/contributors/maki-02.jpg b/resources/NibblePoker/images/contributors/maki-02.jpg new file mode 100644 index 0000000..1b96c81 Binary files /dev/null and b/resources/NibblePoker/images/contributors/maki-02.jpg differ diff --git a/resources/NibblePoker/images/contributors/maki-03.jpg b/resources/NibblePoker/images/contributors/maki-03.jpg new file mode 100644 index 0000000..faac8b6 Binary files /dev/null and b/resources/NibblePoker/images/contributors/maki-03.jpg differ diff --git a/resources/NibblePoker/js/nibblepoker-contributors.js b/resources/NibblePoker/js/nibblepoker-contributors.js new file mode 100644 index 0000000..b477682 --- /dev/null +++ b/resources/NibblePoker/js/nibblepoker-contributors.js @@ -0,0 +1,27 @@ +const rootSoundDirectory = "/resources/NibblePoker/sounds/" + +const kittySoundData = { + "kitty-kiki" : [ + "meow-test-01.ogg", + ], + "kitty-maki" : [ + "meow-test-02.ogg", + ], +} + +document.addEventListener("DOMContentLoaded", () => { + for (const [eId, sounds] of Object.entries(kittySoundData)) { + const eHovered = document.getElementById(eId); + + if(eHovered !== null) { + eHovered.addEventListener('mouseover', function() { + const randomIndex = Math.floor(Math.random() * sounds.length); + const audio= new Audio(rootSoundDirectory + sounds[randomIndex]); + audio.volume = 0.1; + try { + audio.play(); + } catch(DOMException) {} + }); + } + } +}); diff --git a/resources/NibblePoker/scss/core/display.scss b/resources/NibblePoker/scss/core/display.scss index 20c28d3..039b4ef 100644 --- a/resources/NibblePoker/scss/core/display.scss +++ b/resources/NibblePoker/scss/core/display.scss @@ -11,3 +11,5 @@ .o-hidden { overflow: hidden; } + +// Note: 'core/grid.scss' defines '.d-grid' ! diff --git a/resources/NibblePoker/scss/core/grid.scss b/resources/NibblePoker/scss/core/grid.scss new file mode 100644 index 0000000..ec76595 --- /dev/null +++ b/resources/NibblePoker/scss/core/grid.scss @@ -0,0 +1,25 @@ +// NibblePoker.lu CSS - (C) 2023 Bozet Herwin + +.grid, .d-grid { + display: grid; +} + +@mixin grid-col-maker($col-count, $middle-part) { + .col-#{$middle-part}#{$col-count} { + grid-template-columns: repeat(#{$col-count}, 1fr); + } +} + +// Defining rules for all devices. +@include grid-col-maker("1", ""); +@include grid-col-maker("2", ""); +@include grid-col-maker("3", ""); +@include grid-col-maker("4", ""); +@include grid-col-maker("6", ""); +@include grid-col-maker("8", ""); + +@media only screen and (max-width: 768px) { + @include grid-col-maker("1", "mobile-"); + @include grid-col-maker("2", "mobile-"); + @include grid-col-maker("3", "mobile-"); +} diff --git a/resources/NibblePoker/scss/nibblepoker.scss b/resources/NibblePoker/scss/nibblepoker.scss index 9186d4c..9094904 100644 --- a/resources/NibblePoker/scss/nibblepoker.scss +++ b/resources/NibblePoker/scss/nibblepoker.scss @@ -23,6 +23,7 @@ @import 'core/float'; @import 'core/sizing'; @import 'core/flex'; +@import 'core/grid'; @import 'core/text'; @import 'core/containers'; @import 'core/display'; diff --git a/resources/NibblePoker/scss/site/image.scss b/resources/NibblePoker/scss/site/image.scss index 38094e2..ac652af 100644 --- a/resources/NibblePoker/scss/site/image.scss +++ b/resources/NibblePoker/scss/site/image.scss @@ -15,6 +15,49 @@ height: 7.5rem; } +.img-contributor, .img-contributor > img { + width: 6rem; + height: 6rem; + + border-radius: 50%; + + transition: width 0.175s ease-in-out, height 0.175s ease-in-out, opacity 0.175s ease-in-out; + + &:hover, &:hover > img { + width: 7.5rem; + height: 7.5rem; + } + + &.kitty { + cursor: grab; + } +} + +.img-contributor { + display: inline-block; + box-shadow: 0 0 6px 0 rgba(0,0,0,0.75); + + &>img { + position: absolute; + + &:last-child { + box-shadow: none; + position: relative; + opacity: 0.0; + } + } + + &:hover { + img { + opacity: 0.0; + } + &>img:last-child { + opacity: 1.0; + } + } +} + + .sidebar-entry > i { }