mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 06:20:48 +08:00
Feature/default templates (#1334)
This commit is contained in:
parent
7fbae0d333
commit
4e03c84fbb
1
.gitignore
vendored
1
.gitignore
vendored
@ -31,3 +31,4 @@ v2/test/kitchensink/frontend/package.json.md5
|
|||||||
!v2/internal/ffenestri/windows/x64/webview2.dll
|
!v2/internal/ffenestri/windows/x64/webview2.dll
|
||||||
!v2/internal/ffenestri/windows/x64/WebView2Loader.dll
|
!v2/internal/ffenestri/windows/x64/WebView2Loader.dll
|
||||||
.idea/
|
.idea/
|
||||||
|
v2/cmd/wails/internal/commands/initialise/templates/testtemplates/
|
||||||
|
@ -132,7 +132,7 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run go mod tidy to ensure we're up to date
|
// Run go mod tidy to ensure we're up to date
|
||||||
err = runCommand(cwd, false, "go", "mod", "tidy")
|
err = runCommand(cwd, false, "go", "mod", "tidy", "-compat=1.17")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ func initProject(options *templates.Options, quiet bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run `go mod tidy` to ensure `go.sum` is up to date
|
// Run `go mod tidy` to ensure `go.sum` is up to date
|
||||||
cmd := exec.Command("go", "mod", "tidy")
|
cmd := exec.Command("go", "mod", "tidy", "-compat=1.17")
|
||||||
cmd.Dir = options.TargetDir
|
cmd.Dir = options.TargetDir
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
if !quiet {
|
if !quiet {
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
# README
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
This is the official Wails $NAME template.
|
||||||
|
|
||||||
|
## Live Development
|
||||||
|
|
||||||
|
To run in live development mode, run `wails dev` in the project directory. In another terminal, go into the `frontend`
|
||||||
|
directory and run `npm run dev`. The frontend dev server will run on http://localhost:34115. Connect to this in your
|
||||||
|
browser and connect to your application.
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
To build a redistributable, production mode package, use `wails build`.
|
@ -0,0 +1,21 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// App struct
|
||||||
|
type App struct {
|
||||||
|
ctx context.Context
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewApp creates a new App application struct
|
||||||
|
func NewApp() *App {
|
||||||
|
return &App{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Greet returns a greeting for the given name
|
||||||
|
func (a *App) Greet(name string) string {
|
||||||
|
return fmt.Sprintf("Hello %s, It's show time!", name)
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require github.com/wailsapp/wails/v2 {{.WailsVersion}}
|
||||||
|
|
||||||
|
// replace github.com/wailsapp/wails/v2 {{.WailsVersion}} => {{.WailsDirectory}}
|
@ -0,0 +1,30 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
"github.com/wailsapp/wails/v2"
|
||||||
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed frontend/dist
|
||||||
|
var assets embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// Create an instance of the app structure
|
||||||
|
app := NewApp()
|
||||||
|
|
||||||
|
// Create application with options
|
||||||
|
err := wails.Run(&options.App{
|
||||||
|
Title: "{{.ProjectName}}",
|
||||||
|
Width: 1024,
|
||||||
|
Height: 768,
|
||||||
|
Assets: assets,
|
||||||
|
Bind: []interface{}{
|
||||||
|
app,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
println("Error:", err)
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "$NAME",
|
||||||
|
"shortname": "$SHORTNAME",
|
||||||
|
"author": "Lea Anthony",
|
||||||
|
"description": "$DESCRIPTION",
|
||||||
|
"helpurl": "https://wails.io"
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "{{.ProjectName}}",
|
||||||
|
"outputfilename": "{{.BinaryName}}",
|
||||||
|
"frontend:install": "npm install",
|
||||||
|
"frontend:build": "npm run build",
|
||||||
|
"frontend:dev:watcher": "npm run dev",
|
||||||
|
"frontend:dev:serverUrl": "http://localhost:3000",
|
||||||
|
"author": {
|
||||||
|
"name": "{{.AuthorName}}",
|
||||||
|
"email": "{{.AuthorEmail}}"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
Copyright 2016 The Nunito Project Authors (contact@sansoxygen.com),
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
@ -0,0 +1,26 @@
|
|||||||
|
html {
|
||||||
|
background-color: rgba(27, 38, 54, 1);
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
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-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(""),
|
||||||
|
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1: string): Promise<string>;
|
@ -0,0 +1,7 @@
|
|||||||
|
// @ts-check
|
||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1) {
|
||||||
|
return window['go']['main']['App']['Greet'](arg1);
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{(function(){let n=function(e){for(var s=window[e.shift()];s&&e.length;)s=s[e.shift()];return s},o=n(["chrome","webview","postMessage"]),t=n(["webkit","messageHandlers","external","postMessage"]);if(!o&&!t){console.error("Unsupported Platform");return}o&&(window.WailsInvoke=e=>window.chrome.webview.postMessage(e)),t&&(window.WailsInvoke=e=>window.webkit.messageHandlers.external.postMessage(e))})();})();
|
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@wailsapp/runtime",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Wails Javascript runtime library",
|
||||||
|
"main": "runtime.js",
|
||||||
|
"types": "runtime.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/wailsapp/wails.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Wails",
|
||||||
|
"Javascript",
|
||||||
|
"Go"
|
||||||
|
],
|
||||||
|
"author": "Lea Anthony <lea.anthony@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/wailsapp/wails/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/wailsapp/wails#readme"
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
export interface Position {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Size {
|
||||||
|
w: number;
|
||||||
|
h: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface runtime {
|
||||||
|
EventsEmit(eventName: string, data?: any): void;
|
||||||
|
|
||||||
|
EventsOn(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void;
|
||||||
|
|
||||||
|
EventsOnce(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOff(eventName: string): void;
|
||||||
|
|
||||||
|
LogTrace(message: string): void;
|
||||||
|
|
||||||
|
LogDebug(message: string): void;
|
||||||
|
|
||||||
|
LogError(message: string): void;
|
||||||
|
|
||||||
|
LogFatal(message: string): void;
|
||||||
|
|
||||||
|
LogInfo(message: string): void;
|
||||||
|
|
||||||
|
LogWarning(message: string): void;
|
||||||
|
|
||||||
|
WindowReload(): void;
|
||||||
|
|
||||||
|
WindowSetSystemDefaultTheme(): void;
|
||||||
|
|
||||||
|
WindowSetLightTheme(): void;
|
||||||
|
|
||||||
|
WindowSetDarkTheme(): void;
|
||||||
|
|
||||||
|
WindowCenter(): void;
|
||||||
|
|
||||||
|
WindowSetTitle(title: string): void;
|
||||||
|
|
||||||
|
WindowFullscreen(): void;
|
||||||
|
|
||||||
|
WindowUnfullscreen(): void;
|
||||||
|
|
||||||
|
WindowSetSize(width: number, height: number): Promise<Size>;
|
||||||
|
|
||||||
|
WindowGetSize(): Promise<Size>;
|
||||||
|
|
||||||
|
WindowSetMaxSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetMinSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetPosition(x: number, y: number): void;
|
||||||
|
|
||||||
|
WindowGetPosition(): Promise<Position>;
|
||||||
|
|
||||||
|
WindowHide(): void;
|
||||||
|
|
||||||
|
WindowShow(): void;
|
||||||
|
|
||||||
|
WindowMaximise(): void;
|
||||||
|
|
||||||
|
WindowToggleMaximise(): void;
|
||||||
|
|
||||||
|
WindowUnmaximise(): void;
|
||||||
|
|
||||||
|
WindowMinimise(): void;
|
||||||
|
|
||||||
|
WindowUnminimise(): void;
|
||||||
|
|
||||||
|
WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||||
|
|
||||||
|
BrowserOpenURL(url: string): void;
|
||||||
|
|
||||||
|
Quit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
runtime: runtime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{var d=Object.defineProperty;var m=n=>d(n,"__esModule",{value:!0});var e=(n,i)=>{m(n);for(var o in i)d(n,o,{get:i[o],enumerable:!0})};var t={};e(t,{LogDebug:()=>p,LogError:()=>x,LogFatal:()=>s,LogInfo:()=>W,LogTrace:()=>f,LogWarning:()=>c});function f(n){window.runtime.LogTrace(n)}function p(n){window.runtime.LogDebug(n)}function W(n){window.runtime.LogInfo(n)}function c(n){window.runtime.LogWarning(n)}function x(n){window.runtime.LogError(n)}function s(n){window.runtime.LogFatal(n)}var w={};e(w,{EventsEmit:()=>L,EventsOff:()=>S,EventsOn:()=>a,EventsOnMultiple:()=>l,EventsOnce:()=>g});function l(n,i,o){window.runtime.EventsOnMultiple(n,i,o)}function a(n,i){OnMultiple(n,i,-1)}function S(n){return window.runtime.EventsOff(n)}function g(n,i){OnMultiple(n,i,1)}function L(n){let i=[n].slice.call(arguments);return window.runtime.EventsEmit.apply(null,i)}var r={};e(r,{WindowCenter:()=>v,WindowFullscreen:()=>z,WindowGetPosition:()=>P,WindowGetSize:()=>D,WindowHide:()=>b,WindowMaximise:()=>k,WindowMinimise:()=>H,WindowReload:()=>M,WindowSetDarkTheme:()=>h,WindowSetLightTheme:()=>T,WindowSetMaxSize:()=>R,WindowSetMinSize:()=>B,WindowSetPosition:()=>F,WindowSetRGBA:()=>Q,WindowSetSize:()=>G,WindowSetSystemDefaultTheme:()=>E,WindowSetTitle:()=>O,WindowShow:()=>y,WindowToggleMaximise:()=>A,WindowUnfullscreen:()=>U,WindowUnmaximise:()=>C,WindowUnminimise:()=>I});function M(){window.runtime.WindowReload()}function E(){window.runtime.WindowSetSystemDefaultTheme()}function T(){window.runtime.WindowSetLightTheme()}function h(){window.runtime.WindowSetDarkTheme()}function v(){window.runtime.WindowCenter()}function O(n){window.runtime.WindowSetTitle(n)}function z(){window.runtime.WindowFullscreen()}function U(){window.runtime.WindowUnfullscreen()}function D(){window.runtime.WindowGetSize()}function G(n,i){window.runtime.WindowSetSize(n,i)}function R(n,i){window.runtime.WindowSetMaxSize(n,i)}function B(n,i){window.runtime.WindowSetMinSize(n,i)}function F(n,i){window.runtime.WindowSetPosition(n,i)}function P(){window.runtime.WindowGetPosition()}function b(){window.runtime.WindowHide()}function y(){window.runtime.WindowShow()}function k(){window.runtime.WindowMaximise()}function A(){window.runtime.WindowToggleMaximise()}function C(){window.runtime.WindowUnmaximise()}function H(){window.runtime.WindowMinimise()}function I(){window.runtime.WindowUnminimise()}function Q(n){window.runtime.WindowSetRGBA(n)}var u={};e(u,{BrowserOpenURL:()=>j});function j(n){window.runtime.BrowserOpenURL(n)}function q(){window.runtime.Quit()}var K={...t,...w,...r,...u,Quit:q};})();
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
<link href="./src/style.css" rel="stylesheet">
|
||||||
|
<script src="./src/my-element.ts" type="module"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<my-element/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,103 @@
|
|||||||
|
import {css, html, LitElement} from 'lit'
|
||||||
|
import logo from './assets/images/logo-universal.png'
|
||||||
|
import {Greet} from "../wailsjs/go/main/App";
|
||||||
|
import {customElement, property} from 'lit/decorators.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example element.
|
||||||
|
*
|
||||||
|
* @slot - This element has a slot
|
||||||
|
* @csspart button - The button
|
||||||
|
*/
|
||||||
|
@customElement('my-element')
|
||||||
|
export class MyElement extends LitElement {
|
||||||
|
static styles = css`
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
@property()
|
||||||
|
resultText = "Please enter your name below 👇"
|
||||||
|
|
||||||
|
greet()
|
||||||
|
{
|
||||||
|
let thisName = this.shadowRoot.getElementById('name').value
|
||||||
|
Greet(thisName).then(result => {
|
||||||
|
this.resultText = result
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render()
|
||||||
|
{
|
||||||
|
return html`
|
||||||
|
<main>
|
||||||
|
<img id="logo" src=${logo} alt="Wails logo">
|
||||||
|
<div class="result" id="result">${this.resultText}</div>
|
||||||
|
<div class="input-box" id="input">
|
||||||
|
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||||
|
<button @click=${this.greet} class="btn">Greet</button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
'my-element': MyElement
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
import {defineConfig} from 'vite'
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({})
|
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
<link href="./src/style.css" rel="stylesheet">
|
||||||
|
<script src="./src/my-element.js" type="module"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<my-element/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,93 @@
|
|||||||
|
Copyright 2016 The Nunito Project Authors (contact@sansoxygen.com),
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
@ -0,0 +1,105 @@
|
|||||||
|
import {css, html, LitElement} from 'lit'
|
||||||
|
import logo from './assets/images/logo-universal.png'
|
||||||
|
import {Greet} from "../wailsjs/go/main/App";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example element.
|
||||||
|
*
|
||||||
|
* @slot - This element has a slot
|
||||||
|
* @csspart button - The button
|
||||||
|
*/
|
||||||
|
export class MyElement extends LitElement {
|
||||||
|
static get styles() {
|
||||||
|
return css`
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
this.resultText = "Please enter your name below 👇"
|
||||||
|
}
|
||||||
|
|
||||||
|
static get properties() {
|
||||||
|
return {
|
||||||
|
resultText: {type: String},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
greet() {
|
||||||
|
let thisName = this.shadowRoot.getElementById('name').value
|
||||||
|
Greet(thisName).then(result => {
|
||||||
|
this.resultText = result
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return html`
|
||||||
|
<main>
|
||||||
|
<img id="logo" src=${logo} alt="Wails logo">
|
||||||
|
<div class="result" id="result">${this.resultText}</div>
|
||||||
|
<div class="input-box" id="input">
|
||||||
|
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||||
|
<button @click=${this.greet} class="btn">Greet</button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
window.customElements.define('my-element', MyElement)
|
@ -0,0 +1,26 @@
|
|||||||
|
html {
|
||||||
|
background-color: rgba(27, 38, 54, 1);
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
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-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(""),
|
||||||
|
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
import {defineConfig} from 'vite'
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({})
|
@ -0,0 +1,4 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1: string): Promise<string>;
|
@ -0,0 +1,7 @@
|
|||||||
|
// @ts-check
|
||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1) {
|
||||||
|
return window['go']['main']['App']['Greet'](arg1);
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{(function(){let n=function(e){for(var s=window[e.shift()];s&&e.length;)s=s[e.shift()];return s},o=n(["chrome","webview","postMessage"]),t=n(["webkit","messageHandlers","external","postMessage"]);if(!o&&!t){console.error("Unsupported Platform");return}o&&(window.WailsInvoke=e=>window.chrome.webview.postMessage(e)),t&&(window.WailsInvoke=e=>window.webkit.messageHandlers.external.postMessage(e))})();})();
|
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@wailsapp/runtime",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Wails Javascript runtime library",
|
||||||
|
"main": "runtime.js",
|
||||||
|
"types": "runtime.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/wailsapp/wails.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Wails",
|
||||||
|
"Javascript",
|
||||||
|
"Go"
|
||||||
|
],
|
||||||
|
"author": "Lea Anthony <lea.anthony@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/wailsapp/wails/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/wailsapp/wails#readme"
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
export interface Position {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Size {
|
||||||
|
w: number;
|
||||||
|
h: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface runtime {
|
||||||
|
EventsEmit(eventName: string, data?: any): void;
|
||||||
|
|
||||||
|
EventsOn(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void;
|
||||||
|
|
||||||
|
EventsOnce(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOff(eventName: string): void;
|
||||||
|
|
||||||
|
LogTrace(message: string): void;
|
||||||
|
|
||||||
|
LogDebug(message: string): void;
|
||||||
|
|
||||||
|
LogError(message: string): void;
|
||||||
|
|
||||||
|
LogFatal(message: string): void;
|
||||||
|
|
||||||
|
LogInfo(message: string): void;
|
||||||
|
|
||||||
|
LogWarning(message: string): void;
|
||||||
|
|
||||||
|
WindowReload(): void;
|
||||||
|
|
||||||
|
WindowSetSystemDefaultTheme(): void;
|
||||||
|
|
||||||
|
WindowSetLightTheme(): void;
|
||||||
|
|
||||||
|
WindowSetDarkTheme(): void;
|
||||||
|
|
||||||
|
WindowCenter(): void;
|
||||||
|
|
||||||
|
WindowSetTitle(title: string): void;
|
||||||
|
|
||||||
|
WindowFullscreen(): void;
|
||||||
|
|
||||||
|
WindowUnfullscreen(): void;
|
||||||
|
|
||||||
|
WindowSetSize(width: number, height: number): Promise<Size>;
|
||||||
|
|
||||||
|
WindowGetSize(): Promise<Size>;
|
||||||
|
|
||||||
|
WindowSetMaxSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetMinSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetPosition(x: number, y: number): void;
|
||||||
|
|
||||||
|
WindowGetPosition(): Promise<Position>;
|
||||||
|
|
||||||
|
WindowHide(): void;
|
||||||
|
|
||||||
|
WindowShow(): void;
|
||||||
|
|
||||||
|
WindowMaximise(): void;
|
||||||
|
|
||||||
|
WindowToggleMaximise(): void;
|
||||||
|
|
||||||
|
WindowUnmaximise(): void;
|
||||||
|
|
||||||
|
WindowMinimise(): void;
|
||||||
|
|
||||||
|
WindowUnminimise(): void;
|
||||||
|
|
||||||
|
WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||||
|
|
||||||
|
BrowserOpenURL(url: string): void;
|
||||||
|
|
||||||
|
Quit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
runtime: runtime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{var d=Object.defineProperty;var m=n=>d(n,"__esModule",{value:!0});var e=(n,i)=>{m(n);for(var o in i)d(n,o,{get:i[o],enumerable:!0})};var t={};e(t,{LogDebug:()=>p,LogError:()=>x,LogFatal:()=>s,LogInfo:()=>W,LogTrace:()=>f,LogWarning:()=>c});function f(n){window.runtime.LogTrace(n)}function p(n){window.runtime.LogDebug(n)}function W(n){window.runtime.LogInfo(n)}function c(n){window.runtime.LogWarning(n)}function x(n){window.runtime.LogError(n)}function s(n){window.runtime.LogFatal(n)}var w={};e(w,{EventsEmit:()=>L,EventsOff:()=>S,EventsOn:()=>a,EventsOnMultiple:()=>l,EventsOnce:()=>g});function l(n,i,o){window.runtime.EventsOnMultiple(n,i,o)}function a(n,i){OnMultiple(n,i,-1)}function S(n){return window.runtime.EventsOff(n)}function g(n,i){OnMultiple(n,i,1)}function L(n){let i=[n].slice.call(arguments);return window.runtime.EventsEmit.apply(null,i)}var r={};e(r,{WindowCenter:()=>v,WindowFullscreen:()=>z,WindowGetPosition:()=>P,WindowGetSize:()=>D,WindowHide:()=>b,WindowMaximise:()=>k,WindowMinimise:()=>H,WindowReload:()=>M,WindowSetDarkTheme:()=>h,WindowSetLightTheme:()=>T,WindowSetMaxSize:()=>R,WindowSetMinSize:()=>B,WindowSetPosition:()=>F,WindowSetRGBA:()=>Q,WindowSetSize:()=>G,WindowSetSystemDefaultTheme:()=>E,WindowSetTitle:()=>O,WindowShow:()=>y,WindowToggleMaximise:()=>A,WindowUnfullscreen:()=>U,WindowUnmaximise:()=>C,WindowUnminimise:()=>I});function M(){window.runtime.WindowReload()}function E(){window.runtime.WindowSetSystemDefaultTheme()}function T(){window.runtime.WindowSetLightTheme()}function h(){window.runtime.WindowSetDarkTheme()}function v(){window.runtime.WindowCenter()}function O(n){window.runtime.WindowSetTitle(n)}function z(){window.runtime.WindowFullscreen()}function U(){window.runtime.WindowUnfullscreen()}function D(){window.runtime.WindowGetSize()}function G(n,i){window.runtime.WindowSetSize(n,i)}function R(n,i){window.runtime.WindowSetMaxSize(n,i)}function B(n,i){window.runtime.WindowSetMinSize(n,i)}function F(n,i){window.runtime.WindowSetPosition(n,i)}function P(){window.runtime.WindowGetPosition()}function b(){window.runtime.WindowHide()}function y(){window.runtime.WindowShow()}function k(){window.runtime.WindowMaximise()}function A(){window.runtime.WindowToggleMaximise()}function C(){window.runtime.WindowUnmaximise()}function H(){window.runtime.WindowMinimise()}function I(){window.runtime.WindowUnminimise()}function Q(n){window.runtime.WindowSetRGBA(n)}var u={};e(u,{BrowserOpenURL:()=>j});function j(n){window.runtime.BrowserOpenURL(n)}function q(){window.runtime.Quit()}var K={...t,...w,...r,...u,Quit:q};})();
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.tsx" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,59 @@
|
|||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import './App.css'
|
||||||
|
import logo from "./assets/images/logo-universal.png"
|
||||||
|
import {Greet} from "../wailsjs/go/main/App";
|
||||||
|
import {useState} from "preact/hooks";
|
||||||
|
|
||||||
|
export function App(props: any) {
|
||||||
|
const [resultText, setResultText] = useState("Please enter your name below 👇");
|
||||||
|
const [name, setName] = useState('');
|
||||||
|
const updateName = (e: any) => setName(e.target.value);
|
||||||
|
const updateResultText = (result: string) => setResultText(result);
|
||||||
|
|
||||||
|
function greet() {
|
||||||
|
Greet(name).then(updateResultText);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div id="App">
|
||||||
|
<img src={logo} id="logo" alt="logo"/>
|
||||||
|
<div id="result" className="result">{resultText}</div>
|
||||||
|
<div id="input" className="input-box">
|
||||||
|
<input id="name" onChange={updateName} autoComplete="off" name="input" type="text"/>
|
||||||
|
<button className="btn" onClick={greet}>Greet</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
import {render} from 'preact';
|
||||||
|
import {App} from './app';
|
||||||
|
import './style.css';
|
||||||
|
|
||||||
|
render(<App/>, document.getElementById('app')!);
|
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.jsx" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,59 @@
|
|||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import './App.css'
|
||||||
|
import logo from "./assets/images/logo-universal.png"
|
||||||
|
import {Greet} from "../wailsjs/go/main/App";
|
||||||
|
import {useState} from "preact/hooks";
|
||||||
|
|
||||||
|
export function App(props) {
|
||||||
|
const [resultText, setResultText] = useState("Please enter your name below 👇");
|
||||||
|
const [name, setName] = useState('');
|
||||||
|
const updateName = (e) => setName(e.target.value);
|
||||||
|
const updateResultText = (result) => setResultText(result);
|
||||||
|
|
||||||
|
function greet() {
|
||||||
|
Greet(name).then(updateResultText);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div id="App">
|
||||||
|
<img src={logo} id="logo" alt="logo"/>
|
||||||
|
<div id="result" className="result">{resultText}</div>
|
||||||
|
<div id="input" className="input-box">
|
||||||
|
<input id="name" onChange={updateName} autoComplete="off" name="input" type="text"/>
|
||||||
|
<button className="btn" onClick={greet}>Greet</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
Copyright 2016 The Nunito Project Authors (contact@sansoxygen.com),
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
import {render} from 'preact';
|
||||||
|
import {App} from './app';
|
||||||
|
import './style.css';
|
||||||
|
|
||||||
|
render(<App/>, document.getElementById('app'));
|
@ -0,0 +1,26 @@
|
|||||||
|
html {
|
||||||
|
background-color: rgba(27, 38, 54, 1);
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
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-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(""),
|
||||||
|
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1: string): Promise<string>;
|
@ -0,0 +1,7 @@
|
|||||||
|
// @ts-check
|
||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1) {
|
||||||
|
return window['go']['main']['App']['Greet'](arg1);
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{(function(){let n=function(e){for(var s=window[e.shift()];s&&e.length;)s=s[e.shift()];return s},o=n(["chrome","webview","postMessage"]),t=n(["webkit","messageHandlers","external","postMessage"]);if(!o&&!t){console.error("Unsupported Platform");return}o&&(window.WailsInvoke=e=>window.chrome.webview.postMessage(e)),t&&(window.WailsInvoke=e=>window.webkit.messageHandlers.external.postMessage(e))})();})();
|
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@wailsapp/runtime",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Wails Javascript runtime library",
|
||||||
|
"main": "runtime.js",
|
||||||
|
"types": "runtime.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/wailsapp/wails.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Wails",
|
||||||
|
"Javascript",
|
||||||
|
"Go"
|
||||||
|
],
|
||||||
|
"author": "Lea Anthony <lea.anthony@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/wailsapp/wails/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/wailsapp/wails#readme"
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
export interface Position {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Size {
|
||||||
|
w: number;
|
||||||
|
h: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface runtime {
|
||||||
|
EventsEmit(eventName: string, data?: any): void;
|
||||||
|
|
||||||
|
EventsOn(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void;
|
||||||
|
|
||||||
|
EventsOnce(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOff(eventName: string): void;
|
||||||
|
|
||||||
|
LogTrace(message: string): void;
|
||||||
|
|
||||||
|
LogDebug(message: string): void;
|
||||||
|
|
||||||
|
LogError(message: string): void;
|
||||||
|
|
||||||
|
LogFatal(message: string): void;
|
||||||
|
|
||||||
|
LogInfo(message: string): void;
|
||||||
|
|
||||||
|
LogWarning(message: string): void;
|
||||||
|
|
||||||
|
WindowReload(): void;
|
||||||
|
|
||||||
|
WindowSetSystemDefaultTheme(): void;
|
||||||
|
|
||||||
|
WindowSetLightTheme(): void;
|
||||||
|
|
||||||
|
WindowSetDarkTheme(): void;
|
||||||
|
|
||||||
|
WindowCenter(): void;
|
||||||
|
|
||||||
|
WindowSetTitle(title: string): void;
|
||||||
|
|
||||||
|
WindowFullscreen(): void;
|
||||||
|
|
||||||
|
WindowUnfullscreen(): void;
|
||||||
|
|
||||||
|
WindowSetSize(width: number, height: number): Promise<Size>;
|
||||||
|
|
||||||
|
WindowGetSize(): Promise<Size>;
|
||||||
|
|
||||||
|
WindowSetMaxSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetMinSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetPosition(x: number, y: number): void;
|
||||||
|
|
||||||
|
WindowGetPosition(): Promise<Position>;
|
||||||
|
|
||||||
|
WindowHide(): void;
|
||||||
|
|
||||||
|
WindowShow(): void;
|
||||||
|
|
||||||
|
WindowMaximise(): void;
|
||||||
|
|
||||||
|
WindowToggleMaximise(): void;
|
||||||
|
|
||||||
|
WindowUnmaximise(): void;
|
||||||
|
|
||||||
|
WindowMinimise(): void;
|
||||||
|
|
||||||
|
WindowUnminimise(): void;
|
||||||
|
|
||||||
|
WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||||
|
|
||||||
|
BrowserOpenURL(url: string): void;
|
||||||
|
|
||||||
|
Quit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
runtime: runtime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{var d=Object.defineProperty;var m=n=>d(n,"__esModule",{value:!0});var e=(n,i)=>{m(n);for(var o in i)d(n,o,{get:i[o],enumerable:!0})};var t={};e(t,{LogDebug:()=>p,LogError:()=>x,LogFatal:()=>s,LogInfo:()=>W,LogTrace:()=>f,LogWarning:()=>c});function f(n){window.runtime.LogTrace(n)}function p(n){window.runtime.LogDebug(n)}function W(n){window.runtime.LogInfo(n)}function c(n){window.runtime.LogWarning(n)}function x(n){window.runtime.LogError(n)}function s(n){window.runtime.LogFatal(n)}var w={};e(w,{EventsEmit:()=>L,EventsOff:()=>S,EventsOn:()=>a,EventsOnMultiple:()=>l,EventsOnce:()=>g});function l(n,i,o){window.runtime.EventsOnMultiple(n,i,o)}function a(n,i){OnMultiple(n,i,-1)}function S(n){return window.runtime.EventsOff(n)}function g(n,i){OnMultiple(n,i,1)}function L(n){let i=[n].slice.call(arguments);return window.runtime.EventsEmit.apply(null,i)}var r={};e(r,{WindowCenter:()=>v,WindowFullscreen:()=>z,WindowGetPosition:()=>P,WindowGetSize:()=>D,WindowHide:()=>b,WindowMaximise:()=>k,WindowMinimise:()=>H,WindowReload:()=>M,WindowSetDarkTheme:()=>h,WindowSetLightTheme:()=>T,WindowSetMaxSize:()=>R,WindowSetMinSize:()=>B,WindowSetPosition:()=>F,WindowSetRGBA:()=>Q,WindowSetSize:()=>G,WindowSetSystemDefaultTheme:()=>E,WindowSetTitle:()=>O,WindowShow:()=>y,WindowToggleMaximise:()=>A,WindowUnfullscreen:()=>U,WindowUnmaximise:()=>C,WindowUnminimise:()=>I});function M(){window.runtime.WindowReload()}function E(){window.runtime.WindowSetSystemDefaultTheme()}function T(){window.runtime.WindowSetLightTheme()}function h(){window.runtime.WindowSetDarkTheme()}function v(){window.runtime.WindowCenter()}function O(n){window.runtime.WindowSetTitle(n)}function z(){window.runtime.WindowFullscreen()}function U(){window.runtime.WindowUnfullscreen()}function D(){window.runtime.WindowGetSize()}function G(n,i){window.runtime.WindowSetSize(n,i)}function R(n,i){window.runtime.WindowSetMaxSize(n,i)}function B(n,i){window.runtime.WindowSetMinSize(n,i)}function F(n,i){window.runtime.WindowSetPosition(n,i)}function P(){window.runtime.WindowGetPosition()}function b(){window.runtime.WindowHide()}function y(){window.runtime.WindowShow()}function k(){window.runtime.WindowMaximise()}function A(){window.runtime.WindowToggleMaximise()}function C(){window.runtime.WindowUnmaximise()}function H(){window.runtime.WindowMinimise()}function I(){window.runtime.WindowUnminimise()}function Q(n){window.runtime.WindowSetRGBA(n)}var u={};e(u,{BrowserOpenURL:()=>j});function j(n){window.runtime.BrowserOpenURL(n)}function q(){window.runtime.Quit()}var K={...t,...w,...r,...u,Quit:q};})();
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script src="./src/main.tsx" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,59 @@
|
|||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import {useState} from 'react';
|
||||||
|
import logo from './assets/images/logo-universal.png';
|
||||||
|
import './App.css';
|
||||||
|
import {Greet} from "../wailsjs/go/main/App";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
const [resultText, setResultText] = useState("Please enter your name below 👇");
|
||||||
|
const [name, setName] = useState('');
|
||||||
|
const updateName = (e: any) => setName(e.target.value);
|
||||||
|
const updateResultText = (result: string) => setResultText(result);
|
||||||
|
|
||||||
|
function greet() {
|
||||||
|
Greet(name).then(updateResultText);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div id="App">
|
||||||
|
<img src={logo} id="logo" alt="logo"/>
|
||||||
|
<div id="result" className="result">{resultText}</div>
|
||||||
|
<div id="input" className="input-box">
|
||||||
|
<input id="name" onChange={updateName} autoComplete="off" name="input" type="text"/>
|
||||||
|
<button className="btn" onClick={greet}>Greet</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App
|
@ -0,0 +1,11 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ReactDOM from 'react-dom'
|
||||||
|
import './style.css'
|
||||||
|
import App from './App'
|
||||||
|
|
||||||
|
ReactDOM.render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<App/>
|
||||||
|
</React.StrictMode>,
|
||||||
|
document.getElementById('root')
|
||||||
|
)
|
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script src="./src/main.jsx" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,59 @@
|
|||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import {useState} from 'react';
|
||||||
|
import logo from './assets/images/logo-universal.png';
|
||||||
|
import './App.css';
|
||||||
|
import {Greet} from "../wailsjs/go/main/App";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
const [resultText, setResultText] = useState("Please enter your name below 👇");
|
||||||
|
const [name, setName] = useState('');
|
||||||
|
const updateName = (e) => setName(e.target.value);
|
||||||
|
const updateResultText = (result) => setResultText(result);
|
||||||
|
|
||||||
|
function greet() {
|
||||||
|
Greet(name).then(updateResultText);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div id="App">
|
||||||
|
<img src={logo} id="logo" alt="logo"/>
|
||||||
|
<div id="result" className="result">{resultText}</div>
|
||||||
|
<div id="input" className="input-box">
|
||||||
|
<input id="name" onChange={updateName} autoComplete="off" name="input" type="text"/>
|
||||||
|
<button className="btn" onClick={greet}>Greet</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App
|
@ -0,0 +1,93 @@
|
|||||||
|
Copyright 2016 The Nunito Project Authors (contact@sansoxygen.com),
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
@ -0,0 +1,11 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ReactDOM from 'react-dom'
|
||||||
|
import './style.css'
|
||||||
|
import App from './App'
|
||||||
|
|
||||||
|
ReactDOM.render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<App/>
|
||||||
|
</React.StrictMode>,
|
||||||
|
document.getElementById('root')
|
||||||
|
)
|
@ -0,0 +1,26 @@
|
|||||||
|
html {
|
||||||
|
background-color: rgba(27, 38, 54, 1);
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
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-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(""),
|
||||||
|
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1: string): Promise<string>;
|
@ -0,0 +1,7 @@
|
|||||||
|
// @ts-check
|
||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1) {
|
||||||
|
return window['go']['main']['App']['Greet'](arg1);
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{(function(){let n=function(e){for(var s=window[e.shift()];s&&e.length;)s=s[e.shift()];return s},o=n(["chrome","webview","postMessage"]),t=n(["webkit","messageHandlers","external","postMessage"]);if(!o&&!t){console.error("Unsupported Platform");return}o&&(window.WailsInvoke=e=>window.chrome.webview.postMessage(e)),t&&(window.WailsInvoke=e=>window.webkit.messageHandlers.external.postMessage(e))})();})();
|
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@wailsapp/runtime",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Wails Javascript runtime library",
|
||||||
|
"main": "runtime.js",
|
||||||
|
"types": "runtime.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/wailsapp/wails.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Wails",
|
||||||
|
"Javascript",
|
||||||
|
"Go"
|
||||||
|
],
|
||||||
|
"author": "Lea Anthony <lea.anthony@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/wailsapp/wails/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/wailsapp/wails#readme"
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
export interface Position {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Size {
|
||||||
|
w: number;
|
||||||
|
h: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface runtime {
|
||||||
|
EventsEmit(eventName: string, data?: any): void;
|
||||||
|
|
||||||
|
EventsOn(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void;
|
||||||
|
|
||||||
|
EventsOnce(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOff(eventName: string): void;
|
||||||
|
|
||||||
|
LogTrace(message: string): void;
|
||||||
|
|
||||||
|
LogDebug(message: string): void;
|
||||||
|
|
||||||
|
LogError(message: string): void;
|
||||||
|
|
||||||
|
LogFatal(message: string): void;
|
||||||
|
|
||||||
|
LogInfo(message: string): void;
|
||||||
|
|
||||||
|
LogWarning(message: string): void;
|
||||||
|
|
||||||
|
WindowReload(): void;
|
||||||
|
|
||||||
|
WindowSetSystemDefaultTheme(): void;
|
||||||
|
|
||||||
|
WindowSetLightTheme(): void;
|
||||||
|
|
||||||
|
WindowSetDarkTheme(): void;
|
||||||
|
|
||||||
|
WindowCenter(): void;
|
||||||
|
|
||||||
|
WindowSetTitle(title: string): void;
|
||||||
|
|
||||||
|
WindowFullscreen(): void;
|
||||||
|
|
||||||
|
WindowUnfullscreen(): void;
|
||||||
|
|
||||||
|
WindowSetSize(width: number, height: number): Promise<Size>;
|
||||||
|
|
||||||
|
WindowGetSize(): Promise<Size>;
|
||||||
|
|
||||||
|
WindowSetMaxSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetMinSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetPosition(x: number, y: number): void;
|
||||||
|
|
||||||
|
WindowGetPosition(): Promise<Position>;
|
||||||
|
|
||||||
|
WindowHide(): void;
|
||||||
|
|
||||||
|
WindowShow(): void;
|
||||||
|
|
||||||
|
WindowMaximise(): void;
|
||||||
|
|
||||||
|
WindowToggleMaximise(): void;
|
||||||
|
|
||||||
|
WindowUnmaximise(): void;
|
||||||
|
|
||||||
|
WindowMinimise(): void;
|
||||||
|
|
||||||
|
WindowUnminimise(): void;
|
||||||
|
|
||||||
|
WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||||
|
|
||||||
|
BrowserOpenURL(url: string): void;
|
||||||
|
|
||||||
|
Quit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
runtime: runtime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{var d=Object.defineProperty;var m=n=>d(n,"__esModule",{value:!0});var e=(n,i)=>{m(n);for(var o in i)d(n,o,{get:i[o],enumerable:!0})};var t={};e(t,{LogDebug:()=>p,LogError:()=>x,LogFatal:()=>s,LogInfo:()=>W,LogTrace:()=>f,LogWarning:()=>c});function f(n){window.runtime.LogTrace(n)}function p(n){window.runtime.LogDebug(n)}function W(n){window.runtime.LogInfo(n)}function c(n){window.runtime.LogWarning(n)}function x(n){window.runtime.LogError(n)}function s(n){window.runtime.LogFatal(n)}var w={};e(w,{EventsEmit:()=>L,EventsOff:()=>S,EventsOn:()=>a,EventsOnMultiple:()=>l,EventsOnce:()=>g});function l(n,i,o){window.runtime.EventsOnMultiple(n,i,o)}function a(n,i){OnMultiple(n,i,-1)}function S(n){return window.runtime.EventsOff(n)}function g(n,i){OnMultiple(n,i,1)}function L(n){let i=[n].slice.call(arguments);return window.runtime.EventsEmit.apply(null,i)}var r={};e(r,{WindowCenter:()=>v,WindowFullscreen:()=>z,WindowGetPosition:()=>P,WindowGetSize:()=>D,WindowHide:()=>b,WindowMaximise:()=>k,WindowMinimise:()=>H,WindowReload:()=>M,WindowSetDarkTheme:()=>h,WindowSetLightTheme:()=>T,WindowSetMaxSize:()=>R,WindowSetMinSize:()=>B,WindowSetPosition:()=>F,WindowSetRGBA:()=>Q,WindowSetSize:()=>G,WindowSetSystemDefaultTheme:()=>E,WindowSetTitle:()=>O,WindowShow:()=>y,WindowToggleMaximise:()=>A,WindowUnfullscreen:()=>U,WindowUnmaximise:()=>C,WindowUnminimise:()=>I});function M(){window.runtime.WindowReload()}function E(){window.runtime.WindowSetSystemDefaultTheme()}function T(){window.runtime.WindowSetLightTheme()}function h(){window.runtime.WindowSetDarkTheme()}function v(){window.runtime.WindowCenter()}function O(n){window.runtime.WindowSetTitle(n)}function z(){window.runtime.WindowFullscreen()}function U(){window.runtime.WindowUnfullscreen()}function D(){window.runtime.WindowGetSize()}function G(n,i){window.runtime.WindowSetSize(n,i)}function R(n,i){window.runtime.WindowSetMaxSize(n,i)}function B(n,i){window.runtime.WindowSetMinSize(n,i)}function F(n,i){window.runtime.WindowSetPosition(n,i)}function P(){window.runtime.WindowGetPosition()}function b(){window.runtime.WindowHide()}function y(){window.runtime.WindowShow()}function k(){window.runtime.WindowMaximise()}function A(){window.runtime.WindowToggleMaximise()}function C(){window.runtime.WindowUnmaximise()}function H(){window.runtime.WindowMinimise()}function I(){window.runtime.WindowUnminimise()}function Q(n){window.runtime.WindowSetRGBA(n)}var u={};e(u,{BrowserOpenURL:()=>j});function j(n){window.runtime.BrowserOpenURL(n)}function q(){window.runtime.Quit()}var K={...t,...w,...r,...u,Quit:q};})();
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<link href="./src/style.css" rel="stylesheet">
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.ts" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,79 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import logo from './assets/images/logo-universal.png'
|
||||||
|
import {Greet} from '../wailsjs/go/main/App.js'
|
||||||
|
|
||||||
|
let resultText: string = "Please enter your name below 👇"
|
||||||
|
let name: string
|
||||||
|
|
||||||
|
function greet(): void {
|
||||||
|
Greet(name).then(result => resultText = result)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<img alt="Wails logo" id="logo" src="{logo}">
|
||||||
|
<div class="result" id="result">{resultText}</div>
|
||||||
|
<div class="input-box" id="input">
|
||||||
|
<input autocomplete="off" bind:value={name} class="input" id="name" type="text"/>
|
||||||
|
<button class="btn" on:click={greet}>Greet</button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,26 @@
|
|||||||
|
html {
|
||||||
|
background-color: rgba(27, 38, 54, 1);
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
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-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(""),
|
||||||
|
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<link href="./src/style.css" rel="stylesheet">
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.js" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,79 @@
|
|||||||
|
<script>
|
||||||
|
import logo from './assets/images/logo-universal.png'
|
||||||
|
import {Greet} from '../wailsjs/go/main/App.js'
|
||||||
|
|
||||||
|
let resultText = "Please enter your name below 👇"
|
||||||
|
let name
|
||||||
|
|
||||||
|
function greet() {
|
||||||
|
Greet(name).then(result => resultText = result)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<img alt="Wails logo" id="logo" src="{logo}">
|
||||||
|
<div class="result" id="result">{resultText}</div>
|
||||||
|
<div class="input-box" id="input">
|
||||||
|
<input autocomplete="off" bind:value={name} class="input" id="name" type="text"/>
|
||||||
|
<button class="btn" on:click={greet}>Greet</button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,26 @@
|
|||||||
|
html {
|
||||||
|
background-color: rgba(27, 38, 54, 1);
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
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-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local(""),
|
||||||
|
url("assets/fonts/nunito-v16-latin-regular.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1: string): Promise<string>;
|
@ -0,0 +1,7 @@
|
|||||||
|
// @ts-check
|
||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export function Greet(arg1) {
|
||||||
|
return window['go']['main']['App']['Greet'](arg1);
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{(function(){let n=function(e){for(var s=window[e.shift()];s&&e.length;)s=s[e.shift()];return s},o=n(["chrome","webview","postMessage"]),t=n(["webkit","messageHandlers","external","postMessage"]);if(!o&&!t){console.error("Unsupported Platform");return}o&&(window.WailsInvoke=e=>window.chrome.webview.postMessage(e)),t&&(window.WailsInvoke=e=>window.webkit.messageHandlers.external.postMessage(e))})();})();
|
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@wailsapp/runtime",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "Wails Javascript runtime library",
|
||||||
|
"main": "runtime.js",
|
||||||
|
"types": "runtime.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/wailsapp/wails.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Wails",
|
||||||
|
"Javascript",
|
||||||
|
"Go"
|
||||||
|
],
|
||||||
|
"author": "Lea Anthony <lea.anthony@gmail.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/wailsapp/wails/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/wailsapp/wails#readme"
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
export interface Position {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Size {
|
||||||
|
w: number;
|
||||||
|
h: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface runtime {
|
||||||
|
EventsEmit(eventName: string, data?: any): void;
|
||||||
|
|
||||||
|
EventsOn(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void;
|
||||||
|
|
||||||
|
EventsOnce(eventName: string, callback: (data?: any) => void): void;
|
||||||
|
|
||||||
|
EventsOff(eventName: string): void;
|
||||||
|
|
||||||
|
LogTrace(message: string): void;
|
||||||
|
|
||||||
|
LogDebug(message: string): void;
|
||||||
|
|
||||||
|
LogError(message: string): void;
|
||||||
|
|
||||||
|
LogFatal(message: string): void;
|
||||||
|
|
||||||
|
LogInfo(message: string): void;
|
||||||
|
|
||||||
|
LogWarning(message: string): void;
|
||||||
|
|
||||||
|
WindowReload(): void;
|
||||||
|
|
||||||
|
WindowSetSystemDefaultTheme(): void;
|
||||||
|
|
||||||
|
WindowSetLightTheme(): void;
|
||||||
|
|
||||||
|
WindowSetDarkTheme(): void;
|
||||||
|
|
||||||
|
WindowCenter(): void;
|
||||||
|
|
||||||
|
WindowSetTitle(title: string): void;
|
||||||
|
|
||||||
|
WindowFullscreen(): void;
|
||||||
|
|
||||||
|
WindowUnfullscreen(): void;
|
||||||
|
|
||||||
|
WindowSetSize(width: number, height: number): Promise<Size>;
|
||||||
|
|
||||||
|
WindowGetSize(): Promise<Size>;
|
||||||
|
|
||||||
|
WindowSetMaxSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetMinSize(width: number, height: number): void;
|
||||||
|
|
||||||
|
WindowSetPosition(x: number, y: number): void;
|
||||||
|
|
||||||
|
WindowGetPosition(): Promise<Position>;
|
||||||
|
|
||||||
|
WindowHide(): void;
|
||||||
|
|
||||||
|
WindowShow(): void;
|
||||||
|
|
||||||
|
WindowMaximise(): void;
|
||||||
|
|
||||||
|
WindowToggleMaximise(): void;
|
||||||
|
|
||||||
|
WindowUnmaximise(): void;
|
||||||
|
|
||||||
|
WindowMinimise(): void;
|
||||||
|
|
||||||
|
WindowUnminimise(): void;
|
||||||
|
|
||||||
|
WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||||
|
|
||||||
|
BrowserOpenURL(url: string): void;
|
||||||
|
|
||||||
|
Quit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
runtime: runtime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
(()=>{var d=Object.defineProperty;var m=n=>d(n,"__esModule",{value:!0});var e=(n,i)=>{m(n);for(var o in i)d(n,o,{get:i[o],enumerable:!0})};var t={};e(t,{LogDebug:()=>W,LogError:()=>x,LogFatal:()=>s,LogInfo:()=>c,LogTrace:()=>p,LogWarning:()=>f});function p(n){window.runtime.LogTrace(n)}function W(n){window.runtime.LogDebug(n)}function c(n){window.runtime.LogInfo(n)}function f(n){window.runtime.LogWarning(n)}function x(n){window.runtime.LogError(n)}function s(n){window.runtime.LogFatal(n)}var w={};e(w,{EventsEmit:()=>S,EventsOn:()=>a,EventsOnMultiple:()=>l,EventsOnce:()=>g});function l(n,i,o){window.runtime.EventsOnMultiple(n,i,o)}function a(n,i){OnMultiple(n,i,-1)}function g(n,i){OnMultiple(n,i,1)}function S(n){let i=[n].slice.call(arguments);return window.runtime.EventsEmit.apply(null,i)}var r={};e(r,{WindowCenter:()=>M,WindowFullscreen:()=>v,WindowGetPosition:()=>B,WindowGetSize:()=>O,WindowHide:()=>F,WindowMaximise:()=>b,WindowMinimise:()=>C,WindowReload:()=>L,WindowSetMaxSize:()=>G,WindowSetMinSize:()=>R,WindowSetPosition:()=>T,WindowSetRGBA:()=>H,WindowSetSize:()=>U,WindowSetTitle:()=>E,WindowShow:()=>P,WindowToggleMaximise:()=>h,WindowUnfullscreen:()=>z,WindowUnmaximise:()=>A,WindowUnminimise:()=>D});function L(){window.runtime.WindowReload()}function M(){window.runtime.WindowCenter()}function E(n){window.runtime.WindowSetTitle(n)}function v(){window.runtime.WindowFullscreen()}function z(){window.runtime.WindowUnfullscreen()}function O(){window.runtime.WindowGetSize()}function U(n,i){window.runtime.WindowSetSize(n,i)}function G(n,i){window.runtime.WindowSetMaxSize(n,i)}function R(n,i){window.runtime.WindowSetMinSize(n,i)}function T(n,i){window.runtime.WindowSetPosition(n,i)}function B(){window.runtime.WindowGetPosition()}function F(){window.runtime.WindowHide()}function P(){window.runtime.WindowShow()}function b(){window.runtime.WindowMaximise()}function h(){window.runtime.WindowToggleMaximise()}function A(){window.runtime.WindowUnmaximise()}function C(){window.runtime.WindowMinimise()}function D(){window.runtime.WindowUnminimise()}function H(n){window.runtime.WindowSetRGBA(n)}var u={};e(u,{BrowserOpenURL:()=>I});function I(n){window.runtime.BrowserOpenURL(n)}function Q(){window.runtime.Quit()}var j={...t,...w,...r,...u,Quit:Q};})();
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.ts" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,54 @@
|
|||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
import './style.css';
|
||||||
|
import './app.css';
|
||||||
|
|
||||||
|
import logo from './assets/images/logo-universal.png';
|
||||||
|
import {Greet} from '../wailsjs/go/main/App';
|
||||||
|
|
||||||
|
// Setup the greet function
|
||||||
|
window.greet = function () {
|
||||||
|
// Get name
|
||||||
|
let name = nameElement!.value;
|
||||||
|
|
||||||
|
// Check if the input is empty
|
||||||
|
if (name === "") return;
|
||||||
|
|
||||||
|
// Call App.Greet(name)
|
||||||
|
try {
|
||||||
|
Greet(name)
|
||||||
|
.then((result) => {
|
||||||
|
// Update result with data back from App.Greet()
|
||||||
|
resultElement!.innerText = result;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.querySelector('#app')!.innerHTML = `
|
||||||
|
<img id="logo" class="logo">
|
||||||
|
<div class="result" id="result">Please enter your name below 👇</div>
|
||||||
|
<div class="input-box" id="input">
|
||||||
|
<input class="input" id="name" type="text" autocomplete="off" />
|
||||||
|
<button class="btn" onclick="greet()">Greet</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
(document.getElementById('logo') as HTMLImageElement).src = logo;
|
||||||
|
|
||||||
|
let nameElement = (document.getElementById("name") as HTMLInputElement);
|
||||||
|
nameElement.focus();
|
||||||
|
let resultElement = document.getElementById("result");
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
greet: () => void;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.js" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,54 @@
|
|||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
import './style.css';
|
||||||
|
import './app.css';
|
||||||
|
|
||||||
|
import logo from './assets/images/logo-universal.png';
|
||||||
|
import {Greet} from '../wailsjs/go/main/App';
|
||||||
|
|
||||||
|
document.querySelector('#app').innerHTML = `
|
||||||
|
<img id="logo" class="logo">
|
||||||
|
<div class="result" id="result">Please enter your name below 👇</div>
|
||||||
|
<div class="input-box" id="input">
|
||||||
|
<input class="input" id="name" type="text" autocomplete="off" />
|
||||||
|
<button class="btn" onclick="greet()">Greet</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
document.getElementById('logo').src = logo;
|
||||||
|
|
||||||
|
let nameElement = document.getElementById("name");
|
||||||
|
nameElement.focus();
|
||||||
|
let resultElement = document.getElementById("result");
|
||||||
|
|
||||||
|
// Setup the greet function
|
||||||
|
window.greet = function () {
|
||||||
|
// Get name
|
||||||
|
let name = nameElement.value;
|
||||||
|
|
||||||
|
// Check if the input is empty
|
||||||
|
if (name === "") return;
|
||||||
|
|
||||||
|
// Call App.Greet(name)
|
||||||
|
try {
|
||||||
|
Greet(name)
|
||||||
|
.then((result) => {
|
||||||
|
// Update result with data back from App.Greet()
|
||||||
|
resultElement.innerText = result;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,4 @@
|
|||||||
|
This template uses a work around as the default template does not compile due to this issue:
|
||||||
|
https://github.com/vuejs/core/issues/1228
|
||||||
|
|
||||||
|
In `tsconfig.json`, `isolatedModules` is set to `false` rather than `true` to work around the issue.
|
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
<link href="./src/style.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script src="./src/main.ts" type="module"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import HelloWorld from './components/HelloWorld.vue'</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<img id="logo" alt="Wails logo" src="./assets/images/logo-universal.png"/>
|
||||||
|
<HelloWorld/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#logo {
|
||||||
|
display: block;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
margin: auto;
|
||||||
|
padding: 10% 0 0;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-origin: content-box;
|
||||||
|
}
|
||||||
|
</style>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user