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

Bugfix auto-suggest, snow and feature requests #17

Merged
merged 4 commits into from
Dec 8, 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
10 changes: 10 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { useSettings } from "./hooks/useSettings";
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";
import PageContainer from "./components/PageContainer";
import Snowfall from 'react-snowfall'

function App() {
const [{ theme }] = useSettings();
const isDecember = new Date().getMonth() === 11;

useEffect(() => {
if (theme === "dark") {
Expand All @@ -22,6 +24,14 @@ function App() {

return (
<PageContainer>
{isDecember && (
<Snowfall
// Changes the snowflake color
color="#00BCD4"
snowflakeCount={window.innerWidth*0.1}
speed={[1.0, 1.1]}
/>
)}
<ToastContainer
hideProgressBar
position="top-center"
Expand Down
1 change: 0 additions & 1 deletion src/components/CountryInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export function CountryInput({
const { key, ...restProps } = containerProps;
return (
<div
key={Math.random()} // Ensure each element has a unique key (only if you don't have other unique identifiers)
{...restProps}
className={`${restProps.className} absolute bottom-full w-full bg-white mb-1 divide-x-2 max-h-52 overflow-auto`}
>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Game/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function Game() {
state: { country, guesses, gameResult, dateString },
} = useSharedGameState();
const { t } = useTranslation();
const today = DateTime.now();

useEffect(() => {
if (
Expand All @@ -40,8 +41,8 @@ export function Game() {
<div className={(guesses.length >= 3 && gameResult === "ONGOING") ? "p-4 text-center" : ""}>
{(guesses.length >= 3 && gameResult === "ONGOING") && t("mapHelperRecommendation")}
</div>
<div className={(Math.floor(Interval.fromDateTimes(DateTime.fromISO("2023-12-31"), DateTime.fromISO(dateString)).length("day"))<327) ? "p-4 text-center" : ""}>
{(Math.floor(Interval.fromDateTimes(DateTime.fromISO("2023-12-31"), DateTime.fromISO(dateString)).length("day"))<327) && "Hallaien irriterte Bergensere! Vi har lagt om random-funksjonen i Bergle. Det blir forhåpentligvis ikke lenger duplikater flere dager på rad i fremtiden."}
<div className={(today >= DateTime.fromISO("2024-12-08") && today <= DateTime.fromISO("2024-12-15")) ? "p-4 text-center" : ""}>
{today >= DateTime.fromISO("2024-12-08") && today <= DateTime.fromISO("2024-12-15") && "Hallaien irriterte Bergensere! E det nokke du er irritert over? Har du idéer eller tanker? Del dem med oss. Se kontaktinfo i FAQ"}
</div>
<div className={(Math.floor(Interval.fromDateTimes(DateTime.fromISO("2023-12-31"), DateTime.fromISO(dateString)).length("day"))===365) ? "p-4 text-center" : ""}>
{(Math.floor(Interval.fromDateTimes(DateTime.fromISO("2023-12-31"), DateTime.fromISO(dateString)).length("day"))===365) && "I dag er det et år siden Bergle ble publisert! Tusen takk for at du fortsatt spiller!"}
Expand Down
Loading