-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
157 lines (136 loc) · 7.85 KB
/
index.html
File metadata and controls
157 lines (136 loc) · 7.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" src="style.css">
<title>Phung Dao's Portfolio: Order & Chaos of the Universe</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.2/jquery.min.js"></script>
<button id="button" aria-describedby="tooltip">Final Fantasy XIII: Serah's Theme</button>
<div id="tooltip" role="tooltip"></div>
<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=Chewy&family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Meow+Script&family=Modak&display=swap" rel="stylesheet">
</head>
<body>
<div class="container" id="load">
<div class="text-center mx-auto comic-neue-regular" id="quote">
"There seems to be a kind of order in the universe... in the movement of the stars and the turning of the Earth and the changing of the seasons.<br>But human life is almost pure chaos."
</div>
</div>
<canvas id="bg"></canvas>
<div id="audio-control" style="z-index: 1000; position: absolute; right: 5%; bottom: 8%;">
<p id="song-title" style="font-size: 8px; color: #fff">Final Fantasy XIII: Serah's Theme</p>
<button id="playPause" class="hidden"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fff">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" />
</svg></button>
<button id="play-button" style="background-color:transparent;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fff">
<path fill-rule="evenodd" d="M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z" clip-rule="evenodd" />
</svg></button>
<audio width="0" autoplay="false" height="0" src="serahstheme.mp3"></audio>
<input type='range' class='timeline' max='100' value='0'>
</div>
<div id="links" style="position: absolute; left: 5%; bottom: 8%;background-color: transparent; ">
<a href="https://portfolio.phungdao.com" target="_blank">
<button id="portfolio" style="margin-left: 20px;"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#fff" class="bi bi-columns-gap" viewBox="0 0 16 16">
<path d="M6 1v3H1V1h5zM1 0a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1H1zm14 12v3h-5v-3h5zm-5-1a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-5zM6 8v7H1V8h5zM1 7a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H1zm14-6v7h-5V1h5zm-5-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1h-5z"/>
</svg></button>
<p style="padding: 5px 5px; margin-left: 20px;">Portfolio</p></a>
</div>
<div class="links2" style="position: absolute; left: 5%; bottom: 12%;background-color: transparent">
<a href="https://rsm.io/phung" target="_blank">
<button id="resume"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#fff" class="bi bi-r-square-fill" viewBox="0 0 16 16">
<path d="M6.835 5.092v2.777h1.549c.995 0 1.573-.463 1.573-1.36 0-.913-.596-1.417-1.537-1.417H6.835Z"/>
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2Zm3.5 4.002h3.11c1.71 0 2.741.973 2.741 2.46 0 1.138-.667 1.94-1.495 2.24L11.5 12H9.98L8.52 8.924H6.836V12H5.5V4.002Z"/>
</svg></button>
<p style="padding: 5px 5px; margin-left: 20px;">Resume</p></a></div>
</div>
</div>
<!-- <div class="words"> -->
<!-- <p id="typing"></p> -->
<!-- <p id="typing2"></p>
<p id="typing3"></p> -->
<!-- </div> -->
<script id="main" type="module" src="main.js"></script>
<script>
const playerButton = document.querySelector('#playPause'),
audio = document.querySelector('audio'),
timeline = document.querySelector('.timeline'),
soundButton = document.querySelector('#play-button'),
playIcon = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fff">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" />
</svg>`,
pauseIcon = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fff">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
`,
soundIcon = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fff">
<path fill-rule="evenodd" d="M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z" clip-rule="evenodd" />
</svg>`,
muteIcon = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#fff">
<path fill-rule="evenodd" d="M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>`;
audio.volume = '.20'
toggleAudio()
function toggleAudio () {
if (audio.paused) {
playerButton.innerHTML = pauseIcon;
audio.play();
} else {
audio.pause();
playerButton.innerHTML = playIcon;
}
}
playerButton.addEventListener('click', toggleAudio);
function changeTimelinePosition () {
const percentagePosition = (100*audio.currentTime) / audio.duration;
timeline.style.backgroundSize = `${percentagePosition}% 100%`;
timeline.value = percentagePosition;
}
audio.ontimeupdate = changeTimelinePosition;
function changeSeek () {
const time = (timeline.value * audio.duration) / 100;
audio.currentTime = time;
}
timeline.addEventListener('change', changeSeek);
function toggleSound () {
audio.muted = !audio.muted;
soundButton.innerHTML = audio.muted ? muteIcon : soundIcon;
}
soundButton.addEventListener('click', toggleSound);
// addStuff.id = "mute";
// addStuff.innerHTML = "<img src='images/audio.png' style='z-index:10000; width: 25px; position: absolute; bottom: 5%; right: 5%; animation: 0.5s linear 0s 50 normal none running pulse;'>"
function sound() {
const audio = document.getElementById('music')
if(audio.play) {
audio.volume = '0.25'
}
}
$('#mute').click(function(){
const audio = document.getElementById('music')
if(audio.volume == '0') {
audio.volume = '0.25'
} else {
audio.volume = '0';
}
})
// audioEle.innterHTML = "<button id='mute'></button>"
const audioControl = document.getElementById('audio-control')
const addStuff = document.createElement('button')
// const audioEle = document.createElement('audio')
// audioEle.id = "music";
// audioEle.src = "serahstheme.mp3";
// audioEle.volume = '.25';
// audioEle.autoplay = "true"
// audioControl.appendChild(audioEle)
</script>
</body>
</html>