Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #5

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const paskaOvo = new PaskaOvo(
paskaOvo.listen();
```

Check the [example](https://egamagz.github.io/paska-ovo/) with [source code](https://github.com/EGAMAGZ/paska-ovo/tree/master/example).

## Credits

Inspired by the project [Egg.js](https://github.com/mikeflynn/egg.js) and [La Velada Web](https://github.com/midudev/la-velada-web-oficial). Created by [EGAMAGZ](https://github.com/EGAMAGZ).
Expand Down
25 changes: 25 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@egamagz/paska-ovo": "npm:@jsr/egamagz__paska-ovo@^0.1.2",
"@preact/signals": "^1.2.3",
"@preact/signals-core": "^1.6.0",
"@tabler/icons-preact": "^3.3.0",
"astro": "^4.6.3",
"preact": "^10.20.2",
"tailwindcss": "^3.4.3",
Expand Down
2 changes: 1 addition & 1 deletion example/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions example/src/components/Badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { type ComponentChildren } from "preact";

interface Props {
text: string
url: string
children: ComponentChildren
}

export default function Badge({ text, url, children }: Props) {
return (
<a href={url} target="_blank" class="flex flex-row bg-red-500 text-black font-bold py-2 px-4 border-2 border-black border-solid">
{children} <span>{text}</span>
</a>
);
}
7 changes: 2 additions & 5 deletions example/src/components/EasterEgg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ export default function EasterEgg() {
})

return (
<div class="w-screen h-screen bg-red-300 flex flex-col justify-center items-center relative">
<div class={`w-96 h-48 transition-all ${easterEggStatus.value === EasterEggStatus.Awesome ? "rainbow-border p-2" : ""} ${easterEggStatus.value === EasterEggStatus.BarrelRoll ? "animate-spin" : ""}`}>
<Title showKonami={easterEggStatus.value === EasterEggStatus.Konami} />
</div>
<span class="text-3xl font-thin">Find the easter eggs!</span>
<div class={`w-96 h-48 transition-all ${easterEggStatus.value === EasterEggStatus.Awesome ? "rainbow-border p-2" : ""} ${easterEggStatus.value === EasterEggStatus.BarrelRoll ? "animate-spin" : ""}`}>
<Title showKonami={easterEggStatus.value === EasterEggStatus.Konami} />
</div>
);
}
5 changes: 5 additions & 0 deletions example/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
name="description"
content="Paska Ovo: A simple javascript library for adding easter eggs to web pages."
/>
<meta
name="keywords"
content="paska, ovo, easter, eggs, javascript, deno, jsr, node, egamagz"
/>
<meta name="author" content="egamagz" />
<title>Paska Ovo</title>
</head>
<body>
Expand Down
21 changes: 20 additions & 1 deletion example/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
---
import Badge from "@/components/Badge";
import EasterEgg from "@/components/EasterEgg";
import Layout from "@/layouts/Layout.astro";
import { IconBrandGithub } from "@tabler/icons-preact";
---

<Layout>
<EasterEgg client:idle />
<div
class="w-screen h-screen bg-red-300 flex flex-col justify-center items-center relative gap-2"
>
<EasterEgg client:idle />
<div class="text-center">
<p class="font-mono text-xl max-w-xl">
<strong
>A simple javascript library for adding easter eggs to web
pages. Try to find the easter egg!
</strong>
</p>
</div>
<div>
<Badge text="Github" url="https://github.com/EGAMAGZ/paska-ovo">
<IconBrandGithub size={24} color="black" />
</Badge>
</div>
</div>
</Layout>
Loading