This layout is a personal experiment created in Webflow with Grid and Flex CSS property after one of my typo student request. I tried build and mimic similar layout and behaviours as in its predecessor and inspiration, the Lubalin 100 website.
This Square field was builded with the Grid CSS property.
This layout is an experiment created in Webflow with Grid and Flex CSS property. We try build and mimic similar layout and behaviours as in its predecessor and inspiration, Lubalin 100 website.
Modul squares are builded with Flex CSS property.
<audio class="audio-player" src="https://goeast-s3-server.s3.eu-central-1.amazonaws.com/1.mp3" controls></audio>
<video class="video-player" src="https://forraivideotestfiles.s3.eu-central-1.amazonaws.com/videos/coverr-hanging-up-laundry-1584440535002.mp4" poster="https://assets.website-files.com/5bbaed3988480934a8e10250/5da38851848a16533edc1d6a_Tipost%202019%20Facebook%20Front.svg" controls autoplay loop></video>
Attributes
See above the embed code. If the attribute is not presented in code, then it's not applied on player.
controls – shows/hide video player controls
autoplay
loop
mute – if this is not included, the autoplay in Chrome will not start
poster – url of the cover image
w3school description
For proper working you should copy this embed code into your document, use your own links to your audio files and use any image or html element to start or stop to play an audio. Important thing is setup a proper ID on clickable elements (any HTML element) based on linked audio files ID's in embedded code. Audio starts play on a click and stops when you click again on the image.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
const audioFiles = {
"one" : src="https://goeast-s3-server.s3.eu-central-1.amazonaws.com/1.mp3",
"two" : src="https://goeast-s3-server.s3.eu-central-1.amazonaws.com/2.mp3",
"three": src="https://goeast-s3-server.s3.eu-central-1.amazonaws.com/4.mp3",
"four": src="https://goeast-s3-server.s3.eu-central-1.amazonaws.com/folder/5.mp3",
"five": src="https://goeast-s3-server.s3.eu-central-1.amazonaws.com/folder/6.mp3"
} const audioObjects = {} function play(id) {
const isPaused = (audioObjects[id].currentTime <= 0 || audioObjects[id].paused)
stopAll();
// only start if its not playing (if you click on a playing one, it stops)
if (isPaused){
audioObjects[id].currentTime = 0;
audioObjects[id].play();
}
} function stopAll(){
Object.keys(audioObjects).forEach(function(id) {
audioObjects[id].pause()
});
} function loadAll(){
Object.keys(audioFiles).forEach(function(id) {
const file = audioFiles[id]
audioObjects[id] = new Audio();
audioObjects[id].src = file
audioObjects[id].addEventListener('load', function () {
//debug only
//console.log("loaded" + id +": " + file)
});
const playButton = document.getElementById(id)
playButton.addEventListener("click", () => {
play(id);
});
});
}