Skip to content

Commit

Permalink
Merge branch 'main' into soap-konami-code
Browse files Browse the repository at this point in the history
  • Loading branch information
MattEzekiel authored Apr 29, 2024
2 parents 285a7cb + 15f5b8d commit 799effa
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 66 deletions.
97 changes: 97 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Reportar problema
description: Reporta un problema
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: "# Pre-requisitos"
- type: checkboxes
id: pre-requisitos
attributes:
label: Señala los requisitos cumplidos
description: |
Asegúrate de cumplir estos requisitos antes de reportar un problema
options:
- label: Estoy corriendo la última versión.
required: true
- label: |
He revisado si ya hay un issue creado con características similares.
required: true
- type: markdown
attributes:
value: "# Comportamiento"
- type: textarea
id: comportamiento-esperado
attributes:
label: Comportamiento esperado
description: Describe el comportamiento esperado de la issue
placeholder: Esta feature debería hacer ...
- type: textarea
id: comportamiento-actual
attributes:
label: Comportamiento actual
description: Describe el comportamiento actual de la issue
placeholder: Esta feature hace ...
- type: markdown
attributes:
value: "# Información"
- type: textarea
id: informacion-bug
attributes:
label: Información del bug
description: Aporta información sobre el bug
placeholder: Este bug ocurre cuando ...
- type: textarea
id: pasos-reproducir
attributes:
label: Pasos para reproducirlo
description: Pasos necesarios para reproducir el bug
placeholder: |
1. Paso1
2. Paso2
- type: markdown
attributes:
value: "# Contexto"
- type: dropdown
id: navegadores
attributes:
label: ¿En qué navegadores encuentras el problema?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
- Todos los navegadores
- type: input
id: version-navegador
attributes:
label: Versión del navegador
description: Versión del navegador en el cuál encuentras el problema
placeholder: Chrome v124.0.6367.92 ...
- type: dropdown
id: sistema-operativo
attributes:
label: Sistema operativo
description: Sistema operativo en el cuál encuentras el problema
multiple: true
options:
- Windows
- MacOS
- Linux
- Android
- Todos los sistemas
- type: markdown
attributes:
value: "# Información adicional"
- type: textarea
attributes:
label: Añade información adicional si fuese necesario
description: Imágenes, link del código, fragmento de código ...
placeholder: |
```typescript
const variable = "..."
```
...
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Propuesta de mejora
description: Sugerir una mejora o feature para el proyecto
title: "[Feat]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: "## Pre-requisitos"
- type: markdown
attributes:
value: |
Antes de sugerir una feature, busca [features existentes](https://github.com/midudev/la-velada-web-oficial/issues)
- type: textarea
attributes:
label: Descripción
description: Descripción de la feature que quieres que se añada
placeholder: |
Estaría bien que el proyecto tuviese ...
validations:
required: true
38 changes: 0 additions & 38 deletions .github/issue_template.md

This file was deleted.

8 changes: 5 additions & 3 deletions src/components/AnimatedX.astro
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
>
</span>
<script>
import { $ } from "@/lib/dom-selector"

let intervalId: NodeJS.Timeout
type AnimatedXElement = SVGGElement | null

Expand All @@ -152,9 +154,9 @@
if (prefersReducedMotion) return

intervalId && clearInterval(intervalId)
const $svgGroup1 = document.getElementById("layer1") as AnimatedXElement
const $svgGroup2 = document.getElementById("layer2") as AnimatedXElement
const $svgGroup3 = document.getElementById("layer3") as AnimatedXElement
const $svgGroup1 = $("#layer1") as AnimatedXElement
const $svgGroup2 = $("#layer2") as AnimatedXElement
const $svgGroup3 = $("#layer3") as AnimatedXElement

intervalId = setInterval(() => drawGroup([$svgGroup1, $svgGroup2, $svgGroup3]), INTERVAL_TIME)
})
Expand Down
8 changes: 5 additions & 3 deletions src/components/Boxers/Gallery.astro
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ const { id, name } = Astro.props
</style>

<script>
import { $ } from "@/lib/dom-selector"

