Skip to content

Commit

Permalink
Modernize (thanks ChatGPT), remove jQuery, add README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tronic committed May 9, 2023
1 parent c2692bf commit 250fb9a
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 449 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Performous.org

The website is statically generated from custom format, using the tool in webconv folder.

Static assets are in htdocs-binary and source code in `htdocs-source`, and in particular the navigation menu is defined in `htdocs-source/AWC-cfg.txt`. See `webconv/README.txt` for mode details on the source formats and the conversion tool.

Use `local-deploy.sh` script to rebuild into `web` folder, that can then be uploaded to web server.
75 changes: 39 additions & 36 deletions htdocs-binary/js/index-page.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
var img = Math.floor(Math.random() * 20);
var anim = -1;
var frames_anim = 120;
var frames_img = 400;
let img = Math.floor(Math.random() * 20)
let anim = -1
const framesAnim = 120
const framesImg = 400
let lastTimestamp

function showcaseScroll() {
++anim;
if (anim == frames_img) { anim = 0; ++img; }
var a = Math.min(anim / frames_anim, 1.0);
var pos = 5 * 128 * (img + 0.5 * (1 - Math.cos(Math.PI * a)));
$('#showcase').css('backgroundPosition', Math.round(-pos) + 'px 0');
function showcaseScroll(timestamp) {
if (lastTimestamp === undefined) lastTimestamp = timestamp
const deltaTime = timestamp - lastTimestamp
lastTimestamp = timestamp
const animDelta = (deltaTime * 60) / 1000
anim += animDelta
if (anim >= framesImg) {
anim = 0
++img
}
const a = Math.min(anim / framesAnim, 1.0)
const pos = 5 * 128 * (img + 0.5 * (1 - Math.cos(Math.PI * a)))
const showcase = document.getElementById("showcase")
showcase.style.backgroundPosition = Math.round(-pos) + "px 0"
requestAnimationFrame(showcaseScroll)
}
requestAnimationFrame(showcaseScroll)

function smartDownload() {
var e = document.getElementById('download');
if (!e) return;
if (navigator.platform.indexOf("Win32") != -1 || navigator.platform.indexOf("Win64") != -1) {
// Windows
e.href = 'https://github.com/performous/performous/releases/download/1.2.0/Performous-1.2.0.exe';
e.title = 'Performous 1.2.0 (Windows)';
return;
} else if (navigator.platform.indexOf("Linux") != -1) {
// Linux
return;
} else if (navigator.userAgent.indexOf("Mac OS X") != -1 || navigator.userAgent.indexOf("MSIE 5.2") != -1 || navigator.platform.indexOf("Mac") != -1) {
// Mac/Mac OS X
e.href = 'https://github.com/performous/performous/releases/download/1.2.0/Performous-1.2.0.dmg';
e.title = 'Performous 1.2 (OS X 10.6 or newer)';
return;
} else {
// Other
return;
}
const e = document.getElementById("download")
if (!e) return
const platform = navigator.userAgentData.platform
if (platform === "Windows") {
// Windows
e.href = "https://github.com/performous/performous/releases/download/1.2.0/Performous-1.2.0.exe"
e.title = "Performous 1.2.0 (Windows)"
} else if (platform === "Linux") {
// Linux
} else if (platform === "macOS") {
// Mac/Mac OS X
e.href = "https://github.com/performous/performous/releases/download/1.2.0/Performous-1.2.0.dmg"
e.title = "Performous 1.2 (OS X 10.6 or newer)"
} else {
// Other
}
}

$('document').ready(function() {
setInterval(smartDownload, 50);
setInterval(showcaseScroll, 16.66);
});



// Poll for updates (if user navigates to index page from another page)
setInterval(smartDownload, 50)
2 changes: 0 additions & 2 deletions htdocs-binary/js/jquery.js

This file was deleted.

Loading

0 comments on commit 250fb9a

Please sign in to comment.