changed some stuff - moving project off of 'code-server'

This commit is contained in:
Daniel Sommer 2022-02-01 11:20:24 +01:00
parent c2d7333228
commit 7b33b35315
7 changed files with 487 additions and 570 deletions

22
.vscode/launch.json vendored
View file

@ -1,22 +0,0 @@
{
"version": "0.0.1",
"configurations": [
{
"type": "node-terminal",
"request": "launch",
"name": "debug",
"command": "yarn serve"
},
{
"type": "chrome",
"request": "launch",
"name": "vuejs: chrome",
"url": "http://ws-dso:8080",
"webRoot": "${workspaceFolder}/src",
"breakOnLoad": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
},
]
}

22
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "yarn",
"args": [
"build"
]
},
{
"label": "serve",
"type": "shell",
"command": "yarn",
"args": [
"run",
"serve"
]
}
]
}

View file

@ -9,7 +9,7 @@
"url": "https://git.velvettear.de/velvettear/autoscroll.git"
},
"scripts": {
"serve": "vue-cli-service serve",
"serve": "vue-cli-service serve --host 0.0.0.0 --port 9000",
"build": "vue-cli-service build"
},
"dependencies": {
@ -19,7 +19,7 @@
"vue-router": "^3.5.3"
},
"devDependencies": {
"@vue/cli-service": "^4.5.0",
"@vue/cli-service": "^3.12.1",
"vue-template-compiler": "^2.6.11"
}
}

View file

@ -3,5 +3,5 @@
"title": "Funeralopolis",
"bass": "Electric Wizard - Funeralopolis_inverted.png",
"media": "Electric Wizard - Funeralopolis.mp3",
"duration": 140
"duration": 532
}

View file

@ -49,42 +49,50 @@ export default {
var pageLeft = pageEnd - this.getViewPortMax();
var percentagePageLeft = pageLeft / (pageEnd / 100);
var percentageDurationLeft = ((this.entry.duration * 1000) / 100) * percentagePageLeft;
var percentageDurationLeft =
((this.entry.duration * 1000) / 100) * percentagePageLeft;
console.log("DURATION LEFT " + this.entry.duration * (percentagePageLeft / 100))
console.log("pixels left: " + pageLeft);
var durationLeft = this.entry.duration * (percentagePageLeft / 100);
console.log("duration left: " + durationLeft + " seconds");
var pixelsPerSec = pageLeft / durationLeft;
console.log("need to scroll " + pixelsPerSec + " pixels / sec");
var scroll = pixelsPerSec / 100;
console.log("need to scroll " + scroll + " pixels / 100 ms");
console.log("estimated scrolls: " + (pageLeft / scroll))
var sleep = 10;
var sleeps = percentageDurationLeft / sleep;
var scrollHeight = pageLeft / sleeps;
var heightDiff = 1 - scrollHeight;
if (heightDiff >= 0) {
scrollHeight = 1;
console.log("FIX HEIGHT BY: " + heightDiff)
sleep = sleep * (1 + heightDiff);
console.log("NEW SLEEP: " + sleep)
}
var scrolls = 0;
var start = new Date();
var timediff = 0;
while (this.scrolling) {
var scrollTarget = this.getViewPortMax() + scrollHeight;
var startPrec = window.performance.now();
var scrollTarget = this.getViewPortMax() + scroll;
if (scrollTarget >= pageEnd) {
window.scrollTo(0, pageEnd);
this.scrolling = false;
var time = new Date().getTime() - start.getTime();
console.log(
"end of page reached after " +
time +
"ms - scrolls: " +
time / 1000 +
" seconds - scrolls: " +
scrolls +
" times"
);
return;
}
scrolls++;
window.scrollBy(0, scrollHeight);
await this.sleep(sleep);
window.scrollBy(0, scroll);
timediff += window.performance.now() - startPrec;
if (timediff >= 2) {
await this.sleep(sleep - timediff);
timediff = 0
} else {
await this.sleep(sleep);
}
}
this.scrolling = false;

View file

@ -1,3 +1,14 @@
module.exports = {
runtimeCompiler: true
}
runtimeCompiler: true,
chainWebpack: (config) => {
config
.plugin('html')
.tap((args) => {
args[0].title = "tabber";
return args;
});
},
configureWebpack: {
devtool: 'source-map'
}
}

950
yarn.lock

File diff suppressed because it is too large Load diff