Skip to content

Commit

Permalink
feat(app): Add web
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Feb 17, 2024
1 parent d659a3d commit 0a75036
Show file tree
Hide file tree
Showing 22 changed files with 11,758 additions and 46 deletions.
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"**.openapi.json",
"**/CHANGELOG.md",
"external",
"packages/app/web/sqlite3.wasm",
"packages/app/web/sqflite_sw.js",
"packages/dynamite/dynamite/example/lib",
"packages/file_icons/lib/src/data.dart",
"packages/neon_lints/lib",
Expand Down
2 changes: 2 additions & 0 deletions packages/app/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web/sqflite_sw.js -diff
web/sqlite3.wasm -diff
3 changes: 3 additions & 0 deletions packages/app/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ migration:
- platform: linux
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
- platform: web
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c

# User provided section

Expand Down
8 changes: 8 additions & 0 deletions packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ A beautiful convergent cross-platform client for Nextcloud written in Flutter.
You can build it yourself from source or download it from the automatic build pipelines.
The app will be published on F-Droid, the Google Playstore and Flathub later on.

## Run on web

Due to CORS issues the app must be run with web security disabled.

```bash
fvm flutter run -d chrome --web-browser-flag "--disable-web-security"
```

## Screenshots

For more screenshots see `./screenshots/`.
Expand Down
2 changes: 1 addition & 1 deletion packages/app/flutter_native_splash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ flutter_native_splash:
icon_background_color: "#ffffff"
icon_background_color_dark: "#202020"
ios: false
web: false
web: true
58 changes: 21 additions & 37 deletions packages/app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
charcode:
dependency: transitive
description:
name: charcode
sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
url: "https://pub.dev"
source: hosted
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -268,10 +260,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.2"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -402,10 +394,10 @@ packages:
dependency: transitive
description:
name: flutter_markdown
sha256: "30088ce826b5b9cfbf9e8bece34c716c8a59fa54461dcae1e4ac01a94639e762"
sha256: "21b085a1c185e46701373866144ced56cfb7a0c33f63c916bb8fe2d0c1491278"
url: "https://pub.dev"
source: hosted
version: "0.6.18+3"
version: "0.6.19"
flutter_material_design_icons:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -862,26 +854,26 @@ packages:
dependency: transitive
description:
name: permission_handler
sha256: "3c84d49f0a5e1915364707159ab71f11b3b8a429532176d3a6248a45718ad4f9"
sha256: "74e962b7fad7ff75959161bb2c0ad8fe7f2568ee82621c9c2660b751146bfe44"
url: "https://pub.dev"
source: hosted
version: "11.2.1"
version: "11.3.0"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: a5ebaa420cee8fd880ef10dedd42c6b3f493e7dbe27d7e0a7e1798669373082a
sha256: "1acac6bae58144b442f11e66621c062aead9c99841093c38f5bcdcc24c1c3474"
url: "https://pub.dev"
source: hosted
version: "12.0.4"
version: "12.0.5"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: "6ca25ee52518a8a26e80aaefe3c71caf6e2dfd809c1b20900d0882df6faed36e"
sha256: bdafc6db74253abb63907f4e357302e6bb786ab41465e8635f362ee71fd8707b
url: "https://pub.dev"
source: hosted
version: "9.3.1"
version: "9.4.0"
permission_handler_html:
dependency: transitive
description:
Expand All @@ -894,10 +886,10 @@ packages:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: "5c43148f2bfb6d14c5a8162c0a712afe891f2d847f35fcff29c406b37da43c3c"
sha256: "23dfba8447c076ab5be3dee9ceb66aad345c4a648f0cac292c77b1eb0e800b78"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
version: "4.2.0"
permission_handler_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -1194,10 +1186,10 @@ packages:
dependency: transitive
description:
name: sqlite3
sha256: c4a4c5a4b2a32e2d0f6837b33d7c91a67903891a5b7dbe706cf4b1f6b0c798c5
sha256: "072128763f1547e3e9b4735ce846bfd226d68019ccda54db4cd427b12dfdedc9"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
version: "2.4.0"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -1302,14 +1294,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
universal_html:
dependency: transitive
description:
name: universal_html
sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971"
url: "https://pub.dev"
source: hosted
version: "2.2.4"
universal_io:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1338,10 +1322,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f"
sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745
url: "https://pub.dev"
source: hosted
version: "6.2.2"
version: "6.3.0"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1370,10 +1354,10 @@ packages:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
Expand Down Expand Up @@ -1466,10 +1450,10 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.4.2"
webdriver:
dependency: transitive
description:
Expand Down Expand Up @@ -1559,5 +1543,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.2.3 <4.0.0"
dart: ">=3.3.0-279.1.beta <4.0.0"
flutter: ">=3.16.6"
Binary file added packages/app/web/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/icons/Icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/icons/Icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions packages/app/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A beautiful convergent cross-platform client for Nextcloud written in Flutter.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Neon">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png">

<title>app</title>
<link rel="manifest" href="manifest.json">

<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer=""></script>
<style id="splash-screen-style">
html {
height: 100%
}

body {
margin: 0;
min-height: 100%;
background-color: #ffffff;
background-size: 100% 100%;
}

.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}

.contain {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
}

.stretch {
display: block;
width: 100%;
height: 100%;
}

.cover {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}

.bottom {
position: absolute;
bottom: 0;
left: 50%;
-ms-transform: translate(-50%, 0);
transform: translate(-50%, 0);
}

.bottomLeft {
position: absolute;
bottom: 0;
left: 0;
}

.bottomRight {
position: absolute;
bottom: 0;
right: 0;
}

@media (prefers-color-scheme: dark) {
body {
background-color: #202020;
}
}
</style>
<script id="splash-screen-script">
function removeSplashFromWeb() {
document.getElementById("splash")?.remove();
document.getElementById("splash-branding")?.remove();
document.body.style.background = "transparent";
}
</script>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
</head>
<body>
<picture id="splash">
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x"
media="(prefers-color-scheme: light)">
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x"
media="(prefers-color-scheme: dark)">
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
</picture>
<script>
window.addEventListener('load', function (ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function (engineInitializer) {
engineInitializer.initializeEngine({
useColorEmoji: true,
}).then(function (appRunner) {
appRunner.runApp();
});
}
});
});
</script>


</body>
</html>
23 changes: 23 additions & 0 deletions packages/app/web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Neon",
"short_name": "Neon",
"start_url": ".",
"display": "standalone",
"background_color": "#f37736",
"theme_color": "#f37736",
"description": "A beautiful convergent cross-platform client for Nextcloud written in Flutter.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
Binary file added packages/app/web/splash/img/dark-1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/dark-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/dark-3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/dark-4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/light-1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/light-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/light-3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/app/web/splash/img/light-4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0a75036

Please sign in to comment.