Skip to content

Commit

Permalink
Final Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
R3ISilva committed Feb 13, 2023
0 parents commit 8634645
Show file tree
Hide file tree
Showing 26 changed files with 1,095 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/Onde andas.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# R3ISilva.github.io
Tell me where you've been and I'll tell you who you are.
Autobiography made out of interactive soundscapes.
Binary file added audio/bar/anim.wav
Binary file not shown.
Binary file added audio/bar/hover.wav
Binary file not shown.
Binary file added audio/favorite_spot/anim.wav
Binary file not shown.
Binary file added audio/favorite_spot/hover.wav
Binary file not shown.
Binary file added audio/home/anim.wav
Binary file not shown.
Binary file added audio/home/hover.wav
Binary file not shown.
Binary file added audio/studio/anim.wav
Binary file not shown.
Binary file added audio/studio/hover.wav
Binary file not shown.
Binary file added audio/work/anim.wav
Binary file not shown.
Binary file added audio/work/hover.wav
Binary file not shown.
Binary file added audio/zone/anim.wav
Binary file not shown.
Binary file added audio/zone/hover.wav
Binary file not shown.
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PSI1</title>
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700;900&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha512-z4OUqw38qNLpn1libAN9BsoDx6nbNFio5lA6CuTp9NlK83b89hgyCVq+N5FdBJptINztxn1Z3SaKSKUS5UP60Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js" integrity="sha512-6+YN/9o9BWrk6wSfGxQGpt3EUK6XeHi6yeHV+TYD2GR0Sj/cggRpXr1BrAQf0as6XslxomMUxXp2vIl+fv0QRA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body id="graph">
<p id="animation-text">click to start</p>
<svg id="lines" height="100%" width="100%"></svg>
<div id="nome" class="nome">
<p> João Silva, 2023 </p>
</div>
</body>
<script src="scripts/config.js"></script>
<script src="scripts/model.js"></script>
<script src="scripts/audio.js"></script>
<script src="scripts/graph.js"></script>
<script src="scripts/script.js"></script>
</html>
50 changes: 50 additions & 0 deletions scripts/audio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
class GraphAudio {

constructor(backgroundAudio) {
this.audios = new Map()
this.addAudio(backgroundAudio, backgroundAudio)
this.backgroundAudio = backgroundAudio
this.currentPlayingID = undefined
}

addAudio(id, src) {
if (this.audios.has(id)) return
const audio = {
howl: new Howl({
src: '../audio/' + src,
loop: true,
volume: 0
}),
id: undefined
}
this.audios.set(id, audio)
audio.howl.once('load', () => {
audio.id = audio.howl.play()
})
return audio
}

playAudio(id) {
const audio = this.audios.get(id)
if (audio === undefined) throw new Error("Audio '" + id + "' not found")

// Same audio, return
if (this.currentPlayingID !== undefined && audio.id === this.currentPlayingID) return

// Pause current sound
if (this.currentPlayingID !== undefined) {
this.stopAudio(this.currentPlayingID)
}

// Play new sound
audio.howl.fade(audio.howl.volume(audio.id), 1.0, 500, audio.id)
this.currentPlayingID = id
}

stopAudio(id) {
let audio = this.audios.get(id)
if (audio === undefined) throw new Error("Audio '" + this.currentPlayingID + "' not found")

audio.howl.fade(audio.howl.volume(audio.id), 0, 500, audio.id)
}
}
171 changes: 171 additions & 0 deletions scripts/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
const graphConfig = {
title: "Tell me where you've been and I'll tell you who you are",
circlesContainerId: 'graph',
linesContainerId: 'lines',
backgroundAudio: 'zone/hover.wav',
mainCircle: 'zone',
circles: {
zone: {
text: 'ZONE',
size: 'normal',
priority: 0,
prerequisites: [],
lines: [
{ adjacentCircle: 'work', isDashed: false },
{ adjacentCircle: 'home', isDashed: false },
{ adjacentCircle: 'studio', isDashed: false },
{ adjacentCircle: 'bar', isDashed: false },
{ adjacentCircle: 'favorite_spot', isDashed: false }
],
animation: {
audio: 'zone/anim.wav',
steps: [
{
text: 'ZONE, the only non-physical soundscape',
duration: 1000
},
{
text: 'A blend of soundscapes',
duration: 1000
}
]
}
},
work: {
text: 'WORK',
size: 'normal',
hoverAudio: 'work/hover.wav',
priority: 1,
prerequisites: ['zone'],
lines: [
{ adjacentCircle: 'productivity', isDashed: true }
],
animation: {
audio: 'work/anim.wav',
steps: [
{
text: 'The place to sustain other places',
duration: 1000
}
]
}
},
studio: {
text: 'STUDIO',
size: 'normal',
hoverAudio: 'studio/hover.wav',
priority: 1,
prerequisites: ['zone'],
lines: [
{ adjacentCircle: 'productivity', isDashed: true },
{ adjacentCircle: 'friends', isDashed: true }
],
animation: {
audio: 'studio/anim.wav',
steps: [
{
text: 'A place to work, create, and have fun,',
duration: 1000
},
{
text: 'a good place for a good amount of productivity and leisure',
duration: 1000
}
]
}
},
home: {
text: 'HOME',
size: 'normal',
hoverAudio: 'home/hover.wav',
priority: 1,
prerequisites: ['zone'],
lines: [
{ adjacentCircle: 'family', isDashed: true },
{ adjacentCircle: 'productivity', isDashed: true },
{ adjacentCircle: 'food', isDashed: true },
{ adjacentCircle: 'friends', isDashed: true }
],
animation: {
audio: 'home/anim.wav',
steps: [
{
text: "A place where I'm myself the most,",
duration: 1000
},
{
text: "at 21 years old, I've spent ~100 000 hours at home.",
duration: 1000
}
]
}
},
bar: {
text: 'BAR',
size: 'normal',
hoverAudio: 'bar/hover.wav',
priority: 1,
prerequisites: ['zone'],
lines: [
{ adjacentCircle: 'food', isDashed: true },
{ adjacentCircle: 'friends', isDashed: true }
],
animation: {
audio: 'bar/anim.wav',
steps: [
{
text: 'A place to relax and brainstorm',
duration: 1000
}
]
},
},
favorite_spot: {
text: 'FAVORITE SPOT',
size: 'normal',
hoverAudio: 'favorite_spot/hover.wav',
priority: 1,
prerequisites: ['zone'],
lines: [
{ adjacentCircle: 'friends', isDashed: true }
],
animation: {
audio: 'favorite_spot/anim.wav',
steps: [
{
text: 'A place to forget everything,',
duration: 1000
},
{
text: 'and experience the sound and landscape',
duration: 1000
}
]
}
},
family: {
text: 'FAMILY',
size: 'small',
priority: 2,
prerequisites: ['home']
},
friends: {
text: 'FRIENDS',
size: 'small',
priority: 2,
prerequisites: ['home', 'studio', 'bar', 'favorite_spot']
},
food: {
text: 'FOOD',
size: 'small',
priority: 2,
prerequisites: ['home', 'bar']
},
productivity: {
text: 'PRODUCTIVITY',
size: 'small',
priority: 2,
prerequisites: ['work', 'studio', 'home']
}
}
}
Loading

0 comments on commit 8634645

Please sign in to comment.