删除无用的header

master v1.0.1
落雨楓 2 years ago
parent 0331de0b3b
commit fbd86beb8e

@ -1,3 +1,5 @@
NOVLEAI_ENVIRONMENT=debug NOVLEAI_ENVIRONMENT=debug
NOVELAI_BACKEND_URL=http://localhost:6969
NOVELAI_MOCK_ENV=false NOVELAI_MOCK_ENV=false
NOVELAI_RECAPTCHA_KEY= NOVELAI_RECAPTCHA_KEY=
NEXT_PUBLIC_IS_ISEKAI=false

1
.gitignore vendored

@ -29,6 +29,7 @@ yarn-error.log*
.env.development.local .env.development.local
.env.test.local .env.test.local
.env.production.local .env.production.local
.env.production
# vercel # vercel
.vercel .vercel

@ -52,6 +52,7 @@ const sharedConfig = {
NEXT_PUBLIC_PADDLE_GIFTKEY_TABLET_ID: process.env.NOVELAI_PADDLE_GIFTKEY_TABLET_ID, NEXT_PUBLIC_PADDLE_GIFTKEY_TABLET_ID: process.env.NOVELAI_PADDLE_GIFTKEY_TABLET_ID,
NEXT_PUBLIC_PADDLE_GIFTKEY_SCROLL_ID: process.env.NOVELAI_PADDLE_GIFTKEY_SCROLL_ID, NEXT_PUBLIC_PADDLE_GIFTKEY_SCROLL_ID: process.env.NOVELAI_PADDLE_GIFTKEY_SCROLL_ID,
NEXT_PUBLIC_PADDLE_GIFTKEY_OPUS_ID: process.env.NOVELAI_PADDLE_GIFTKEY_OPUS_ID, NEXT_PUBLIC_PADDLE_GIFTKEY_OPUS_ID: process.env.NOVELAI_PADDLE_GIFTKEY_OPUS_ID,
NEXT_PUBLIC_IS_ISEKAI: process.env.NOVELAI_IS_ISEKAI,
}, },
productionBrowserSourceMaps: true, productionBrowserSourceMaps: true,
generateBuildId: () => commithash.slice(0, 7) + '-' + process.env.NOVELAI_ENVIRONMENT, generateBuildId: () => commithash.slice(0, 7) + '-' + process.env.NOVELAI_ENVIRONMENT,

@ -1,3 +1,5 @@
export const IsIsekai = process.env.NEXT_PUBLIC_IS_ISEKAI === 'true'
export const Environment = process.env.NEXT_PUBLIC_ENVIRONMENT || 'debug' export const Environment = process.env.NEXT_PUBLIC_ENVIRONMENT || 'debug'
export const CommitHash = process.env.NEXT_PUBLIC_COMMITHASH || 'unknown' export const CommitHash = process.env.NEXT_PUBLIC_COMMITHASH || 'unknown'

