audio-book-data-source
parent
783406bad5
commit
4d0e7be92d
|
@ -55,8 +55,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
// this.getVideos()
|
|
||||||
fetch('https://management.beanstalkedu.com/items/themes?filter[status][_eq]=published')
|
fetch('https://management.beanstalkedu.com/items/themes?filter[status][_eq]=published')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
@ -65,13 +64,19 @@ export default {
|
||||||
// console.log(this.page[0].id)
|
// console.log(this.page[0].id)
|
||||||
return this.page[0].id
|
return this.page[0].id
|
||||||
})
|
})
|
||||||
fetch('https://management.beanstalkedu.com/items/theme_audio_book')
|
.then((themesID) => {
|
||||||
.then(resp => resp.json())
|
fetch('https://management.beanstalkedu.com/items/theme_audio_book?filter[theme_key][_in]='+ themesID)
|
||||||
.then(audiobooks => {
|
.then(resp => resp.json())
|
||||||
this.audiobooks=audiobooks.data.reverse().slice(0, 3)
|
.then(audiobooks => {
|
||||||
// console.log(this.audiobooks)
|
this.audiobooks=audiobooks.data.reverse().slice(0, 4)
|
||||||
|
// console.log(this.videos)
|
||||||
|
})
|
||||||
|
return themesID
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,201 @@
|
||||||
|
<template>
|
||||||
|
<section class="container mx-auto pt-10 px-4 xl:px-24">
|
||||||
|
<span class="h1-text text-blue-700 font-semibold">Audio Books</span>
|
||||||
|
<h1 class="text-2xl text-justify text-color-2 py-4" v-if="page">{{page[0].audio_books_text}}</h1>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 mt-12 gap-10 place-items-center px-4">
|
||||||
|
<div v-for="audiobooks in audiobooks" :key="audiobooks.id" class="grid">
|
||||||
|
<div @click="showAbModal(audiobooks.file)">
|
||||||
|
<div class="grid place-items-center cursor-pointer">
|
||||||
|
<div class=" ">
|
||||||
|
<img class="w-56" v-if="audiobooks.audio_icon" :src="'https://management.beanstalkedu.com/assets/'+ audiobooks.audio_icon" alt=""/>
|
||||||
|
</div>
|
||||||
|
<h1 class="pt-4 w-fit font-20px text-center">{{audiobooks.title}}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div v-if="abModal" id="abModal" class="flex justify-center abModal">
|
||||||
|
<div class="modal-content" @click="doNothing()">
|
||||||
|
<span @click="hideAbModal" class="close">×</span>
|
||||||
|
<audio controls>
|
||||||
|
<source :src="'https://management.beanstalkedu.com/assets/'+ abID" type="audio/ogg">
|
||||||
|
Your browser does not support the audio element.
|
||||||
|
</audio>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page:null,
|
||||||
|
abModal:false,
|
||||||
|
audiobooks:null,
|
||||||
|
abworld:null,
|
||||||
|
abmath:null,
|
||||||
|
abID:''
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showAbModal(abID){
|
||||||
|
this.abModal=true
|
||||||
|
this.abID=abID
|
||||||
|
// alert(abID)
|
||||||
|
},
|
||||||
|
hideAbModal(){
|
||||||
|
this.abModal=false
|
||||||
|
// // this.abID=abID
|
||||||
|
},
|
||||||
|
doNothing(){
|
||||||
|
// alert();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
var url = new URL(location.href) + '';
|
||||||
|
var parts = url.split('/');
|
||||||
|
var slug = parts.pop() || parts.pop();
|
||||||
|
this.slug=slug;
|
||||||
|
console.log(slug)
|
||||||
|
fetch('https://management.beanstalkedu.com/items/themes?filter[theme_slug][_eq]=' + slug)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
this.page = data.data
|
||||||
|
this.isLoading = false
|
||||||
|
// console.log(this.page[0].id)
|
||||||
|
return this.page[0].id
|
||||||
|
})
|
||||||
|
.then((themesID) => {
|
||||||
|
fetch('https://management.beanstalkedu.com/items/theme_audio_book?filter[theme_key][_in]='+ themesID)
|
||||||
|
.then(resp => resp.json())
|
||||||
|
.then(audiobooks => {
|
||||||
|
this.audiobooks=audiobooks.data.reverse().slice(0, 4)
|
||||||
|
// console.log(this.videos)
|
||||||
|
})
|
||||||
|
return themesID
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
.abModal {
|
||||||
|
/* display: none; */
|
||||||
|
position: fixed;
|
||||||
|
z-index: 999991;
|
||||||
|
padding-top: 100px;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
background-color: rgb(0,0,0);
|
||||||
|
background-color: rgba(0,0,0,0.4);
|
||||||
|
}
|
||||||
|
.modal-content{
|
||||||
|
background-color: rgb(255, 255, 255);
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid #888;
|
||||||
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
.close {
|
||||||
|
display: flex;
|
||||||
|
place-items: center;
|
||||||
|
color: #aaaaaa;
|
||||||
|
float: right;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close:hover,
|
||||||
|
.close:focus {
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.bg3 {
|
||||||
|
background: linear-gradient(0deg, rgb(191, 219, 254, 1) 0%, rgba(255, 255, 255) 100%);
|
||||||
|
}
|
||||||
|
.font-20px {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 801px) {
|
||||||
|
.hero-text {
|
||||||
|
font-size: 50px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.hero-text {
|
||||||
|
font-size: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 801px) {
|
||||||
|
.h1-text {
|
||||||
|
font-size: 40px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.h1-text {
|
||||||
|
font-size: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text-color-1 {
|
||||||
|
color: #7C4C23;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-color-2 {
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
/* DROPDOWN MENU */
|
||||||
|
.services {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.dropdown {
|
||||||
|
z-index: 999;
|
||||||
|
background-color: rgb(247, 235, 173);
|
||||||
|
padding: 1em 0;
|
||||||
|
position: absolute; /*WITH RESPECT TO PARENT*/
|
||||||
|
display: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
top: 35px;
|
||||||
|
margin-left: -30px;
|
||||||
|
}
|
||||||
|
.dropdown li + li {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.dropdown li {
|
||||||
|
padding: 0.5em 1em;
|
||||||
|
width: 8em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.dropdown li:hover {
|
||||||
|
background-color: rgb(250, 230, 133);
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
.services:hover .dropdown {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
input[type=checkbox]{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,251 +0,0 @@
|
||||||
---
|
|
||||||
const {var1} = Astro.props;
|
|
||||||
---
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<section class="container mx-auto py-6 px-4 xl:px-24">
|
|
||||||
<div class="h1-text text-blue-700 font-semibold py-4">Videos</div>
|
|
||||||
<h1 class="text-2xl text-justify text-color-2 py-4" v-if="page">{{page[0].videos_text}}</h1>
|
|
||||||
<div v-if="videos" class="grid place-items-center grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
|
|
||||||
<div v-for="vdo in videos.slice(0, 3)" :key="videos.id" class="p-4">
|
|
||||||
<div @click="showYtModal(vdo.youtube_id)">
|
|
||||||
<div class="flex bg-gray-200 -rotate-6 cursor-pointer gap-8">
|
|
||||||
<div class="flex rotate-6 relative"><img v-if="vdo.video_thumb" :src="'https://management.beanstalkedu.com/assets/'+vdo.video_thumb" alt="" class="rounded-tl-xl rounded-br-xl shadow-2xl" />
|
|
||||||
<img class="absolute top-16 left-24 -rotate-6 w-16" src="/img/svg/play.svg" alt="" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-6 text-center text-xl text-color-2">{{vdo.videos_title}}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- <label :for="vdo.videos_file" >
|
|
||||||
<div class="flex bg-gray-200 -rotate-6 cursor-pointer gap-8">
|
|
||||||
<div class="flex rotate-6 relative"><img v-if="vdo.video_thumb" :src="'https://management.beanstalkedu.com/assets/'+vdo.video_thumb" alt="" class="rounded-tl-xl rounded-br-xl shadow-2xl" />
|
|
||||||
<img v-else src="/img/image_not_available.png" alt="" />
|
|
||||||
<img class="absolute top-20 left-28 -rotate-6 w-24" src="/img/svg/play.svg" alt="" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-6 text-center text-xl text-color-2">{{vdo.videos_title}}</div>
|
|
||||||
</label>
|
|
||||||
<input type="checkbox" :id="vdo.videos_file" class="modal-toggle" />
|
|
||||||
<label :for="vdo.videos_file" class="modal cursor-pointer">
|
|
||||||
<label class="modal-box relative" for="">
|
|
||||||
<iframe width="340"
|
|
||||||
src="https://www.youtube.com/embed/tgbNymZ7vqY">
|
|
||||||
</iframe>
|
|
||||||
</label>
|
|
||||||
</label> -->
|
|
||||||
</div>
|
|
||||||
<a href="/plan">
|
|
||||||
<div v-for="vdo in videos.slice(3, 4)" :key="videos.id" class="p-4">
|
|
||||||
<div class="flex bg-gray-200 -rotate-6 gap-8">
|
|
||||||
<div class="flex rotate-6 relative"><img v-if="vdo.video_thumb" :src="'https://management.beanstalkedu.com/assets/'+vdo.video_thumb" alt="" class="rounded-tl-lg rounded-br-lg" />
|
|
||||||
<div class="absolute top-16 left-20">
|
|
||||||
<h3 class="text-center inline-block px-4 py-2.5 bg-amber-500 text-white font-medium text-xs leading-tight rounded shadow-md hover:bg-amber-400 hover:shadow-lg focus:bg-amber-600 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out">+ Subscribe </h3>
|
|
||||||
<h3 class="-ml-2"> To download <br> more resources</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-6 text-center text-lg opacity-0">...</div>
|
|
||||||
</div></a>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<div @click="hideYtModal" v-if="ytModal" id="ytModal" class="flex justify-center ytModal">
|
|
||||||
<div class="modal-content">
|
|
||||||
<span @click="hideYtModal" class="close">×</span>
|
|
||||||
<div style="width: 100%;">
|
|
||||||
<iframe width="380" height="320"
|
|
||||||
:src="'https://www.youtube.com/embed/'+ytID">
|
|
||||||
</iframe>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
|
||||||
setup(){
|
|
||||||
// const route = useRoute();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showYtModal(ytID){
|
|
||||||
this.ytModal=true
|
|
||||||
this.ytID=ytID
|
|
||||||
},
|
|
||||||
hideYtModal(){
|
|
||||||
this.ytModal=false
|
|
||||||
// this.ytID=ytID
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
page: null,
|
|
||||||
faqOccassion: null,
|
|
||||||
occassionblog: null,
|
|
||||||
themes:null,
|
|
||||||
allOccassion:null,
|
|
||||||
stories: null,
|
|
||||||
ideas: null,
|
|
||||||
worksheets: null,
|
|
||||||
videos: null,
|
|
||||||
youtube: null,
|
|
||||||
audio: null,
|
|
||||||
isLoading: true,
|
|
||||||
ytModal:false,
|
|
||||||
ytID:''
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted: function () {
|
|
||||||
fetch('https://management.beanstalkedu.com/items/themes?filter[status][_eq]=published')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
this.page = data.data
|
|
||||||
this.isLoading = false
|
|
||||||
// console.log(this.page[0].id)
|
|
||||||
return this.page[0].id
|
|
||||||
})
|
|
||||||
.then((themesID) => {
|
|
||||||
fetch('https://management.beanstalkedu.com/items/theme_videos?filter[theme_key][_in]='+ themesID)
|
|
||||||
.then(resp => resp.json())
|
|
||||||
.then(videos => {
|
|
||||||
this.videos=videos.data.reverse().slice(0, 4)
|
|
||||||
// console.log(this.videos)
|
|
||||||
})
|
|
||||||
return themesID
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scopped>
|
|
||||||
.font-20px {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 1500px) {
|
|
||||||
.hero-text {
|
|
||||||
font-size: 50px;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 1499px) {
|
|
||||||
.hero-text {
|
|
||||||
font-size: 40px;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 1199px) {
|
|
||||||
.hero-text {
|
|
||||||
font-size: 30px;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 801px) {
|
|
||||||
.h1-text {
|
|
||||||
font-size: 40px;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 1500px) {
|
|
||||||
.h2-text {
|
|
||||||
font-size: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 1499px) {
|
|
||||||
.h2-text {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 1199px) {
|
|
||||||
.h2-text {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
|
||||||
.h1-text {
|
|
||||||
font-size: 30px;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.load-wraper{
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
background-color: rgb(211,211,211);
|
|
||||||
z-index: 44;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
.activity{
|
|
||||||
position: absolute;
|
|
||||||
left: -45%;
|
|
||||||
height: 100%;
|
|
||||||
width: 45%;
|
|
||||||
background-image: linear-gradient(to left, rgba(251,251,251, .05), rgba(251,251,251, .3), rgba(251,251,251, .6), rgba(251,251,251, .3), rgba(251,251,251, .05));
|
|
||||||
background-image: -moz-linear-gradient(to left, rgba(251,251,251, .05), rgba(251,251,251, .3), rgba(251,251,251, .6), rgba(251,251,251, .3), rgba(251,251,251, .05));
|
|
||||||
background-image: -webkit-linear-gradient(to left, rgba(251,251,251, .05), rgba(251,251,251, .3), rgba(251,251,251, .6), rgba(251,251,251, .3), rgba(251,251,251, .05));
|
|
||||||
animation: loading 1s infinite;
|
|
||||||
z-index: 45;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes loading {
|
|
||||||
0%{
|
|
||||||
left: -45%;
|
|
||||||
}
|
|
||||||
100%{
|
|
||||||
left: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.text-color-1 {
|
|
||||||
color: #7C4C23;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-color-2 {
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
.box{
|
|
||||||
width: 380px;
|
|
||||||
height: 220px;
|
|
||||||
}
|
|
||||||
.box1 {
|
|
||||||
width: 500px;
|
|
||||||
height: 220px;
|
|
||||||
}
|
|
||||||
input[type="file"] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.custom-file-upload {
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 6px 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.ytModal {
|
|
||||||
/* display: none; */
|
|
||||||
position: fixed;
|
|
||||||
width: 80%;
|
|
||||||
z-index: 999991;
|
|
||||||
padding-top: 100px;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
background-color: rgb(0,0,0);
|
|
||||||
background-color: rgba(0,0,0,0.4);
|
|
||||||
}
|
|
||||||
.bg3 {
|
|
||||||
background: linear-gradient(0deg, rgb(191, 219, 254, 1) 0%, rgba(255, 255, 255) 100%);}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -27,8 +27,8 @@ const twsRespJson = await twsResp.json();
|
||||||
const twsRespData = twsRespJson.data.reverse().slice(0, 3);
|
const twsRespData = twsRespJson.data.reverse().slice(0, 3);
|
||||||
const twsRespData2 = twsRespJson.data[3];
|
const twsRespData2 = twsRespJson.data[3];
|
||||||
|
|
||||||
import ThemesVideos from "../../components/ThemesVideosID.vue";
|
import ThemesVideosID from "../../components/ThemesVideosID.vue";
|
||||||
import ThemesAudioBook from "../../components/ThemesAudioBook.vue";
|
import ThemesAudioBookID from "../../components/ThemesAudioBookID.vue";
|
||||||
|
|
||||||
const tcsResp = await fetch('https://management.beanstalkedu.com/items/theme_celebration_stories?filter[theme_key][_in]=' + thisThemesID);
|
const tcsResp = await fetch('https://management.beanstalkedu.com/items/theme_celebration_stories?filter[theme_key][_in]=' + thisThemesID);
|
||||||
const tcsRespJson = await tcsResp.json();
|
const tcsRespJson = await tcsResp.json();
|
||||||
|
@ -124,8 +124,8 @@ import Footer from "../../components/Footer.vue";
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<ThemesVideos themeId={thisThemesID} client:visible/>
|
<ThemesVideosID client:visible/>
|
||||||
<ThemesAudioBook client:visible/>
|
<ThemesAudioBookID client:visible/>
|
||||||
<!-- <section class="container mx-auto pt-16 xl:px-24 px-4">
|
<!-- <section class="container mx-auto pt-16 xl:px-24 px-4">
|
||||||
<h1 class="h1-text text-blue-700 font-semibold">Celebretion stories</h1>
|
<h1 class="h1-text text-blue-700 font-semibold">Celebretion stories</h1>
|
||||||
<h1 class="text-2xl text-justify text-color-2 py-4" v-if="page">{themes[0].celebration_stories_text}</h1>
|
<h1 class="text-2xl text-justify text-color-2 py-4" v-if="page">{themes[0].celebration_stories_text}</h1>
|
||||||
|
|
Loading…
Reference in New Issue