document.addEventListener("astro:page-load", () => {
const $lightbox = document.getElementById("lightbox") as HTMLDialogElement
const $gallery = document.getElementById("boxer-gallery") as HTMLElement
const $lightbox = $("#lightbox") as HTMLDialogElement
const $gallery = $("#boxer-gallery") as HTMLElement
if (!$gallery) return

const $links = $gallery?.querySelectorAll("a")
Expand Down Expand Up @@ -167,7 +169,7 @@ const { id, name } = Astro.props
$close?.addEventListener("click", close)

$lightbox?.addEventListener("click", (event) => {
const $dialogBg = document.querySelector("[data-dialog-bg]") as HTMLDivElement
const $dialogBg = $("[data-dialog-bg]") as HTMLDivElement
const canClose = event.target === $dialogBg || event.target === $lightbox
if (canClose) close()
})
Expand Down
4 changes: 3 additions & 1 deletion src/components/ButtonUp.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
</div>

<script>
import { $ } from "@/lib/dom-selector"

document.addEventListener("astro:page-load", () => {
let timeout: number = 0 // Identificador para clearTimeout
const $button = document.getElementById("scroll-to-top") as HTMLButtonElement
const $button = $("#scroll-to-top") as HTMLButtonElement

const DISPLAY = { BLOCK: "block", NONE: "none" } as const

Expand Down
4 changes: 3 additions & 1 deletion src/components/CalendarButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Action from "@/components/Action.astro"
</Action>

<script is:inline>
import { $ } from "@/lib/dom-selector"

document.addEventListener("astro:page-load", () => {
const config = {
name: "🥊 La Velada del Año 4 - El Evento del Año",
Expand Down Expand Up @@ -42,7 +44,7 @@ import Action from "@/components/Action.astro"
})
}

const button = document.querySelector("#add-to-calendar")
const button = $("#add-to-calendar")

const handleClick = async () => {
if (status === "loading") return
Expand Down
10 changes: 6 additions & 4 deletions src/components/ClipsModal.astro
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@
</style>

<script>
import { $, $$ } from "@/lib/dom-selector"

document.addEventListener("astro:page-load", () => {
const $clipContainer = document.querySelectorAll(".clip-container")
const $clipDialog = document.querySelector(".clip-dialog") as HTMLDialogElement
const $closeButton = document.querySelector(".close-dialog")
const $ytFrame = document.querySelector(".yt-iframe")
const $clipContainer = $$(".clip-container")
const $clipDialog = $(".clip-dialog") as HTMLDialogElement
const $closeButton = $(".close-dialog")
const $ytFrame = $(".yt-iframe")

if (!$clipDialog) return

Expand Down
4 changes: 3 additions & 1 deletion src/components/SmokeBackground.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
</div>

<script>
import { $ } from "@/lib/dom-selector"

const NUM_PARTICLES = 50 // Número de partículas
const canvas = document.getElementById("smoke-canvas") as HTMLCanvasElement
const canvas = $("#smoke-canvas") as HTMLCanvasElement
const ctx = canvas.getContext("2d") as CanvasRenderingContext2D
let raf: number

Expand Down
14 changes: 8 additions & 6 deletions src/components/TwitchLiveBox.astro
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,22 @@ const { streamer = "ibai" } = Astro.props
</div>

<script is:inline>
import { $ } from "@/lib/dom-selector"

const CONFIG = {
MIDU_API_UPTIME_WORKER: "https://midudev-apis.midudev.workers.dev/uptime",
VELADA_DATE: "2024-07-13 19:00:00 GMT+0100",
TWITCH_PLAYER_URL: "https://player.twitch.tv",
}
const streamer = document.querySelector("#streamer").value
const streamer = $("#streamer").value
const isVeladaTime = new Date().getTime() >= new Date(CONFIG.VELADA_DATE).getTime()
if (isVeladaTime) {
fetch(`${CONFIG.MIDU_API_UPTIME_WORKER}/${streamer}`)
.then((res) => res.json())
.then(({ online }) => {
if (online) {
document.querySelector("#live").style.display = "block"
document.querySelector("#live-frame").innerHTML =
$("#live").style.display = "block"
$("#live-frame").innerHTML =
`<iframe src="${CONFIG.TWITCH_PLAYER_URL}/?channel=${streamer}&parent=${document.location.hostname}" frameborder="0" width="380" height="200" allowfullscreen="true" scrolling="no"></iframe>`
}
})
Expand All @@ -62,9 +64,9 @@ const { streamer = "ibai" } = Astro.props
})
}

const closeButton = document.querySelector("#live-close")
const closeButton = $("#live-close")
closeButton?.addEventListener("click", () => {
document.querySelector("#live").style.display = "none"
document.querySelector("#live").innerHTML = ""
$("#live").style.display = "none"
$("#live").innerHTML = ""
})
</script>
15 changes: 8 additions & 7 deletions src/function/toast.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// from: https://github.com/dgtlss/butterup/tree/main
import { $ } from "@/lib/dom-selector"

interface ToastOptions {
title: string
Expand Down Expand Up @@ -41,7 +42,7 @@ export const butterup: ButterupProps = {
stackedToasts: true,
},
toast({ title, message, type, location, icon, theme, dismissible }) {
let toaster = document.getElementById("toaster")
let toaster = $("#toaster")
if (toaster == null) {
// toaster doesn't exist, create it
toaster = document.createElement("div")
Expand All @@ -54,7 +55,7 @@ export const butterup: ButterupProps = {
document.body.appendChild(toaster)

// Create the toasting rack inside of the toaster
if (document.getElementById("butterupRack") == null) {
if ($("#butterupRack") == null) {
const rack = document.createElement("ol")
rack.id = "butterupRack"
rack.className = "rack"
Expand Down Expand Up @@ -85,8 +86,8 @@ export const butterup: ButterupProps = {
// Check if there are too many toasts on the screen
if (butterup.options.currentToasts >= butterup.options.maxToasts) {
// there are too many toasts on the screen, delete the oldest one
const oldestToast = document.getElementById("butterupRack")?.firstChild
if (oldestToast) document.getElementById("butterupRack")?.removeChild(oldestToast)
const oldestToast = $("#butterupRack")?.firstChild
if (oldestToast) $("#butterupRack")?.removeChild(oldestToast)
butterup.options.currentToasts--
}

Expand Down Expand Up @@ -119,7 +120,7 @@ export const butterup: ButterupProps = {
}

// Add the toast to the rack
document.getElementById("butterupRack")?.appendChild(toast)
$("#butterupRack")?.appendChild(toast)

// check if the user wants an icon
if (icon != null && icon === true) {
Expand Down Expand Up @@ -205,7 +206,7 @@ export const butterup: ButterupProps = {
},
despawnToast(toastId) {
// fade out the toast and then remove it from the DOM
const toast = document.getElementById(toastId)
const toast = $(`#${toastId}`)
// does the toast exist?
if (toast != null) {
toast.className += " fadeOutToast"
Expand All @@ -220,7 +221,7 @@ export const butterup: ButterupProps = {
}
// if this was the last toast on the screen, remove the toaster
if (butterup.options.currentToasts === 0) {
const toaster = document.getElementById("toaster")
const toaster = $("#toaster")
if (toaster) toaster.parentNode?.removeChild(toaster)
}
}, 500)
Expand Down
2 changes: 1 addition & 1 deletion src/sections/PrincipalDate.astro
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ import MapMarkerIcon from "@/icons/map-marker.astro"
// Verifica si el evento ya ha pasado
const eventHasPassed = EVENT_TIMESTAMP < Date.now()
if (eventHasPassed) {
const addToCalendarBtn = document.getElementById("add-to-calendar")
const addToCalendarBtn = $("#add-to-calendar")
if (addToCalendarBtn) {
addToCalendarBtn.remove()
}
Expand Down
2 changes: 1 addition & 1 deletion src/sections/SelectYourBoxer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const boxerColumns = [
new URLSearchParams(window.location.search).get("boxer") ||
"el-mariana"

const updatedSelectedBoxerElement: HTMLElement | null = document.querySelector(
const updatedSelectedBoxerElement: HTMLElement | null = $(
`.boxer-link[data-id=${updatedSelectedBoxerId}]`
)
if (updatedSelectedBoxerElement) {
Expand Down

0 comments on commit 799effa

Please sign in to comment.