diff --git a/SiriLazor.WASM/Components/App.razor b/SiriLazor.WASM/Components/App.razor new file mode 100644 index 0000000..6fd3ed1 --- /dev/null +++ b/SiriLazor.WASM/Components/App.razor @@ -0,0 +1,12 @@ + + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
diff --git a/SiriLazor.WASM/Components/Layout/MainLayout.razor b/SiriLazor.WASM/Components/Layout/MainLayout.razor new file mode 100644 index 0000000..e1a9a75 --- /dev/null +++ b/SiriLazor.WASM/Components/Layout/MainLayout.razor @@ -0,0 +1,3 @@ +@inherits LayoutComponentBase + +@Body diff --git a/SiriLazor.WASM/Components/Pages/Home.razor b/SiriLazor.WASM/Components/Pages/Home.razor new file mode 100644 index 0000000..b5d774a --- /dev/null +++ b/SiriLazor.WASM/Components/Pages/Home.razor @@ -0,0 +1,104 @@ +@page "/" +@using SiriLazor.UI; + +SiriLazorDemo + +
+

SiriLazor

+

+ The Apple® Siri wave-form. +

+
+
+

Classic Wave

+ +
+ + + +
+
+ + +

@sliderClassicSpeedValue

+
+
+ + +

@sliderClassicAmpValue

+
+
+
+

IOS9 Wave

+ +
+ + + + +
+
+ + +

@sliderIos9SpeedValue

+
+
+ + +

@sliderIos9AmpValue

