├── README.md ├── CHANGELOG.md ├── analysis_options.yaml ├── .gitignore ├── .github ├── dependabot.yaml └── workflows │ └── gh_pages_deploy.yml ├── .vscode └── tasks.json ├── pubspec.yaml ├── web ├── styles.css ├── index.html └── main.dart └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | An absolute bare-bones web app. 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version. 4 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:dart_test_tools/strict.yaml 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | pubspec.lock 5 | 6 | # Conventional directory for build output. 7 | build/ 8 | 9 | custom_lint.log 10 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "pub" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | - package-ecosystem: "github-actions" 8 | directory: "/" 9 | schedule: 10 | interval: "weekly" 11 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "dart", 6 | "command": "dart", 7 | "cwd": "", 8 | "args": [ 9 | "run", 10 | "webdev", 11 | "serve" 12 | ], 13 | "problemMatcher": [], 14 | "label": "dart: dart run webdev serve", 15 | "detail": "", 16 | "group": { 17 | "kind": "build", 18 | "isDefault": true 19 | } 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: improved_initiative_interceptor 2 | description: An absolute bare-bones web app. 3 | version: 2.0.0 4 | 5 | environment: 6 | sdk: ^3.7.0 7 | 8 | dependencies: 9 | lzstring: ^2.0.0+2 10 | web: ^1.1.1 11 | 12 | dev_dependencies: 13 | build_runner: ^2.4.15 14 | build_web_compilers: ^4.1.1 15 | custom_lint: ">=0.7.3 <0.9.0" 16 | dart_test_tools: ">=6.1.0 <8.0.0" 17 | webdev: ^3.7.1 18 | -------------------------------------------------------------------------------- /web/styles.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Roboto); 2 | 3 | html, body { 4 | width: 100%; 5 | height: 100%; 6 | margin: 0; 7 | padding: 0; 8 | font-family: 'Roboto', sans-serif; 9 | 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | } 14 | 15 | #output { 16 | text-align: start; 17 | height: calc(100vh - 20px); 18 | width: calc(100vw - 20px); 19 | } 20 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | improved_initiative_interceptor 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/gh_pages_deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to GitHub-Pages 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - "*" 8 | pull_request: 9 | branches: 10 | - "*" 11 | 12 | jobs: 13 | build_and_deploy: 14 | permissions: 15 | contents: write 16 | name: Build and Deploy 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: dart-lang/setup-dart@v1.4 20 | - uses: actions/checkout@v6 21 | - run: dart pub get 22 | - run: dart analyze --fatal-infos 23 | - run: dart format -onone --set-exit-if-changed $(git ls-files '*.dart') 24 | - run: dart run webdev build --release 25 | - uses: JamesIves/github-pages-deploy-action@v4.7.4 26 | with: 27 | branch: gh-pages 28 | folder: build 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Felix Barz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /web/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'dart:js_interop'; 4 | 5 | import 'package:lzstring/lzstring.dart'; 6 | import 'package:web/web.dart'; 7 | 8 | Future main() async { 9 | final textAreaElement = 10 | (document.querySelector('#output')! as HTMLTextAreaElement) 11 | ..value = 'Loading, please wait...'; 12 | 13 | final query = URLSearchParams(window.location.search.toJS); 14 | final source = query.get('i'); 15 | if (source == null) { 16 | textAreaElement.value = 'No stats found in URL'; 17 | return; 18 | } 19 | 20 | try { 21 | final decodedStats = await LZString.decompressFromEncodedURIComponent( 22 | source, 23 | ); 24 | if (decodedStats == null) { 25 | textAreaElement.value = 'Failed to decode stats'; 26 | return; 27 | } 28 | 29 | final prettyStats = const JsonEncoder.withIndent( 30 | ' ', 31 | ).convert(json.decode(decodedStats)); 32 | 33 | textAreaElement 34 | ..value = prettyStats 35 | ..select(); 36 | 37 | await Future(() => textAreaElement.scrollTop = 0); 38 | } on Exception catch (e, s) { 39 | textAreaElement.value = '$e\n$s'; 40 | } 41 | } 42 | --------------------------------------------------------------------------------