react-season-effects
Version:
Uma biblioteca React/TypeScript com efeitos visuais sazonais automáticos
1,430 lines (1,411 loc) • 70.1 kB
JavaScript
var jt = Object.defineProperty;
var St = (f, t, r) => t in f ? jt(f, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[t] = r;
var d = (f, t, r) => St(f, typeof t != "symbol" ? t + "" : t, r);
import tt, { useRef as F, useEffect as W, useCallback as je, useState as Ot } from "react";
import Xt from "canvas-confetti";
var Se = { exports: {} }, oe = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ke;
function $t() {
if (Ke) return oe;
Ke = 1;
var f = tt, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, u = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
function h(s, l, o) {
var p, g = {}, x = null, E = null;
o !== void 0 && (x = "" + o), l.key !== void 0 && (x = "" + l.key), l.ref !== void 0 && (E = l.ref);
for (p in l) a.call(l, p) && !i.hasOwnProperty(p) && (g[p] = l[p]);
if (s && s.defaultProps) for (p in l = s.defaultProps, l) g[p] === void 0 && (g[p] = l[p]);
return { $$typeof: t, type: s, key: x, ref: E, props: g, _owner: u.current };
}
return oe.Fragment = r, oe.jsx = h, oe.jsxs = h, oe;
}
var se = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Qe;
function At() {
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
var f = tt, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), s = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), o = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), C = Symbol.iterator, P = "@@iterator";
function X(e) {
if (e === null || typeof e != "object")
return null;
var n = C && e[C] || e[P];
return typeof n == "function" ? n : null;
}
var v = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function y(e) {
{
for (var n = arguments.length, c = new Array(n > 1 ? n - 1 : 0), m = 1; m < n; m++)
c[m - 1] = arguments[m];
Y("error", e, c);
}
}
function Y(e, n, c) {
{
var m = v.ReactDebugCurrentFrame, R = m.getStackAddendum();
R !== "" && (n += "%s", c = c.concat([R]));
var T = c.map(function(k) {
return String(k);
});
T.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, T);
}
}
var $ = !1, re = !1, J = !1, ce = !1, ne = !1, ae;
ae = Symbol.for("react.module.reference");
function we(e) {
return !!(typeof e == "string" || typeof e == "function" || e === a || e === i || ne || e === u || e === o || e === p || ce || e === E || $ || re || J || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === g || e.$$typeof === h || e.$$typeof === s || e.$$typeof === l || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === ae || e.getModuleId !== void 0));
}
function V(e, n, c) {
var m = e.displayName;
if (m)
return m;
var R = n.displayName || n.name || "";
return R !== "" ? c + "(" + R + ")" : c;
}
function xe(e) {
return e.displayName || "Context";
}
function L(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case a:
return "Fragment";
case r:
return "Portal";
case i:
return "Profiler";
case u:
return "StrictMode";
case o:
return "Suspense";
case p:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case s:
var n = e;
return xe(n) + ".Consumer";
case h:
var c = e;
return xe(c._context) + ".Provider";
case l:
return V(e, e.render, "ForwardRef");
case g:
var m = e.displayName || null;
return m !== null ? m : L(e.type) || "Memo";
case x: {
var R = e, T = R._payload, k = R._init;
try {
return L(k(T));
} catch {
return null;
}
}
}
return null;
}
var D = Object.assign, Z = 0, fe, ue, Ce, K, B, he, pe;
function Ae() {
}
Ae.__reactDisabledLog = !0;
function at() {
{
if (Z === 0) {
fe = console.log, ue = console.info, Ce = console.warn, K = console.error, B = console.group, he = console.groupCollapsed, pe = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: Ae,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
Z++;
}
}
function it() {
{
if (Z--, Z === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: D({}, e, {
value: fe
}),
info: D({}, e, {
value: ue
}),
warn: D({}, e, {
value: Ce
}),
error: D({}, e, {
value: K
}),
group: D({}, e, {
value: B
}),
groupCollapsed: D({}, e, {
value: he
}),
groupEnd: D({}, e, {
value: pe
})
});
}
Z < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var ke = v.ReactCurrentDispatcher, Ee;
function me(e, n, c) {
{
if (Ee === void 0)
try {
throw Error();
} catch (R) {
var m = R.stack.trim().match(/\n( *(at )?)/);
Ee = m && m[1] || "";
}
return `
` + Ee + e;
}
}
var Re = !1, ge;
{
var ot = typeof WeakMap == "function" ? WeakMap : Map;
ge = new ot();
}
function Fe(e, n) {
if (!e || Re)
return "";
{
var c = ge.get(e);
if (c !== void 0)
return c;
}
var m;
Re = !0;
var R = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var T;
T = ke.current, ke.current = null, at();
try {
if (n) {
var k = function() {
throw Error();
};
if (Object.defineProperty(k.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(k, []);
} catch (S) {
m = S;
}
Reflect.construct(e, [], k);
} else {
try {
k.call();
} catch (S) {
m = S;
}
e.call(k.prototype);
}
} else {
try {
throw Error();
} catch (S) {
m = S;
}
e();
}
} catch (S) {
if (S && m && typeof S.stack == "string") {
for (var w = S.stack.split(`
`), j = m.stack.split(`
`), M = w.length - 1, _ = j.length - 1; M >= 1 && _ >= 0 && w[M] !== j[_]; )
_--;
for (; M >= 1 && _ >= 0; M--, _--)
if (w[M] !== j[_]) {
if (M !== 1 || _ !== 1)
do
if (M--, _--, _ < 0 || w[M] !== j[_]) {
var A = `
` + w[M].replace(" at new ", " at ");
return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && ge.set(e, A), A;
}
while (M >= 1 && _ >= 0);
break;
}
}
} finally {
Re = !1, ke.current = T, it(), Error.prepareStackTrace = R;
}
var ee = e ? e.displayName || e.name : "", U = ee ? me(ee) : "";
return typeof e == "function" && ge.set(e, U), U;
}
function st(e, n, c) {
return Fe(e, !1);
}
function lt(e) {
var n = e.prototype;
return !!(n && n.isReactComponent);
}
function ve(e, n, c) {
if (e == null)
return "";
if (typeof e == "function")
return Fe(e, lt(e));
if (typeof e == "string")
return me(e);
switch (e) {
case o:
return me("Suspense");
case p:
return me("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case l:
return st(e.render);
case g:
return ve(e.type, n, c);
case x: {
var m = e, R = m._payload, T = m._init;
try {
return ve(T(R), n, c);
} catch {
}
}
}
return "";
}
var ie = Object.prototype.hasOwnProperty, Ie = {}, Le = v.ReactDebugCurrentFrame;
function ye(e) {
if (e) {
var n = e._owner, c = ve(e.type, e._source, n ? n.type : null);
Le.setExtraStackFrame(c);
} else
Le.setExtraStackFrame(null);
}
function dt(e, n, c, m, R) {
{
var T = Function.call.bind(ie);
for (var k in e)
if (T(e, k)) {
var w = void 0;
try {
if (typeof e[k] != "function") {
var j = Error((m || "React class") + ": " + c + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw j.name = "Invariant Violation", j;
}
w = e[k](n, k, m, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (M) {
w = M;
}
w && !(w instanceof Error) && (ye(R), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", c, k, typeof w), ye(null)), w instanceof Error && !(w.message in Ie) && (Ie[w.message] = !0, ye(R), y("Failed %s type: %s", c, w.message), ye(null));
}
}
}
var ct = Array.isArray;
function Te(e) {
return ct(e);
}
function ft(e) {
{
var n = typeof Symbol == "function" && Symbol.toStringTag, c = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
return c;
}
}
function ut(e) {
try {
return Ne(e), !1;
} catch {
return !0;
}
}
function Ne(e) {
return "" + e;
}
function De(e) {
if (ut(e))
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ft(e)), Ne(e);
}
var We = v.ReactCurrentOwner, ht = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, ze, qe;
function pt(e) {
if (ie.call(e, "ref")) {
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
if (n && n.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function mt(e) {
if (ie.call(e, "key")) {
var n = Object.getOwnPropertyDescriptor(e, "key").get;
if (n && n.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function gt(e, n) {
typeof e.ref == "string" && We.current;
}
function vt(e, n) {
{
var c = function() {
ze || (ze = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
};
c.isReactWarning = !0, Object.defineProperty(e, "key", {
get: c,
configurable: !0
});
}
}
function yt(e, n) {
{
var c = function() {
qe || (qe = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
};
c.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: c,
configurable: !0
});
}
}
var bt = function(e, n, c, m, R, T, k) {
var w = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: e,
key: n,
ref: c,
props: k,
// Record the component responsible for creating this element.
_owner: T
};
return w._store = {}, Object.defineProperty(w._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(w, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: m
}), Object.defineProperty(w, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: R
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
};
function wt(e, n, c, m, R) {
{
var T, k = {}, w = null, j = null;
c !== void 0 && (De(c), w = "" + c), mt(n) && (De(n.key), w = "" + n.key), pt(n) && (j = n.ref, gt(n, R));
for (T in n)
ie.call(n, T) && !ht.hasOwnProperty(T) && (k[T] = n[T]);
if (e && e.defaultProps) {
var M = e.defaultProps;
for (T in M)
k[T] === void 0 && (k[T] = M[T]);
}
if (w || j) {
var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
w && vt(k, _), j && yt(k, _);
}
return bt(e, w, j, R, m, We.current, k);
}
}
var Me = v.ReactCurrentOwner, He = v.ReactDebugCurrentFrame;
function Q(e) {
if (e) {
var n = e._owner, c = ve(e.type, e._source, n ? n.type : null);
He.setExtraStackFrame(c);
} else
He.setExtraStackFrame(null);
}
var _e;
_e = !1;
function Pe(e) {
return typeof e == "object" && e !== null && e.$$typeof === t;
}
function Ve() {
{
if (Me.current) {
var e = L(Me.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function xt(e) {
return "";
}
var Ze = {};
function Ct(e) {
{
var n = Ve();
if (!n) {
var c = typeof e == "string" ? e : e.displayName || e.name;
c && (n = `
Check the top-level render call using <` + c + ">.");
}
return n;
}
}
function Be(e, n) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var c = Ct(n);
if (Ze[c])
return;
Ze[c] = !0;
var m = "";
e && e._owner && e._owner !== Me.current && (m = " It was passed a child from " + L(e._owner.type) + "."), Q(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, m), Q(null);
}
}
function Ue(e, n) {
{
if (typeof e != "object")
return;
if (Te(e))
for (var c = 0; c < e.length; c++) {
var m = e[c];
Pe(m) && Be(m, n);
}
else if (Pe(e))
e._store && (e._store.validated = !0);
else if (e) {
var R = X(e);
if (typeof R == "function" && R !== e.entries)
for (var T = R.call(e), k; !(k = T.next()).done; )
Pe(k.value) && Be(k.value, n);
}
}
}
function kt(e) {
{
var n = e.type;
if (n == null || typeof n == "string")
return;
var c;
if (typeof n == "function")
c = n.propTypes;
else if (typeof n == "object" && (n.$$typeof === l || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
n.$$typeof === g))
c = n.propTypes;
else
return;
if (c) {
var m = L(n);
dt(c, e.props, "prop", m, e);
} else if (n.PropTypes !== void 0 && !_e) {
_e = !0;
var R = L(n);
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", R || "Unknown");
}
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Et(e) {
{
for (var n = Object.keys(e.props), c = 0; c < n.length; c++) {
var m = n[c];
if (m !== "children" && m !== "key") {
Q(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), Q(null);
break;
}
}
e.ref !== null && (Q(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), Q(null));
}
}
var Ge = {};
function Je(e, n, c, m, R, T) {
{
var k = we(e);
if (!k) {
var w = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var j = xt();
j ? w += j : w += Ve();
var M;
e === null ? M = "null" : Te(e) ? M = "array" : e !== void 0 && e.$$typeof === t ? (M = "<" + (L(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : M = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, w);
}
var _ = wt(e, n, c, R, T);
if (_ == null)
return _;
if (k) {
var A = n.children;
if (A !== void 0)
if (m)
if (Te(A)) {
for (var ee = 0; ee < A.length; ee++)
Ue(A[ee], e);
Object.freeze && Object.freeze(A);
} else
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Ue(A, e);
}
if (ie.call(n, "key")) {
var U = L(e), S = Object.keys(n).filter(function(Yt) {
return Yt !== "key";
}), Ye = S.length > 0 ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Ge[U + Ye]) {
var Pt = S.length > 0 ? "{" + S.join(": ..., ") + ": ...}" : "{}";
y(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, Ye, U, Pt, U), Ge[U + Ye] = !0;
}
}
return e === a ? Et(_) : kt(_), _;
}
}
function Rt(e, n, c) {
return Je(e, n, c, !0);
}
function Tt(e, n, c) {
return Je(e, n, c, !1);
}
var Mt = Tt, _t = Rt;
se.Fragment = a, se.jsx = Mt, se.jsxs = _t;
}()), se;
}
process.env.NODE_ENV === "production" ? Se.exports = $t() : Se.exports = At();
var b = Se.exports;
const Ft = () => {
const f = /* @__PURE__ */ new Date(), t = f.getMonth(), r = f.getDate();
return t === 9 && r === 10 ? "birthday" : t === 11 && r >= 20 && r <= 22 ? "aurora" : t === 11 && r >= 31 || t === 0 && r <= 1 ? "newYear" : t === 8 && r >= 23 || t === 9 || t === 10 || t === 11 && r <= 19 ? "autumn" : t === 2 && r >= 20 || t === 3 || t === 4 || t === 5 && r <= 20 ? "spring" : t === 3 && r >= 13 && r <= 27 ? "easter" : t === 5 && r >= 21 || t === 6 || t === 7 || t === 8 && r <= 22 ? "summer" : t === 9 && r >= 25 ? "halloween" : t === 11 && r >= 23 || t === 0 || t === 1 || t === 2 && r <= 19 ? "winter" : null;
}, It = () => {
const f = F(null), t = F(null);
return W(() => {
const r = document.createElement("style");
r.innerHTML = `
.aurora-container {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-image: linear-gradient(to top, #38578d 0%, #112247 80%, #0c0f1e 100%);
overflow: hidden;
z-index: 1;
}
.aurora {
height: 100vh;
width: 100vw;
position: relative;
overflow: hidden;
}
.whisp {
display: block;
background-color: var(--bg-color);
position: absolute;
bottom: 0;
left: var(--left-ini);
height: var(--height);
width: var(--width);
opacity: var(--opacity);
border-top-left-radius: 50% 100%;
border-top-right-radius: 50% 100%;
filter: blur(var(--blur));
will-change: height, width, opacity, filter, transform;
mix-blend-mode: color-dodge;
}
.scene {
height: 100vh;
width: 100vw;
background-position: center bottom;
background-size: cover;
position: absolute;
z-index: 200;
}
.snowflake {
--size: calc(var(--z-index) * 0.2px);
left: var(--left);
filter: blur(calc(var(--inverse-z) * 0.7px));
width: var(--size);
height: var(--size);
background: white;
border-radius: 50%;
position: absolute;
top: -5vh;
animation: snowfall var(--fall-duration) linear infinite;
animation-delay: var(--fall-delay);
z-index: var(--z-index);
will-change: top, left, transform;
}
@keyframes snowfall {
0% {
transform: translate3d(var(--left-ini), -20vh, 0);
}
100% {
transform: translate3d(var(--left-end), 110vh, 0);
}
}
`, document.head.appendChild(r);
const a = f.current, u = ["#14e81e", "#00ea8d", "#017ed5", "#b53dff", "#8d00c4"];
function i(l, o) {
const p = Math.ceil(l), g = Math.floor(o);
return Math.floor(Math.random() * (g - p + 1)) + p;
}
if (a) {
for (let l = 0; l < 12; l++) {
const o = document.createElement("div");
o.classList.add("whisp"), o.setAttribute(
"style",
`
--z-index: ${i(1, 10)};
--opacity: ${Math.random() * 0.3};
--blur: ${i(30, 60)}px;
--width: ${i(5, 20)}vw;
--height: ${i(50, 120)}vh;
--left-ini: ${i(-20, 100)}vw;
--bg-color: ${u[i(0, 4)]};
transform: skew(${i(-30, -50)}deg);
`
), a.appendChild(o);
}
setTimeout(() => {
const l = a.querySelectorAll(".whisp");
for (const o of l) {
const p = o;
p.animate && (p.animate(
{
opacity: [Math.random() * 0.3, Math.random() * 0.6]
},
{
duration: i(4, 10) * 1e3,
iterations: 1 / 0,
direction: "alternate",
easing: "ease-in-out"
}
), p.animate(
{
transform: [
`translate(${i(-20, 20)}vw, 0) skew(${i(-30, -50)}deg)`,
`translate(${i(-20, 20)}vw, 0) skew(${i(-30, -50)}deg)`
]
},
{
duration: i(20, 40) * 1e3,
iterations: 1 / 0,
direction: "alternate",
easing: "ease-in-out"
}
), p.animate(
{
height: [
`${i(20, 120)}vh`,
`${i(20, 120)}vh`
]
},
{
duration: i(10, 20) * 1e3,
iterations: 1 / 0,
direction: "alternate",
easing: "ease-in-out"
}
), p.animate(
{
width: [`${i(2, 20)}vw`, `${i(2, 20)}vw`]
},
{
duration: i(5, 40) * 1e3,
iterations: 1 / 0,
direction: "alternate",
easing: "ease-in-out"
}
));
}
}, 100);
}
const h = t.current;
function s(l) {
return Math.floor(Math.random() * l);
}
if (h)
for (let l = 0; l < 100; l++) {
const o = document.createElement("div");
o.classList.add("snowflake");
const p = s(10) + 1, g = (p * -1 + 10) * 0.5;
o.setAttribute(
"style",
`
--z-index: ${p};
--inverse-z: ${g};
--fall-duration: ${s(10) + 7}s;
--rotation-x: ${s(5)};
--rotation-y: ${s(5)};
--rotation-z: ${s(5)};
--fall-delay: ${s(20) - 11}s;
--left: ${s(100)}vw;
--left-ini: ${s(20) - 10}vw;
--left-end: ${s(20) - 10}vw;
`
), h.appendChild(o);
}
return () => {
r.parentNode && document.head.removeChild(r), a && (a.innerHTML = ""), h && (h.innerHTML = "");
};
}, []), /* @__PURE__ */ b.jsx("div", { className: "aurora-container", children: /* @__PURE__ */ b.jsxs("div", { className: "aurora", ref: f, children: [
/* @__PURE__ */ b.jsx("div", { className: "trees" }),
/* @__PURE__ */ b.jsx("div", { className: "scene", ref: t })
] }) });
};
function Lt() {
const f = F(null), t = () => {
if (f.current) {
const r = f.current.getBoundingClientRect(), a = r.left + r.width / 2, u = r.top + r.height / 2;
Xt({
particleCount: 100,
// Efeito de clique: 100 partículas
spread: 90,
origin: { x: a / window.innerWidth, y: u / window.innerHeight }
});
}
};
return /* @__PURE__ */ b.jsx(
"div",
{
style: {
position: "fixed",
// Para cobrir toda a tela e ser o contexto do botão
top: 0,
left: 0,
width: "100vw",
height: "100vh",
background: "#121212"
},
children: /* @__PURE__ */ b.jsx(
"button",
{
ref: f,
onClick: t,
"aria-label": "Happy Birthday",
style: {
position: "absolute",
// Posicionamento absoluto em relação ao div pai
top: "80%",
// 80% para baixo (mantido)
left: "60%",
// 60% para a direita (ALTERADO AQUI!)
transform: "translate(-50%, -50%)",
// Centraliza o botão no ponto
background: "transparent",
border: "none",
cursor: "pointer",
fontSize: "64px",
color: "#fff",
padding: 0,
outlineOffset: "4px",
transition: "transform 0.2s ease"
},
onMouseEnter: (r) => {
r.currentTarget.style.transform = "translate(-50%, -50%) scale(1.2)";
},
onMouseLeave: (r) => {
r.currentTarget.style.transform = "translate(-50%, -50%) scale(1)";
},
children: "🎉"
}
)
}
);
}
const Nt = () => (W(() => {
const f = [
"#1d9bf0",
// azul Bluesky
"#0ea5e9",
// azul céu
"#3b82f6",
// azul médio
"#8b5cf6",
// roxo
"#a855f7",
// roxo claro
"#dc2626",
// vermelho
"#ef4444",
// vermelho claro
"#b91c1c",
// vermelho escuro
"#7c3aed",
// violeta
"#2563eb"
// azul royal
], t = [
{ left: "#1d9bf0", right: "#8b5cf6" },
// azul Bluesky + roxo
{ left: "#dc2626", right: "#1d9bf0" },
// vermelho + azul Bluesky
{ left: "#a855f7", right: "#ef4444" },
// roxo claro + vermelho claro
{ left: "#7c3aed", right: "#0ea5e9" }
// violeta + azul céu
], r = [];
for (let i = 0; i < 6; i++) {
const h = Math.random() < 5e-3;
r.push({
random: Math.random(),
isRare: h,
colors: h ? t[Math.floor(Math.random() * t.length)] : {
solid: f[Math.floor(Math.random() * f.length)]
}
});
}
const a = document.createElement("div");
a.className = "butterfly-scene", a.style.cssText = `
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: 10;
perspective: 800px;
overflow: hidden;
`;
const u = document.createElement("style");
return u.innerHTML = `
.butterfly-scene * {
transform-style: preserve-3d;
position: absolute;
}
.butterfly {
position: absolute;
animation: butterfly-fly calc(16s + var(--random) * 8s) calc(var(--random) * -100s) infinite linear;
}
.butterfly::before,
.butterfly::after {
box-shadow: 0 0 15px #0007 inset;
content: '';
position: absolute;
width: 30px;
height: 53px;
background-color: var(--wing-color);
clip-path: path('m0 24.949c 2.6262-5.4316 9.7782-15.554 16.428-20.546 4.798-3.6021 12.572-6.3892 12.572 2.4795 0 1.7712-1.0155 14.879-1.6111 17.007-2.0703 7.3984-9.6144 9.2854-16.325 8.1433 11.73 1.9964 14.714 8.6092 8.2697 15.222-12.239 12.559-17.591-3.1511-18.963-7.1766-.2514-.73797-.36904-1.0832-.37077-.78964z');
transform-origin: left;
}
.butterfly::before {
animation: butterfly-flapB calc(0.2s + var(--random) * 0.1s) infinite alternate ease-in-out;
background-color: var(--wing-left-color);
}
.butterfly::after {
animation: butterfly-flapA calc(0.2s + var(--random) * 0.1s) infinite alternate ease-in-out;
background-color: var(--wing-right-color);
}
@keyframes butterfly-fly {
0% {
transform:
translateX(calc(var(--start-x) * 1px))
translateY(calc(var(--start-y) * 1px))
rotateX(90deg)
rotate(calc(var(--random) * 360deg))
translateX(200px)
translateZ(-70vh);
}
25% {
transform:
translateX(calc(var(--mid1-x) * 1px))
translateY(calc(var(--mid1-y) * 1px))
rotateX(90deg)
rotate(calc(var(--random) * 360deg - 180deg))
translateX(200px)
translateZ(0vh);
}
50% {
transform:
translateX(calc(var(--mid2-x) * 1px))
translateY(calc(var(--mid2-y) * 1px))
rotateX(90deg)
rotate(calc(var(--random) * 360deg - 360deg))
translateX(200px)
translateZ(70vh);
}
75% {
transform:
translateX(calc(var(--mid3-x) * 1px))
translateY(calc(var(--mid3-y) * 1px))
rotateX(90deg)
rotate(calc(var(--random) * 360deg - 540deg))
translateX(200px)
translateZ(0vh);
}
100% {
transform:
translateX(calc(var(--start-x) * 1px))
translateY(calc(var(--start-y) * 1px))
rotateX(90deg)
rotate(calc(var(--random) * 360deg - 720deg))
translateX(200px)
translateZ(-70vh);
}
}
@keyframes butterfly-flapB {
from { rotate: y 15deg; }
to { rotate: y -30deg; }
}
@keyframes butterfly-flapA {
from { rotate: y 165deg; }
to { rotate: y 210deg; }
}
/* Efeito especial para borboletas raras */
.butterfly.rare::before,
.butterfly.rare::after {
box-shadow:
0 0 15px #0007 inset,
0 0 20px var(--wing-color);
}
`, document.head.appendChild(u), r.forEach((i, h) => {
const s = document.createElement("div");
s.className = i.isRare ? "butterfly rare" : "butterfly";
const l = Math.random() * window.innerWidth, o = Math.random() * window.innerHeight, p = Math.random() * window.innerWidth, g = Math.random() * window.innerHeight, x = Math.random() * window.innerWidth, E = Math.random() * window.innerHeight, C = Math.random() * window.innerWidth, P = Math.random() * window.innerHeight;
s.style.setProperty("--random", i.random.toString()), s.style.setProperty("--start-x", l.toString()), s.style.setProperty("--start-y", o.toString()), s.style.setProperty("--mid1-x", p.toString()), s.style.setProperty("--mid1-y", g.toString()), s.style.setProperty("--mid2-x", x.toString()), s.style.setProperty("--mid2-y", E.toString()), s.style.setProperty("--mid3-x", C.toString()), s.style.setProperty("--mid3-y", P.toString()), i.isRare ? (s.style.setProperty(
"--wing-left-color",
i.colors.left
), s.style.setProperty(
"--wing-right-color",
i.colors.right
), s.style.setProperty(
"--wing-color",
i.colors.left
)) : (s.style.setProperty(
"--wing-left-color",
i.colors.solid
), s.style.setProperty(
"--wing-right-color",
i.colors.solid
), s.style.setProperty(
"--wing-color",
i.colors.solid
)), a.appendChild(s);
}), document.body.appendChild(a), () => {
a.parentNode && document.body.removeChild(a), u.parentNode && document.head.removeChild(u);
};
}, []), null), Dt = () => (W(() => {
const f = [
// Laranjas/Dourados
{ primary: "#db9e3a", secondary: "#ffc257", tertiary: "#ffe972" },
{ primary: "#e67e22", secondary: "#f39c12", tertiary: "#f1c40f" },
{ primary: "#d68910", secondary: "#f4d03f", tertiary: "#fff5b7" },
// Rosas/Vermelhos
{ primary: "#e8979a", secondary: "#fc9eaf", tertiary: "#e8d0d9" },
{ primary: "#e74c3c", secondary: "#ec7063", tertiary: "#fadbd8" },
{ primary: "#c0392b", secondary: "#e74c3c", tertiary: "#f1948a" },
// Azuis (incluindo azul do contador)
{ primary: "#73c2df", secondary: "#97e4ff", tertiary: "#b2c1ff" },
{ primary: "#3498db", secondary: "#5dade2", tertiary: "#aed6f1" },
{ primary: "#1d9bf0", secondary: "#5dbaff", tertiary: "#a8d8ff" },
// Azul Bluesky
// Amarelos/Verdes
{ primary: "#ffff4c", secondary: "#ffdea3", tertiary: "#fff5be" },
{ primary: "#f1c40f", secondary: "#f7dc6f", tertiary: "#fcf3cf" },
{ primary: "#2ecc71", secondary: "#58d68d", tertiary: "#a9dfbf" },
// Roxos/Violetas
{ primary: "#9b59b6", secondary: "#bb8fce", tertiary: "#d7bde2" },
{ primary: "#8e44ad", secondary: "#a569bd", tertiary: "#c39bd3" }
], t = document.createElement("div");
t.className = "easter-eggs-container", t.style.cssText = `
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
overflow: hidden;
`;
const r = document.createElement("style");
r.innerHTML = `
.easter-egg {
width: 30px;
height: 42px;
border-radius: 50%/60% 60% 40% 40%;
position: absolute;
cursor: pointer;
pointer-events: auto;
transition: transform 0.2s ease;
z-index: 1;
}
.easter-egg:hover {
transform: scale(1.1);
}
@keyframes egg-spawn {
0% {
opacity: 0;
transform: scale(0.5);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes egg-collect {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(0);
}
}
@keyframes egg-disappear {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(0.8);
}
}
`, document.head.appendChild(r);
const a = () => {
const i = document.createElement("div");
i.className = "easter-egg";
const h = f[Math.floor(Math.random() * f.length)];
i.style.background = `linear-gradient(20deg, ${h.primary} 31%, ${h.secondary} 66%, ${h.tertiary} 83%)`;
const s = window.innerWidth * 0.5, l = window.innerWidth - 50, o = Math.random() * (l - s) + s, p = Math.random() * (window.innerHeight - 200) + 100;
i.style.left = `${o}px`, i.style.top = `${p}px`, i.style.animation = "egg-spawn 0.6s ease-out", i.addEventListener("click", () => {
i.style.animation = "egg-collect 0.4s ease-out", i.style.pointerEvents = "none", setTimeout(() => {
i.parentNode && t.removeChild(i);
}, 400);
}), setTimeout(() => {
i.parentNode && i.style.pointerEvents !== "none" && (i.style.animation = "egg-disappear 1s ease-out", setTimeout(() => {
i.parentNode && t.removeChild(i);
}, 1e3));
}, 15e3), t.appendChild(i);
}, u = setInterval(() => {
t.children.length < 3 && a();
}, 8e3);
return setTimeout(a, 2e3), document.body.appendChild(t), () => {
clearInterval(u), t.parentNode && document.body.removeChild(t), r.parentNode && document.head.removeChild(r);
};
}, []), null), de = {
Red: "#ff0043",
Green: "#14fc56",
Blue: "#1e7fff",
Purple: "#e60aff",
Gold: "#ffbf36",
White: "#ffffff"
}, Wt = Object.keys(de), be = Wt.map(
(f) => de[f]
), Xe = "_INVISIBLE_", rt = [...be, Xe], $e = 0.9, q = Math.PI * 2, zt = Math.PI * 0.5, N = (f, t) => Math.random() * (t - f) + f, Oe = (f, t) => Math.floor(N(f, t)), qt = () => be[Oe(0, be.length)], et = (f, t, r = 0, a = q) => {
const i = 2 * (0.5 * Math.sqrt(f / Math.PI)) * Math.PI, h = i / 2;
for (let s = 0; s <= h; s++) {
const l = s / h * zt, o = Math.cos(l), p = i * o, g = p * (a / q), x = q / p, E = Math.random() * x + r, C = x * 0.33;
for (let P = 0; P < g; P++) {
const X = Math.random() * C, v = x * P + E + X;
t(v, o);
}
}
}, nt = () => {
const f = {};
return rt.forEach((t) => {
f[t] = [];
}), f;
}, O = class O {
constructor(t, r, a, u, i, h, s = 0, l = 0) {
d(this, "x");
d(this, "y");
d(this, "prevX");
d(this, "prevY");
d(this, "speedX");
d(this, "speedY");
d(this, "life");
d(this, "fullLife");
d(this, "color");
d(this, "sparkFreq");
d(this, "sparkTimer");
d(this, "sparkColor");
d(this, "sparkSpeed");
d(this, "sparkLife");
d(this, "sparkLifeVariation");
d(this, "visible");
d(this, "heavy");
d(this, "strobe");
d(this, "strobeFreq");
d(this, "transitionTime");
d(this, "secondColor");
d(this, "colorChanged");
d(this, "spinAngle");
d(this, "spinSpeed");
d(this, "spinRadius");
d(this, "updateFrame");
d(this, "onDeath");
this.x = t, this.y = r, this.prevX = t, this.prevY = r, this.speedX = Math.sin(u) * i + s, this.speedY = Math.cos(u) * i + l, this.life = h, this.fullLife = h, this.color = a, this.sparkFreq = 0, this.sparkTimer = 0, this.sparkColor = a, this.sparkSpeed = 1, this.sparkLife = 750, this.sparkLifeVariation = 0.25, this.visible = !0, this.heavy = !1, this.strobe = !1, this.strobeFreq = 60, this.transitionTime = 0, this.colorChanged = !1, this.spinAngle = Math.random() * q, this.spinSpeed = 0.8, this.spinRadius = 0, this.updateFrame = 0;
}
static add(t, r, a, u, i, h, s = 0, l = 0) {
const o = O._pool.pop() || new O(t, r, a, u, i, h, s, l);
return o.x = t, o.y = r, o.prevX = t, o.prevY = r, o.color = a, o.speedX = Math.sin(u) * i + s, o.speedY = Math.cos(u) * i + l, o.life = h, o.fullLife = h, o.visible = !0, o.heavy = !1, o.sparkFreq = 0, o.sparkTimer = 0, o.sparkColor = a, o.sparkSpeed = 1, o.sparkLife = 750, o.sparkLifeVariation = 0.25, o.strobe = !1, o.transitionTime = 0, o.secondColor = void 0, o.colorChanged = !1, o.spinAngle = Math.random() * q, o.spinRadius = 0, o.onDeath = void 0, O.active[a].push(o), o;
}
static returnInstance(t) {
var r;
(r = t.onDeath) == null || r.call(t, t), t.onDeath = void 0, t.secondColor = void 0, O._pool.push(t);
}
update(t, r) {
if (this.life -= t, this.life <= 0) return !1;
const a = (this.life / this.fullLife) ** 0.5, u = 1 - a;
this.prevX = this.x, this.prevY = this.y, this.x += this.speedX * (t / 16), this.y += this.speedY * (t / 16);
const i = this.heavy ? 0.992 : 0.98;
if (this.speedX *= i ** (t / 16), this.speedY *= i ** (t / 16), this.speedY += $e * t / 1e3, this.spinRadius > 0 && (this.spinAngle += this.spinSpeed * t / 16, this.x += Math.sin(this.spinAngle) * this.spinRadius * t / 16, this.y += Math.cos(this.spinAngle) * this.spinRadius * t / 16), this.sparkFreq > 0)
for (this.sparkTimer -= t; this.sparkTimer < 0; )
this.sparkTimer += this.sparkFreq * 0.75 + this.sparkFreq * u * 4, r.push(
new G(
this.x,
this.y,
this.sparkColor,
Math.random() * q,
Math.random() * this.sparkSpeed * a,
this.sparkLife * 0.8 + Math.random() * this.sparkLife * this.sparkLifeVariation
)
);
if (this.life < this.transitionTime) {
if (this.secondColor && !this.colorChanged) {
this.colorChanged = !0;
const h = O.active[this.color], s = h.indexOf(this);
s > -1 && (h.splice(s, 1), this.color = this.secondColor, O.active[this.secondColor].push(this), this.secondColor === Xe && (this.sparkFreq = 0));
}
this.strobe && (this.visible = Math.floor(this.life / this.strobeFreq) % 3 === 0);
}
return !0;
}
draw(t) {
this.visible && (t.strokeStyle = this.color, t.lineWidth = O.drawWidth, t.lineCap = "round", t.beginPath(), t.moveTo(this.x, this.y), t.lineTo(this.prevX, this.prevY), t.stroke());
}
};
d(O, "drawWidth", 4.4), d(O, "airDrag", 0.98), d(O, "airDragHeavy", 0.992), d(O, "active", nt()), d(O, "_pool", []);
let H = O;
const I = class I {
constructor(t, r, a, u, i, h) {
d(this, "x");
d(this, "y");
d(this, "prevX");
d(this, "prevY");
d(this, "speedX");
d(this, "speedY");
d(this, "life");
d(this, "fullLife");
d(this, "color");
this.x = t, this.y = r, this.prevX = t, this.prevY = r, this.speedX = Math.sin(u) * i, this.speedY = Math.cos(u) * i, this.life = h, this.fullLife = h, this.color = a;
}
static add(t, r, a, u, i, h) {
const s = I._pool.pop() || new I(t, r, a, u, i, h);
return s.x = t, s.y = r, s.prevX = t, s.prevY = r, s.speedX = Math.sin(u) * i, s.speedY = Math.cos(u) * i, s.life = h, s.fullLife = h, s.color = a, I.active[a].push(s), s;
}
static returnInstance(t) {
I._pool.push(t);
}
update(t) {
return this.life -= t, this.life <= 0 ? !1 : (this.prevX = this.x, this.prevY = this.y, this.x += this.speedX * (t / 16), this.y += this.speedY * (t / 16), this.speedX *= 0.9 ** (t / 16), this.speedY *= 0.9 ** (t / 16), this.speedY += $e * t / 1e3, !0);
}
draw(t) {
const r = this.life / this.fullLife;
t.globalAlpha = r, t.strokeStyle = this.color, t.lineWidth = I.drawWidth, t.lineCap = "round", t.beginPath(), t.moveTo(this.x, this.y), t.lineTo(this.prevX, this.prevY), t.stroke(), t.globalAlpha = 1;
}
};
d(I, "drawWidth", 1), d(I, "airDrag", 0.9), d(I, "active", nt()), d(I, "_pool", []);
let G = I;
const z = class z {
constructor(t, r, a) {
d(this, "x");
d(this, "y");
d(this, "radius");
this.x = t, this.y = r, this.radius = a;
}
static add(t, r, a) {
const u = z._pool.pop() || new z(t, r, a);
return u.x = t, u.y = r, u.radius = a, z.active.push(u), u;
}
static returnInstance(t) {
z._pool.push(t);
}
};
d(z, "active", []), d(z, "_pool", []);
let te = z;
class Ht {
constructor(t, r, a) {
d(this, "x");
d(this, "y");
d(this, "targetX");
d(this, "targetY");
d(this, "speedX");
d(this, "speedY");
d(this, "life");
d(this, "color");
d(this, "size");
d(this, "type");
d(this, "exploded");
d(this, "comet");
this.x = t, this.y = window.innerHeight, this.targetX = r, this.targetY = a;
const u = Math.sqrt((r - t) ** 2 + (a - this.y) ** 2), i = (u * 0.021) ** 0.64;
this.speedX = (r - t) / u * i * 0.3, this.speedY = -i * 0.8, this.life = i * 300, this.color = qt(), this.size = N(1, 1.2), this.type = this.getRandomType(), this.exploded = !1;
}
getRandomType() {
const t = ["chrysanthemum", "palm"];
return t[Oe(0, t.length)];
}
update(t) {
return !(this.exploded || (this.life -= t, this.x += this.speedX * (t / 16), this.y += this.speedY * (t / 16), this.speedY += $e * t / 1e3, Math.sqrt(
(this.targetX - this.x) ** 2 + (this.targetY - this.y) ** 2
) < 15 || this.life <= 0 || this.speedY > 0));
}
launch() {
this.comet = H.add(
this.x,
this.y,
this.color,
Math.PI,
Math.abs(this.speedY) * 1.5,
// um pouco maior
this.life
), this.comet.heavy = !0, this.comet.spinRadius = N(0.65, 0.4), this.comet.sparkFreq = 32, this.comet.sparkLife = 320, this.comet.sparkLifeVariation = 3, this.comet.sparkSpeed = 0.5, this.comet.sparkColor = this.color;
}
draw(t) {
this.exploded || (t.strokeStyle = this.color, t.lineWidth = 3, t.lineCap = "round", t.beginPath(), t.moveTo(this.x, this.y), t.lineTo(this.x - this.speedX * 3, this.y - this.speedY * 3), t.stroke(), t.fillStyle = this.color, t.beginPath(), t.arc(this.x, this.y, 2, 0, q), t.fill());
}
explode(t, r) {
this.exploded = !0;
const a = 60 + Oe(0, 40), u = 3 + this.size;
switch (this.type) {
case "chrysanthemum":
this.createChrysanthemum(t, r, a, u);
break;
case "palm":
this.createPalm(t, r, a, u);
break;
}
this.createBurstFlash(r);
}
createChrysanthemum(t, r, a, u) {
et(a, (i, h) => {
const s = H.add(
this.x,
this.y,
this.color,
i,
h * u,
900 + N(-200, 200)
);
Math.random() < 0.3 && (s.sparkFreq = 200, s.sparkColor = de.Gold, s.sparkSpeed = 0.5, s.sparkLife = 400), t.push(s);
});
}
createPalm(t, r, a, u) {
et(Math.floor(a * 0.4), (i, h) => {
const s = H.add(
this.x,
this.y,
this.color,
i,
h * u,
1800 + N(-300, 300)
);
s.sparkFreq = 80, s.sparkColor = de.Gold, s.sparkSpeed = 0.8, s.sparkLife = 1400, s.sparkLifeVariation = 2, t.push(s);
});
}
createBurstFlash(t) {
te.add(this.x, this.y, 40 + this.size * 10);
for (let r = 0; r < 30; r++)
t.push(
new G(
this.x,
this.y,
de.White,
Math.random() * q,
N(0.5, 3),
150 + N(-30, 30)
)
);
}
}
const Vt = () => {
const f = F(null), t = F(null), r = F(), a = F(0), u = F([]), i = F([]), h = F([]), s = F(0), l = je(() => {
const g = f.current, x = t.current;
if (!g || !x) return;
const E = window.innerWidth, C = window.innerHeight;
g.width = E, g.height = C, x.width = E, x.height = C, document.body.style.overflow = "hidden", document.body.style.margin = "0", document.body.style.padding = "0";
}, []), o = je(() => {
const g = window.innerWidth, x = window.innerHeight, E = 120, C = N(E, g - E), P = N(E, g - E), X = N(x * 0.35, x * 0.45), v = new Ht(C, P, X);
v.launch(), u.current.push(v);
}, []), p = je(
(g) => {
const x = f.current, E = t.current;
if (!x || !E) return;
const C = x.getContext("2d"), P = E.getContext("2d");
if (!C || !P) return;
const X = g - a.current || 16;
for (a.current = g, g - s.current > 1500 && (o(), s.current = g), P.clearRect(0, 0, E.width, E.height), C.globalCompositeOperation = "source-over", C.fillStyle = "rgba(0, 0, 0, 0.15)", C.fillRect(0, 0, x.width, x.height); te.active.length > 0; ) {
const v = te.active.pop(), y = C.createRadialGradient(
v.x,
v.y,
0,
v.x,
v.y,
v.radius
);
y.addColorStop(0.024, "rgba(255, 255, 255, 1)"), y.addColorStop(0.125, "rgba(255, 160, 20, 0.2)"), y.addColorStop(0.32, "rgba(255, 140, 20, 0.11)"), y.addColorStop(1, "rgba(255, 120, 20, 0)"), C.fillStyle = y, C.fillRect(
v.x - v.radius,
v.y - v.radius,
v.radius * 2,
v.radius * 2
), te.returnInstance(v);
}
C.globalCompositeOperation = "lighten";
for (let v = u.current