From 043834fa0adf502f61ba09fe312fa3e90b8a6bcc Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 20 Jan 2025 19:29:50 +0500 Subject: initial commit --- html/build.gradle | 157 +++++++++++++++++++++ .../kz/ilotterytea/frogartha/GdxDefinition.gwt.xml | 35 +++++ .../frogartha/GdxDefinitionSuperdev.gwt.xml | 9 ++ .../kz/ilotterytea/frogartha/gwt/GwtLauncher.java | 28 ++++ html/webapp/WEB-INF/web.xml | 3 + html/webapp/index.html | 31 ++++ html/webapp/refresh.png | Bin 0 -> 232 bytes html/webapp/styles.css | 53 +++++++ 8 files changed, 316 insertions(+) create mode 100644 html/build.gradle create mode 100644 html/src/main/java/kz/ilotterytea/frogartha/GdxDefinition.gwt.xml create mode 100644 html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml create mode 100644 html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java create mode 100644 html/webapp/WEB-INF/web.xml create mode 100644 html/webapp/index.html create mode 100644 html/webapp/refresh.png create mode 100644 html/webapp/styles.css (limited to 'html') diff --git a/html/build.gradle b/html/build.gradle new file mode 100644 index 0000000..2036b11 --- /dev/null +++ b/html/build.gradle @@ -0,0 +1,157 @@ + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'org.gretty:gretty:3.1.0' + classpath "org.docstr:gwt-gradle-plugin:$gwtPluginVersion" + + } +} +apply plugin: "gwt" +apply plugin: "war" +apply plugin: "org.gretty" + +gwt { + gwtVersion = "$gwtFrameworkVersion" // Should match the version used for building the GWT backend. See gradle.properties. + maxHeapSize = '1G' // Default 256m is not enough for the GWT compiler. GWT is HUNGRY. + minHeapSize = '1G' + + src = files(file('src/main/java')) // Needs to be in front of "modules" below. + modules 'kz.ilotterytea.frogartha.GdxDefinition' + devModules 'kz.ilotterytea.frogartha.GdxDefinitionSuperdev' + project.webAppDirName = 'webapp' + + compiler.strict = true + compiler.disableCastChecking = true + //// The next line can be useful to uncomment if you want output that hasn't been obfuscated. +// compiler.style = org.docstr.gradle.plugins.gwt.Style.DETAILED + + sourceLevel = 1.11 +} + +dependencies { + implementation "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion" + implementation "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources" + implementation "com.badlogicgames.gdx:gdx:$gdxVersion:sources" + implementation "com.github.mgsx-dev.gdx-gltf:gltf:$gdxGltfVersion:sources" + implementation project(':core') + +} + +import org.akhikhl.gretty.AppBeforeIntegrationTestTask +import org.docstr.gradle.plugins.gwt.GwtSuperDev + +gretty.httpPort = 8080 +// The line below will need to be changed only if you change the build directory to something other than "build". +gretty.resourceBase = "${project.layout.buildDirectory.asFile.get().absolutePath}/gwt/draftOut" +gretty.contextPath = "/" +gretty.portPropertiesFileName = "TEMP_PORTS.properties" + +task startHttpServer (dependsOn: [draftCompileGwt]) { + doFirst { + copy { + from "webapp" + into gretty.resourceBase + } + copy { + from "war" + into gretty.resourceBase + } + } +} +task beforeRun(type: AppBeforeIntegrationTestTask, dependsOn: startHttpServer) { + // The next line allows ports to be reused instead of + // needing a process to be manually terminated. + file("build/TEMP_PORTS.properties").delete() + // Somewhat of a hack; uses Gretty's support for wrapping a task in + // a start and then stop of a Jetty server that serves files while + // also running the SuperDev code server. + integrationTestTask 'superDev' + + interactive false +} + +task superDev(type: GwtSuperDev) { + doFirst { + gwt.modules = gwt.devModules + } +} + +//// We delete the (temporary) war/ folder because if any extra files get into it, problems occur. +//// The war/ folder shouldn't be committed to version control. +clean.delete += [file("war")] + +// This next line can be changed if you want to, for instance, always build into the +// docs/ folder of a Git repo, which can be set to automatically publish on GitHub Pages. +// This is relative to the html/ folder. +var outputPath = "build/dist/" + +task dist(dependsOn: [clean, compileGwt]) { + doLast { + // Uncomment the next line if you have changed outputPath and know that its contents + // should be replaced by a new dist build. Some large JS files are not cleaned up by + // default unless the outputPath is inside build/ (then the clean task removes them). + // Do not uncomment the next line if you changed outputPath to a folder that has + // non-generated files that you want to keep! + //delete(file(outputPath)) + + file(outputPath).mkdirs() + copy { + from("build/gwt/out"){ + exclude '**/*.symbolMap' // Not used by a dist, and these can be large. + } + into outputPath + } + copy { + from("webapp") { + exclude 'index.html' // We edit this HTML file later. + exclude 'refresh.png' // We don't need this button; this saves some bytes. + } + into outputPath + } + copy { + from("webapp") { + // These next two lines take the index.html page and remove the superdev refresh button. + include 'index.html' + filter { String line -> line.replaceAll(' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml b/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml new file mode 100644 index 0000000..86d6eac --- /dev/null +++ b/html/src/main/java/kz/ilotterytea/frogartha/GdxDefinitionSuperdev.gwt.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java b/html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java new file mode 100644 index 0000000..a4e7ea3 --- /dev/null +++ b/html/src/main/java/kz/ilotterytea/frogartha/gwt/GwtLauncher.java @@ -0,0 +1,28 @@ +package kz.ilotterytea.frogartha.gwt; + +import com.badlogic.gdx.ApplicationListener; +import com.badlogic.gdx.backends.gwt.GwtApplication; +import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration; +import kz.ilotterytea.frogartha.FrogarthaGame; + +/** + * Launches the GWT application. + */ +public class GwtLauncher extends GwtApplication { + @Override + public GwtApplicationConfiguration getConfig() { + // Resizable application, uses available space in browser with no padding: + GwtApplicationConfiguration cfg = new GwtApplicationConfiguration(true); + cfg.padVertical = 0; + cfg.padHorizontal = 0; + return cfg; + // If you want a fixed size application, comment out the above resizable section, + // and uncomment below: + //return new GwtApplicationConfiguration(640, 480); + } + + @Override + public ApplicationListener createApplicationListener() { + return FrogarthaGame.getInstance(); + } +} diff --git a/html/webapp/WEB-INF/web.xml b/html/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..4301df2 --- /dev/null +++ b/html/webapp/WEB-INF/web.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/html/webapp/index.html b/html/webapp/index.html new file mode 100644 index 0000000..01f2f40 --- /dev/null +++ b/html/webapp/index.html @@ -0,0 +1,31 @@ + + + + Frogartha + + + + + + + +
+ + + + + diff --git a/html/webapp/refresh.png b/html/webapp/refresh.png new file mode 100644 index 0000000..aab1e38 Binary files /dev/null and b/html/webapp/refresh.png differ diff --git a/html/webapp/styles.css b/html/webapp/styles.css new file mode 100644 index 0000000..e768a39 --- /dev/null +++ b/html/webapp/styles.css @@ -0,0 +1,53 @@ +canvas { + cursor: default; + outline: none; +} + +body { + background-color: #222222; +} + +p { + text-align: center; + color: #eeeeee; +} + +a { + text-align: center; + color: #bbbbff; +} + +.superdev { + color: rgb(37,37,37); + text-shadow: 0px 1px 1px rgba(250,250,250,0.1); + font-size: 50pt; + display: block; + position: relative; + text-decoration: none; + background-color: rgb(83,87,93); + box-shadow: 0px 3px 0px 0px rgb(34,34,34), + 0px 7px 10px 0px rgb(17,17,17), + inset 0px 1px 1px 0px rgba(250, 250, 250, .2), + inset 0px -12px 35px 0px rgba(0, 0, 0, .5); + width: 70px; + height: 70px; + border: 0; + border-radius: 35px; + text-align: center; + line-height: 68px; +} + +.superdev:active { + box-shadow: 0px 0px 0px 0px rgb(34,34,34), + 0px 3px 7px 0px rgb(17,17,17), + inset 0px 1px 1px 0px rgba(250, 250, 250, .2), + inset 0px -10px 35px 5px rgba(0, 0, 0, .5); + background-color: rgb(83,87,93); + top: 3px; + color: #fff; + text-shadow: 0px 0px 3px rgb(250,250,250); +} + +.superdev:hover { + background-color: rgb(100,100,100); +} -- cgit v1.2.3