From 706205839dbc9ff5e0fa6e9cbcb07c53a25fee9c Mon Sep 17 00:00:00 2001 From: Mark Kevin Baldemor Date: Sat, 7 Dec 2019 05:14:16 +0800 Subject: [PATCH 1/4] 2.3-SNAPSHOT Archetype --- README.md | 12 +- gwt-test/pom.xml | 2 +- pom.xml | 4 +- .../META-INF/maven/archetype-metadata.xml | 2 +- .../archetype-resources/bin/sw-builder.js | 25 +-- .../archetype-resources/bin/sw-template.js | 156 ++++-------------- .../resources/archetype-resources/pom.xml | 2 +- 7 files changed, 56 insertions(+), 147 deletions(-) diff --git a/README.md b/README.md index 0543346..3e47a2e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # gwt-material-pwa-archetype PWA (Progressive Web App) + GMD Archetype -# Current Version - 2.1.1 +# Current Version - 2.3 ### Includes - Updated GWT Version to 2.8.2 - Updated GWTP Version to 1.5.3 -- Updated GMD Version to 2.1.1 +- Updated GMD Version to 2.3 # Usage: 1. Download the archetype 2. From the download folder, install the archetype in your local Maven repo by running this command: mvn clean install -3. Create a new project by running the following command in a folder of your choice: mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-pwa-archetype -DarchetypeVersion=2.1.1 +3. Create a new project by running the following command in a folder of your choice: mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-pwa-archetype -DarchetypeVersion=2.3 4. Follow the prompts mvn clean install archetype:update-local-catalog @@ -19,7 +19,7 @@ PWA (Progressive Web App) + GMD Archetype mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign \ -DarchetypeArtifactId=gwt-material-pwa-archetype \ - -DarchetypeVersion=2.1.1 + -DarchetypeVersion=2.3 4. Follow the prompts. That's it! @@ -27,7 +27,7 @@ PWA (Progressive Web App) + GMD Archetype mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign \ -DarchetypeArtifactId=gwt-material-pwa-archetype \ - -DarchetypeVersion=2.1.1 \ + -DarchetypeVersion=2.3 \ -DgroupId=your.company.domain \ -Dpackage=your.company.domain.myapp \ -DartifactId=your-project \ @@ -39,7 +39,7 @@ PWA (Progressive Web App) + GMD Archetype mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-pwa-archetype -DarchetypeRepository=https://oss.sonatype.org/content/repositories/snapshots/ - -DarchetypeVersion=2.2-SNAPSHOT + -DarchetypeVersion=2.3-SNAPSHOT # Test/Run diff --git a/gwt-test/pom.xml b/gwt-test/pom.xml index 98d6fd3..12e968c 100644 --- a/gwt-test/pom.xml +++ b/gwt-test/pom.xml @@ -36,7 +36,7 @@ 2.8.2 1.6 2.1.2 - 2.1.1 + 2.3-SNAPSHOT 1.8 1.8 diff --git a/pom.xml b/pom.xml index 6c4ea81..f1213dc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ gwt-material-parent com.github.gwtmaterialdesign - 2.1.1 + 2.3-SNAPSHOT com.github.gwtmaterialdesign gwt-material-pwa-archetype - 2.1.1 + 2.3-SNAPSHOT jar diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml index 4c5a3d5..b67100b 100644 --- a/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -40,7 +40,7 @@ ${groupId} - 2.1.1 + 2.3 diff --git a/src/main/resources/archetype-resources/bin/sw-builder.js b/src/main/resources/archetype-resources/bin/sw-builder.js index 2369f56..3ee06d5 100644 --- a/src/main/resources/archetype-resources/bin/sw-builder.js +++ b/src/main/resources/archetype-resources/bin/sw-builder.js @@ -13,7 +13,8 @@ const rootFolder = 'target/' + buildFolderName; const fs = require('fs'); var Handlebars = require('handlebars'); -var filesToCache = []; +var filesToCache = [ +]; browseAllFilesInDirectory(rootFolder); @@ -23,14 +24,14 @@ function browseAllFilesInDirectory(folder) { fs.readdirSync(folder).forEach(fileName => { const resource = folder + "/" + fileName; - if (exceptions.indexOf(fileName) < 0) { - if (fileName.match(filesRegExp)) { - filesToCache.push(resource.replace(rootFolder + "/", "")); - } else if (fs.lstatSync(resource).isDirectory()) { - browseAllFilesInDirectory(resource); - } + if (exceptions.indexOf(fileName) < 0) { + if (fileName.match(filesRegExp)) { + filesToCache.push(resource.replace(rootFolder + "/", "")); + } else if (fs.lstatSync(resource).isDirectory()) { + browseAllFilesInDirectory(resource); } - }); + } +}); } var swData = { @@ -43,9 +44,9 @@ fs.readFile("bin/sw-template.js", "utf8", (error, data) => { console.log("Unable to read template file"); } var template = Handlebars.compile(data); - var serviceWorkerJs = template(swData); +var serviceWorkerJs = template(swData); - fs.writeFile(rootFolder + "/service-worker.js", serviceWorkerJs, (error) => { - console.log("Successfully generated service worker service-worker.js in " + rootFolder); - }); +fs.writeFile(rootFolder + "/service-worker.js", serviceWorkerJs, (error) => { + console.log("Successfully generated service worker service-worker.js in " + rootFolder); +}); }); \ No newline at end of file diff --git a/src/main/resources/archetype-resources/bin/sw-template.js b/src/main/resources/archetype-resources/bin/sw-template.js index 81c5aea..2ee12cc 100644 --- a/src/main/resources/archetype-resources/bin/sw-template.js +++ b/src/main/resources/archetype-resources/bin/sw-template.js @@ -3,19 +3,18 @@ var cacheName = '{{cacheName}}'; var filesToCache = [ {{#each filesToCache}} '{{.}}'{{#unless @last}},{{/unless}} {{/each}} - ,'service-worker.js' ]; + /** * The install event is your chance to cache everything you need before being able to control clients. The promise you * pass to event.waitUntil() lets the browser know when your install completes, and if it was successful. */ -self.addEventListener('install', function (e) { - console.log('[ServiceWorker] Install'); +self.addEventListener('install', e => { e.waitUntil( - caches.open(cacheName).then(function (cache) { - console.log('[ServiceWorker] Caching app shell'); - return cache.addAll(filesToCache); + caches.open(cacheName).then(cache => { + return cache.addAll(filesToCache) + .then(() => self.skipWaiting()); }) ); }); @@ -24,16 +23,20 @@ self.addEventListener('install', function (e) { * Once your service worker is ready to control clients and handle functional events like push and sync, you'll get an * activate event. But that doesn't mean the page that called .register() will be controlled. */ -self.addEventListener('activate', function (e) { - console.log('[ServiceWorker] Activate'); - e.waitUntil( - caches.keys().then(function (keyList) { - return Promise.all(keyList.map(function (key) { - console.log('[ServiceWorker] Removing old cache', key); - if (key !== cacheName) { - return caches.delete(key); - } - })); +self.addEventListener('activate', event => { + event.waitUntil( + caches.keys().then(function(cacheNames) { + return Promise.all( + cacheNames.map(function(oldCache) { + if (oldCache !== cacheName) { + console.log('ServiceWorker : Deleting old cache:', oldCache); + return caches.delete(oldCache); + } + }) + ); + }).then(function() { + console.log('ServiceWorker : Claiming clients for version', cacheName); + return self.clients.claim(); }) ); }); @@ -42,113 +45,18 @@ self.addEventListener('activate', function (e) { * It contains information about the fetch, including the request and how the receiver will treat the response. * It provides the event.respondWith() method, which allows us to provide a response to this fetch. */ -self.addEventListener('fetch', function (e) { - console.log('[ServiceWorker] Fetch', e.request.url); - e.respondWith( - caches.match(e.request).then(function (response) { - return response || fetch(e.request); - }) - ); -}); - -/** - * Will listen to any push event comming from native push or fcm push services. - * This will also provide you a Notification UI build from the JSON Payload provided before sending the message. - */ -self.addEventListener('push', function (event) { - console.log("Service Worker Push Received"); - var json = event.data.json(); - // The Notification Data which contains all required parameters to display a notification ui. - var data = JSON.parse(json.data.model); - var title = data.title; - - const options = { - body: data.body, - icon: data.icon, - image: data.image, - badge: data.badge, - vibrate: data.vibrate, - sound: data.sound, - actions: data.actions, - dir: data.dir, - tag: data.tag, - data: data.payload, - requireInteraction: data.requireInteraction, - renotify: data.renotify, - silent: data.silent, - timestamp: data.timestamp - } - - event.waitUntil(self.registration.showNotification(title, options)); -}); - -/** - * When a user clicks on a notification they usually expect to be taken directly to where they can get more - * information about the notification. We also add a functionality wherein we will check if the data.url is - * available then we will redirect the user to that url else we will just close the notification. - */ -self.addEventListener('notificationclick', function (event) { - var notification = event.notification; - var data = event.notification.data; - var action = event.action; - - if (action === 'close') { - notification.close(); +self.addEventListener('fetch', event => { + if (event.request.method !== 'GET') { + /* If we don't block the event as shown below, then the request will go to + the network as usual. + */ + return; } - // Define your action callbacks below. -}); - -/** - * If the user dismisses the notification through a direct action on the notification - * (such as a swipe in Android), it raises a notificationclose event inside the service worker. - * - * Note: If the user dismisses all notifications then, to save resources, an event - * is not raised in the service worker. - */ -self.addEventListener('notificationclose', function (event) { - // For now we dont have any useful usecase to define - // atm when notification was closed. -}); - -/** - * This is a listener for the service-worker.js to listen to any Client messages. - */ -self.addEventListener('message', function (event) { - var data = event.data; - if (data == 'skipWaiting') { - self.skipWaiting(); - } - // Define any custom messaging below by calling sendMessageToAllClients(message). -}); - -/** - * This function will allow to send a messa2ge to specific client. - * If you want to send to all opened client instances call #sendMessageToAllClients - */ -function sendMessageToClient(client, message) { - return new Promise(function (resolve, reject) { - var messageChannel = new MessageChannel(); - - messageChannel.port1.onmessage = function (event) { - if (event.data.error) { - reject(event.data.error); - } else { - resolve(event.data); - } - }; - - client.postMessage(message, [messageChannel.port2]); - }); -} - -/** - * This function will allow the service-worker.js to send a message to any opened client's channel - * (Take not that each client will be referenced to any opened browser / tab instances. - */ -function sendMessageToAllClients(message) { - clients.matchAll().then(clients => { - clients.forEach(client => { - sendMessageToClient(client, message); + event.respondWith( + caches.open(cacheName) + .then(cache => cache.match(event.request, {ignoreSearch: true})) + .then(response => { + return response || fetch(event.request); }) - }) -} \ No newline at end of file + ); +}); \ No newline at end of file diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index c925499..1e4fdb0 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -36,7 +36,7 @@ 2.8.2 1.6 2.1.2 - 2.1.1 + 2.3-SNAPSHOT 1.8 1.8 From d2d9aef924b2360e0865c9e2941f2cd6ca47efa8 Mon Sep 17 00:00:00 2001 From: Mark Kevin Baldemor Date: Sat, 7 Dec 2019 05:33:07 +0800 Subject: [PATCH 2/4] Minor fixes --- src/main/resources/archetype-resources/bin/sw-builder.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/archetype-resources/bin/sw-builder.js b/src/main/resources/archetype-resources/bin/sw-builder.js index 3ee06d5..e499286 100644 --- a/src/main/resources/archetype-resources/bin/sw-builder.js +++ b/src/main/resources/archetype-resources/bin/sw-builder.js @@ -14,6 +14,7 @@ const fs = require('fs'); var Handlebars = require('handlebars'); var filesToCache = [ + "/" ]; browseAllFilesInDirectory(rootFolder); From 82326c519914ba90beda3239e179d99071415394 Mon Sep 17 00:00:00 2001 From: Mark Kevin Baldemor Date: Sat, 11 Jan 2020 11:47:52 +0800 Subject: [PATCH 3/4] Added dark theme support --- README.md | 8 +- gwt-test/pom.xml | 2 +- pom.xml | 4 +- .../META-INF/maven/archetype-metadata.xml | 2 +- .../resources/archetype-resources/pom.xml | 2 +- .../AppDarkThemeLoader.java} | 16 +- .../application/ApplicationPresenter.java | 23 +- .../client/application/ApplicationView.ui.xml | 9 +- .../main/java/client/gin/ClientModule.java | 3 - .../java/client/resources/AppResources.java | 15 +- .../client/resources/css/app-dark.css | 1 + .../resources/client/resources/css/app.css | 1 + .../client/resources/css/normalize.gss | 409 ------------------ .../resources/client/resources/css/style.gss | 0 14 files changed, 52 insertions(+), 443 deletions(-) rename src/main/resources/archetype-resources/src/main/java/client/{resources/ResourceLoader.java => application/AppDarkThemeLoader.java} (64%) create mode 100644 src/main/resources/archetype-resources/src/main/resources/client/resources/css/app-dark.css create mode 100644 src/main/resources/archetype-resources/src/main/resources/client/resources/css/app.css delete mode 100644 src/main/resources/archetype-resources/src/main/resources/client/resources/css/normalize.gss delete mode 100644 src/main/resources/archetype-resources/src/main/resources/client/resources/css/style.gss diff --git a/README.md b/README.md index 3e47a2e..bf575fb 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # gwt-material-pwa-archetype PWA (Progressive Web App) + GMD Archetype -# Current Version - 2.3 +# Current Version - 2.3.0 ### Includes - Updated GWT Version to 2.8.2 - Updated GWTP Version to 1.5.3 -- Updated GMD Version to 2.3 +- Updated GMD Version to 2.3.0 # Usage: 1. Download the archetype @@ -19,7 +19,7 @@ PWA (Progressive Web App) + GMD Archetype mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign \ -DarchetypeArtifactId=gwt-material-pwa-archetype \ - -DarchetypeVersion=2.3 + -DarchetypeVersion=2.3.0 4. Follow the prompts. That's it! @@ -27,7 +27,7 @@ PWA (Progressive Web App) + GMD Archetype mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign \ -DarchetypeArtifactId=gwt-material-pwa-archetype \ - -DarchetypeVersion=2.3 \ + -DarchetypeVersion=2.3.0 \ -DgroupId=your.company.domain \ -Dpackage=your.company.domain.myapp \ -DartifactId=your-project \ diff --git a/gwt-test/pom.xml b/gwt-test/pom.xml index 12e968c..c67c61b 100644 --- a/gwt-test/pom.xml +++ b/gwt-test/pom.xml @@ -36,7 +36,7 @@ 2.8.2 1.6 2.1.2 - 2.3-SNAPSHOT + 2.3.0 1.8 1.8 diff --git a/pom.xml b/pom.xml index f1213dc..58bd79c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ gwt-material-parent com.github.gwtmaterialdesign - 2.3-SNAPSHOT + 2.3.0 com.github.gwtmaterialdesign gwt-material-pwa-archetype - 2.3-SNAPSHOT + 2.3.0 jar diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml index b67100b..e21d14b 100644 --- a/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -40,7 +40,7 @@ ${groupId} - 2.3 + 2.3.0 diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index 1e4fdb0..e0f26b9 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -36,7 +36,7 @@ 2.8.2 1.6 2.1.2 - 2.3-SNAPSHOT + 2.3.0 1.8 1.8 diff --git a/src/main/resources/archetype-resources/src/main/java/client/resources/ResourceLoader.java b/src/main/resources/archetype-resources/src/main/java/client/application/AppDarkThemeLoader.java similarity index 64% rename from src/main/resources/archetype-resources/src/main/java/client/resources/ResourceLoader.java rename to src/main/resources/archetype-resources/src/main/java/client/application/AppDarkThemeLoader.java index 8422f09..7a120b1 100644 --- a/src/main/resources/archetype-resources/src/main/java/client/resources/ResourceLoader.java +++ b/src/main/resources/archetype-resources/src/main/java/client/application/AppDarkThemeLoader.java @@ -2,7 +2,7 @@ * #%L * GwtMaterial * %% - * Copyright (C) 2015 - 2017 GwtMaterialDesign + * Copyright (C) 2015 - 2020 GwtMaterialDesign * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +17,14 @@ * limitations under the License. * #L% */ -package ${package}.client.resources; +package ${package}.client.application; -import javax.inject.Inject; +import ${package}.client.resources.AppResources; +import gwt.material.design.client.theme.dark.DarkThemeLoader; -public class ResourceLoader { - @Inject - ResourceLoader(AppResources appResources) { - appResources.normalize().ensureInjected(); - appResources.style().ensureInjected(); +public class AppDarkThemeLoader extends DarkThemeLoader { + + public AppDarkThemeLoader() { + super(AppResources.INSTANCE.appDarkCss()); } } diff --git a/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationPresenter.java b/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationPresenter.java index 88fada0..6436f57 100644 --- a/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationPresenter.java +++ b/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationPresenter.java @@ -19,15 +19,20 @@ */ package ${package}.client.application; +import ${package}.client.resources.AppResources; import com.google.gwt.event.shared.GwtEvent; +import com.gwtplatform.mvp.client.annotations.ContentSlot; +import com.gwtplatform.mvp.client.proxy.RevealContentHandler; +import com.google.gwt.dom.client.StyleInjector; import com.google.inject.Inject; import com.google.web.bindery.event.shared.EventBus; import com.gwtplatform.mvp.client.Presenter; import com.gwtplatform.mvp.client.View; -import com.gwtplatform.mvp.client.annotations.ContentSlot; import com.gwtplatform.mvp.client.annotations.ProxyStandard; import com.gwtplatform.mvp.client.proxy.Proxy; -import com.gwtplatform.mvp.client.proxy.RevealContentHandler; +import gwt.material.design.addins.client.dark.AddinsDarkThemeLoader; +import gwt.material.design.client.theme.dark.CoreDarkThemeLoader; +import gwt.material.design.client.theme.dark.DarkThemeManager; public class ApplicationPresenter extends Presenter { @@ -47,4 +52,18 @@ interface MyProxy extends Proxy { MyProxy proxy) { super(eventBus, view, proxy, RevealType.Root); } + + @Override + protected void onBind() { + super.onBind(); + + // Dark Theme Mode + DarkThemeManager.get() + .register(new CoreDarkThemeLoader()) + .register(new AddinsDarkThemeLoader()) + .register(new AppDarkThemeLoader()) + .load(); + + StyleInjector.inject(AppResources.INSTANCE.appCss().getText()); + } } diff --git a/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationView.ui.xml b/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationView.ui.xml index 9cc9e9f..11384ac 100644 --- a/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationView.ui.xml +++ b/src/main/resources/archetype-resources/src/main/java/client/application/ApplicationView.ui.xml @@ -27,7 +27,8 @@ - + + @@ -35,9 +36,9 @@ - - - + + + diff --git a/src/main/resources/archetype-resources/src/main/java/client/gin/ClientModule.java b/src/main/resources/archetype-resources/src/main/java/client/gin/ClientModule.java index 0b26e34..a30df97 100644 --- a/src/main/resources/archetype-resources/src/main/java/client/gin/ClientModule.java +++ b/src/main/resources/archetype-resources/src/main/java/client/gin/ClientModule.java @@ -21,7 +21,6 @@ import ${package}.client.application.ApplicationModule; import ${package}.client.place.NameTokens; -import ${package}.client.resources.ResourceLoader; import com.gwtplatform.mvp.client.annotations.DefaultPlace; import com.gwtplatform.mvp.client.annotations.ErrorPlace; import com.gwtplatform.mvp.client.annotations.UnauthorizedPlace; @@ -34,8 +33,6 @@ protected void configure() { install(new DefaultModule.Builder().build()); install(new ApplicationModule()); - bind(ResourceLoader.class).asEagerSingleton(); - // DefaultPlaceManager Places bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.HOME); bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.HOME); diff --git a/src/main/resources/archetype-resources/src/main/java/client/resources/AppResources.java b/src/main/resources/archetype-resources/src/main/java/client/resources/AppResources.java index e162602..26232d0 100644 --- a/src/main/resources/archetype-resources/src/main/java/client/resources/AppResources.java +++ b/src/main/resources/archetype-resources/src/main/java/client/resources/AppResources.java @@ -19,19 +19,18 @@ */ package ${package}.client.resources; +import com.google.gwt.core.client.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.CssResource; +import com.google.gwt.resources.client.TextResource; public interface AppResources extends ClientBundle { - interface Normalize extends CssResource { - } - interface Style extends CssResource { - } + AppResources INSTANCE = GWT.create(AppResources.class); - @Source("css/normalize.gss") - Normalize normalize(); + @Source("css/app.css") + TextResource appCss(); - @Source("css/style.gss") - Style style(); + @Source("css/app-dark.css") + TextResource appDarkCss(); } diff --git a/src/main/resources/archetype-resources/src/main/resources/client/resources/css/app-dark.css b/src/main/resources/archetype-resources/src/main/resources/client/resources/css/app-dark.css new file mode 100644 index 0000000..b2e55af --- /dev/null +++ b/src/main/resources/archetype-resources/src/main/resources/client/resources/css/app-dark.css @@ -0,0 +1 @@ +/** Dark theme Style for your application specific styles **/ \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/main/resources/client/resources/css/app.css b/src/main/resources/archetype-resources/src/main/resources/client/resources/css/app.css new file mode 100644 index 0000000..0143cbf --- /dev/null +++ b/src/main/resources/archetype-resources/src/main/resources/client/resources/css/app.css @@ -0,0 +1 @@ +/** Default Style for your application specific styles **/ \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/main/resources/client/resources/css/normalize.gss b/src/main/resources/archetype-resources/src/main/resources/client/resources/css/normalize.gss deleted file mode 100644 index 7f4e79a..0000000 --- a/src/main/resources/archetype-resources/src/main/resources/client/resources/css/normalize.gss +++ /dev/null @@ -1,409 +0,0 @@ -/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions -========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links -========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background: transparent; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a:active, -a:hover, -button:active, -button:hover { - outline: 0; -} - -/* Text-level semantics -========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* Embedded content -========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9/10. - */ - -img { - border: 0; -} - -/* Grouping content -========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} - -/* Forms -========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables -========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/src/main/resources/archetype-resources/src/main/resources/client/resources/css/style.gss b/src/main/resources/archetype-resources/src/main/resources/client/resources/css/style.gss deleted file mode 100644 index e69de29..0000000 From 783188d28dd48e6d3b95373d7a67faf9d9925767 Mon Sep 17 00:00:00 2001 From: Mark Kevin Baldemor Date: Sat, 11 Jan 2020 12:50:58 +0800 Subject: [PATCH 4/4] Splash screen update --- .../src/main/webapp/index.html | 9 +++++++ .../src/main/webapp/splash/splash.css | 24 ++++--------------- .../src/main/webapp/splash/splash.js | 8 +++---- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/main/resources/archetype-resources/src/main/webapp/index.html b/src/main/resources/archetype-resources/src/main/webapp/index.html index 268f8e8..fa24419 100644 --- a/src/main/resources/archetype-resources/src/main/webapp/index.html +++ b/src/main/resources/archetype-resources/src/main/webapp/index.html @@ -9,12 +9,21 @@ + + diff --git a/src/main/resources/archetype-resources/src/main/webapp/splash/splash.css b/src/main/resources/archetype-resources/src/main/webapp/splash/splash.css index 8d3ed5e..4e2246e 100644 --- a/src/main/resources/archetype-resources/src/main/webapp/splash/splash.css +++ b/src/main/resources/archetype-resources/src/main/webapp/splash/splash.css @@ -1,20 +1,10 @@ -@font-face { - font-family: "Roboto"; - src: local(Roboto Regular), url("font/Roboto-Regular.eot"); - src: url("font/Roboto-Regular.eot?#iefix") - format("embedded-opentype"), url("font/Roboto-Regular.woff2") - format("woff2"), url("font/Roboto-Regular.woff") - format("woff"), url("font/Roboto-Regular.ttf") - format("truetype"); - font-weight: 400 -} #splashscreen { top: 0; left: 0; right: 0; bottom: 0; position: fixed; - background: #2196f3 !important; + background: #fff !important; display: -webkit-box; display: -moz-box; display: -ms-flexbox; @@ -24,9 +14,10 @@ -ms-flex-align: center; -webkit-align-items: center; align-items: center; - color: #fff; - font-family: 'Roboto', sans-serif; + color: #000; z-index: 9999; + font-display: swap; + font-family: monospace, monospace; } #splashscreen div { @@ -35,10 +26,6 @@ width: 100%; } -#splashscreen img { - width: 150px; -} - #splashscreen .progress { margin: 0px; position: absolute; @@ -53,5 +40,4 @@ #splashscreen span.descripton { font-weight: 200; -} - +} \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/main/webapp/splash/splash.js b/src/main/resources/archetype-resources/src/main/webapp/splash/splash.js index 882c211..b1cdea5 100644 --- a/src/main/resources/archetype-resources/src/main/webapp/splash/splash.js +++ b/src/main/resources/archetype-resources/src/main/webapp/splash/splash.js @@ -4,7 +4,7 @@ splashcontainer.id = "splashscreen"; var splashContent = document.createElement('div'); var image = document.createElement("img"); -image.src = "/launcher-icons/launcher4x.png"; +image.src = "https://gwtmaterialdesign.github.io/gmd-core-demo/launcher-icons/launcher2x.png"; var title = document.createElement("span"); title.className = "title"; @@ -12,7 +12,7 @@ title.innerHTML = "${projectName}"; var description = document.createElement("span"); description.className = "description"; -description.innerHTML = "${projectName}"; +description.innerHTML = "Some description"; var progress = document.createElement("div"); progress.className = "progress"; @@ -27,6 +27,4 @@ splashContent.append(description); splashContent.append(progress); splashcontainer.append(splashContent); -document.body.appendChild(splashcontainer); - -document.write(''); \ No newline at end of file +document.body.appendChild(splashcontainer); \ No newline at end of file