-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from bhavya32/yt_speedload
YouTube Embeds And Styling Improvement
- Loading branch information
Showing
7 changed files
with
108 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<template v-if="!loaded"> | ||
|
||
<img class="absolute inset-0 bottom-0 left-0 right-0 top-0 h-full w-full" | ||
:src="`https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`" alt="Youtube video thumbnail" | ||
style="z-index:1" title="Please wait for the YT Player to load" /> | ||
|
||
<div class="absolute spinner" style="z-index:1"></div> | ||
|
||
</template> | ||
|
||
<iframe class="embed-responsive-item absolute bottom-0 left-0 right-0 top-0 h-full w-full" :src="videoUrl" | ||
style="z-index: 0" allowfullscreen @load="loaded=true" /> | ||
|
||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'YoutubeVid', | ||
props: { | ||
videoId: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
data() { | ||
return { | ||
loaded: false, | ||
videoUrl: `https://www.youtube.com/embed/${this.videoId}` | ||
} | ||
}, | ||
} | ||
</script> | ||
<style scoped> | ||
.spinner { | ||
width: 50px; | ||
height: 50px; | ||
border: 4px solid rgba(0, 0, 0, 0.1); | ||
border-left-color: #910404; | ||
border-radius: 50%; | ||
animation: spin 1s linear infinite; | ||
top: calc(50% - 25px); | ||
left: calc(50% - 25px); | ||
} | ||
@keyframes spin { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
</style> |
7c36541
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sundarbans – ./
sundarbans-sundarbans-projects.vercel.app
sundarbans-git-main-sundarbans-projects.vercel.app