diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/app.tmpl.go b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/app.tmpl.go index c4e363623..417e65bf0 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/app.tmpl.go +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/app.tmpl.go @@ -28,5 +28,5 @@ func (b *App) shutdown(ctx context.Context) { // Greet returns a greeting for the given name func (b *App) Greet(name string) string { - return fmt.Sprintf("Hello %s!", name) + return fmt.Sprintf("Hello %s, It's your show time!", name) } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/index.html b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/index.html index 001ed725b..7f516f7fa 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/index.html +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/index.html @@ -5,12 +5,12 @@ - -
- - + +
Please enter your name below 👇
+
+ +
-
diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.css b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.css index b4f30e598..af6412466 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.css +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.css @@ -1,47 +1,72 @@ - html { + background-color: rgba(33, 37, 43, 1); text-align: center; color: white; - background-color: rgba(0, 0, 0, 1); } body { - color: white; - font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; margin: 0; + color: white; + font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", + "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; } @font-face { - font-family: 'Nunito'; + font-family: "Nunito"; font-style: normal; font-weight: 400; - src: local(''), - url('assets/fonts/nunito-v16-latin-regular.woff2') format('woff2') + src: local(""), + url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2"); } -#result { - margin-top: 1rem; -} - -button { - -webkit-appearance: default-button; - padding: 6px; -} - -#name { - border-radius: 3px; - outline: none; - height: 20px; - -webkit-font-smoothing: antialiased; -} - -#logo { - width: 40%; - height: 40%; - padding-top: 20%; - margin: auto; +.logo { display: block; + width: 35%; + height: 35%; + margin: auto; + padding: 15% 0 0; background-position: center; background-repeat: no-repeat; background-image: url("./assets/images/logo-dark.svg"); } +.result { + height: 20px; + line-height: 20px; + margin: 1.5rem auto; +} +.input-box .btn { + width: 60px; + height: 30px; + line-height: 30px; + border-radius: 3px; + border: none; + margin: 0 0 0 20px; + padding: 0 8px; + cursor: pointer; +} +.input-box .btn:hover { + background-image: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%); + color: #333333; +} + +.input-box .input { + border: none; + border-radius: 3px; + outline: none; + height: 30px; + line-height: 30px; + padding: 0 10px; + background-color: rgba(240, 240, 240, 1); + -webkit-font-smoothing: antialiased; +} + +.input-box .input:hover { + border: none; + background-color: rgba(255, 255, 255, 1); +} + +.input-box .input:focus { + border: none; + background-color: rgba(255, 255, 255, 1); +} diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.js index f0e85dc1b..db404e459 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/src/main.js @@ -14,3 +14,10 @@ window.greet = function () { document.getElementById("result").innerText = result; }); }; + +nameElement.onkeydown = function (e) { + console.log(e) + if (e.keyCode == 13) { + window.greet() + } +} \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/main.tmpl.go b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/main.tmpl.go index c3a2818b8..2c27fa686 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/main.tmpl.go +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/main.tmpl.go @@ -4,11 +4,10 @@ import ( "embed" "log" - "github.com/wailsapp/wails/v2/pkg/options/windows" - "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/logger" "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/windows" ) //go:embed frontend/src @@ -21,18 +20,18 @@ func main() { err := wails.Run(&options.App{ Title: "{{.ProjectName}}", - Width: 800, - Height: 600, - MinWidth: 400, - MinHeight: 400, + Width: 720, + Height: 570, + MinWidth: 720, + MinHeight: 570, MaxWidth: 1280, - MaxHeight: 1024, + MaxHeight: 740, DisableResize: false, Fullscreen: false, Frameless: false, StartHidden: false, HideWindowOnClose: false, - RGBA: &options.RGBA{0, 0, 0, 255}, + RGBA: &options.RGBA{255, 255, 255, 255}, Assets: assets, Windows: &windows.Options{ WebviewIsTransparent: false, @@ -46,6 +45,7 @@ func main() { app, }, }) + if err != nil { log.Fatal(err) }