<link rel="icon" href="#">
<script type="module">
try {
+ const {hostname, port} = new URL(window.location)
let NanoPow, Cache, stats
- try {
+ if (port && hostname === '127.0.0.1') {
NanoPow = await import('../dist/index.js')
- } catch (err) {
- console.warn(err)
+ } else {
try {
NanoPow = await import('https://unpkg.com/nano-pow@5.2/dist/index.js')
} catch (err) {
}
}
- try {
+ if (port && hostname === '127.0.0.1') {
({ Cache, stats } = await import('../dist/utils/index.js'))
- } catch (err) {
- console.warn(err)
+ } else {
try {
({ Cache, stats } = await import('https://unpkg.com/nano-pow@5.2/dist/utils/index.js'))
} catch (err) {
async function run (size, difficulty, effort, api, isOutputShown, isDebug, isSelfCheck) {
// Generate once on load to compile shaders and initialize buffers
- await NanoPow.work_generate(random(), { api, difficulty: '0', debug: isDebug})
+ await NanoPow.work_generate(random(), { api, difficulty: '0', debug: isDebug })
const type = api
api = type.toLowerCase()
if (isSelfCheck) {