summaryrefslogtreecommitdiff
path: root/www/scripts
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2026-05-17 13:01:57 +0800
committeraltaf-creator <dev@altafcreator.com>2026-05-17 13:01:57 +0800
commit9e7fe6d8dad56c237adb1905e130c1d723131812 (patch)
treedd067e14b3ec5af719d748427bb322320c248879 /www/scripts
parentd04598ba59d7267ee4db3745ff90eaa1a990072a (diff)
big structural change, altafcreator.com no longer served statically, projects now use md, blog is being reworked, videos removed temp
Diffstat (limited to 'www/scripts')
-rw-r--r--www/scripts/bannervideo.js22
-rw-r--r--www/scripts/blog.js4
-rw-r--r--www/scripts/captcha.js2
-rw-r--r--www/scripts/video.js16
-rw-r--r--www/scripts/videopage.js0
-rw-r--r--www/scripts/videoprojects.js15
6 files changed, 41 insertions, 18 deletions
diff --git a/www/scripts/bannervideo.js b/www/scripts/bannervideo.js
new file mode 100644
index 0000000..82576d4
--- /dev/null
+++ b/www/scripts/bannervideo.js
@@ -0,0 +1,22 @@
+const banner = document.getElementsByClassName("banner-section")[0]
+
+function playVideo(elementId) {
+ var element = document.getElementById(elementId);
+
+ element.style.visibility = "visible";
+ element.style.opacity = "100%";
+ element.play();
+
+ banner.style.background = "black";
+}
+
+function stopVideo(elementId) {
+ var element = document.getElementById(elementId);
+
+ element.style.visibility = "hidden";
+ element.style.opacity = "0%";
+ element.pause();
+ element.currentTime = 0;
+
+ banner.style.removeProperty("background");
+}
diff --git a/www/scripts/blog.js b/www/scripts/blog.js
index 1cf6657..767d1f0 100644
--- a/www/scripts/blog.js
+++ b/www/scripts/blog.js
@@ -1,8 +1,10 @@
var evaluatedTags = "";
const clamp = (val, min, max) => Math.min(Math.max(val, min), max)
+const api_url = "https://backend.altafcreator.com"
+
function postList(n = 0) {
- fetch("/data/posts.json")
+ fetch(`${api_url}/api/blogs/`)
.then((response) => response.json())
.then((data) => {
n = clamp(n, 0, data.posts.length);
diff --git a/www/scripts/captcha.js b/www/scripts/captcha.js
index abe5070..38fc11c 100644
--- a/www/scripts/captcha.js
+++ b/www/scripts/captcha.js
@@ -1,7 +1,7 @@
const emailUl = document.getElementById("email-list")
async function emailTurnstileSuccess(token) {
- const response = await fetch("https://backend.altafcreator.com/email", {
+ const response = await fetch("https://backend.altafcreator.com/api/email/", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
diff --git a/www/scripts/video.js b/www/scripts/video.js
deleted file mode 100644
index b74587e..0000000
--- a/www/scripts/video.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function playVideo(elementId) {
- var element = document.getElementById(elementId);
-
- element.style.visibility = "visible";
- element.style.opacity = "100%";
- element.play();
-}
-
-function stopVideo(elementId) {
- var element = document.getElementById(elementId);
-
- element.style.visibility = "hidden";
- element.style.opacity = "0%";
- element.pause();
- element.currentTime = 0;
-}
diff --git a/www/scripts/videopage.js b/www/scripts/videopage.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/www/scripts/videopage.js
diff --git a/www/scripts/videoprojects.js b/www/scripts/videoprojects.js
new file mode 100644
index 0000000..1879474
--- /dev/null
+++ b/www/scripts/videoprojects.js
@@ -0,0 +1,15 @@
+const playerContainer = document.getElementById("full-video-player");
+const playerVideo = document.getElementById("full-video-player-video");
+const playerCaption = document.getElementById("full-video-player-caption");
+
+function closeFullPlayer() {
+ playerContainer.style.display = "none";
+ playerVideo.pause();
+ playerVideo.currentTime = 0;
+}
+
+function loadVideo(url, caption) {
+ playerContainer.style.display = "flex";
+ playerVideo.src = url;
+ playerCaption.innerHTML = caption;
+}