From: Michael Tremer Date: Tue, 27 Jun 2023 17:18:06 +0000 (+0000) Subject: web: Replace the background image with a video of fire X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f7a79273b38684f500c063bf1f2f10cac369803;p=ipfire.org.git web: Replace the background image with a video of fire Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index a8357f07..02a68fea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -991,6 +991,20 @@ static_images_DATA = \ static_imagesdir = $(staticdir)/images +EXTRA_DIST += \ + src/static/videos/firewall.mp4 + +CLEANFILES += \ + $(static_videos_DATA) + +static_videos_DATA = \ + src/static/videos/firewall.jpg \ + src/static/videos/firewall@1920.av1.mp4 \ + src/static/videos/firewall@1920.hevc.mp4 \ + src/static/videos/firewall@1920.h264.mp4 + +static_videosdir = $(staticdir)/videos + static_js_DATA = \ src/static/js/Control.Geocoder.min.js \ src/static/js/editor.js \ @@ -1080,6 +1094,69 @@ src/static/img/apple-touch-icon-%-precomposed.png: src/static/img/ipfire-tux.png -extent $(patsubst src/static/img/apple-touch-icon-%-precomposed.png,%,$@)x$(patsubst src/static/img/apple-touch-icon-%-precomposed.png,%,$@) \ $< $@ +# Video Stuff + +FFMPEG += \ + -loglevel quiet + +# AV1 +src/static/videos/firewall@%.av1.mp4: src/static/videos/firewall.mp4 + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(FFMPEG) -y \ + -i $^ \ + -map_metadata -1 \ + -an \ + -c:v libsvtav1 \ + -crf 30 \ + -preset veryslow \ + -pix_fmt yuv420p \ + -movflags +faststart \ + -vf scale=$(patsubst src/static/videos/firewall@%.av1.mp4,%,$@):-2,fps=25 \ + $@ + +# HEVC +src/static/videos/firewall@%.hevc.mp4: src/static/videos/firewall.mp4 + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(FFMPEG) -y \ + -i $^ \ + -map_metadata -1 \ + -an \ + -c:v libx265 \ + -crf 22 \ + -preset veryslow \ + -pix_fmt yuv420p \ + -movflags +faststart \ + -tag:v hvc1 \ + -vf scale=$(patsubst src/static/videos/firewall@%.hevc.mp4,%,$@):-2,fps=25 \ + $@ + +# H.264 +src/static/videos/firewall@%.h264.mp4: src/static/videos/firewall.mp4 + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(FFMPEG) -y \ + -i $^ \ + -map_metadata -1 \ + -an \ + -c:v libx264 \ + -crf 24 \ + -preset veryslow \ + -profile:v main \ + -pix_fmt yuv420p \ + -movflags +faststart \ + -vf scale=$(patsubst src/static/videos/firewall@%.h264.mp4,%,$@):-2,fps=25 \ + $@ + +# Cover image +src/static/videos/firewall.jpg: src/static/videos/firewall.mp4 + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(FFMPEG) -y \ + -i $^ \ + -map_metadata -1 \ + -qscale:v 1 \ + -frames:v 1 \ + -vf scale=1920:-2 \ + $@ + .PHONY: update update: for i in src/systemd/ipfire.org-webapp-*.service; do systemctl restart $$(basename $${i}) && sleep 5; done diff --git a/configure.ac b/configure.ac index d2f8a857..c5f4c7f2 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,12 @@ if test -z "${CONVERT}"; then AC_MSG_ERROR([convert is required]) fi +# ffmpeg +AC_CHECK_PROG(FFMPEG, [ffmpeg], [ffmpeg]) +if test -z "${FFMPEG}"; then + AC_MSG_ERROR([ffmpeg is required]) +fi + # ------------------------------------------------------------------------------ AC_ARG_WITH([systemd], diff --git a/src/sass/main.sass b/src/sass/main.sass index b23846f0..5bcbde92 100644 --- a/src/sass/main.sass +++ b/src/sass/main.sass @@ -62,10 +62,13 @@ $section-padding-desktop: 3rem 0.5rem // Custom CSS #hero-index - background-image: url("img/bg-img.jpg"); - background-position: center; - background-repeat: no-repeat; - background-size: cover; + position: relative + video + width: 100%; + height: 100%; + position: absolute; + object-fit: cover; + z-index: 0; .footer a diff --git a/src/static/videos/.gitignore b/src/static/videos/.gitignore new file mode 100644 index 00000000..94400148 --- /dev/null +++ b/src/static/videos/.gitignore @@ -0,0 +1,2 @@ +# Ignore anything that isn't the original video +*@* diff --git a/src/static/videos/firewall.jpg b/src/static/videos/firewall.jpg new file mode 100644 index 00000000..5fe88a17 Binary files /dev/null and b/src/static/videos/firewall.jpg differ diff --git a/src/static/videos/firewall.mp4 b/src/static/videos/firewall.mp4 new file mode 100644 index 00000000..de538da7 Binary files /dev/null and b/src/static/videos/firewall.mp4 differ diff --git a/src/templates/index.html b/src/templates/index.html index f2070aaa..bbd876b7 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -9,9 +9,9 @@ {% block container %} {% if latest_release %} -
+
-

+

{{ _("Latest Release: %(release)s from %(when)s") \ % { "release" : latest_release.name, "when" : locale.format_day(latest_release.date, dow=False) } }} @@ -28,10 +28,31 @@ {% end %}

+ +
-

{{ _("More Than A Firewall") }}

-
The market leader in Linux based, Open Source security with a comprehensible feature set
+

+ {{ _("More Than A Firewall") }} +

+ +
+ The market leader in Linux based, Open Source security with a comprehensible feature set +
@@ -39,7 +60,7 @@

- {{ _("The Open Source Firewall") }}_ + {{ _("IPFire") }}_ ‐ {{ _("The Open Source Firewall") }}