Compare commits

...

4 Commits

8 changed files with 75 additions and 16 deletions

19
assets/img/logo_color.svg Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100%"
height="100%"
viewBox="0 0 78.574379 17.664054"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<path
d="m 64.140362,126.65896 q 0.08682,0.17364 0.08682,0.33487 0,0.16123 -0.03721,0.26045 -0.03721,0.0992 -0.161231,0.23564 -0.124023,0.12402 -0.186035,0.17363 -0.04961,0.0496 -0.21084,0.16123 -1.252636,0.89297 -3.224609,0.89297 -0.979785,0 -1.860352,-0.29765 -0.868164,-0.28526 -1.575097,-0.85577 -0.706934,-0.5705 -1.128613,-1.53789 -0.409278,-0.97978 -0.409278,-2.24482 v -5.02295 h -1.116211 q -0.558105,0 -0.868164,-0.31006 -0.310058,-0.31006 -0.310058,-0.85576 v -0.86816 q 0,-0.57051 0.297656,-0.86817 0.310058,-0.29765 0.880566,-0.29765 h 1.116211 v -2.95176 q 0,-0.5209 0.285254,-0.78135 0.297656,-0.26045 0.880566,-0.38447 l 2.033985,-0.35967 q 0.545703,-0.11162 0.855762,0.22324 0.310058,0.32246 0.310058,0.91778 v 3.33623 h 2.517676 q 0.558105,0 0.855762,0.31005 0.310058,0.29766 0.310058,0.85577 v 0.86816 q 0,0.5457 -0.310058,0.85576 -0.310059,0.31006 -0.855762,0.31006 h -2.517676 v 4.56406 q 0,0.86817 0.384473,1.26504 0.396875,0.39688 1.041797,0.39688 0.446484,0 1.041797,-0.35967 0.756542,-0.4961 1.16582,0.38447 z m 10.541993,-11.02568 q 0.409277,0.13643 0.58291,0.37207 0.186035,0.22324 0.04961,0.71934 l -0.483691,1.90996 q -0.285254,0.99218 -1.066602,0.68213 -0.855761,-0.26045 -1.32705,-0.26045 -1.103809,0 -1.711524,0.66972 -0.595312,0.66973 -0.595312,1.82315 v 5.66787 q 0,0.5457 -0.297657,0.85576 -0.297656,0.31006 -0.843359,0.31006 h -2.108398 q -0.545703,0 -0.84336,-0.31006 -0.297656,-0.31006 -0.297656,-0.85576 v -10.49238 q 0,-0.54571 0.297656,-0.85577 0.297657,-0.31005 0.84336,-0.31005 h 1.339453 q 0.545703,0 0.843359,0.31005 0.310059,0.31006 0.310059,0.85577 v 0.60771 q 1.426269,-1.98437 3.472656,-1.98437 0.95498,0 1.835547,0.28525 z m 7.218163,-0.28525 q 1.21543,0 2.257227,0.28525 1.041797,0.28525 1.922363,0.89297 0.880566,0.60771 1.389063,1.69912 0.508496,1.09141 0.508496,2.56728 v 6.42442 q 0,1.16582 -1.165821,1.16582 H 85.77005 q -0.545704,0 -0.855762,-0.31006 -0.297656,-0.31006 -0.297656,-0.85576 v -0.0992 q -1.761133,1.5999 -4.055567,1.5999 -2.269629,0 -3.646289,-1.10381 -1.364258,-1.11621 -1.364258,-2.93935 0,-1.95957 1.500684,-3.1502 1.500684,-1.19062 3.96875,-1.19062 1.314648,0 2.889746,0.5333 v -0.45889 q 0,-0.89297 -0.607715,-1.40146 -0.595312,-0.5085 -1.699121,-0.5085 -1.599902,0 -2.852539,0.74414 -0.95498,0.5333 -1.463476,-0.45889 l -0.285254,-0.58291 q -0.297657,-0.63251 -0.21084,-0.97978 0.08682,-0.34727 0.520898,-0.62012 0.917774,-0.58291 2.17041,-0.91777 1.252637,-0.33486 2.418457,-0.33486 z m -0.223242,10.64121 q 0.979785,0 1.649512,-0.4961 0.682129,-0.49609 0.682129,-1.04179 v -1.0418 q -1.203028,-0.55811 -2.282031,-0.55811 -0.930176,0 -1.500684,0.44649 -0.558106,0.44648 -0.558106,1.15342 0,0.70693 0.545704,1.12861 0.545703,0.40928 1.463476,0.40928 z m 17.264063,-3.98116 4.043161,5.20899 q 0.37207,0.5333 0.18604,0.85576 -0.17363,0.31006 -0.74414,0.31006 h -2.753323 q -0.508496,0 -0.855761,-0.26045 -0.334864,-0.26045 -0.744141,-0.85576 l -1.773535,-2.54248 -1.79834,2.54248 q -0.409277,0.59531 -0.756543,0.85576 -0.334863,0.26045 -0.868164,0.26045 h -2.294434 q -0.58291,0 -0.781347,-0.31006 -0.186035,-0.31006 0.198437,-0.85576 l 4.067969,-5.20899 -4.043164,-5.28339 q -0.384473,-0.54571 -0.21084,-0.85577 0.186035,-0.31005 0.768945,-0.31005 h 2.716114 q 0.520898,0 0.880566,0.27285 0.359668,0.26045 0.756543,0.84336 l 1.773535,2.59209 1.748731,-2.59209 q 0.421679,-0.59532 0.768945,-0.85577 0.347265,-0.26044 0.855757,-0.26044 h 2.31924 q 0.58291,0 0.76895,0.31005 0.19844,0.31006 -0.18604,0.85577 z m 14.237891,0 4.04316,5.20899 q 0.37207,0.5333 0.18604,0.85576 -0.17364,0.31006 -0.74414,0.31006 h -2.75332 q -0.5085,0 -0.85577,-0.26045 -0.33486,-0.26045 -0.74414,-0.85576 l -1.77353,-2.54248 -1.79834,2.54248 q -0.40928,0.59531 -0.75654,0.85576 -0.33487,0.26045 -0.86817,0.26045 h -2.29443 q -0.58291,0 -0.78135,-0.31006 -0.18604,-0.31006 0.19844,-0.85576 l 4.06797,-5.20899 -4.04317,-5.28339 q -0.38447,-0.54571 -0.21084,-0.85577 0.18604,-0.31005 0.76895,-0.31005 h 2.71611 q 0.5209,0 0.88057,0.27285 0.35967,0.26045 0.75654,0.84336 l 1.77354,2.59209 1.74873,-2.59209 q 0.42168,-0.59532 0.76894,-0.85577 0.34727,-0.26044 0.85576,-0.26044 h 2.31924 q 0.58291,0 0.76895,0.31005 0.19843,0.31006 -0.18604,0.85577 z m 14.23789,0 4.04316,5.20899 q 0.37207,0.5333 0.18603,0.85576 -0.17363,0.31006 -0.74414,0.31006 h -2.75332 q -0.50849,0 -0.85576,-0.26045 -0.33486,-0.26045 -0.74414,-0.85576 l -1.77353,-2.54248 -1.79834,2.54248 q -0.40928,0.59531 -0.75655,0.85576 -0.33486,0.26045 -0.86816,0.26045 h -2.29443 q -0.58291,0 -0.78135,-0.31006 -0.18604,-0.31006 0.19844,-0.85576 l 4.06796,-5.20899 -4.04316,-5.28339 q -0.38447,-0.54571 -0.21084,-0.85577 0.18604,-0.31005 0.76895,-0.31005 h 2.71611 q 0.5209,0 0.88057,0.27285 0.35966,0.26045 0.75654,0.84336 l 1.77353,2.59209 1.74873,-2.59209 q 0.42168,-0.59532 0.76895,-0.85577 0.34727,-0.26044 0.85576,-0.26044 h 2.31924 q 0.58291,0 0.76894,0.31005 0.19844,0.31006 -0.18603,0.85577 z"
transform="translate(-53.139484,-111.05371)"
id="path1"
style="fill:#f65596;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

