forked from gamemcu/www-genshin
-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 04ab5f6
Showing
101 changed files
with
28,895 additions
and
0 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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,35 @@ | ||
# 原神启动 | ||
|
||
> 免责声明: | ||
本网站是一个纯粹的技术示例,旨在展示和分享我们的技术能力。网站的设计和内容受到《原神》的启发,并尽可能地复制了《原神》的登录界面。我们对此表示敬意,并强调这个项目不是官方的《原神》产品,也没有与《原神》或其母公司miHoYo有任何关联。我们没有,也无意从这个项目中获得任何经济利益。这个网站的所有内容仅供学习和研究目的,以便让更多的人了解和熟悉webgl开发技术。 | ||
如果miHoYo或任何有关方面认为这个项目侵犯了他们的权益,请联系我们,我们会立即采取行动。 | ||
|
||
## 简介 | ||
视频介绍:[【超还原!three.js复刻原神启动,网页就能玩】](https://www.bilibili.com/video/BV1E8411v7xy/?share_source=copy_web&vd_source=a8feede4d26d2a3cfa4e68803fdd2c94) | ||
|
||
《原神启动》是一个基于xviewer.js开发的在线网站,本仓库包含了此项目的所有源码。前端开发我们也在摸索学习,不规范的地方欢迎大家指正。由于本网站与《原神》比较接近,大家切勿将本源码用于不正当用途! | ||
|
||
由于网站访问量比较大,免费的托管服务都不让用,我自己的服务器也因为被攻击暂时没有对外了,如果有云服务商愿意赞助将不胜感激。我们也会制作更多有趣的项目开源给大家。 | ||
|
||
启动代码 | ||
|
||
```js | ||
npm i | ||
npm start | ||
``` | ||
如果npm比较慢,可使用cnpm | ||
|
||
## xviewer.js是什么 | ||
xviewer.js是一个基于three.js的插件式渲染框架,它对three.js做了一层简洁优雅的封装,包含了大量实用的组件和插件,目标是让前端开发者能更简单地应用webgl技术。xviewer.js也会在近期开源,我们也在制作更多有趣的演示案例,欢迎大家关注我的b站账号。[【three.js实现水墨杭州迎亚运】](https://www.bilibili.com/video/BV1yG411Z7sw/?share_source=copy_web&vd_source=a8feede4d26d2a3cfa4e68803fdd2c94)也是基于xviewer.js开发的。 | ||
|
||
## three.js教程 | ||
制作教程是一件非常费时费力的事,所以我对所有愿意制作教程的博主给予敬意,以下是我比较推荐的内容 | ||
|
||
官网手册:[Three.js Fundamentals](https://threejs.org/manual/#en/fundamentals) | ||
|
||
视频教程:[Three.js Journey](https://threejs-journey.com/)(b站有搬运) | ||
|
||
shader教程:[The Book of Shaders by Patricio Gonzalez Vivo & Jen Lowe](https://thebookofshaders.com/?lan=ch) | ||
|
||
## 交流群 | ||
暂无计划 |
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,37 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/logo.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" /> | ||
<meta name="description" content="An online genshin loading demo, created by TEAM.x.y.z. team." /> | ||
<title>原神启动</title> | ||
<script> | ||
(function (w, d, s, q, i) { | ||
w[q] = w[q] || []; | ||
var f = d.getElementsByTagName(s)[0], j = d.createElement(s); | ||
j.async = true; | ||
j.id = 'beacon-aplus'; | ||
j.src = 'https://d.alicdn.com/alilog/mlog/aplus/' + i + '.js'; | ||
f.parentNode.insertBefore(j, f); | ||
})(window, document, 'script', 'aplus_queue', '203467608'); | ||
|
||
//集成应用的appKey | ||
aplus_queue.push({ | ||
action: 'aplus.setMetaInfo', | ||
arguments: ['appKey', '6502638e58a9eb5b0adbbd2e'] | ||
}); | ||
/************************以下内容为可选配置内容****************************/ | ||
//是否开启调试模式 | ||
aplus_queue.push({ | ||
action: 'aplus.setMetaInfo', | ||
arguments: ['DEBUG', false] | ||
}); | ||
/******************************************************************/ | ||
</script> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
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,30 @@ | ||
{ | ||
"name": "xviewer-react-template", | ||
"private": true, | ||
"version": "1.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"start": "vite --host", | ||
"build": "tsc && vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.2.15", | ||
"@types/react-dom": "^18.2.7", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"@vitejs/plugin-react": "^4.0.3", | ||
"eslint": "^8.45.0", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.4.3", | ||
"less": "^4.1.3", | ||
"less-loader": "^11.1.3", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.4.5" | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,45 @@ | ||
#root { | ||
margin: 0 0; | ||
padding: 0 0; | ||
text-align: center; | ||
|
||
height: 100%; | ||
width: 100%; | ||
position: absolute; | ||
} | ||
|
||
.logo { | ||
height: 6em; | ||
padding: 1.5em; | ||
will-change: filter; | ||
transition: filter 300ms; | ||
} | ||
.logo:hover { | ||
filter: drop-shadow(0 0 2em #646cffaa); | ||
} | ||
.logo.react:hover { | ||
filter: drop-shadow(0 0 2em #61dafbaa); | ||
} | ||
|
||
@keyframes logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
a:nth-of-type(2) .logo { | ||
animation: logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.card { | ||
padding: 2em; | ||
} | ||
|
||
.read-the-docs { | ||
color: #888; | ||
} |
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,27 @@ | ||
import './App.css' | ||
import { useEffect, useRef, useState } from 'react' | ||
import { Menu } from './pages/Menu' | ||
import { Preloader } from './pages/Preloader' | ||
import { gameManager } from './core/GameManager' | ||
import { unscheduleDelay } from './pages/Scheduler' | ||
import { Canvas } from './pages/Canvas' | ||
|
||
export function App() { | ||
const [loading, setLoading] = useState(true); | ||
useEffect(() => { | ||
gameManager.on("preloaded", () => setLoading(false)); | ||
gameManager.on("restart", () => setLoading(true)); | ||
return () => { | ||
gameManager.reset(); | ||
unscheduleDelay(); | ||
} | ||
}, [gameManager.restartCount]) | ||
|
||
return ( | ||
<> | ||
<Canvas /> | ||
{loading && <Preloader />} | ||
{!loading && <Menu />} | ||
</> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.