Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/00-team/dream
Browse files Browse the repository at this point in the history
  • Loading branch information
SadraTghvi committed Jun 23, 2024
2 parents c18d27b + 159f320 commit 46e3392
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 226 deletions.
291 changes: 177 additions & 114 deletions app/index.html

Large diffs are not rendered by default.

68 changes: 4 additions & 64 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Alert } from 'comps'
import { Orders } from 'pages/dashboard/orders'
import { Profile } from 'pages/dashboard/profile'
import { Wallet } from 'pages/dashboard/wallet'
import { Component, createEffect, lazy, onCleanup, onMount } from 'solid-js'
import { Component, createEffect, lazy, onMount } from 'solid-js'
import { render } from 'solid-js/web'
import { setTheme, theme } from 'store/theme'

Expand All @@ -17,10 +17,12 @@ import './style/base.scss'
import './style/config.scss'
import './style/fonts/imports.scss'
import './style/theme.scss'
import './style/signature.scss'

import './layout/signature/style.scss'
import './layout/style/footer.scss'

import './signature'

const App: Component<RouteSectionProps> = P => {
const prefersDarkColorScheme = () =>
matchMedia && matchMedia('(prefers-color-scheme: dark)').matches
Expand All @@ -35,78 +37,16 @@ const App: Component<RouteSectionProps> = P => {
document.documentElement.setAttribute('data-theme', theme())
})

// onMount(() => {
// if ('serviceWorker' in navigator) {
// navigator.serviceWorker.register('/sw.js')
// }
// })

return (
<>
<Navbar />
{P.children}
{/* <Footer />
<Signature /> */}
<Alert />
</>
)
}

let LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$#!%^&*()_-+=/'
let ORIGIN = 'developed by 00 team'

const Root = () => {
let signature: HTMLElement

let interval
let interval2

function hackEffect() {
if (!signature) return

let counter = 0

interval = setInterval(() => {
if (counter >= ORIGIN.length) {
// signature.style.textShadow = '0 0 74px gold;'
clearInterval(interval)
if (!signature.classList.contains('active'))
signature.className += ' active'
}

signature.innerText = signature.innerText
.split('')
.map((letter, index) => {
if (index < counter) return ORIGIN[index]

return LETTERS[Math.floor(Math.random() * LETTERS.length)]
})
.join('')
}, 30)

interval2 = setInterval(() => {
counter++
if (counter >= ORIGIN.length) clearInterval(interval2)
}, 100)
}

onMount(() => {
signature = document.querySelector<HTMLElement>('a.signature-00-team')

let observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
hackEffect()
observer.unobserve(signature)
}
}, {})

observer.observe(signature)
})

onCleanup(() => {
clearInterval(interval)
clearInterval(interval2)
})
return (
<Router>
<Route component={App}>
Expand Down
14 changes: 0 additions & 14 deletions app/layout/signature/index.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions app/layout/signature/style.scss

This file was deleted.

1 change: 1 addition & 0 deletions app/pages/products/style/popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ main.products .product-popup {
gap: 0.5rem;

label {
white-space: nowrap;
text-transform: capitalize;
}

Expand Down
33 changes: 33 additions & 0 deletions app/signature.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
let signature: HTMLAnchorElement = document.querySelector('.signature-00-team')

const LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$#!%^&*()_-+=/'
const ORIGIN = signature.innerText

function hack_effect() {
let counter = 0

let interval = setInterval(() => {
if (counter >= ORIGIN.length) clearInterval(interval)

signature.innerText = signature.innerText
.split('')
.map((_, i) => {
if (i < counter) return ORIGIN[i]

return LETTERS[Math.floor(Math.random() * LETTERS.length)]
})
.join('')
}, 30)

let counter_interval = setInterval(() => {
counter++
if (counter >= ORIGIN.length) clearInterval(counter_interval)
}, 100)
}

let signature_00_team_observer = new IntersectionObserver(([entry]) => {
if (!entry.isIntersecting) return
hack_effect()
signature_00_team_observer.disconnect()
})
signature_00_team_observer.observe(signature)
6 changes: 2 additions & 4 deletions app/store/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { createEffect, createSignal } from 'solid-js'
import { createSignal } from 'solid-js'

const [theme, setTheme] = createSignal<'light' | 'dark'>('dark')

export { theme, setTheme }
export const [theme, setTheme] = createSignal<'light' | 'dark'>('dark')
16 changes: 16 additions & 0 deletions app/style/signature.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.signature-00-team {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #040404;
color: #f2f2f2;

direction: ltr;
font-family: 'Graduate';
font-size: clamp(1.2rem, 2.3vw + 0.7rem, 2.1rem);

padding: 1.5rem;
text-decoration: none;
text-transform: uppercase;
}

0 comments on commit 46e3392

Please sign in to comment.