naumch1k / one-fall Goto Github PK
View Code? Open in Web Editor NEWLanding page for ONE FALL, Salem-based melodic punk and hardcore quartet has rapidly made a mark in New England
Home Page: https://develop--one-fall.netlify.app/
Landing page for ONE FALL, Salem-based melodic punk and hardcore quartet has rapidly made a mark in New England
Home Page: https://develop--one-fall.netlify.app/
In our project, we currently use a custom useInitAudioTrackRefs
hook to create a reference for each track's audio element on our page. These refs are later used to obtain the duration of each track, calculate album duration, start and pause track playback, and get the timestamp, audio object currentTime
property, of the playing track to display the player's progress.
useInitAudioTrackRefs
iterates through all the albums and collects tracks into a single array.
const [tracks, setTracks] = useState<ITrack[]>([])
useEffect(() => {
const getAllTracks = (data: { items: IAlbum[] }) => {
let allTracks: ITrack[] = []
data.items.forEach(album => {
album.tracks.items.forEach((track: ITrack) => allTracks.push(track))
})
setTracks(allTracks)
}
getAllTracks(data)
}, [data])
Then, a key-value pair is created in the audioTrackRefs
object for each track in the tracks array. The key is set to the track's name.
const audioTrackRefs: Record<string, TAudioRef> = {}
tracks.forEach(track => audioTrackRefs[track.name] = createRef<HTMLAudioElement>())
The potential problem here is that if two albums have tracks with the same name (which is not uncommon in the music industry, e.g., Greatest Hits), the reference created for the second track will overwrite the reference created for the first track. This can lead to incorrect duration calculations for tracks and albums and playing the wrong track.
To avoid key collisions, we should use a unique identifier for each track as the key. This could be a combination of the album name and the track name, or a unique track ID if available.
const uniqueKey = `${track.albumName}-${track.name}`
The proposed solution requires updating useAlbumInfo
and useAudioTrackDuration
hooks to use these unique keys.
When we integrate with a database or a CMS, we could leverage the unique identifier (e.g., _id
or equivalent) provided by the database or CMS to reference each track.
Several UI elements do not display hover styles when using the Microsoft Edge browser
Steps to reproduce the behavior:
The background color of the BUY DIGITAL ALBUM button should change to yellow when hovered over
In Microsoft Edge, the background color of the BUY DIGITAL ALBUM button does not change when hovered over
Desktop:
Other affected elements include Audio Track, Event Link, Merch Card image, and Merch Card BUY ON BANDCAMP button.
The issue appears to be caused by Microsoft Edge having a border around the window that reduces the viewport width by at least 8px. Hover effects in our project are set kick in at a minimum screen width of 1280px
. Changing the media query to @media screen and (min-width: 1272px)
resolves the issue.
Additionally, during the debugging process, it was also discovered that layouts originally intended for tablet landscape are now applied on smaller desktop devices in Microsoft Edge for the same reason.
Adding contributing guide would be nice. Also new-issue
workflow will need to be updated with following:
For full info on how to contribute, please check out our [contributors guide]().
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.