-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
276 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/app.d.ts linguist-vendored=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
# queries: security-extended,security-and-quality | ||
|
||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
|
||
# If the Autobuild fails above, remove it and uncomment the following three lines. | ||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
|
||
# - run: | | ||
# echo "Run, Build Application using script" | ||
# ./location_of_script_within_repo/buildscript.sh | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<script lang="ts" context="module"> | ||
import { dev } from "$app/env"; | ||
import type { Load } from "@sveltejs/kit"; | ||
import type { CaptchaGetAll } from "$data/model"; | ||
import type { Insight } from "$types"; | ||
export const prerender = false; | ||
export const load: Load = async ({ fetch }) => { | ||
if (!dev) | ||
return { | ||
status: 403, | ||
error: "You shall not pass! Debug is only available in Debug", | ||
}; | ||
const [_data, _insight] = await Promise.all([ | ||
fetch("/api/getall"), | ||
fetch("/api/insight"), | ||
]); | ||
const [data, insight] = await Promise.all([_data.json(), _insight.json()]); | ||
return { | ||
props: { | ||
data: data as CaptchaGetAll, | ||
insight: insight as Insight, | ||
}, | ||
}; | ||
}; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import Label from "$components/Label.svelte"; | ||
export let data: CaptchaGetAll; | ||
export let insight: Insight; | ||
function I(cate: string) { | ||
return insight.categories[cate]; | ||
} | ||
</script> | ||
|
||
<main class="premium-font my-10 flex flex-col gap-4"> | ||
<h1>Insight created at {insight.created_at}</h1> | ||
|
||
{#each Object.entries(data) as [cate, captcha]} | ||
<h2 class="mt-10">Category: {cate}</h2> | ||
<table class="captcha-table"> | ||
<thead> | ||
<tr class="bg-sky-200 text-xl"> | ||
<th>Category</th> | ||
<th>Index</th> | ||
<th>Image</th> | ||
<th>Character Name</th> | ||
<th>Anime</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{#each captcha.questions as question, index} | ||
<tr class={question.answer ? "bg-green-100" : "bg-red-100"}> | ||
<td>{cate}</td> | ||
<td>{index + 1}</td> | ||
<td> | ||
<div | ||
class="aspect-square bg-cover bg-center mx-auto w-28 h-28" | ||
style="background-image: url({question.image})" | ||
/> | ||
</td> | ||
<td><Label label={question.name} /></td> | ||
<td><Label label={question.anime} /></td> | ||
</tr> | ||
{/each} | ||
</tbody> | ||
</table> | ||
<h2> | ||
Correct Ratio: {I(cate).correct_count}/{I(cate).questions_count} ({I(cate) | ||
.correct_ratio}) | ||
</h2> | ||
{/each} | ||
</main> | ||
|
||
<style lang="postcss"> | ||
tbody > tr > td:nth-child(-n + 2) { | ||
@apply text-2xl font-bold; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7a948fc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
anime-captcha – ./
anime-captcha.vercel.app
anime-captcha-git-main-leomotors.vercel.app
anime-captcha-leomotors.vercel.app