18
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "traxxx-web",
"version": "0.25.7",
"version": "0.25.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.25.7",
"version": "0.25.8",
"dependencies": {
"@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5",
@ -35,6 +35,7 @@
"express-query-boolean": "^2.0.0",
"express-session": "^1.18.0",
"floating-vue": "^5.2.2",
"graphql": "^16.9.0",
"ip-cidr": "^4.0.0",
"js-cookie": "^3.0.5",
"knex": "^3.1.0",
@ -6310,6 +6311,14 @@
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true
},
"node_modules/graphql": {
"version": "16.9.0",
"resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz",
"integrity": "sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==",
"engines": {
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
}
},
"node_modules/has-bigints": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
@ -14877,6 +14886,11 @@
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true
},
"graphql": {
"version": "16.9.0",
"resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz",
"integrity": "sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw=="
},
"has-bigints": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",

View File

@ -35,6 +35,7 @@
"express-query-boolean": "^2.0.0",
"express-session": "^1.18.0",
"floating-vue": "^5.2.2",
"graphql": "^16.9.0",
"ip-cidr": "^4.0.0",
"js-cookie": "^3.0.5",
"knex": "^3.1.0",
@ -77,5 +78,5 @@
"postcss-custom-media": "^10.0.2",
"postcss-nesting": "^12.0.2"
},
"version": "0.25.7"
"version": "0.25.8"
}

