-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b089ec0
commit 82638ac
Showing
21 changed files
with
329 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ module.exports = { | |
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} | ||
{ | ||
"name": "", | ||
"short_name": "", | ||
"icons": [ | ||
{ | ||
"src": "/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/android-chrome-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"theme_color": "#ffffff", | ||
"background_color": "#ffffff", | ||
"display": "standalone" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
import {$, component$, useOnDocument, useStore} from "@builder.io/qwik"; | ||
import { $, component$, useOnDocument, useStore } from "@builder.io/qwik"; | ||
|
||
const useBrowserInformation = () => { | ||
const store = useStore({ | ||
userAgent: '', | ||
}) | ||
const store = useStore({ | ||
userAgent: "", | ||
}); | ||
|
||
useOnDocument('load', $(() => { | ||
store.userAgent = navigator.userAgent; | ||
})); | ||
useOnDocument( | ||
"load", | ||
$(() => { | ||
store.userAgent = navigator.userAgent; | ||
}) | ||
); | ||
|
||
return store; | ||
} | ||
return store; | ||
}; | ||
|
||
export default component$(() => { | ||
const browser = useBrowserInformation(); | ||
const browser = useBrowserInformation(); | ||
|
||
return (<section class="bg-[#FF6D28] hover:bg-opacity-60 transition-colors bg-opacity-5 rounded-2xl p-6 xl:p-18 flex flex-col justify-center items-stretch"> | ||
<h3 class="text-2xl mb-4">Browser</h3> | ||
return ( | ||
<section class="bg-[#FF6D28] hover:bg-opacity-60 transition-colors bg-opacity-5 rounded-2xl p-6 xl:p-18 flex flex-col justify-center items-stretch"> | ||
<h3 class="text-2xl mb-4">Browser</h3> | ||
|
||
<div class="grid grid-cols-1 lg:grid-cols-3 auto-rows-fr gap-4 flex-1"> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl col-span-3"> | ||
<h5 class="text-lg">user agent</h5> | ||
<div class="font-mono flex-1 flex items-center"> | ||
{browser.userAgent} | ||
</div> | ||
</div> | ||
<div class="grid grid-cols-1 lg:grid-cols-3 auto-rows-fr gap-4 flex-1"> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl col-span-3"> | ||
<h5 class="text-lg">user agent</h5> | ||
<div class="font-mono flex-1 flex items-center"> | ||
{browser.userAgent} | ||
</div> | ||
</div> | ||
</section>); | ||
</div> | ||
</section> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
import {$, component$, useOnDocument, useStore} from "@builder.io/qwik"; | ||
import { $, component$, useOnDocument, useStore } from "@builder.io/qwik"; | ||
|
||
const useHostInformation = () => { | ||
const store = useStore({ | ||
platform: '', | ||
memory: '', | ||
online: false, | ||
}) | ||
const store = useStore({ | ||
platform: "", | ||
memory: "", | ||
online: false, | ||
}); | ||
|
||
useOnDocument('load', $(() => { | ||
store.platform = navigator.platform; | ||
// @ts-ignore | ||
store.memory = navigator.deviceMemory ?? '-'; | ||
store.online = navigator.onLine; | ||
})); | ||
useOnDocument( | ||
"load", | ||
$(() => { | ||
store.platform = navigator.platform; | ||
// @ts-ignore | ||
store.memory = navigator.deviceMemory ?? "-"; | ||
store.online = navigator.onLine; | ||
}) | ||
); | ||
|
||
return store; | ||
} | ||
return store; | ||
}; | ||
|
||
export default component$(() => { | ||
const host = useHostInformation(); | ||
const host = useHostInformation(); | ||
|
||
return (<section class="bg-[#FF6D28] hover:bg-opacity-60 transition-colors bg-opacity-5 rounded-2xl p-6 xl:p-18 flex flex-col justify-center items-stretch"> | ||
<h3 class="text-2xl mb-4">Host</h3> | ||
return ( | ||
<section class="bg-[#FF6D28] hover:bg-opacity-60 transition-colors bg-opacity-5 rounded-2xl p-6 xl:p-18 flex flex-col justify-center items-stretch"> | ||
<h3 class="text-2xl mb-4">Host</h3> | ||
|
||
<div class="grid grid-cols-1 lg:grid-cols-3 auto-rows-fr gap-4 flex-1"> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl"> | ||
<h5 class="text-lg">platform</h5> | ||
<div class="font-mono flex-1 flex items-center"> | ||
{host.platform} | ||
</div> | ||
</div> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl"> | ||
<h5 class="text-lg">memory</h5> | ||
<div class="font-mono flex-1 flex items-center"> | ||
{host.memory} | ||
</div> | ||
</div> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl"> | ||
<h5 class="text-lg">online</h5> | ||
<div class="font-mono flex-1 flex items-center"> | ||
{host.online ? '✅' : '❎'} | ||
</div> | ||
</div> | ||
<div class="grid grid-cols-1 lg:grid-cols-3 auto-rows-fr gap-4 flex-1"> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl"> | ||
<h5 class="text-lg">platform</h5> | ||
<div class="font-mono flex-1 flex items-center">{host.platform}</div> | ||
</div> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl"> | ||
<h5 class="text-lg">memory</h5> | ||
<div class="font-mono flex-1 flex items-center">{host.memory}</div> | ||
</div> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl"> | ||
<h5 class="text-lg">online</h5> | ||
<div class="font-mono flex-1 flex items-center"> | ||
{host.online ? "✅" : "❎"} | ||
</div> | ||
</div> | ||
</section>); | ||
</div> | ||
</section> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,53 @@ | ||
import {$, component$, useSignal} from "@builder.io/qwik"; | ||
import {checkIfBrowserSupported, takeScreenshot} from "@xata.io/screenshot"; | ||
import { $, component$, useSignal } from "@builder.io/qwik"; | ||
import { checkIfBrowserSupported, takeScreenshot } from "@xata.io/screenshot"; | ||
|
||
export default component$(() => { | ||
const image = useSignal<string>(); | ||
const image = useSignal<string>(); | ||
|
||
const saveAsImage = $(async () => { | ||
if (checkIfBrowserSupported()) { | ||
image.value = await takeScreenshot(); | ||
} | ||
}); | ||
const saveAsImage = $(async () => { | ||
if (checkIfBrowserSupported()) { | ||
image.value = await takeScreenshot(); | ||
} | ||
}); | ||
|
||
const share = $(() => { | ||
const data = { | ||
url: 'https://runningon.dev/', | ||
title: 'runningon.dev' | ||
}; | ||
const share = $(() => { | ||
const data = { | ||
url: "https://runningon.dev/", | ||
title: "runningon.dev", | ||
}; | ||
|
||
if (navigator.canShare(data)) { | ||
navigator.share(data); | ||
} | ||
}); | ||
if (navigator.canShare(data)) { | ||
navigator.share(data); | ||
} | ||
}); | ||
|
||
return <section class="bg-[#F2DEBA] transition-colors bg-opacity-5 rounded-2xl p-6 xl:p-18 grid grid-cols-3 grid-rows-1 gap-4"> | ||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl bg-navy bg-opacity-10 hover:bg-opacity-60 transition-colors" onClick$={share}> | ||
<div class="font-mono flex-1 flex items-center"> | ||
share | ||
</div> | ||
</div> | ||
return ( | ||
<section class="bg-[#F2DEBA] transition-colors bg-opacity-5 rounded-2xl p-6 xl:p-18 grid grid-cols-3 grid-rows-1 gap-4"> | ||
<div | ||
class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl bg-navy bg-opacity-10 hover:bg-opacity-60 transition-colors" | ||
onClick$={share} | ||
> | ||
<div class="font-mono flex-1 flex items-center">share</div> | ||
</div> | ||
|
||
<div class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl bg-navy bg-opacity-10 hover:bg-opacity-60 transition-colors cursor-pointer" onClick$={saveAsImage}> | ||
<div class="font-mono flex-1 flex items-center"> | ||
save as image | ||
</div> | ||
<div | ||
class="p-4 xl:p-8 flex flex-col justify-center items-center border-1 rounded-2xl bg-navy bg-opacity-10 hover:bg-opacity-60 transition-colors cursor-pointer" | ||
onClick$={saveAsImage} | ||
> | ||
<div class="font-mono flex-1 flex items-center">save as image</div> | ||
|
||
{image.value ? <a href={image.value} download target="_blank"> | ||
<div class="w-48 h-48 sm:h-36 sm:w-36 rounded-full border-4 border-light shadow-lg hover:shadow-2xl transition-shadow"> | ||
<img class="rounded-full object-cover w-full h-full" src={image.value} alt="screenshot" /> | ||
</div> | ||
</a> : null} | ||
</div> | ||
{image.value ? ( | ||
<a href={image.value} download target="_blank"> | ||
<div class="w-48 h-48 sm:h-36 sm:w-36 rounded-full border-4 border-light shadow-lg hover:shadow-2xl transition-shadow"> | ||
<img | ||
class="rounded-full object-cover w-full h-full" | ||
src={image.value} | ||
alt="screenshot" | ||
/> | ||
</div> | ||
</a> | ||
) : null} | ||
</div> | ||
</section> | ||
); | ||
}); |
Oops, something went wrong.