@ -153,12 +153,11 @@ function App(props: AppPropsWithErrAndLayout): JSX.Element {
<meta <meta
name="description" name="description"
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
content="GPT-powered AI Storyteller. Driven by AI, construct unique stories, thrilling tales, seductive romances, or just fool around. Anything goes!" content="Naifu AI Image generator!"
/> />
<meta <meta
name="keywords" name="keywords"
content="ai, adventure, writing, novelai, novel ai, anlatan, ai dungeon, aidungeon, openai, \ content="ai, ai image"
nai, games, computer, videogames, text, textadventure, novel, kurumuz, latitude"
/> />
<meta httpEquiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta httpEquiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta httpEquiv="Pragma" content="no-cache" /> <meta httpEquiv="Pragma" content="no-cache" />

@ -1,6 +1,7 @@
import Document, { DocumentContext, DocumentInitialProps, Html, Head, Main, NextScript } from 'next/document' import Document, { DocumentContext, DocumentInitialProps, Html, Head, Main, NextScript } from 'next/document'
import { Fragment } from 'react' import { Fragment } from 'react'
import { ServerStyleSheet } from 'styled-components' import { ServerStyleSheet } from 'styled-components'
import { IsIsekai } from '../globals/constants'
export default class CustomDocument extends Document { export default class CustomDocument extends Document {
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> { static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
@ -35,10 +36,18 @@ export default class CustomDocument extends Document {
<link rel="preconnect" href="https://fonts.gstatic.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" />
<meta name="referrer" content="no-referrer" /> <meta name="referrer" content="no-referrer" />
{/* Remove resources which not exists
<link rel="icon" href="/icons/novelai-round.png" /> <link rel="icon" href="/icons/novelai-round.png" />
<link rel="apple-touch-icon" href="/icons/novelai-square.png" /> <link rel="apple-touch-icon" href="/icons/novelai-square.png" />
<link rel="mask-icon" href="/icons/pen-tip-light.svg" color="#ffffff" /> <link rel="mask-icon" href="/icons/pen-tip-light.svg" color="#ffffff" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
*/}
{IsIsekai && (
<>
<script id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script dangerouslySetInnerHTML={{ __html: 'LA.init({id: "JqlW3LkE9dgxYnN1",ck: "JqlW3LkE9dgxYnN1"})' }}></script>
</>
)}
</Head> </Head>
<body> <body>
<Main /> <Main />

@ -8,7 +8,7 @@ import { useRouter } from 'next/router'
import { AnimatePresence, motion } from 'framer-motion' import { AnimatePresence, motion } from 'framer-motion'
import { HexAlphaColorPicker, HexColorInput } from 'react-colorful' import { HexAlphaColorPicker, HexColorInput } from 'react-colorful'
import { MdFileUpload, MdHelpOutline } from 'react-icons/md' import { MdFileUpload, MdHelpOutline } from 'react-icons/md'
import { FaQuestion } from 'react-icons/fa' import { FaCoffee, FaQuestion } from 'react-icons/fa'
import TextareaAutosize from 'react-textarea-autosize' import TextareaAutosize from 'react-textarea-autosize'
import JSZip from 'jszip' import JSZip from 'jszip'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
@ -64,7 +64,7 @@ import Checkbox from '../components/controls/checkbox'
import { getStorage } from '../data/storage/storage' import { getStorage } from '../data/storage/storage'
import { getUserSetting } from '../data/user/settings' import { getUserSetting } from '../data/user/settings'
import { useReload } from '../hooks/useReload' import { useReload } from '../hooks/useReload'
import { BackendURLTagSearch } from '../globals/constants' import { BackendURLTagSearch, IsIsekai } from '../globals/constants'
import Tooltip from '../components/tooltip' import Tooltip from '../components/tooltip'
import { WorkerInterface } from '../tokenizer/interface' import { WorkerInterface } from '../tokenizer/interface'
import { EncoderType } from '../tokenizer/encoder' import { EncoderType } from '../tokenizer/encoder'
@ -2004,6 +2004,30 @@ function ImageGenContent(): JSX.Element {
<HistoryIcon /> <HistoryIcon />
</OpenHistoryButton> </OpenHistoryButton>
<FlexSpaceFull /> <FlexSpaceFull />
<div
style={{
display: 'flex',
gap: '10px',
alignItems: 'center',
justifyContent: 'space-between'
}}
>
{IsIsekai && (
<ImportImageLink
href="https://www.isekai.cn"
target="_blank"
style={{
fontSize: '0.875rem',
opacity: 0.8,
width: 'max-content',
padding: '0 0 0 10px',
}}
>
<FaCoffee />
&nbsp;
</ImportImageLink>
)}
<ImportImageLink <ImportImageLink
href="//docs.novelai.net" href="//docs.novelai.net"
target="_blank" target="_blank"
@ -2016,6 +2040,7 @@ function ImageGenContent(): JSX.Element {
> >
<FaQuestion /> <FaQuestion />
</ImportImageLink> </ImportImageLink>
</div>
</HideMobileInline> </HideMobileInline>
</MainTopperInnerRight> </MainTopperInnerRight>
</MainTopper> </MainTopper>
@ -2322,8 +2347,7 @@ function ImageGenContent(): JSX.Element {
SD_TOKEN_LIMIT SD_TOKEN_LIMIT
} }
style={{ style={{
height: `${ height: `${((promptTokens[promptid] ?? 0) /
((promptTokens[promptid] ?? 0) /
SD_TOKEN_LIMIT) * SD_TOKEN_LIMIT) *
100 100
}%`, }%`,
@ -3692,7 +3716,6 @@ function GenerationOptions(props: {
maxRows={6} maxRows={6}
placeholder="Anything in here is added to the preset selected above." placeholder="Anything in here is added to the preset selected above."
value={props.negPrompt ?? ''} value={props.negPrompt ?? ''}
warn={props.negPromptTokens > SD_TOKEN_LIMIT}
onChange={(e) => { onChange={(e) => {
props.setNegPrompt((e.target.value || '').replace(/(\n|\r)/g, '')) props.setNegPrompt((e.target.value || '').replace(/(\n|\r)/g, ''))
}} }}

Loading…
Cancel
Save