BIN
public/img/og_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -59,10 +59,13 @@ async function onRenderHtml(pageContext) {
<link rel="manifest" href="/img/favicon/site.webmanifest">
<link rel="mask-icon" href="/img/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/img/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#b91d47">
<meta name="msapplication-config" content="/img/favicon/browserconfig.xml">
<meta name="theme-color" content="#f65596">
<meta property="og:image" content="https://traxxx.me/img/og_logo.png" />
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,interactive-widget=resizes-content" />
<meta name="description" content="${desc}" />

View File

@ -1,11 +1,6 @@
export default function consentHandler(req, res, next) {
const redirect = req.headers.referer && new URL(req.headers.referer).searchParams.get('redirect');
if (req.path.includes('/api')) {
next();
return;
}
if (Object.hasOwn(req.query, 'lgbt')) {
const lgbtFilters = (req.tagFilter || []).filter((tag) => !['gay', 'bisexual', 'transsexual'].includes(tag));

View File

@ -41,8 +41,6 @@ export async function curateScenesQuery(query) {
}
export async function fetchScenesApi(req, res) {
console.log('REQUEST', req.query);
const {
scenes,
aggActors,
@ -58,8 +56,6 @@ export async function fetchScenesApi(req, res) {
limit: Number(req.query.limit) || 30,
}, req.user);
console.log('OUTPUT', scenes.length);
res.send(stringify({
scenes,
aggActors,
@ -69,3 +65,33 @@ export async function fetchScenesApi(req, res) {
total,
}));
}
export const scenesSchema = `
type Scene {
id: Int!
title: String
}
`;
export async function fetchScenesGraphql(query, req) {
const {
scenes,
aggActors,
aggTags,
aggChannels,
limit,
total,
} = await fetchScenes({}, {
page: 1,
limit: 30,
}, req.user);
return {
scenes,
aggActors,
aggTags,
aggChannels,
limit,
total,
};
}

View File

@ -9,8 +9,6 @@ import compression from 'compression';
import cookie from 'cookie';
import { renderPage } from 'vike/server'; // eslint-disable-line import/extensions
// import root from './root.js';
import redis from '../redis.js';
import errorHandler from './error.js';
@ -22,6 +20,8 @@ import { fetchMoviesApi } from './movies.js';
import { fetchEntitiesApi } from './entities.js';
import { fetchTagsApi } from './tags.js';
import { graphqlApi } from './graphql.js';
import {
setUserApi,
loginApi,
@ -124,8 +124,6 @@ export default async function initServer() {
router.use(viteDevMiddleware);
}
router.use(consentHandler);
router.get('/consent', (req, res) => {
res.sendFile(path.join(import.meta.dirname, '../../assets/consent.html'));
});
@ -175,6 +173,9 @@ export default async function initServer() {
// TAGS
router.get('/api/tags', fetchTagsApi);
router.post('/graphql', graphqlApi);
router.use(consentHandler);
router.use((req, res, next) => {
/* eslint-disable no-param-reassign */
res.set('Accept-CH', 'Sec-CH-Prefers-Color-Scheme');