+
+
+
+ + +
+ + +@code{ + IOS9Wave ios9Wave; + ClassicWave classicWave; + + double sliderIos9SpeedValue = 0.2; + double sliderIos9AmpValue = 1; + + double sliderClassicSpeedValue = 0.2; + double sliderClassicAmpValue = 1; + + async ValueTask StopClassic() + { + await classicWave.Stop(); + } + async ValueTask StopIOS9() + { + await ios9Wave.Stop(); + } + + async ValueTask StartIOS9() + { + await ios9Wave.Start(); + } + async ValueTask StartClassic() + { + await classicWave.Start(); + } + private async ValueTask UpdateSpeedValueIOS9(ChangeEventArgs e) + { + sliderIos9SpeedValue = Convert.ToDouble(e.Value); + await ios9Wave.SetSpeed(sliderIos9SpeedValue); + } + private async ValueTask UpdateAmpValueIOS9(ChangeEventArgs e) + { + sliderIos9AmpValue = Convert.ToDouble(e.Value); + await ios9Wave.SetAmplitude(sliderIos9AmpValue); + } + private async ValueTask UpdateSpeedValueClassic(ChangeEventArgs e) + { + sliderClassicSpeedValue = Convert.ToDouble(e.Value); + await classicWave.SetSpeed(sliderClassicSpeedValue); + } + private async ValueTask UpdateAmpValueClassic(ChangeEventArgs e) + { + sliderClassicAmpValue = Convert.ToDouble(e.Value); + await classicWave.SetAmplitude(sliderClassicAmpValue); + } +} \ No newline at end of file diff --git a/SiriLazor.WASM/Components/_Imports.razor b/SiriLazor.WASM/Components/_Imports.razor new file mode 100644 index 0000000..169bcd8 --- /dev/null +++ b/SiriLazor.WASM/Components/_Imports.razor @@ -0,0 +1,11 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.AspNetCore.Components.WebAssembly.Http +@using Microsoft.JSInterop +@using SiriLazor.WASM +@using SiriLazor.WASM.Components +@using SiriLazor.WASM.Components.Layout diff --git a/SiriLazor.WASM/Program.cs b/SiriLazor.WASM/Program.cs new file mode 100644 index 0000000..3f70b77 --- /dev/null +++ b/SiriLazor.WASM/Program.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using SiriLazor.WASM.Components; +using SiriLazor.Component.Extentions; + +var builder = WebAssemblyHostBuilder.CreateDefault(args); +builder.RootComponents.Add("#app"); +builder.RootComponents.Add("head::after"); + + +builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); +builder.Services.AddSiriLazor(); +await builder.Build().RunAsync(); diff --git a/SiriLazor.WASM/Properties/launchSettings.json b/SiriLazor.WASM/Properties/launchSettings.json new file mode 100644 index 0000000..408a9ab --- /dev/null +++ b/SiriLazor.WASM/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:12657", + "sslPort": 44345 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "http://localhost:5159", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:7235;http://localhost:5159", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/SiriLazor.WASM/SiriLazor.WASM.csproj b/SiriLazor.WASM/SiriLazor.WASM.csproj new file mode 100644 index 0000000..f72b378 --- /dev/null +++ b/SiriLazor.WASM/SiriLazor.WASM.csproj @@ -0,0 +1,17 @@ + + + net8.0 + enable + enable + + + + + + + + + + + + \ No newline at end of file diff --git a/SiriLazor.WASM/Style/tailwind.css b/SiriLazor.WASM/Style/tailwind.css new file mode 100644 index 0000000..65087de --- /dev/null +++ b/SiriLazor.WASM/Style/tailwind.css @@ -0,0 +1,4 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;500;600;700;800;900&display=swap'); +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/SiriLazor.WASM/package-lock.json b/SiriLazor.WASM/package-lock.json new file mode 100644 index 0000000..835d1a7 --- /dev/null +++ b/SiriLazor.WASM/package-lock.json @@ -0,0 +1,901 @@ +{ + "name": "SiriLazor.WASM", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "tailwindcss": "^3.3.5" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz", + "integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^2.1.1" + }, + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", + "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", + "dependencies": { + "postcss-selector-parser": "^6.0.11" + }, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sucrase": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", + "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz", + "integrity": "sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.19.1", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "engines": { + "node": ">= 14" + } + } + } +} diff --git a/SiriLazor.WASM/package.json b/SiriLazor.WASM/package.json new file mode 100644 index 0000000..34df28e --- /dev/null +++ b/SiriLazor.WASM/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "tailwindcss": "^3.3.5" + } +} diff --git a/SiriLazor.WASM/tailwind.config.js b/SiriLazor.WASM/tailwind.config.js new file mode 100644 index 0000000..d41d6fa --- /dev/null +++ b/SiriLazor.WASM/tailwind.config.js @@ -0,0 +1,13 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./**/*.{razor,html,cshtml}"], + theme: { + extend: { + fontFamily: { + 'inter': "Inter" + } + }, + }, + plugins: [], +} + diff --git a/SiriLazor.WASM/wwwroot/SiriLazor_160x160.png b/SiriLazor.WASM/wwwroot/SiriLazor_160x160.png new file mode 100644 index 0000000..2f123b3 Binary files /dev/null and b/SiriLazor.WASM/wwwroot/SiriLazor_160x160.png differ diff --git a/SiriLazor.WASM/wwwroot/css/style.css b/SiriLazor.WASM/wwwroot/css/style.css new file mode 100644 index 0000000..4e3375b --- /dev/null +++ b/SiriLazor.WASM/wwwroot/css/style.css @@ -0,0 +1,714 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;500;600;700;800;900&display=swap'); + +/* +! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com +*/ + +/* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; + /* 1 */ + border-width: 0; + /* 2 */ + border-style: solid; + /* 2 */ + border-color: #e5e7eb; + /* 2 */ +} + +::before, +::after { + --tw-content: ''; +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +5. Use the user's configured `sans` font-feature-settings by default. +6. Use the user's configured `sans` font-variation-settings by default. +*/ + +html { + line-height: 1.5; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -moz-tab-size: 4; + /* 3 */ + -o-tab-size: 4; + tab-size: 4; + /* 3 */ + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + /* 4 */ + font-feature-settings: normal; + /* 5 */ + font-variation-settings: normal; + /* 6 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ + +body { + margin: 0; + /* 1 */ + line-height: inherit; + /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; + /* 1 */ + color: inherit; + /* 2 */ + border-top-width: 1px; + /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured `mono` font family by default. +2. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; + /* 1 */ + border-color: inherit; + /* 2 */ + border-collapse: collapse; + /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-feature-settings: inherit; + /* 1 */ + font-variation-settings: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + font-weight: inherit; + /* 1 */ + line-height: inherit; + /* 1 */ + color: inherit; + /* 1 */ + margin: 0; + /* 2 */ + padding: 0; + /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; + /* 1 */ + background-color: transparent; + /* 2 */ + background-image: none; + /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to `inherit` in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Reset default styling for dialogs. +*/ + +dialog { + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::-moz-placeholder, textarea::-moz-placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +input::placeholder, +textarea::placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role="button"] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ + +:disabled { + cursor: default; +} + +/* +1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; + /* 1 */ + vertical-align: middle; + /* 2 */ +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* Make elements with the HTML hidden attribute stay hidden by default */ + +[hidden] { + display: none; +} + +*, ::before, ::after{ + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-gradient-from-position: ; + --tw-gradient-via-position: ; + --tw-gradient-to-position: ; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} + +::backdrop{ + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-gradient-from-position: ; + --tw-gradient-via-position: ; + --tw-gradient-to-position: ; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} + +.absolute{ + position: absolute; +} + +.top-1\/3{ + top: 33.333333%; +} + +.m-10{ + margin: 2.5rem; +} + +.mx-auto{ + margin-left: auto; + margin-right: auto; +} + +.mt-4{ + margin-top: 1rem; +} + +.mt-8{ + margin-top: 2rem; +} + +.mb-10{ + margin-bottom: 2.5rem; +} + +.mb-24{ + margin-bottom: 6rem; +} + +.flex{ + display: flex; +} + +.grid{ + display: grid; +} + +.w-1\/2{ + width: 50%; +} + +.w-full{ + width: 100%; +} + +.grid-cols-2{ + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.flex-col{ + flex-direction: column; +} + +.items-center{ + align-items: center; +} + +.justify-center{ + justify-content: center; +} + +.gap-10{ + gap: 2.5rem; +} + +.divide-x > :not([hidden]) ~ :not([hidden]){ + --tw-divide-x-reverse: 0; + border-right-width: calc(1px * var(--tw-divide-x-reverse)); + border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))); +} + +.divide-solid > :not([hidden]) ~ :not([hidden]){ + border-style: solid; +} + +.rounded{ + border-radius: 0.25rem; +} + +.bg-black{ + --tw-bg-opacity: 1; + background-color: rgb(0 0 0 / var(--tw-bg-opacity)); +} + +.bg-white{ + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.bg-gradient-to-r{ + background-image: linear-gradient(to right, var(--tw-gradient-stops)); +} + +.from-rose-400{ + --tw-gradient-from: #fb7185 var(--tw-gradient-from-position); + --tw-gradient-to: rgb(251 113 133 / 0) var(--tw-gradient-to-position); + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); +} + +.to-sky-400{ + --tw-gradient-to: #38bdf8 var(--tw-gradient-to-position); +} + +.bg-clip-text{ + -webkit-background-clip: text; + background-clip: text; +} + +.p-2{ + padding: 0.5rem; +} + +.px-3{ + padding-left: 0.75rem; + padding-right: 0.75rem; +} + +.py-1{ + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + +.text-center{ + text-align: center; +} + +.font-inter{ + font-family: Inter; +} + +.text-6xl{ + font-size: 3.75rem; + line-height: 1; +} + +.text-2xl{ + font-size: 1.5rem; + line-height: 2rem; +} + +.text-3xl{ + font-size: 1.875rem; + line-height: 2.25rem; +} + +.text-4xl{ + font-size: 2.25rem; + line-height: 2.5rem; +} + +.text-5xl{ + font-size: 3rem; + line-height: 1; +} + +.font-black{ + font-weight: 900; +} + +.text-black{ + --tw-text-opacity: 1; + color: rgb(0 0 0 / var(--tw-text-opacity)); +} + +.text-transparent{ + color: transparent; +} + +.text-white{ + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} diff --git a/SiriLazor.WASM/wwwroot/index.html b/SiriLazor.WASM/wwwroot/index.html new file mode 100644 index 0000000..85c8ab0 --- /dev/null +++ b/SiriLazor.WASM/wwwroot/index.html @@ -0,0 +1,32 @@ + + + + + + + SiriLazor.WASM + + + + + +
+
+
+ +
+
+
+ +
+ An unhandled error has occurred. + Reload + 🗙 +
+ + + + + + + diff --git a/SiriLazor.sln b/SiriLazor.sln new file mode 100644 index 0000000..fd38a65 --- /dev/null +++ b/SiriLazor.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34205.153 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SiriLazor", "SiriLazor\SiriLazor.csproj", "{81383E6B-EA86-44D1-BC74-C083D6FD7C8F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SiriLazor.WASM", "SiriLazor.WASM\SiriLazor.WASM.csproj", "{D30D7C33-D7EB-45C8-BBD9-3C49F4E6A536}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resources", "resources", "{99534AA8-8AC6-42B6-BE1A-A4DF893A427D}" + ProjectSection(SolutionItems) = preProject + ..\..\..\OneDrive\Desktop\SiriLazor_160x160.png = ..\..\..\OneDrive\Desktop\SiriLazor_160x160.png + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81383E6B-EA86-44D1-BC74-C083D6FD7C8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81383E6B-EA86-44D1-BC74-C083D6FD7C8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81383E6B-EA86-44D1-BC74-C083D6FD7C8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81383E6B-EA86-44D1-BC74-C083D6FD7C8F}.Release|Any CPU.Build.0 = Release|Any CPU + {D30D7C33-D7EB-45C8-BBD9-3C49F4E6A536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D30D7C33-D7EB-45C8-BBD9-3C49F4E6A536}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D30D7C33-D7EB-45C8-BBD9-3C49F4E6A536}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D30D7C33-D7EB-45C8-BBD9-3C49F4E6A536}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DDD4E93C-4367-4316-B1C2-DB6F865B4977} + EndGlobalSection +EndGlobal diff --git a/SiriLazor/Component/Extentions/SiriLazorExtention.cs b/SiriLazor/Component/Extentions/SiriLazorExtention.cs new file mode 100644 index 0000000..6eab355 --- /dev/null +++ b/SiriLazor/Component/Extentions/SiriLazorExtention.cs @@ -0,0 +1,10 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace SiriLazor.Component.Extentions +{ + public static class SiriLazorExtention + { + public static IServiceCollection AddSiriLazor(this IServiceCollection services) => + services.AddScoped(); + } +} diff --git a/SiriLazor/Component/Interfaces/ICurveDefintion.cs b/SiriLazor/Component/Interfaces/ICurveDefintion.cs new file mode 100644 index 0000000..0749b69 --- /dev/null +++ b/SiriLazor/Component/Interfaces/ICurveDefintion.cs @@ -0,0 +1,8 @@ + +namespace SiriLazor.Component.Interfaces +{ + public interface ICurveDefintion + { + string Color { get; set; } + } +} diff --git a/SiriLazor/Component/Interfaces/IOptions.cs b/SiriLazor/Component/Interfaces/IOptions.cs new file mode 100644 index 0000000..5015bae --- /dev/null +++ b/SiriLazor/Component/Interfaces/IOptions.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Components; +using SiriLazor.Component.Interfaces; + +namespace SiriLazor; +public interface IOptions where TCurve : ICurveDefintion +{ + ElementReference Container { get; set; } + + string? Style { get; set; } + double? Ratio { get; set; } + double? Speed { get; set; } + double? Amplitude { get; set; } + bool? Cover { get; set; } + double? Width { get; set; } + double? Height { get; set; } + bool? Autostart { get; set; } + double? PixelDepth { get; set; } + double? LerpSpeed { get; set; } + IEnumerable? Definitions { get;} + string? GlobalCompositeOperation { get; set; } + +} \ No newline at end of file diff --git a/SiriLazor/Component/Interfaces/ISiriLazor.cs b/SiriLazor/Component/Interfaces/ISiriLazor.cs new file mode 100644 index 0000000..9190a03 --- /dev/null +++ b/SiriLazor/Component/Interfaces/ISiriLazor.cs @@ -0,0 +1,10 @@ +using SiriLazor.Component.Models; + +namespace SiriLazor +{ + public interface ISiriLazor + { + ValueTask InitSiriLazor(IOptions options); + ValueTask InitSiriLazor(IOptions options); + } +} diff --git a/SiriLazor/Component/Interfaces/IWaveOptionBuilder.cs b/SiriLazor/Component/Interfaces/IWaveOptionBuilder.cs new file mode 100644 index 0000000..36d2d2a --- /dev/null +++ b/SiriLazor/Component/Interfaces/IWaveOptionBuilder.cs @@ -0,0 +1,8 @@ + +namespace SiriLazor.Component.Interfaces +{ + public interface IWaveOptionBuilder where TCurve : ICurveDefintion + { + IOptions Build(); + } +} diff --git a/SiriLazor/Component/Models/ClassicWaveCurveDefintion.cs b/SiriLazor/Component/Models/ClassicWaveCurveDefintion.cs new file mode 100644 index 0000000..df1efd2 --- /dev/null +++ b/SiriLazor/Component/Models/ClassicWaveCurveDefintion.cs @@ -0,0 +1,14 @@ +using SiriLazor.Component.Interfaces; + + +namespace SiriLazor.Component.Models +{ + public class ClassicWaveCurveDefintion : ICurveDefintion + { + public string Color { get; set; } + + public int Attenuation { get; set; } + public int LineWidth { get; set; } + public int Opacity { get; set; } + } +} diff --git a/SiriLazor/Component/Models/ClassicWaveOptionBuilder.cs b/SiriLazor/Component/Models/ClassicWaveOptionBuilder.cs new file mode 100644 index 0000000..4337783 --- /dev/null +++ b/SiriLazor/Component/Models/ClassicWaveOptionBuilder.cs @@ -0,0 +1,154 @@ +using Microsoft.AspNetCore.Components; +using SiriLazor.Component.Interfaces; + +namespace SiriLazor.Component.Models +{ + internal class ClassicWaveOptionBuilder : IWaveOptionBuilder + { + private ElementReference Container; + private string? Style; + private string? GlobalCompositeOperation; + private double? Ratio; + private double? Speed; + private double? Amplitude; + private double? Frequency; + private string? Color; + private bool? Cover; + private double? Width; + private double? Height; + private bool? Autostart; + private double? PixelDepth; + private double? LerpSpeed; + private List? Definitions; + + public ClassicWaveOptionBuilder SetContainer(ElementReference container) + { + Container = container; + return this; + } + + public ClassicWaveOptionBuilder SetRatio(double? ratio) + { + Ratio = ratio; + return this; + } + + public ClassicWaveOptionBuilder SetSpeed(double? speed) + { + Speed = speed; + return this; + } + + + public ClassicWaveOptionBuilder SetAmplitude(double? amplitude) + { + Amplitude = amplitude; + return this; + } + public ClassicWaveOptionBuilder SetGlobalCompositeOperation(string globalCompositeOperation) + { + GlobalCompositeOperation = globalCompositeOperation; + return this; + } + + public ClassicWaveOptionBuilder SetFrequency(double? frequency) + { + Frequency = frequency; + return this; + } + + public ClassicWaveOptionBuilder SetColor(string? color) + { + Color = color; + return this; + } + + public ClassicWaveOptionBuilder SetCover(bool? cover) + { + Cover = cover; + return this; + } + + public ClassicWaveOptionBuilder SetWidth(double? width) + { + Width = width; + return this; + } + + public ClassicWaveOptionBuilder SetHeight(double? height) + { + Height = height; + return this; + } + + public ClassicWaveOptionBuilder SetAutostart(bool? autostart) + { + Autostart = autostart; + return this; + } + + public ClassicWaveOptionBuilder SetPixelDepth(double? pixelDepth) + { + PixelDepth = pixelDepth; + return this; + } + + public ClassicWaveOptionBuilder SetLerpSpeed(double? lerpSpeed) + { + LerpSpeed = lerpSpeed; + return this; + } + + public ClassicWaveOptionBuilder SetDefinitions(List definitions) + { + Definitions = definitions; + return this; + } + + public ClassicWaveOptionBuilder GetDefaultOptions(ElementReference Container) + { + + this.Container = Container; + Style = "ios"; + Ratio = 1.0; + Speed = 0.2; + Amplitude = 1.0; + Frequency = 6.0; + Color = "#ffffff"; + Cover = true; + Width = 640.0; + Height = 200.0; + Autostart = true; + PixelDepth = 0.02; + LerpSpeed = 0.01; + Definitions = null; + GlobalCompositeOperation = "lighter"; + + return this; + + } + public IOptions Build() + { + + + return new ClassicWaveOptions + { + Container = Container, + Style = "ios", + Ratio = Ratio, + Speed = Speed, + Amplitude = Amplitude, + Frequency = Frequency, + Color = Color, + Cover = Cover, + Width = Width, + Height = Height, + Autostart = Autostart, + PixelDepth = PixelDepth, + LerpSpeed = LerpSpeed, + Definitions = Definitions, + GlobalCompositeOperation = GlobalCompositeOperation + }; + } + } +} diff --git a/SiriLazor/Component/Models/ClassicWaveOptions.cs b/SiriLazor/Component/Models/ClassicWaveOptions.cs new file mode 100644 index 0000000..d27492b --- /dev/null +++ b/SiriLazor/Component/Models/ClassicWaveOptions.cs @@ -0,0 +1,49 @@ +using Microsoft.AspNetCore.Components; + +namespace SiriLazor.Component.Models +{ + internal record ClassicWaveOptions : IOptions + { + // The DOM container where the DOM canvas element will be added + public ElementReference Container { get; set; } + + public string? Style { get; set; } + + // Ratio of the display to use. Calculated by default. + public double? Ratio { get; set; } + + // The speed of the animation. + public double? Speed { get; set; } + + // The amplitude of the complete wave. + public double? Amplitude { get; set; } + + // The frequency for the complete wave (how many waves). - Not available in iOS9 Style + public double? Frequency { get; set; } + + // The color of the wave, in hexadecimal form (`#336699`, `#FF0`). - Not available in iOS9 Style + public string? Color { get; set; } + + // The `canvas` covers the entire width or height of the container. + public bool? Cover { get; set; } + + // Width of the canvas. Calculated by default. + public double? Width { get; set; } + + // Height of the canvas. Calculated by default. + public double? Height { get; set; } + + // Decide whether to start the animation on boot. + public bool? Autostart { get; set; } + + // Number of steps (in pixels) used when drawn on canvas. + public double? PixelDepth { get; set; } + + // Lerp speed to interpolate properties. + public double? LerpSpeed { get; set; } + public IEnumerable? Definitions { get; set; } + + public string? GlobalCompositeOperation { get; set; } + } + +} diff --git a/SiriLazor/Component/Models/GlobalCompositeOperation.cs b/SiriLazor/Component/Models/GlobalCompositeOperation.cs new file mode 100644 index 0000000..c488623 --- /dev/null +++ b/SiriLazor/Component/Models/GlobalCompositeOperation.cs @@ -0,0 +1,32 @@ +namespace SiriLazor.Component.Models +{ + public static class GlobalCompositeOperation + { + public static readonly string Color = "color"; + public static readonly string ColorBurn = "color-burn"; + public static readonly string ColorDodge = "color-dodge"; + public static readonly string Copy = "copy"; + public static readonly string Darken = "darken"; + public static readonly string DestinationAtop = "destination-atop"; + public static readonly string DestinationIn = "destination-in"; + public static readonly string DestinationOut = "destination-out"; + public static readonly string DestinationOver = "destination-over"; + public static readonly string Difference = "difference"; + public static readonly string Exclusion = "exclusion"; + public static readonly string HardLight = "hard-light"; + public static readonly string Hue = "hue"; + public static readonly string Lighten = "lighten"; + public static readonly string Lighter = "lighter"; + public static readonly string Luminosity = "luminosity"; + public static readonly string Multiply = "multiply"; + public static readonly string Overlay = "overlay"; + public static readonly string Saturation = "saturation"; + public static readonly string Screen = "screen"; + public static readonly string SoftLight = "soft-light"; + public static readonly string SourceAtop = "source-atop"; + public static readonly string SourceIn = "source-in"; + public static readonly string SourceOut = "source-out"; + public static readonly string SourceOver = "source-over"; + public static readonly string Xor = "xor"; + } +} diff --git a/SiriLazor/Component/Models/IOS9WaveCurveDefintion.cs b/SiriLazor/Component/Models/IOS9WaveCurveDefintion.cs new file mode 100644 index 0000000..2a448ad --- /dev/null +++ b/SiriLazor/Component/Models/IOS9WaveCurveDefintion.cs @@ -0,0 +1,11 @@ +using SiriLazor.Component.Interfaces; + + +namespace SiriLazor.Component.Models +{ + public class IOS9WaveCurveDefintion : ICurveDefintion + { + public string Color { get; set; } + public bool SupportLine { get; set; } + } +} diff --git a/SiriLazor/Component/Models/IOS9WaveOptionBuilder.cs b/SiriLazor/Component/Models/IOS9WaveOptionBuilder.cs new file mode 100644 index 0000000..362310e --- /dev/null +++ b/SiriLazor/Component/Models/IOS9WaveOptionBuilder.cs @@ -0,0 +1,140 @@ +using Microsoft.AspNetCore.Components; +using SiriLazor.Component.Interfaces; + +namespace SiriLazor.Component.Models +{ + internal class IOS9WaveOptionBuilder : IWaveOptionBuilder + { + private ElementReference Container; + private string? Style; + private string? GlobalCompositeOperation; + private double? Ratio; + private double? Speed; + private double? Amplitude; + private bool? Cover; + private double? Width; + private double? Height; + private bool? Autostart; + private double? PixelDepth; + private double? LerpSpeed; + private IOS9WaveRanges? iOS9Ranges; + private List? Definitions; + + public IOS9WaveOptionBuilder SetContainer(ElementReference container) + { + Container = container; + return this; + } + + public IOS9WaveOptionBuilder SetRatio(double? ratio) + { + Ratio = ratio; + return this; + } + + public IOS9WaveOptionBuilder SetSpeed(double? speed) + { + Speed = speed; + return this; + } + + public IOS9WaveOptionBuilder SetAmplitude(double? amplitude) + { + Amplitude = amplitude; + return this; + } + public IOS9WaveOptionBuilder SetGlobalCompositeOperation(string globalCompositeOperation) + { + GlobalCompositeOperation = globalCompositeOperation; + return this; + } + public IOS9WaveOptionBuilder SetCover(bool? cover) + { + Cover = cover; + return this; + } + + public IOS9WaveOptionBuilder SetWidth(double? width) + { + Width = width; + return this; + } + + public IOS9WaveOptionBuilder SetHeight(double? height) + { + Height = height; + return this; + } + + public IOS9WaveOptionBuilder SetAutostart(bool? autostart) + { + Autostart = autostart; + return this; + } + + public IOS9WaveOptionBuilder SetPixelDepth(double? pixelDepth) + { + PixelDepth = pixelDepth; + return this; + } + + public IOS9WaveOptionBuilder SetLerpSpeed(double? lerpSpeed) + { + LerpSpeed = lerpSpeed; + return this; + } + + public IOS9WaveOptionBuilder SetIOS9Ranges(IOS9WaveRanges ios9Ranges) + { + iOS9Ranges = ios9Ranges; + return this; + } + + public IOS9WaveOptionBuilder SetDefinitions(List definitions) + { + Definitions = definitions; + return this; + } + public IOS9WaveOptionBuilder GetDefaultOptions(ElementReference Container) + { + this.Container = Container; + Style = "ios"; + Ratio = 1.0; + Speed = 0.2; + Amplitude = 1.0; + Cover = true; + Width = 640.0; + Height = 200.0; + Autostart = true; + PixelDepth = 0.02; + LerpSpeed = 0.01; + Definitions = null; + GlobalCompositeOperation = "lighter"; + + return this; + + } + public IOptions Build() + { + + + return new IOS9WaveOptions + { + Container = Container, + Style = "ios9", + Ratio = Ratio, + Speed = Speed, + Amplitude = Amplitude, + Cover = Cover, + Width = Width, + Height = Height, + Autostart = Autostart, + PixelDepth = PixelDepth, + LerpSpeed = LerpSpeed, + iOS9Ranges = iOS9Ranges, + Definitions = Definitions, + GlobalCompositeOperation = GlobalCompositeOperation + }; + } + } +} diff --git a/SiriLazor/Component/Models/IOS9WaveOptions.cs b/SiriLazor/Component/Models/IOS9WaveOptions.cs new file mode 100644 index 0000000..dde67f5 --- /dev/null +++ b/SiriLazor/Component/Models/IOS9WaveOptions.cs @@ -0,0 +1,45 @@ +using Microsoft.AspNetCore.Components; + +namespace SiriLazor.Component.Models +{ + internal record IOS9WaveOptions : IOptions + { + // The DOM container where the DOM canvas element will be added + public ElementReference Container { get; set; } + + public string? Style { get; set; } + + // Ratio of the display to use. Calculated by default. + public double? Ratio { get; set; } + + + // The speed of the animation. + public double? Speed { get; set; } + + // The amplitude of the complete wave. + public double? Amplitude { get; set; } + + // The `canvas` covers the entire width or height of the container. + public bool? Cover { get; set; } + + // Width of the canvas. Calculated by default. + public double? Width { get; set; } + + // Height of the canvas. Calculated by default. + public double? Height { get; set; } + + // Decide whether to start the animation on boot. + public bool? Autostart { get; set; } + + // Number of steps (in pixels) used when drawn on canvas. + public double? PixelDepth { get; set; } + + // Lerp speed to interpolate properties. + public double? LerpSpeed { get; set; } + + public IOS9WaveRanges? iOS9Ranges { get; set; } + + public IEnumerable? Definitions { get; set; } + public string? GlobalCompositeOperation { get; set; } + } +} diff --git a/SiriLazor/Component/Models/IOS9WaveRanges.cs b/SiriLazor/Component/Models/IOS9WaveRanges.cs new file mode 100644 index 0000000..b29e566 --- /dev/null +++ b/SiriLazor/Component/Models/IOS9WaveRanges.cs @@ -0,0 +1,14 @@ +namespace SiriLazor.Component.Models +{ + public record IOS9WaveRanges + { + public double[] NoOfCurves { get; set; } = new double[2]; + public double[] Amplitude { get; set; } = new double[2]; + public double[] Offset { get; set; } = new double[2]; + public double[] Width { get; set; } = new double[2]; + public double[] Speed { get; set; } = new double[2]; + public double[] DespawnTimeout { get; set; } = new double[2]; + } + + +} diff --git a/SiriLazor/Component/Models/SiriObject.cs b/SiriLazor/Component/Models/SiriObject.cs new file mode 100644 index 0000000..2cb28d8 --- /dev/null +++ b/SiriLazor/Component/Models/SiriObject.cs @@ -0,0 +1,31 @@ +using Microsoft.JSInterop; + +namespace SiriLazor; + +public class SiriObject : IAsyncDisposable +{ + private readonly IJSRuntime jSRuntime; + public int Instance { get; set; } + + public SiriObject(IJSRuntime jSRuntime) + { + this.jSRuntime = jSRuntime; + } + + public async Task StartAnimation() => + await jSRuntime.InvokeVoidAsync("siriWave.start", Instance); + + public async Task StopAnimation() => + await jSRuntime.InvokeVoidAsync("siriWave.stop", Instance); + + public async Task SetSpeed(double newValue) => + await jSRuntime.InvokeVoidAsync("siriWave.setSpeed", newValue, Instance); + + public async Task SetAmplitude(double value) => + await jSRuntime.InvokeVoidAsync("siriWave.setAmplitude", value, Instance); + + public async ValueTask DisposeAsync() => + await jSRuntime.InvokeVoidAsync("siriWave.dispose", Instance); + + +} diff --git a/SiriLazor/Component/UI/ClassicWave.razor b/SiriLazor/Component/UI/ClassicWave.razor new file mode 100644 index 0000000..47c6259 --- /dev/null +++ b/SiriLazor/Component/UI/ClassicWave.razor @@ -0,0 +1,108 @@ +@inject ISiriLazor siriLazor; +@implements IAsyncDisposable; +@namespace SiriLazor.UI + +
+ +@code { + + public ElementReference siriContainer { get; set; } + + + [Parameter] + public double? Ratio { get; set; } + + [Parameter] + public double? Speed { get; set; } + + [Parameter] + public double? Amplitude { get; set; } + + [Parameter] + public double? Frequency { get; set; } + + [Parameter] + public string? Color { get; set; } + + [Parameter] + public bool? Cover { get; set; } + + [Parameter] + public double? Width { get; set; } + + [Parameter] + public double? Height { get; set; } + + [Parameter] + public bool? Autostart { get; set; } + + [Parameter] + public double? PixelDepth { get; set; } + + [Parameter] + public double? LerpSpeed { get; set; } + + [Parameter] + public IEnumerable? Definitions { get; set; } + + [Parameter] + public string? GlobalCompositeOperation { get; set; } + + [Parameter] + public bool SetDefaultOptions { get; set; } + + SiriObject? SiriObject { get; set; } + IOptions? opt; + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + var builder = new ClassicWaveOptionBuilder(); + if (SetDefaultOptions) + builder.GetDefaultOptions(siriContainer); + else + { + builder.SetContainer(siriContainer) + .SetAmplitude(Amplitude) + .SetRatio(Ratio) + .SetWidth(Width) + .SetColor(Color) + .SetFrequency(Frequency) + .SetHeight(Height) + .SetAutostart(Autostart) + .SetPixelDepth(PixelDepth) + .SetLerpSpeed(LerpSpeed) + .SetCover(Cover) + .SetDefinitions(Definitions?.ToList()) + .SetGlobalCompositeOperation(GlobalCompositeOperation); + } + + opt = builder.Build(); + SiriObject = await siriLazor.InitSiriLazor(opt); + } + + } + + public async Task Stop() + { + await SiriObject!.StopAnimation(); + } + public async Task Start() + { + await SiriObject!.StartAnimation(); + } + public async Task SetSpeed(double value) + { + await SiriObject!.SetSpeed(value); + } + public async Task SetAmplitude(double value) + { + await SiriObject!.SetAmplitude(value); + } + + public async ValueTask DisposeAsync() + { + await SiriObject!.DisposeAsync(); + } +} diff --git a/SiriLazor/Component/UI/IOS9Wave.razor b/SiriLazor/Component/UI/IOS9Wave.razor new file mode 100644 index 0000000..ea2f6f6 --- /dev/null +++ b/SiriLazor/Component/UI/IOS9Wave.razor @@ -0,0 +1,107 @@ +@inject ISiriLazor siriLazor; +@implements IAsyncDisposable; +@namespace SiriLazor.UI + +
+ +@code { + + public ElementReference siriContainer { get; set; } + + [Parameter] + public double? Ratio { get; set; } + + [Parameter] + public double? Speed { get; set; } + + [Parameter] + public double? Amplitude { get; set; } + + [Parameter] + public bool? Cover { get; set; } + + [Parameter] + public double? Width { get; set; } + + [Parameter] + public double? Height { get; set; } + + [Parameter] + public bool? Autostart { get; set; } + + [Parameter] + public double? PixelDepth { get; set; } + + [Parameter] + public double? LerpSpeed { get; set; } + + [Parameter] + public IOS9WaveRanges? iOS9Ranges { get; set; } + + [Parameter] + public IEnumerable? Definitions { get; set; } + + [Parameter] + + public string? GlobalCompositeOperation { get; set; } + + [Parameter] + public bool SetDefaultOptions { get; set; } + + + SiriObject? SiriObject { get; set; } + IOptions? opt; + + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + var builder = new IOS9WaveOptionBuilder(); + if (SetDefaultOptions) + { + builder.GetDefaultOptions(siriContainer); + } + else + { + builder.SetContainer(siriContainer) + .SetAmplitude(Amplitude) + .SetRatio(Ratio) + .SetWidth(Width) + .SetHeight(Height) + .SetAutostart(Autostart) + .SetPixelDepth(PixelDepth) + .SetLerpSpeed(LerpSpeed) + .SetCover(Cover) + .SetDefinitions(Definitions?.ToList()) + .SetGlobalCompositeOperation(GlobalCompositeOperation); + } + + opt = builder.Build(); + SiriObject = await siriLazor.InitSiriLazor(opt); + } + + } + + public async Task Stop() + { + await SiriObject!.StopAnimation(); + } + public async Task Start() + { + await SiriObject!.StartAnimation(); + } + public async Task SetSpeed(double value) + { + await SiriObject!.SetSpeed(value); + } + public async Task SetAmplitude(double value) + { + await SiriObject!.SetAmplitude(value); + } + + public async ValueTask DisposeAsync() + { + await SiriObject!.DisposeAsync(); + } +} diff --git a/SiriLazor/SiriLazor.cs b/SiriLazor/SiriLazor.cs new file mode 100644 index 0000000..580357e --- /dev/null +++ b/SiriLazor/SiriLazor.cs @@ -0,0 +1,38 @@ + +using Microsoft.JSInterop; +using SiriLazor.Component.Models; + + +namespace SiriLazor.Component +{ + + public partial class SiriLazor : ISiriLazor , IAsyncDisposable + { + private readonly IJSRuntime jSRuntime; + public SiriLazor(IJSRuntime jSRuntime) + { + this.jSRuntime = (jSRuntime is not null) + ? jSRuntime + : throw new ArgumentNullException(nameof(jSRuntime)); + + } + + public async ValueTask InitSiriLazor(IOptions options) + { + var instance = await jSRuntime.InvokeAsync("siriWave.initIOS", options); + return new SiriObject(jSRuntime) { Instance = instance }; + } + + + public async ValueTask InitSiriLazor(IOptions options) + { + var instance = await jSRuntime.InvokeAsync("siriWave.initIOS9", options); + return new SiriObject(jSRuntime) { Instance = instance }; + } + + public async ValueTask DisposeAsync() => + await jSRuntime.InvokeVoidAsync("siriWave.disposeAll"); + + + } +} diff --git a/SiriLazor/SiriLazor.csproj b/SiriLazor/SiriLazor.csproj new file mode 100644 index 0000000..5c848a2 --- /dev/null +++ b/SiriLazor/SiriLazor.csproj @@ -0,0 +1,26 @@ + + + ES6 + + + ES6 + + + net8.0 + enable + enable + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + \ No newline at end of file diff --git a/SiriLazor/_Imports.razor b/SiriLazor/_Imports.razor new file mode 100644 index 0000000..575c759 --- /dev/null +++ b/SiriLazor/_Imports.razor @@ -0,0 +1,3 @@ +@using Microsoft.AspNetCore.Components.Web +@using global::SiriLazor.Component.Interfaces +@using global::SiriLazor.Component.Models diff --git a/SiriLazor/wwwroot/siriLazorInterop.js b/SiriLazor/wwwroot/siriLazorInterop.js new file mode 100644 index 0000000..ffc840e --- /dev/null +++ b/SiriLazor/wwwroot/siriLazorInterop.js @@ -0,0 +1,100 @@ +window.sw = []; + +window.siriWave = { + initIOS: function (options) { + let instance = new SiriWave({ + container: options.container, + style: 'ios', + ratio: options.ratio || 1.0, + speed: options.speed || 0.2, + amplitude: options.amplitude || 1.0, + frequency: options.frequency || 6.0, + color: options.color || '#ffffff', + cover: options.cover || true, + width: options.width || 640.0, + height: options.height || 200.0, + autostart: options.autostart || true, + pixelDepth: options.pixelDepth || 0.02, + lerpSpeed: options.lerpSpeed || 0.01 + + + }); + + window.sw.push(instance); + + // Get the index of the pushed instance + const instanceIndex = window.sw.indexOf(instance); + + return instanceIndex; + + }, + initIOS9: function (options) { + let instance = new SiriWave({ + container: options.container, + style: 'ios9', + ratio: options.ratio || 1.0, + speed: options.speed || 0.2, + amplitude: options.amplitude || 1.0, + cover: options.cover || true, + width: options.width || 640.0, + height: options.height || 200.0, + autostart: options.autostart || true, + pixelDepth: options.pixelDepth || 0.02, + lerpSpeed: options.lerpSpeed || 0.01, + ranges: options.iOS9Ranges, + globalCompositeOperation: options.globalCompositeOperation || 'lighter', + curveDefinition: options.definitions + + }); + + window.sw.push(instance); + + // Get the index of the pushed instance + const instanceIndex = window.sw.indexOf(instance); + + return instanceIndex; + + + }, + + start: function (instance) { + if (window.sw[instance] !== null) { + window.sw[instance].start(); + } + }, + + stop: function (instance) { + if (window.sw[instance] != null) { + window.sw[instance].stop(); + } + }, + + setSpeed: function (newValue, instance) { + if (window.sw[instance] !== null) { + window.sw[instance].setSpeed(newValue); + } + }, + + setAmplitude: function (value, instance) { + if (window.sw[instance] !== null) { + window.sw[instance].setAmplitude(value); + } + }, + + dispose: function (instance) { + if (window.sw[instance] !== null) { + window.sw[instance].dispose(); + window.sw[instance] = null; + } + }, + + disposeAll: function () { + if (window.sw !== null) { + for (var i = 0; i < sw.length; i++) { + window.sw[i].dispose(); + window.sw[i] = null; + } + } + window.sw = null; + } +}; diff --git a/SiriLazor/wwwroot/siriWave.js b/SiriLazor/wwwroot/siriWave.js new file mode 100644 index 0000000..1ca8adf --- /dev/null +++ b/SiriLazor/wwwroot/siriWave.js @@ -0,0 +1,4 @@ +!function (t, i) { "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = "undefined" != typeof globalThis ? globalThis : t || self).SiriWave = i() }(this, (function () { + "use strict"; + var t = function () { return t = Object.assign || function (t) { for (var i, s = 1, e = arguments.length; s < e; s++)for (var o in i = arguments[s]) Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]); return t }, t.apply(this, arguments) }; var i = function () { function t(t, i) { this.ATT_FACTOR = 4, this.GRAPH_X = 2, this.AMPLITUDE_FACTOR = .6, this.ctrl = t, this.definition = i } return t.prototype.globalAttFn = function (t) { return Math.pow(this.ATT_FACTOR / (this.ATT_FACTOR + Math.pow(t, this.ATT_FACTOR)), this.ATT_FACTOR) }, t.prototype.xPos = function (t) { return this.ctrl.width * ((t + this.GRAPH_X) / (2 * this.GRAPH_X)) }, t.prototype.yPos = function (t) { return this.AMPLITUDE_FACTOR * (this.globalAttFn(t) * (this.ctrl.heightMax * this.ctrl.amplitude) * (1 / this.definition.attenuation) * Math.sin(this.ctrl.opt.frequency * t - this.ctrl.phase)) }, t.prototype.draw = function () { var t = this.ctrl.ctx; t.moveTo(0, 0), t.beginPath(); var i = (this.definition.color || this.ctrl.color).replace(/rgb\(/g, "").replace(/\)/g, ""); t.strokeStyle = "rgba(".concat(i, ",").concat(this.definition.opacity, ")"), t.lineWidth = this.definition.lineWidth; for (var s = -this.GRAPH_X; s <= this.GRAPH_X; s += this.ctrl.opt.pixelDepth)t.lineTo(this.xPos(s), this.ctrl.heightMax + this.yPos(s)); t.stroke() }, t.getDefinition = function () { return [{ attenuation: -2, lineWidth: 1, opacity: .1 }, { attenuation: -6, lineWidth: 1, opacity: .2 }, { attenuation: 4, lineWidth: 1, opacity: .4 }, { attenuation: 2, lineWidth: 1, opacity: .6 }, { attenuation: 1, lineWidth: 1.5, opacity: 1 }] }, t }(), s = function () { function t(t, i) { this.GRAPH_X = 25, this.AMPLITUDE_FACTOR = .8, this.SPEED_FACTOR = 1, this.DEAD_PX = 2, this.ATT_FACTOR = 4, this.DESPAWN_FACTOR = .02, this.DEFAULT_NOOFCURVES_RANGES = [2, 5], this.DEFAULT_AMPLITUDE_RANGES = [.3, 1], this.DEFAULT_OFFSET_RANGES = [-3, 3], this.DEFAULT_WIDTH_RANGES = [1, 3], this.DEFAULT_SPEED_RANGES = [.5, 1], this.DEFAULT_DESPAWN_TIMEOUT_RANGES = [500, 2e3], this.ctrl = t, this.definition = i, this.noOfCurves = 0, this.spawnAt = 0, this.prevMaxY = 0, this.phases = [], this.offsets = [], this.speeds = [], this.finalAmplitudes = [], this.widths = [], this.amplitudes = [], this.despawnTimeouts = [], this.verses = [] } return t.prototype.getRandomRange = function (t) { return t[0] + Math.random() * (t[1] - t[0]) }, t.prototype.spawnSingle = function (t) { var i, s, e, o, n, h, r, a, p, l; this.phases[t] = 0, this.amplitudes[t] = 0, this.despawnTimeouts[t] = this.getRandomRange(null !== (s = null === (i = this.ctrl.opt.ranges) || void 0 === i ? void 0 : i.despawnTimeout) && void 0 !== s ? s : this.DEFAULT_DESPAWN_TIMEOUT_RANGES), this.offsets[t] = this.getRandomRange(null !== (o = null === (e = this.ctrl.opt.ranges) || void 0 === e ? void 0 : e.offset) && void 0 !== o ? o : this.DEFAULT_OFFSET_RANGES), this.speeds[t] = this.getRandomRange(null !== (h = null === (n = this.ctrl.opt.ranges) || void 0 === n ? void 0 : n.speed) && void 0 !== h ? h : this.DEFAULT_SPEED_RANGES), this.finalAmplitudes[t] = this.getRandomRange(null !== (a = null === (r = this.ctrl.opt.ranges) || void 0 === r ? void 0 : r.amplitude) && void 0 !== a ? a : this.DEFAULT_AMPLITUDE_RANGES), this.widths[t] = this.getRandomRange(null !== (l = null === (p = this.ctrl.opt.ranges) || void 0 === p ? void 0 : p.width) && void 0 !== l ? l : this.DEFAULT_WIDTH_RANGES), this.verses[t] = this.getRandomRange([-1, 1]) }, t.prototype.getEmptyArray = function (t) { return new Array(t) }, t.prototype.spawn = function () { var t, i; this.spawnAt = Date.now(), this.noOfCurves = Math.floor(this.getRandomRange(null !== (i = null === (t = this.ctrl.opt.ranges) || void 0 === t ? void 0 : t.noOfCurves) && void 0 !== i ? i : this.DEFAULT_NOOFCURVES_RANGES)), this.phases = this.getEmptyArray(this.noOfCurves), this.offsets = this.getEmptyArray(this.noOfCurves), this.speeds = this.getEmptyArray(this.noOfCurves), this.finalAmplitudes = this.getEmptyArray(this.noOfCurves), this.widths = this.getEmptyArray(this.noOfCurves), this.amplitudes = this.getEmptyArray(this.noOfCurves), this.despawnTimeouts = this.getEmptyArray(this.noOfCurves), this.verses = this.getEmptyArray(this.noOfCurves); for (var s = 0; s < this.noOfCurves; s++)this.spawnSingle(s) }, t.prototype.globalAttFn = function (t) { return Math.pow(this.ATT_FACTOR / (this.ATT_FACTOR + Math.pow(t, 2)), this.ATT_FACTOR) }, t.prototype.sin = function (t, i) { return Math.sin(t - i) }, t.prototype.yRelativePos = function (t) { for (var i = 0, s = 0; s < this.noOfCurves; s++) { var e = 4 * (s / (this.noOfCurves - 1) * 2 - 1); e += this.offsets[s]; var o = t * (1 / this.widths[s]) - e; i += Math.abs(this.amplitudes[s] * this.sin(this.verses[s] * o, this.phases[s]) * this.globalAttFn(o)) } return i / this.noOfCurves }, t.prototype.yPos = function (t) { return this.AMPLITUDE_FACTOR * this.ctrl.heightMax * this.ctrl.amplitude * this.yRelativePos(t) * this.globalAttFn(t / this.GRAPH_X * 2) }, t.prototype.xPos = function (t) { return this.ctrl.width * ((t + this.GRAPH_X) / (2 * this.GRAPH_X)) }, t.prototype.drawSupportLine = function () { var t = this.ctrl.ctx, i = [0, this.ctrl.heightMax, this.ctrl.width, 1], s = t.createLinearGradient.apply(t, i); s.addColorStop(0, "transparent"), s.addColorStop(.1, "rgba(255,255,255,.5)"), s.addColorStop(.8, "rgba(255,255,255,.5)"), s.addColorStop(1, "transparent"), t.fillStyle = s, t.fillRect.apply(t, i) }, t.prototype.draw = function () { var t = this.ctrl.ctx; if (t.globalAlpha = .7, t.globalCompositeOperation = this.ctrl.opt.globalCompositeOperation, 0 === this.spawnAt && this.spawn(), this.definition.supportLine) return this.drawSupportLine(); for (var i = 0; i < this.noOfCurves; i++)this.spawnAt + this.despawnTimeouts[i] <= Date.now() ? this.amplitudes[i] -= this.DESPAWN_FACTOR : this.amplitudes[i] += this.DESPAWN_FACTOR, this.amplitudes[i] = Math.min(Math.max(this.amplitudes[i], 0), this.finalAmplitudes[i]), this.phases[i] = (this.phases[i] + this.ctrl.speed * this.speeds[i] * this.SPEED_FACTOR) % (2 * Math.PI); for (var s = -1 / 0, e = 0, o = [1, -1]; e < o.length; e++) { var n = o[e]; t.beginPath(); for (var h = -this.GRAPH_X; h <= this.GRAPH_X; h += this.ctrl.opt.pixelDepth) { var r = this.xPos(h), a = this.yPos(h); t.lineTo(r, this.ctrl.heightMax - n * a), s = Math.max(s, a) } t.closePath(), t.fillStyle = "rgba(".concat(this.definition.color, ", 1)"), t.strokeStyle = "rgba(".concat(this.definition.color, ", 1)"), t.fill() } return s < this.DEAD_PX && this.prevMaxY > s && (this.spawnAt = 0), this.prevMaxY = s, null }, t.getDefinition = function () { return [{ color: "255,255,255", supportLine: !0 }, { color: "15, 82, 169" }, { color: "173, 57, 76" }, { color: "48, 220, 155" }] }, t }(); return function () { function e(e) { var o = this, n = e.container, h = function (t, i) { var s = {}; for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && i.indexOf(e) < 0 && (s[e] = t[e]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var o = 0; for (e = Object.getOwnPropertySymbols(t); o < e.length; o++)i.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[o]) && (s[e[o]] = t[e[o]]) } return s }(e, ["container"]); this.phase = 0, this.run = !1, this.curves = []; var r = window.getComputedStyle(n); this.opt = t({ container: n, style: "ios", ratio: window.devicePixelRatio || 1, speed: .2, amplitude: 1, frequency: 6, color: "#fff", cover: !1, width: parseInt(r.width.replace("px", ""), 10), height: parseInt(r.height.replace("px", ""), 10), autostart: !0, pixelDepth: .02, lerpSpeed: .1, globalCompositeOperation: "lighter" }, h), this.speed = Number(this.opt.speed), this.amplitude = Number(this.opt.amplitude), this.width = Number(this.opt.ratio * this.opt.width), this.height = Number(this.opt.ratio * this.opt.height), this.heightMax = Number(this.height / 2) - 6, this.color = "rgb(".concat(this.hex2rgb(this.opt.color), ")"), this.interpolation = { speed: this.speed, amplitude: this.amplitude }, this.canvas = document.createElement("canvas"); var a = this.canvas.getContext("2d"); if (null === a) throw new Error("Unable to create 2D Context"); if (this.ctx = a, this.canvas.width = this.width, this.canvas.height = this.height, !0 === this.opt.cover ? this.canvas.style.width = this.canvas.style.height = "100%" : (this.canvas.style.width = "".concat(this.width / this.opt.ratio, "px"), this.canvas.style.height = "".concat(this.height / this.opt.ratio, "px")), "ios9" === this.opt.style) this.curves = (this.opt.curveDefinition || s.getDefinition()).map((function (t) { return new s(o, t) })); else this.curves = (this.opt.curveDefinition || i.getDefinition()).map((function (t) { return new i(o, t) })); this.opt.container.appendChild(this.canvas), this.opt.autostart && this.start() } return e.prototype.hex2rgb = function (t) { t = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (function (t, i, s, e) { return i + i + s + s + e + e })); var i = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t); return i ? "".concat(parseInt(i[1], 16).toString(), ",").concat(parseInt(i[2], 16).toString(), ",").concat(parseInt(i[3], 16).toString()) : null }, e.prototype.intLerp = function (t, i, s) { return t * (1 - s) + i * s }, e.prototype.lerp = function (t) { var i = this.interpolation[t]; return null !== i && (this[t] = this.intLerp(this[t], i, this.opt.lerpSpeed), this[t] - i == 0 && (this.interpolation[t] = null)), this[t] }, e.prototype.clear = function () { this.ctx.globalCompositeOperation = "destination-out", this.ctx.fillRect(0, 0, this.width, this.height), this.ctx.globalCompositeOperation = "source-over" }, e.prototype.draw = function () { this.curves.forEach((function (t) { return t.draw() })) }, e.prototype.startDrawCycle = function () { this.clear(), this.lerp("amplitude"), this.lerp("speed"), this.draw(), this.phase = (this.phase + Math.PI / 2 * this.speed) % (2 * Math.PI), window.requestAnimationFrame ? this.animationFrameId = window.requestAnimationFrame(this.startDrawCycle.bind(this)) : this.timeoutId = setTimeout(this.startDrawCycle.bind(this), 20) }, e.prototype.start = function () { if (!this.canvas) throw new Error("This instance of SiriWave has been disposed, please create a new instance"); this.phase = 0, this.run || (this.run = !0, this.startDrawCycle()) }, e.prototype.stop = function () { this.phase = 0, this.run = !1, this.animationFrameId && window.cancelAnimationFrame(this.animationFrameId), this.timeoutId && clearTimeout(this.timeoutId) }, e.prototype.dispose = function () { this.stop(), this.canvas && (this.canvas.remove(), this.canvas = null) }, e.prototype.set = function (t, i) { this.interpolation[t] = i }, e.prototype.setSpeed = function (t) { this.set("speed", t) }, e.prototype.setAmplitude = function (t) { this.set("amplitude", t) }, e }() +})); \ No newline at end of file