Skip to content

Commit 147c723

Browse files
committed
Mammo redirect
1 parent 61c1aac commit 147c723

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

components/modules/stats/RadarChart.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import * as d3 from "d3"
44
55
/** Services */
6-
import { capitalizeAndReplace } from "@/services/utils"
6+
import { capitalizeAndReplace, isMobile } from "@/services/utils"
77
88
const props = defineProps({
99
series: {
@@ -62,7 +62,7 @@ const buildChart = (chart) => {
6262
const cursorAngle = Math.atan2(y, x)
6363
const cursorDist = Math.sqrt(x * x + y * y)
6464
65-
if (cursorDist > maxRadius) {
65+
if (cursorDist < 10 || cursorDist > maxRadius) {
6666
clearHighlight()
6767
return
6868
}
@@ -99,7 +99,12 @@ const buildChart = (chart) => {
9999
100100
nextTick(() => {
101101
const tooltipWidth = tooltipEl.value?.wrapper ? tooltipEl.value?.wrapper?.getBoundingClientRect()?.width : 100
102-
const offsetX = (cursorAngle < 0 && cursorAngle - 0.5 > -Math.PI / 2) || (cursorAngle > 0 && cursorAngle < Math.PI / 2) ? -(tooltipWidth + 20) : 20
102+
const offsetX =
103+
(cursorAngle < 0 && cursorAngle - 0.5 > -Math.PI / 2) ||
104+
(cursorAngle > 0 && cursorAngle < Math.PI / 2) ||
105+
isMobile()
106+
? -(tooltipWidth + 20)
107+
: 20
103108
const offsetY = -40
104109
tooltip.value.x = event.offsetX + offsetX
105110
tooltip.value.y = event.offsetY + offsetY
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default defineNuxtRouteMiddleware(() => {
2+
if (import.meta.client) return
3+
4+
const host = useRequestHeaders(["host"])?.host
5+
if (host === "https://mammoth.celenium.io/") {
6+
return navigateTo("https://celenium.io/", { redirectCode: 301 })
7+
}
8+
})

0 commit comments

Comments
 (0)