add breakpoints.
This commit is contained in:
6
src/utils/breakpoints.ts
Normal file
6
src/utils/breakpoints.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"
|
||||
|
||||
const breakpoints = useBreakpoints(breakpointsTailwind)
|
||||
|
||||
export const isMobile = breakpoints.smallerOrEqual("md")
|
||||
export const isDesktop = breakpoints.greater("md")
|
||||
@@ -116,7 +116,6 @@ export const PROBLEM_PERMISSION = {
|
||||
export const STORAGE_KEY = {
|
||||
AUTHED: "authed",
|
||||
PROBLEM_CODE: "problemCode",
|
||||
USER: "user",
|
||||
}
|
||||
|
||||
export const DIFFICULTY = {
|
||||
@@ -125,24 +124,6 @@ export const DIFFICULTY = {
|
||||
High: "困难",
|
||||
}
|
||||
|
||||
export function getTagColor(tag: string) {
|
||||
return {
|
||||
Low: "success",
|
||||
Mid: "",
|
||||
High: "danger",
|
||||
简单: "success",
|
||||
中等: "",
|
||||
困难: "danger",
|
||||
}[tag]
|
||||
}
|
||||
|
||||
export function buildProblemCodeKey(problemID: string, contestID = "") {
|
||||
if (contestID) {
|
||||
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`
|
||||
}
|
||||
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`
|
||||
}
|
||||
|
||||
const cSource =
|
||||
'#include<stdio.h>\r\n\r\nint main()\r\n{\r\n printf("黄岩一职");\r\n return 0;\r\n}'
|
||||
const cppSource =
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { STORAGE_KEY } from "./constants"
|
||||
|
||||
export function getACRate(acCount: number, totalCount: number) {
|
||||
let rate = totalCount === 0 ? 0.0 : ((acCount / totalCount) * 100).toFixed(2)
|
||||
return `${rate}%`
|
||||
@@ -12,3 +14,21 @@ export function filterEmptyValue(object: any) {
|
||||
})
|
||||
return query
|
||||
}
|
||||
|
||||
export function buildProblemCodeKey(problemID: string, contestID = "") {
|
||||
if (contestID) {
|
||||
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`
|
||||
}
|
||||
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`
|
||||
}
|
||||
|
||||
export function getTagColor(tag: string) {
|
||||
return {
|
||||
Low: "success",
|
||||
Mid: "",
|
||||
High: "danger",
|
||||
简单: "success",
|
||||
中等: "",
|
||||
困难: "danger",
|
||||
}[tag]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user