Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize (thanks ChatGPT), remove jQuery, add README. #18

Merged
merged 3 commits into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Performous Website

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.

# Github Actions

We're using Github Actions to automaticly deploy the website.

To update the website follow these actions:

1. Make your changes to the website
2. Propose your changes in a Pull Request
3. Github Actions will produce an artifact which we can use to verify the changes
4. Fix any feedback that might come and fix it until an approval is given
5. Rebase and Merge to master
6. GH-Actions will auto-deploy the changes.
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