Skip to content

Commit

Permalink
fix server
Browse files Browse the repository at this point in the history
  • Loading branch information
FarhannDev committed Oct 25, 2023
1 parent 91919dc commit 64c90b1
Show file tree
Hide file tree
Showing 25 changed files with 999 additions and 5,757 deletions.
2 changes: 1 addition & 1 deletion assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ main {
width: 100%;
height: auto;
overflow: hidden;
margin-top: 5rem;
/* margin-top: 5rem; */
}


Expand Down
5 changes: 4 additions & 1 deletion components/Albums.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import { PostsDataType } from '~/utils/data/getInitialPostsData';
defineProps({ categoryId: { type: Number, required: true } })
const { data: albums } = await useAsyncData<PostsDataType>('albums', () => $fetch('/api/posts'))
// const { data: albums } = await useAsyncData<PostsDataType>('albums', () => $fetch('/api/posts'))
const { data: albums } = await useFetch('/api/posts')
</script>

<template>
<div class="album-cover-container row justify-content-start g-3 py-3">

<div v-for="(album, index) in albums?.slice(0, 3)" :key="index" class="col-lg-4">
<NuxtImg :src="album.featured_media" :alt="album.title.rendered" :class="'album-cover__images'" />

Expand Down
56 changes: 18 additions & 38 deletions components/hero/ParallaxBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const backgroundStyle = () => {

<template>
<section class="hero-section">
<div class="hero-image-parallax" :style = "backgroundStyle()">
<div class="hero-image-parallax" :style="backgroundStyle()">
<div class="hero-image-bg__gradient"></div>
<div class="container">
<div class="hero-heading-container">
Expand Down Expand Up @@ -62,7 +62,7 @@ const backgroundStyle = () => {
flex-shrink: 0;
position: relative;
width: 100%;
height: 700px;
height: 100vh;
background: linear-gradient(0deg,
rgba(0, 0, 0, 0.2) 0%,
rgba(0, 0, 0, 0.2) 100%),
Expand Down Expand Up @@ -143,21 +143,22 @@ const backgroundStyle = () => {
/* // Small devices (landscape phones, 576px and up) */
@media (min-width: 540px) {
.hero-heading__title {
font-size: 35px !important;
display: block;
width: 30px;
/* margin-bottom: 50%; */
}
.hero-heading__title {
font-size: 35px !important;
display: block;
width: 30px;
/* margin-bottom: 50%; */
}
.hero-heading__desc {
width: 50px;
font-size: 20px;
/* margin-bottom: 50%; */
margin-top: 1%;
padding-top: 1%;
}
.hero-social-media-container {
.hero-heading__desc {
width: 50px;
font-size: 20px;
/* margin-bottom: 50%; */
margin-top: 1%;
padding-top: 1%;
}
.hero-social-media-container {
position: absolute;
top: 35% !important;
right: 30px !important;
Expand Down Expand Up @@ -214,7 +215,7 @@ const backgroundStyle = () => {
/* // X-Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
.hero-image-parallax {
min-height: 100vh;
height: 100vh;
}
.hero-image-bg__gradient {
Expand Down Expand Up @@ -244,28 +245,7 @@ const backgroundStyle = () => {
z-index: 1000;
}
/* .hero-image-parallax:hover {
-webkit-transform: scale(1.1);
-webkit-transition: .3s ease-in-out;
transform: scale(1.1);
transition: .3s ease-in-out;
} */
}
/* // XX-Large devices (larger desktops, 1400px and up) */
/* @media (min-width: 1400px) {
.hero-heading__title {
font-size: 50px !important;
display: block;
width: 600px;
}
.hero-heading__desc {
width: 800px;
font-size: 31px;
}
} */
</style>


Expand Down
4 changes: 2 additions & 2 deletions components/hero/ParallaxBackgroundHeroSwipe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const backgroundStyle = (background: string | undefined): IbackgroundType => {
height: 100vh;
flex-shrink: 0;
width: 100%;
height: 700px;
height: 100vh;
background: linear-gradient(0deg,
rgba(0, 0, 0, 0.2) 0%,
rgba(0, 0, 0, 0.2) 100%),
Expand Down Expand Up @@ -210,7 +210,7 @@ const backgroundStyle = (background: string | undefined): IbackgroundType => {
/* // X-Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
.hero-image-parallax {
min-height: 100vh;
height: 100vh;
}
.hero-image-bg__gradient {
Expand Down
79 changes: 2 additions & 77 deletions components/navbar/NavbarSticky.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const updateLanguage: (language: string) => string = (language: string) =>
(isLanguage.value = language);
const { data: categories } = await useLazyFetch('/api/categories', {
const { data: categories } = await useFetch('/api/categories', {
transform: (categories: CategoryPostsType) => {
return categories.filter(category => category.parent === 0).map(cat => ({
id: cat.id,
Expand All @@ -59,7 +59,7 @@ const { data: categories } = await useLazyFetch('/api/categories', {
})
const { data: categoriesEvents } = await useLazyFetch('/api/categories', {
const { data: categoriesEvents } = await useFetch('/api/categories', {
transform: (events: CategoryPostsType) => {
return events.filter(event => event.id == 89 ||
event.id === 90 ||
Expand Down Expand Up @@ -194,88 +194,13 @@ const { data: categoriesEvents } = await useLazyFetch('/api/categories', {
}`" to="/contact-us">Hubungi Kami
</NuxtLink>
</li>


<!-- <li class="nav-item dropdown d-xl-none d-xxl-none">
<NuxtLink :class="`nav-link mx-md-1 ${route.path === '/events' ? 'active' : ''
}`" to="/events" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Tema perangkat
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none">
<path
d="M5.74714 6.19354L8.3338 8.7802L10.9205 6.19354C11.1805 5.93354 11.6005 5.93354 11.8605 6.19354C12.1205 6.45354 12.1205 6.87354 11.8605 7.13354L8.80047 10.1935C8.54047 10.4535 8.12047 10.4535 7.86047 10.1935L4.80047 7.13354C4.54047 6.87354 4.54047 6.45354 4.80047 6.19354C5.06047 5.9402 5.48714 5.93354 5.74714 6.19354Z"
fill="#5D5D5D" />
</svg>
</NuxtLink>
<ul class="dropdown-menu" :class="{ show: isDropdownEvents }">
<li>
<button @click="toggleColorMode" class="btn border-0 translate__button" type="button"
:title="colorMode.value" data-bs-toggle="dropdown" aria-expanded="false">
<svg v-if="colorMode.preference === 'light'" xmlns="http://www.w3.org/2000/svg" width="22" height="22"
fill="currentColor" class="bi bi-brightness-high" viewBox="0 0 16 16">
<path
d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" />
</svg>
<svg v-if="colorMode.preference === 'dark'" xmlns="http://www.w3.org/2000/svg" width="22" height="22"
fill="currentColor" class="bi bi-moon" viewBox="0 0 16 16">
<path
d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z" />
</svg>
<svg v-if="colorMode.preference === 'system'" xmlns="http://www.w3.org/2000/svg" width="22" height="22"
fill="currentColor" class="bi bi-display" viewBox="0 0 16 16">
<path
d="M0 4s0-2 2-2h12s2 0 2 2v6s0 2-2 2h-4c0 .667.083 1.167.25 1.5H11a.5.5 0 0 1 0 1H5a.5.5 0 0 1 0-1h.75c.167-.333.25-.833.25-1.5H2s-2 0-2-2V4zm1.398-.855a.758.758 0 0 0-.254.302A1.46 1.46 0 0 0 1 4.01V10c0 .325.078.502.145.602.07.105.17.188.302.254a1.464 1.464 0 0 0 .538.143L2.01 11H14c.325 0 .502-.078.602-.145a.758.758 0 0 0 .254-.302 1.464 1.464 0 0 0 .143-.538L15 9.99V4c0-.325-.078-.502-.145-.602a.757.757 0 0 0-.302-.254A1.46 1.46 0 0 0 13.99 3H2c-.325 0-.502.078-.602.145z" />
</svg> {{ colorMode.value }}
</button>
</li>
</ul>
</li>
<li class="nav-item dropdown d-xl-none d-xxl-none">
<NuxtLink :class="`nav-link mx-md-1 ${route.path === '/events' ? 'active' : ''
}`" to="/events" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Pilihan bahasa
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none">
<path
d="M5.74714 6.19354L8.3338 8.7802L10.9205 6.19354C11.1805 5.93354 11.6005 5.93354 11.8605 6.19354C12.1205 6.45354 12.1205 6.87354 11.8605 7.13354L8.80047 10.1935C8.54047 10.4535 8.12047 10.4535 7.86047 10.1935L4.80047 7.13354C4.54047 6.87354 4.54047 6.45354 4.80047 6.19354C5.06047 5.9402 5.48714 5.93354 5.74714 6.19354Z"
fill="#5D5D5D" />
</svg>
</NuxtLink>
<ul class="dropdown-menu" :class="{ show: isDropdownEvents }">
<li>
<button @click="updateLanguage('ID')" title="Ubah bahasa" type="button" class="dropdown-item mb-3">
<NuxtImg src="/icons/indonesia.png" :width="27" :height="18" alt=" Indonesia" loading="lazy"
format="webp" />
Indonesia
</button>
</li>
<li>
<button @click="updateLanguage('EN')" title="Ubah bahasa" type="button" class="dropdown-item">
<NuxtImg src="/icons/inggris.png" :width="27" :height="18" alt=" Inggris" loading="lazy"
format="webp" />
Inggris
</button>
</li>
</ul>
</li> -->


</ul>
</div>
<!-- Navbar Collapse End -->

<div class="d-none d-lg-none d-xl-block d-xxl-block">
<div class="hstack gx-2">
<Search />

<!-- <form class="d-flex" role="search">
<input class="form-control search-input-container me-2" type="search" placeholder="Cari" aria-label="Cari"> -->
<!-- <button class="btn btn-outline-success" type="submit">Search</button> -->
<!-- </form> -->
<div class="dropdown">
<button @click="toggleColorMode" class="btn border-0 translate__button" type="button" :title="colorMode.value"
data-bs-toggle="dropdown" aria-expanded="false">
Expand Down
Empty file removed content/example.md
Empty file.
1 change: 0 additions & 1 deletion content/index.md

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
43 changes: 36 additions & 7 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,43 @@ export default defineNuxtConfig({
experimental: {
inlineSSRStyles: true, // or a function to determine inlining
clientFallback: true,
crossOriginPrefetch: true,
viewTransition: true,
writeEarlyHints: true,
payloadExtraction: true,
emitRouteChunkError: "automatic", // or 'manual' or false.
inlineRouteRules: true,
renderJsonPayloads: true,
},
runtimeConfig: {
// Private keys are only available on the server
apiSecret: process.env.NUXT_API_SECRET,
// Public keys that are exposed to the client
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE,
webpack: {
extractCSS: true,
optimization: {
splitChunks: {
layouts: true,
pages: true,
commons: true,
cacheGroups: {
styles: {
name: "styles",
test: /\.(css|vue)$/,
chunks: "all",
enforce: true,
},
},
},
},
},
hooks: {
"build:manifest": (manifest) => {
// find the app entry, css list
const css = manifest["node_modules/nuxt/dist/app/entry.js"]?.css;
if (css) {
// start from the end of the array and go to the beginning
for (let i = css.length - 1; i >= 0; i--) {
// if it starts with 'entry', remove it from the list
if (css[i].startsWith("entry")) css.splice(i, 1);
}
}
},
},

Expand All @@ -25,7 +55,6 @@ export default defineNuxtConfig({
"nuxt-bootstrap-icons",
"nuxt-swiper",
"@nuxtjs/color-mode",
"@nuxt/content",
],

app: {
Expand Down
Loading

0 comments on commit 64c90b1

Please sign in to comment.