summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2021-03-12 23:33:11 +0100
committerhorus2021-03-12 23:33:11 +0100
commit1730e54d3423a8d0ab3a2bd9791575b59ab399cc (patch)
treebc4e3f8d6360f35f787ee31b9091cc75ec2a6bf0
parent14e75d123ebc16bbefe6d305181eafe3d4df6333 (diff)
downloadmoehring-1730e54d3423a8d0ab3a2bd9791575b59ab399cc.tar.gz
Add faces as submodule
-rw-r--r--.gitmodules3
-rw-r--r--app.php19
-rw-r--r--public/index.php6
-rw-r--r--views/about.html2
-rw-r--r--views/index.html10
-rw-r--r--views/snippets/layout.html19
-rw-r--r--views/tools.html3
m---------views/tools/faces0
8 files changed, 42 insertions, 20 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..6c2b6b6
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "views/tools/faces"]
+ path = views/tools/faces
+ url = git@git.iamfabulous.de:faces
diff --git a/app.php b/app.php
index e436e42..53ca7eb 100644
--- a/app.php
+++ b/app.php
@@ -7,7 +7,7 @@ $twig = new \Twig\Environment($loader); # no cache
$function = new \Twig\TwigFunction('is_active', function($route) {
$url = strtok($_SERVER["REQUEST_URI"], '?');
- if ( $url == $route ) {
+ if ( str_starts_with($url, $route) ) {
echo " active ";
}
});
@@ -18,3 +18,20 @@ $function = new \Twig\TwigFunction('maincss', function() {
});
$twig->addFunction($function);
+
+/**
+ * Debug
+ */
+$function = new \Twig\TwigFunction('dump', function($data) {
+ var_dump($data);
+});
+$twig->addFunction($function);
+
+function get_faces(){
+ return json_decode( file_get_contents( __DIR__ . '/views/tools/faces/faces.json' ), true );
+}
+
+function str_starts_with( $haystack, $needle ) {
+ $length = strlen( $needle );
+ return substr( $haystack, 0, $length ) === $needle;
+}
diff --git a/public/index.php b/public/index.php
index cbfba57..fa89920 100644
--- a/public/index.php
+++ b/public/index.php
@@ -4,6 +4,8 @@ require_once __DIR__ . '/../app.php';
$url = strtok($_SERVER["REQUEST_URI"], '?');
+#var_dump([ "faces" => get_faces() ]);
+
switch( $url ) {
case("/"):
@@ -18,6 +20,10 @@ case("/projects"):
case("/tools"):
echo $twig->render('tools.html');
break;
+case("/tools/faces"):
+case("/tools/faces/"):
+ echo $twig->render('tools/faces/index.html', [ "faces" => get_faces() ]);
+ break;
default:
http_response_code(404);
echo $twig->render('404.html');
diff --git a/views/about.html b/views/about.html
index 08486e4..190af69 100644
--- a/views/about.html
+++ b/views/about.html
@@ -4,8 +4,6 @@
{% block css %}
.main {
- margin-top: 4rem;
- margin-bottom: 4rem;
font-size: 1.25rem;
}
.float-right-mb {
diff --git a/views/index.html b/views/index.html
index 104e2c8..30c4377 100644
--- a/views/index.html
+++ b/views/index.html
@@ -1,16 +1,6 @@
{% extends "snippets/layout.html" %}
{% block css %}
- .main {
- margin-top: 4rem;
- margin-bottom: 4rem;
- }
- @media (max-width: 992px) {
- .main {
- margin-top: 4rem;
- margin-bottom: 4rem;
- }
- }
.index-list > li {
margin-bottom: 1rem;
}
diff --git a/views/snippets/layout.html b/views/snippets/layout.html
index 0776b3c..0bf0b19 100644
--- a/views/snippets/layout.html
+++ b/views/snippets/layout.html
@@ -24,8 +24,15 @@
color: #e1e1e1;
}
.main {
- margin-top: 1rem;
+ margin-top: 4rem;
font-size: 1.5rem;
+ margin-bottom: 4rem;
+ }
+ @media (max-width: 992px) {
+ .main {
+ margin-top: 3rem;
+ margin-bottom: 4rem;
+ }
}
@media (min-width: 992px) {
.main {
@@ -33,6 +40,10 @@
font-size: 2rem;
}
}
+ .main a {
+ color: #47ccfb;
+ text-decoration: underline;
+ }
h1 {
margin-bottom: 2rem;
}
@@ -78,14 +89,10 @@
h1::before {
content: "# ";
}
- h1 {
+ h1,h2 {
color: #f07206;
font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
- .main a {
- color: #47ccfb;
- text-decoration: underline;
- }
.bg-dark {
background-color: #171717 !important;
}
diff --git a/views/tools.html b/views/tools.html
index b28e927..dd091a1 100644
--- a/views/tools.html
+++ b/views/tools.html
@@ -15,7 +15,8 @@
<ul>
<li>
- <a href="https://faces.iamfabulous.de" title="Best faces on the net" rel="nofollow">Best faces on the net</a>
+ <!--a href="https://faces.iamfabulous.de" title="Best faces on the net" rel="nofollow">Best faces on the net</a-->
+ <a href="/tools/faces" title="Best faces on the net">Best faces on the net</a>
</li>
<li>
<a href="https://untrack.iamfabulous.de" title="Entfernt Tracking Parameter aus der URL" rel="nofollow">untrack - Entfernt Tracking Parameter aus der URL</a>
diff --git a/views/tools/faces b/views/tools/faces
new file mode 160000
+Subproject ec1514d2d7c3889da0f976b64b256d1560cd1d8