Skip to content

Commit d1ee26b

Browse files
committed
Designed the warning in figma and turned it into html and css and have putten it in place in the second and added Github logo in the navbar
1 parent 67a579f commit d1ee26b

3 files changed

Lines changed: 103 additions & 37 deletions

File tree

homepage.js

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,41 +1330,42 @@ function animate(time){
13301330
if(firstRender){
13311331
firstRender = false
13321332
if(window.scrollY == 0){
1333-
let timeline = gsap.timeline({
1334-
defaults:{
1335-
ease:'power4.inOut',
1336-
duration:3,
1333+
let timeline = gsap.timeline({
1334+
defaults:{
1335+
ease:'power4.inOut',
1336+
duration:3,
1337+
}
1338+
})
1339+
timeline.to('#wave2',{
1340+
scale:1,
1341+
x:window.innerWidth/ 2 - 60,
1342+
y:-window.innerHeight/ 2 + 50,
1343+
})
1344+
.to('#loader-cont',{
1345+
opacity:0
1346+
},"<")
1347+
1348+
.to('#wave',{
1349+
opacity:1,
1350+
duration:2,
1351+
onComplete:()=>{
1352+
opacityallowance = true
1353+
}
1354+
})
1355+
.to(factor,{
1356+
o:1,
1357+
duration:2
1358+
,onComplete:()=>{
1359+
document.getElementById('loader-cont').remove()
1360+
Loadercanvas.remove()
1361+
clearInterval(loaderanimationr)
13371362
}
1338-
})
1339-
timeline.to('#wave2',{
1340-
scale:1,
1341-
x:window.innerWidth/ 2 - 60,
1342-
y:-window.innerHeight/ 2 + 50,
1343-
})
1344-
.to('#loader-cont',{
1345-
opacity:0
1346-
},"<")
1347-
1348-
.to('#wave',{
1349-
opacity:1,
1363+
},"<-.5")
1364+
.to('#wave2',{
1365+
opacity:0,
13501366
duration:2,
1351-
onComplete:()=>{
1352-
opacityallowance = true
1353-
}
1354-
})
1355-
.to(factor,{
1356-
o:1,
1357-
duration:2
1358-
,onComplete:()=>{
1359-
document.getElementById('loader-cont').remove()
1360-
Loadercanvas.remove()
1361-
clearInterval(loaderanimationr)
1362-
}
1363-
},"<-.5")
1364-
.to('#wave2',{
1365-
opacity:0,
1366-
duration:2,
1367-
},'<')
1367+
},'<')
1368+
13681369
}else{
13691370
Loadercanvas.remove()
13701371
document.getElementById('loader-cont').remove()

index.html

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,15 @@
9595
transform: translateX(-50%);
9696
opacity: 0;
9797
}
98-
98+
.content{
99+
font-family: 'Myfont';
100+
font-size: 32px;
101+
width: calc(100% - 94px);
102+
}
103+
.Warning::before,
104+
.Warning::after {
105+
box-sizing: content-box !important;
106+
}
99107
textPath {
100108
fill: #ffffff;
101109
font-family: "MyCustomFont";
@@ -138,6 +146,11 @@
138146
#Third{
139147
transform-origin: center;
140148
}
149+
.header{
150+
font-family: 'sub';
151+
font-size:53px ;
152+
}
153+
141154
@font-face {
142155
font-family: 'Myfont';
143156
src: url("./fonts/NeueRegradeVariable.ttf") format("truetype");
@@ -156,6 +169,12 @@
156169
font-style: normal;
157170
font-display: swap;
158171
}
172+
@font-face {
173+
font-family: 'sub';
174+
src: url('fonts/Subatomic.otf') format('opentype');
175+
font-style: normal;
176+
font-display: swap;
177+
}
159178

160179
</style>
161180
<script type="importmap">
@@ -419,8 +438,15 @@
419438
</div>
420439
</a>
421440
<ul style="
422-
align-self: center;margin: 0;
441+
align-self: center;margin: 0;display: flex;
442+
gap: 30px;
443+
align-items: center;
423444
">
445+
<a title="Subsussp" target="_blank" href="https://github.com/Subsussp/THE">
446+
<svg xmlns="http://www.w3.org/2000/svg" style="scale: 1.5;" width="20" height="20" fill="white" viewBox="0 0 24 24">
447+
<path d="M12 .5C5.73.5.5 5.73.5 12a11.5 11.5 0 0 0 7.87 10.94c.58.1.79-.25.79-.56v-2.17c-3.2.7-3.88-1.54-3.88-1.54-.53-1.34-1.3-1.7-1.3-1.7-1.07-.73.08-.72.08-.72 1.18.08 1.8 1.2 1.8 1.2 1.05 1.8 2.75 1.28 3.42.98.1-.76.41-1.28.75-1.57-2.55-.29-5.23-1.27-5.23-5.65 0-1.25.45-2.27 1.2-3.07-.12-.3-.52-1.5.11-3.12 0 0 .98-.31 3.2 1.17a11.1 11.1 0 0 1 5.82 0c2.22-1.48 3.2-1.17 3.2-1.17.63 1.62.23 2.82.11 3.12.75.8 1.2 1.82 1.2 3.07 0 4.4-2.69 5.36-5.25 5.64.42.36.8 1.08.8 2.18v3.23c0 .31.21.67.8.56A11.5 11.5 0 0 0 23.5 12C23.5 5.73 18.27.5 12 .5z"/>
448+
</svg>
449+
</a>
424450
<li>
425451
<div class="disposable">
426452
<canvas id="wave" style="cursor: pointer;height: 100%;opacity: 0;" class="sfxbtn"></canvas>

src/js/three.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { RenderPass } from 'https://cdn.jsdelivr.net/npm/three@0.158.0/examples/
77
import { UnrealBloomPass } from 'https://cdn.jsdelivr.net/npm/three@0.158.0/examples/jsm/postprocessing/UnrealBloomPass.js';
88
import { OutputPass } from 'https://cdn.jsdelivr.net/npm/three@0.158.0/examples/jsm/postprocessing/OutputPass.js';
99
import { OrbitControls } from 'https://cdn.jsdelivr.net/npm/three@0.158.0/examples/jsm/controls/OrbitControls.js';
10-
import { fetchaudio } from './fetchaudio.js';
11-
import { audioCache } from './var/audiocache.js';
1210
import { GUI } from 'https://cdn.jsdelivr.net/npm/lil-gui@0.18/+esm';
1311
import { float, If, PI, color, cos, instanceIndex, Loop, mix,atan,vec2,length , mod, sin, instancedArray, Fn, uint, uniform, uniformArray, hash, vec3, vec4, ceil, min, time } from '../../build/three.tsl.js';
1412
import { listener, sound } from './var/threesound.js';
@@ -21,6 +19,47 @@ let button1 = document.createElement('button')
2119
const audioLoader = new THREE.AudioLoader();
2220
let main = document.getElementById('main')
2321
let currentSceneHandler = null;
22+
let inject = true
23+
document.body.insertAdjacentHTML('beforebegin',`<div class="Warning" id="warnin" style="position: absolute;border: 2px solid white;top: 50%;padding-top:44px;left: 50%;transform: translate(-50%,-50%) scale(0.7);transform-origin: center ;display: flex;width: 750px;height: 400px;flex-direction:column;background-color: black;z-index:600">
24+
<div>
25+
<div style="color: white;text-align: center;" class="header">GPU REQUIRED</div>
26+
<svg width="100%" height="20">
27+
<line x1="224" y1="10" x2="528" y2="10" stroke="white"/>
28+
</svg>
29+
</div>
30+
<div class="content" style="color: white;width:100%;position: absolute;top: 58%;left: 50%;transform: translate(-50%,-50%);text-align: center;padding: 0 47px;">
31+
You need a GPU or at least an integrated one <br /> for the website to work properly, though <br /> integrated GPUs aren't recommended.
32+
</div>
33+
</div>`)
34+
function handleClick() {
35+
const item = document.getElementById('warnin');
36+
37+
if (inject && item) {
38+
inject = false;
39+
40+
item.innerHTML = `
41+
<div style="font-size: 46px;font-family: 'MyCustomFont1';color: azure;position: absolute;top: 25%;left: 50%;transform: translate(-50%,-50%);text-align: center;width: 100%;">
42+
If the website isn't working <span style="color: rgb(133, 23, 23);">properly</span>
43+
</div>
44+
45+
<svg style="width: 100%;height:10%;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);">
46+
<line x1="32.5" y1="20" x2="718.5" y2="20" stroke="white"/>
47+
</svg>
48+
49+
<div style="font-size: 48px;font-family: 'MyCustomFont1';color: azure;position: absolute;top: 70%;left: 50%;transform: translate(-50%,-50%);text-align: center;width: 100%;">
50+
check out the <a target="_blank" href="https://flavortown.hackclub.com/projects/4068" style="background-color: rgb(24, 20, 20);color: white;text-decoration: none;">\`Demo\`</a> in my repo
51+
</div>
52+
`;
53+
} else if (item && !inject) {
54+
item.remove();
55+
document.removeEventListener('click', handleClick);
56+
}
57+
}
58+
59+
document.addEventListener('click', handleClick);
60+
61+
62+
2463
function configaudio(buffer) {
2564
minN = 0
2665
minh = 0;

0 commit comments

Comments
 (0)