diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..33c72e6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 2 + +[*.css] +indent_size = 4 +tab_width = 4 diff --git a/.gitignore b/.gitignore index 50b5631..f4ed55c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,243 @@ -bin/ +### VisualStudioCode template +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### ExtJs template +.architect +bootstrap.css +bootstrap.js +bootstrap.json +bootstrap.jsonp +build/ +classic.json +classic.jsonp +ext/ +modern.json +modern.jsonp +resources/sass/.sass-cache/ +resources/.arch-internal-preview.css +.arch-internal-preview.css + +# Binary directory +bin/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/guihacker.iml b/.idea/guihacker.iml new file mode 100644 index 0000000..c02aa02 --- /dev/null +++ b/.idea/guihacker.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..d23208f --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/markdown.xml b/.idea/markdown.xml new file mode 100644 index 0000000..62b08b7 --- /dev/null +++ b/.idea/markdown.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3edb4bb --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/webResources.xml b/.idea/webResources.xml new file mode 100644 index 0000000..3432ba4 --- /dev/null +++ b/.idea/webResources.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.naverc b/.naverc new file mode 100644 index 0000000..d5a1596 --- /dev/null +++ b/.naverc @@ -0,0 +1 @@ +20.10.0 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..2478c39 --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +engine-strict = true +strict-peer-dependencies=false +auto-install-peers=true diff --git a/README.md b/README.md index 3e7fadc..97d3ee0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Ridiculous output to make you look like an amazing hacker. Created as a joke for this question on [Code Golf SE](http://codegolf.stackexchange.com/questions/30322/make-it-look-like-im-working) -Added some limited options for customizability +Added some limited options for customization * title - change the title to whatever * color - give it a css color string and the script will use that color @@ -15,4 +15,4 @@ You can pass the options to the url via the location hash like so ```http://guihacker.com/#{"title":"sometitle", "color" : "red", "gui":false}``` -[Running at http://guihacker.com](http://guihacker.com) \ No newline at end of file +[Running at http://guihacker.com](http://guihacker.com) diff --git a/app.js b/app.js index 35af322..0cf2b70 100644 --- a/app.js +++ b/app.js @@ -1,33 +1,38 @@ - /** * Module dependencies. */ +const express = require('express'), + routes = require('./routes'), + http = require('http'), + favicon = require('serve-favicon'), + bodyParser = require('body-parser'), + methodOverride = require('method-override'), + logger = require('morgan'), + errorHandler = require('errorhandler'), + path = require('path'); -var express = require('express'), - routes = require('./routes'), - http = require('http'), - path = require('path'); - -var app = express(); +const app = express(); // all environments app.set('port', process.env.PORT || 8085); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); -app.use(express.favicon()); -app.use(express.logger('dev')); -app.use(express.bodyParser()); -app.use(express.methodOverride()); -app.use(app.router); + +app.use(favicon(path.join(__dirname, 'public', 'images', 'favicon.png'))); +app.use(logger('dev')); +app.use(methodOverride()); +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); + app.use(express.static(path.join(__dirname, 'public'))); +app.use('/', routes); + // development only -if ('development' == app.get('env')) { - app.use(express.errorHandler()); +if ('development' === app.get('env')) { + app.use(errorHandler()); } -app.get('/', routes.index); - -http.createServer(app).listen(app.get('port'), function(){ +app.listen(app.get('port'), () => { console.log('Express server listening on port ' + app.get('port')); }); diff --git a/package.json b/package.json index 63497b4..f16bd2a 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,24 @@ { "name": "guihacker", - "version": "0.0.1", + "version": "1.0.0", "private": true, "scripts": { - "start": "node ./bin/www" + "start": "node app.js" }, + "engineStrict": true, + "engines": { + "node": ">= 20.8.1" + }, + "packageManager": "pnpm@8.15.3", "dependencies": { - "express": "~3.4.8", - "static-favicon": "~1.0.0", - "morgan": "~1.0.0", - "cookie-parser": "~1.0.1", - "body-parser": "~1.0.0", - "debug": "~0.7.4", - "ejs": "~0.8.5" + "body-parser": "~1.20.2", + "cookie-parser": "~1.4.6", + "ejs": "~3.1.9", + "errorhandler": "^1.5.1", + "express": "~4.18.3", + "method-override": "^3.0.0", + "morgan": "~1.10.0", + "serve-favicon": "^2.5.0", + "static-favicon": "~1.0.0" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..14cba32 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,681 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + body-parser: + specifier: ~1.20.2 + version: 1.20.2 + cookie-parser: + specifier: ~1.4.6 + version: 1.4.6 + ejs: + specifier: ~3.1.9 + version: 3.1.9 + errorhandler: + specifier: ^1.5.1 + version: 1.5.1 + express: + specifier: ~4.18.3 + version: 4.18.3 + method-override: + specifier: ^3.0.0 + version: 3.0.0 + morgan: + specifier: ~1.10.0 + version: 1.10.0 + serve-favicon: + specifier: ^2.5.0 + version: 2.5.0 + static-favicon: + specifier: ~1.0.0 + version: 1.0.2 + +packages: + + /accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: false + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: false + + /array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: false + + /async@3.2.5: + resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} + dev: false + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: false + + /basic-auth@2.0.1: + resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} + engines: {node: '>= 0.8'} + dependencies: + safe-buffer: 5.1.2 + dev: false + + /body-parser@1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: false + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: false + + /bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: false + + /call-bind@1.0.5: + resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} + dependencies: + function-bind: 1.1.2 + get-intrinsic: 1.2.2 + set-function-length: 1.2.0 + dev: false + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: false + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: false + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: false + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: false + + /content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: false + + /content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + dev: false + + /cookie-parser@1.4.6: + resolution: {integrity: sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==} + engines: {node: '>= 0.8.0'} + dependencies: + cookie: 0.4.1 + cookie-signature: 1.0.6 + dev: false + + /cookie-signature@1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: false + + /cookie@0.4.1: + resolution: {integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==} + engines: {node: '>= 0.6'} + dev: false + + /cookie@0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: false + + /debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: false + + /debug@3.1.0: + resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: false + + /define-data-property@1.1.1: + resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: false + + /depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: false + + /destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: false + + /ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: false + + /ejs@3.1.9: + resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==} + engines: {node: '>=0.10.0'} + hasBin: true + dependencies: + jake: 10.8.7 + dev: false + + /encodeurl@1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: false + + /errorhandler@1.5.1: + resolution: {integrity: sha512-rcOwbfvP1WTViVoUjcfZicVzjhjTuhSMntHh6mW3IrEiyE6mJyXvsToJUJGlGlw/2xU9P5whlWNGlIDVeCiT4A==} + engines: {node: '>= 0.8'} + dependencies: + accepts: 1.3.8 + escape-html: 1.0.3 + dev: false + + /escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: false + + /etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: false + + /express@4.18.3: + resolution: {integrity: sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.2 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /filelist@1.0.4: + resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} + dependencies: + minimatch: 5.1.6 + dev: false + + /finalhandler@1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + + /forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: false + + /fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: false + + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: false + + /get-intrinsic@1.2.2: + resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} + dependencies: + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + dev: false + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.2 + dev: false + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: false + + /has-property-descriptors@1.0.1: + resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} + dependencies: + get-intrinsic: 1.2.2 + dev: false + + /has-proto@1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} + dev: false + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: false + + /hasown@2.0.0: + resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: false + + /http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: false + + /iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: false + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: false + + /ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: false + + /jake@10.8.7: + resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} + engines: {node: '>=10'} + hasBin: true + dependencies: + async: 3.2.5 + chalk: 4.1.2 + filelist: 1.0.4 + minimatch: 3.1.2 + dev: false + + /media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: false + + /merge-descriptors@1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: false + + /method-override@3.0.0: + resolution: {integrity: sha512-IJ2NNN/mSl9w3kzWB92rcdHpz+HjkxhDJWNDBqSlas+zQdP8wBiJzITPg08M/k2uVvMow7Sk41atndNtt/PHSA==} + engines: {node: '>= 0.10'} + dependencies: + debug: 3.1.0 + methods: 1.1.2 + parseurl: 1.3.3 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: false + + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + + /mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: false + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: false + + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: false + + /morgan@1.10.0: + resolution: {integrity: sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==} + engines: {node: '>= 0.8.0'} + dependencies: + basic-auth: 2.0.1 + debug: 2.6.9 + depd: 2.0.0 + on-finished: 2.3.0 + on-headers: 1.0.2 + transitivePeerDependencies: + - supports-color + dev: false + + /ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: false + + /ms@2.1.1: + resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==} + dev: false + + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: false + + /negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: false + + /object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: false + + /on-finished@2.3.0: + resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: false + + /on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: false + + /on-headers@1.0.2: + resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} + engines: {node: '>= 0.8'} + dev: false + + /parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: false + + /path-to-regexp@0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: false + + /proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: false + + /qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: false + + /range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: false + + /raw-body@2.5.2: + resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: false + + /safe-buffer@5.1.1: + resolution: {integrity: sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==} + dev: false + + /safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: false + + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: false + + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: false + + /send@0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: false + + /serve-favicon@2.5.0: + resolution: {integrity: sha512-FMW2RvqNr03x+C0WxTyu6sOv21oOjkq5j8tjquWccwa6ScNyGFOGJVpuS1NmTVGBAHS07xnSKotgf2ehQmf9iA==} + engines: {node: '>= 0.8.0'} + dependencies: + etag: 1.8.1 + fresh: 0.5.2 + ms: 2.1.1 + parseurl: 1.3.3 + safe-buffer: 5.1.1 + dev: false + + /serve-static@1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: false + + /set-function-length@1.2.0: + resolution: {integrity: sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + function-bind: 1.1.2 + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: false + + /setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: false + + /side-channel@1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + object-inspect: 1.13.1 + dev: false + + /static-favicon@1.0.2: + resolution: {integrity: sha512-462dn/fhYwu7CWtOK+B3KAn6iFA2nlwfhM72Qkgm4HIGe3UAJ1BSJs3M9RIufQ2SrTmruzxB0ZCGHo5N7+lNpA==} + engines: {node: '>= 0.10.0'} + deprecated: use serve-favicon module + dev: false + + /statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: false + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: false + + /toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: false + + /type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: false + + /unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: false + + /utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: false + + /vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: false diff --git a/public/javascripts/hack.js b/public/javascripts/hack.js index 58d97cd..3e8f451 100644 --- a/public/javascripts/hack.js +++ b/public/javascripts/hack.js @@ -1,299 +1,305 @@ +let settings = { + canvas: document.querySelector(".hacker-3d"), + ctx: document.querySelector(".hacker-3d").getContext("2d"), + canvasBars: document.querySelector(".bars-and-stuff"), + ctxBars: document.querySelector(".bars-and-stuff").getContext("2d"), + outputConsole: document.querySelector(".output-console"), + vpx: 0, + vpy: 0, + focal: 0, + color: "#00FF00", + title: "Gui Hacker", + gui: true +}; + /* Graphics stuff */ function Square(z) { - this.width = settings.canvas.width/2; - this.height = settings.canvas.height; - z = z || 0; - - var canvas = settings.canvas; - - this.points = [ - new Point({ - x: (canvas.width / 2) - this.width, - y: (canvas.height / 2) - this.height, - z: z, - }), - new Point({ - x: (canvas.width / 2) + this.width, - y: (canvas.height / 2) - this.height, - z: z - }), - new Point({ - x: (canvas.width / 2) + this.width, - y: (canvas.height / 2) + this.height, - z: z - }), - new Point( { - x: (canvas.width / 2) - this.width, - y: (canvas.height / 2) + this.height, - z: z - }) - ]; - this.dist = 0; + this.width = settings.canvas.width / 2; + this.height = settings.canvas.height; + z = z || 0; + + const canvas = settings.canvas; + + this.points = [ + new Point({ + x: (canvas.width / 2) - this.width, + y: (canvas.height / 2) - this.height, + z: z, + }), + new Point({ + x: (canvas.width / 2) + this.width, + y: (canvas.height / 2) - this.height, + z: z + }), + new Point({ + x: (canvas.width / 2) + this.width, + y: (canvas.height / 2) + this.height, + z: z + }), + new Point({ + x: (canvas.width / 2) - this.width, + y: (canvas.height / 2) + this.height, + z: z + }) + ]; + this.dist = 0; } Square.prototype.update = function () { - for (var p = 0; p < this.points.length; p++) { - this.points[p].rotateZ(0.001); - this.points[p].z -= 3; - if (this.points[p].z < -300) { - this.points[p].z = 2700; - } - this.points[p].map2D(); + for (const element of this.points) { + element.rotateZ(0.001); + element.z -= 3; + if (element.z < -300) { + element.z = 2700; } + element.map2D(); + } }; Square.prototype.render = function () { - settings.ctx.beginPath(); - settings.ctx.moveTo(this.points[0].xPos, this.points[0].yPos); + settings.ctx.beginPath(); + settings.ctx.moveTo(this.points[0].xPos, this.points[0].yPos); - for (var p = 1; p < this.points.length; p++) { - if (this.points[p].z > -(settings.focal - 50)) { - settings.ctx.lineTo(this.points[p].xPos, this.points[p].yPos); - } + for (let p = 1; p < this.points.length; p++) { + if (this.points[p].z > -(settings.focal - 50)) { + settings.ctx.lineTo(this.points[p].xPos, this.points[p].yPos); } + } - settings.ctx.closePath(); - settings.ctx.stroke(); + settings.ctx.closePath(); + settings.ctx.stroke(); - this.dist = this.points[this.points.length - 1].z; + this.dist = this.points[this.points.length - 1].z; }; function Point(pos) { - this.x = pos.x - settings.canvas.width / 2 || 0; - this.y = pos.y - settings.canvas.height / 2 || 0; - this.z = pos.z || 0; + this.x = pos.x - settings.canvas.width / 2 || 0; + this.y = pos.y - settings.canvas.height / 2 || 0; + this.z = pos.z || 0; - this.cX = 0; - this.cY = 0; - this.cZ = 0; + this.cX = 0; + this.cY = 0; + this.cZ = 0; - this.xPos = 0; - this.yPos = 0; + this.xPos = 0; + this.yPos = 0; - this.map2D(); + this.map2D(); } Point.prototype.rotateZ = function (angleZ) { - var cosZ = Math.cos(angleZ), - sinZ = Math.sin(angleZ), - x1 = this.x * cosZ - this.y * sinZ, - y1 = this.y * cosZ + this.x * sinZ; + const cosZ = Math.cos(angleZ), + sinZ = Math.sin(angleZ), + y1 = this.y * cosZ + this.x * sinZ; - this.x = x1; - this.y = y1; + this.x = this.x * cosZ - this.y * sinZ; + this.y = y1; }; Point.prototype.map2D = function () { - var scaleX = settings.focal / (settings.focal + this.z + this.cZ), - scaleY = settings.focal / (settings.focal + this.z + this.cZ); + const scaleX = settings.focal / (settings.focal + this.z + this.cZ), + scaleY = settings.focal / (settings.focal + this.z + this.cZ); - this.xPos = settings.vpx + (this.cX + this.x) * scaleX; - this.yPos = settings.vpy + (this.cY + this.y) * scaleY; + this.xPos = settings.vpx + (this.cX + this.x) * scaleX; + this.yPos = settings.vpy + (this.cY + this.y) * scaleY; }; // ** Main function **// -function GuiHacker(){ - this.squares = []; - - this.barVals = []; - this.sineVal = []; - - for (var i = 0; i < 15; i++) { - this.squares.push(new Square(-300 + (i * 200))); - } - - // Console stuff - this.commandStart = [ - 'Performing DNS Lookups for ', - 'Searching ', - 'Analyzing ', - 'Estimating Approximate Location of ', - 'Compressing ', - 'Requesting Authorization From : ', - 'wget -a -t ', - 'tar -xzf ', - 'Entering Location ', - 'Compilation Started of ', - 'Downloading ' - ]; - this.commandParts = [ - 'Data Structure', - 'http://wwjd.com?au&2', - 'Texture', - 'TPS Reports', - ' .... Searching ... ', - 'http://zanb.se/?23&88&far=2', - 'http://ab.ret45-33/?timing=1ww' - ]; - this.responses = [ - 'Authorizing ', - 'Authorized...', - 'Access Granted..', - 'Going Deeper....', - 'Compression Complete.', - 'Compilation of Data Structures Complete..', - 'Entering Security Console...', - 'Encryption Unsuccesful Attempting Retry...', - 'Waiting for response...', - '....Searching...', - 'Calculating Space Requirements ' - ]; - this.isProcessing = false; - this.processTime = 0; - this.lastProcess = 0; - - this.render(); - this.consoleOutput(); +function GuiHacker() { + this.squares = []; + + this.barVals = []; + this.sineVal = []; + + for (let i = 0; i < 15; i++) { + this.squares.push(new Square(-300 + (i * 200))); + } + + // Console stuff + this.commandStart = [ + 'Performing DNS Lookups for ', + 'Searching ', + 'Analyzing ', + 'Estimating Approximate Location of ', + 'Compressing ', + 'Requesting Authorization From : ', + 'wget -a -t ', + 'tar -xzf ', + 'Entering Location ', + 'Compilation Started of ', + 'Downloading ' + ]; + this.commandParts = [ + 'Data Structure', + 'http://wwjd.com?au&2', + 'Texture', + 'TPS Reports', + ' .... Searching ... ', + 'http://zanb.se/?23&88&far=2', + 'http://ab.ret45-33/?timing=1ww' + ]; + this.responses = [ + 'Authorizing ', + 'Authorized...', + 'Access Granted..', + 'Going Deeper....', + 'Compression Complete.', + 'Compilation of Data Structures Complete..', + 'Entering Security Console...', + 'Encryption Unsuccesful Attempting Retry...', + 'Waiting for response...', + '....Searching...', + 'Calculating Space Requirements ' + ]; + this.isProcessing = false; + this.processTime = 0; + this.lastProcess = 0; + + this.render(); + this.consoleOutput(); } -GuiHacker.prototype.render = function(){ - var ctx = settings.ctx, - canvas = settings.canvas, - ctxBars = settings.ctxBars, - canvasBars = settings.canvasBars; +GuiHacker.prototype.render = function () { + let i; + let len = this.squares.length; + const ctx = settings.ctx, + canvas = settings.canvas, + ctxBars = settings.ctxBars, + canvasBars = settings.canvasBars; - ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.clearRect(0, 0, canvas.width, canvas.height); - this.squares.sort(function (a, b) { - return b.dist - a.dist; - }); + this.squares.sort(function (a, b) { + return b.dist - a.dist; + }); - for (var i = 0, len = this.squares.length; i < len; i++) { - var square = this.squares[i]; - square.update(); - square.render(); - } + for (i = 0; i < len; i++) { + const square = this.squares[i]; + square.update(); + square.render(); + } - ctxBars.clearRect(0, 0, canvasBars.width, canvasBars.height); + ctxBars.clearRect(0, 0, canvasBars.width, canvasBars.height); - ctxBars.beginPath(); - var y = canvasBars.height/6; - ctxBars.moveTo(0,y); + ctxBars.beginPath(); + const y = canvasBars.height / 6; + ctxBars.moveTo(0, y); - for(i = 0; i < canvasBars.width; i++){ - var ran = (Math.random()*20)-10; - if(Math.random() > 0.98){ - ran = (Math.random()*50)-25; - } - ctxBars.lineTo(i, y + ran); + for (i = 0; i < canvasBars.width; i++) { + let ran = (Math.random() * 20) - 10; + if (Math.random() > 0.98) { + ran = (Math.random() * 50) - 25; } - - ctxBars.stroke(); - - for(i = 0; i < canvasBars.width; i+=20){ - if(!this.barVals[i]){ - this.barVals[i] = { - val : Math.random()*(canvasBars.height/2), - freq : 0.1, - sineVal : Math.random()*100 - }; - } - - var barVal = this.barVals[i]; - barVal.sineVal+=barVal.freq; - barVal.val+=Math.sin(barVal.sineVal*Math.PI/2)*5; - ctxBars.fillRect(i+5,canvasBars.height,15,-barVal.val); + ctxBars.lineTo(i, y + ran); + } + + ctxBars.stroke(); + + for (i = 0; i < canvasBars.width; i += 20) { + if (!this.barVals[i]) { + this.barVals[i] = { + val: Math.random() * (canvasBars.height / 2), + freq: 0.1, + sineVal: Math.random() * 100 + }; } - var self = this; - requestAnimationFrame(function(){self.render();}); + let barVal = this.barVals[i]; + barVal.sineVal += barVal.freq; + barVal.val += Math.sin(barVal.sineVal * Math.PI / 2) * 5; + ctxBars.fillRect(i + 5, canvasBars.height, 15, -barVal.val); + } + + const self = this; + requestAnimationFrame(function () { + self.render(); + }); }; -GuiHacker.prototype.consoleOutput = function(){ - var textEl = document.createElement('p'); - - if(this.isProcessing){ - textEl = document.createElement('span'); - textEl.textContent += Math.random() + " "; - if(Date.now() > this.lastProcess + this.processTime){ - this.isProcessing = false; - } - }else{ - var commandType = ~~(Math.random()*4); - switch(commandType){ - case 0: - textEl.textContent = this.commandStart[~~(Math.random()*this.commandStart.length)] + this.commandParts[~~(Math.random()*this.commandParts.length)]; - break; - case 3: - this.isProcessing = true; - this.processTime = ~~(Math.random()*5000); - this.lastProcess = Date.now(); - break; - default: - textEl.textContent = this.responses[~~(Math.random()*this.responses.length)]; - break; - } +GuiHacker.prototype.consoleOutput = function () { + let textEl = document.createElement('p'); + + if (this.isProcessing) { + textEl = document.createElement('span'); + textEl.textContent += Math.random() + " "; + if (Date.now() > this.lastProcess + this.processTime) { + this.isProcessing = false; } + } else { + let commandType = ~~(Math.random() * 4); + switch (commandType) { + case 0: + textEl.textContent = this.commandStart[~~(Math.random() * this.commandStart.length)] + this.commandParts[~~(Math.random() * this.commandParts.length)]; + break; + case 3: + this.isProcessing = true; + this.processTime = ~~(Math.random() * 5000); + this.lastProcess = Date.now(); + break; + default: + textEl.textContent = this.responses[~~(Math.random() * this.responses.length)]; + break; + } + } - var outputConsole = settings.outputConsole; - outputConsole.scrollTop = outputConsole.scrollHeight; - outputConsole.appendChild(textEl); + const outputConsole = settings.outputConsole; + outputConsole.scrollTop = outputConsole.scrollHeight; + outputConsole.appendChild(textEl); - if (outputConsole.scrollHeight > window.innerHeight) { - var removeNodes = outputConsole.querySelectorAll('*'); - for(var n = 0; n < ~~(removeNodes.length/3); n++){ - outputConsole.removeChild(removeNodes[n]); - } + if (outputConsole.scrollHeight > window.innerHeight) { + let removeNodes = outputConsole.querySelectorAll('*'); + for (let n = 0; n < ~~(removeNodes.length / 3); n++) { + outputConsole.removeChild(removeNodes[n]); } + } - var self = this; - setTimeout(function(){self.consoleOutput();}, ~~(Math.random()*200)); + const self = this; + setTimeout(function () { + self.consoleOutput(); + }, ~~(Math.random() * 200)); }; // Settings -var settings = { - canvas : document.querySelector(".hacker-3d-shiz"), - ctx : document.querySelector(".hacker-3d-shiz").getContext("2d"), - canvasBars : document.querySelector(".bars-and-stuff"), - ctxBars : document.querySelector(".bars-and-stuff").getContext("2d"), - outputConsole : document.querySelector(".output-console"), - vpx : 0, - vpy : 0, - focal : 0, - color : "#00FF00", - title : "Gui Hacker", - gui : true - }, - hash = decodeURIComponent(document.location.hash.substring(1)), - userSettings = {}; - -if (hash){ - userSettings = JSON.parse(hash); - if(userSettings && userSettings.title !== undefined){ - document.title = userSettings.title; - } +let hash = decodeURIComponent(document.location.hash.substring(1)), + userSettings = {}; - if(userSettings && userSettings.gui !== undefined){ - settings.gui = userSettings.gui; - } +if (hash) { + userSettings = JSON.parse(hash); + if (userSettings && userSettings.title !== undefined) { + document.title = userSettings.title; + } - settings.color = userSettings.color || settings.color; -} + if (userSettings && userSettings.gui !== undefined) { + settings.gui = userSettings.gui; + } -var adjustCanvas = function(){ - if(settings.gui){ - settings.canvas.width = (window.innerWidth/3)*2; - settings.canvas.height = window.innerHeight / 3; + settings.color = userSettings.color || settings.color; +} - settings.canvasBars.width = window.innerWidth/3; - settings.canvasBars.height = settings.canvas.height; +const adjustCanvas = (() => { + if (settings.gui) { + settings.canvas.width = (window.innerWidth / 3) * 2; + settings.canvas.height = window.innerHeight / 3; - settings.outputConsole.style.height = (window.innerHeight / 3) * 2 + 'px'; - settings.outputConsole.style.top = window.innerHeight / 3 + 'px'; + settings.canvasBars.width = window.innerWidth / 3; + settings.canvasBars.height = settings.canvas.height; - settings.focal = settings.canvas.width / 2; - settings.vpx = settings.canvas.width / 2; - settings.vpy = settings.canvas.height / 2; + settings.outputConsole.style.height = (window.innerHeight / 3) * 2 + 'px'; + settings.outputConsole.style.top = window.innerHeight / 3 + 'px'; - settings.ctx.strokeStyle = settings.ctxBars.strokeStyle = settings.ctxBars.fillStyle = settings.color; - }else{ - document.querySelector(".hacker-3d-shiz").style.display = "none"; - document.querySelector(".bars-and-stuff").style.display = "none"; - } - document.body.style.color = settings.color; - }(), - guiHacker = new GuiHacker(settings); + settings.focal = settings.canvas.width / 2; + settings.vpx = settings.canvas.width / 2; + settings.vpy = settings.canvas.height / 2; + settings.ctx.strokeStyle = settings.ctxBars.strokeStyle = settings.ctxBars.fillStyle = settings.color; + } else { + document.querySelector(".hacker-3d").style.display = "none"; + document.querySelector(".bars-and-stuff").style.display = "none"; + } + document.body.style.color = settings.color; +}); +const _ = new GuiHacker(settings); +adjustCanvas(); window.addEventListener('resize', adjustCanvas); diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 8c3dcc8..da2acd0 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,27 +1,32 @@ @font-face { - font-family: 'Source Code Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(http://themes.googleusercontent.com/static/fonts/sourcecodepro/v4/mrl8jkM18OlOQN8JLgasDxM0YzuT7MdOe03otPbuUS0.woff) format('woff'); + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(https://themes.googleusercontent.com/static/fonts/sourcecodepro/v4/mrl8jkM18OlOQN8JLgasDxM0YzuT7MdOe03otPbuUS0.woff) format('woff'); } body { - font-family: 'Source Code Pro'; - background:#000; + font-family: 'Source Code Pro', sans-serif; + background: #000; color: #00FF00; - margin:0; + margin: 0; } + canvas { - position:absolute; - top:0; - left:0; + position: absolute; + top: 0; + left: 0; } -.bars-and-stuff{ - left:66.6%; + +.bars-and-stuff { + left: 66.6%; } .output-console { - position:fixed; - overflow:hidden; + position: fixed; + overflow: hidden; +} + +p { + margin: 0 } -p{margin:0} \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index bfa5260..34197de 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,4 +1,9 @@ +const express = require('express'); +const router = express.Router(); + /* GET home page. */ -exports.index = function(req, res){ +router.get('/', (req, res) => { res.render('index', { title: 'Hacker Gui' }); -}; +}); + +module.exports = router; diff --git a/views/index.ejs b/views/index.ejs index 58e48ef..7aef4b5 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,23 +1,14 @@ - + Gui Hacker - +
-