@saooti/octopus-sdk 40.2.1 → 40.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "40.2.1",
3
+ "version": "40.2.2",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
package/plateform.conf CHANGED
@@ -1 +1 @@
1
- preprod.saooti.org
1
+ dev2.saooti.org
@@ -3,7 +3,7 @@ export const useImageProxy = ()=>{
3
3
 
4
4
  const apiStore = useApiStore();
5
5
 
6
- function useProxyImageUrl(url: string|undefined, width: string, height?: string): string {
6
+ function useProxyImageUrl(url: string|undefined, width: string, height?: string, blur=false): string {
7
7
  if (!url) {
8
8
  return "";
9
9
  }
@@ -13,10 +13,12 @@ export const useImageProxy = ()=>{
13
13
  return (
14
14
  apiStore.imageUrl +
15
15
  "image/" +
16
+ (blur ? "noRedirect/":"")+
16
17
  encode +
17
18
  "?" +
18
19
  size +
19
- "&useWebp=true"
20
+ "&useWebp=true"+
21
+ (blur ? "&blur=true":"")
20
22
  );
21
23
  }
22
24
  return url;
@@ -1,29 +1,31 @@
1
1
  <template>
2
2
  <header
3
- class="top-bar-container"
4
- :class="{ scrolled: scrolled, 'content-top-bar': isContentToDisplay }"
3
+ class="header-saooti-play"
4
+ :style="headerBackgroundImage"
5
+ :class="[contentToDisplay ? 'header-img-bg':'header-color-bg', scrolled? 'scrolled':'', needToBlur ? 'header-force-blur':'']"
5
6
  >
6
7
  <TopBarMainContent
7
- class="top-bar-z-index"
8
8
  :is-phone="isPhone"
9
9
  :scrolled="scrolled"
10
10
  :title-display="titleToDisplay"
11
+ style="height: var(--header-size);"
12
+ :class="headerBackgroundImage.length ? 'header-opacity':''"
11
13
  />
12
- <template v-if="contentToDisplay">
13
- <div class="page-element-bg" :style="backgroundDisplay" />
14
- <h1 v-if="!scrolled" class="text-truncate top-bar-z-index">
14
+ </header>
15
+ <div v-if="contentToDisplay" class="header-content-bg" :style="headerBackgroundImage" :class="{ scrolled: scrolled, 'header-force-blur':needToBlur }" >
16
+ <div class="header-additional-content header-content">
17
+ <h1 v-if="!scrolled" class="text-truncate">
15
18
  {{ titleToDisplay }}
16
19
  </h1>
17
20
  <SubscribeButtons
18
21
  v-if="!isGarRole"
19
22
  v-show="!scrolled"
20
- class="top-bar-z-index"
21
23
  :emission="emissionObject"
22
24
  :playlist-id="contentToDisplay?.playlistId"
23
25
  :window-width="windowWidth"
24
26
  />
25
- </template>
26
- </header>
27
+ </div>
28
+ </div>
27
29
  </template>
28
30
 
29
31
  <script lang="ts">
@@ -38,6 +40,7 @@ import { Emission } from "@/stores/class/general/emission";
38
40
  import {useResizePhone} from "../composable/useResizePhone";
39
41
  import { Playlist } from "@/stores/class/general/playlist";
40
42
  import { Canal } from "@/stores/class/radio/canal";
43
+ import axios from "axios";
41
44
  const SubscribeButtons = defineAsyncComponent(
42
45
  () => import("../display/sharing/SubscribeButtons.vue"),
43
46
  );
@@ -58,6 +61,8 @@ export default defineComponent({
58
61
  scrolled: false as boolean,
59
62
  oldScrollY: 0 as number,
60
63
  minScroll: 0 as number,
64
+ headerBackgroundImage: "" as string,
65
+ needToBlur: false as boolean,
61
66
  };
62
67
  },
63
68
  computed: {
@@ -71,15 +76,6 @@ export default defineComponent({
71
76
  "radio" === this.$route.name
72
77
  );
73
78
  },
74
- backgroundDisplay(): string {
75
- if (!this.contentToDisplay) {
76
- return "";
77
- }
78
- return `background-image: url('${this.useProxyImageUrl(
79
- this.contentToDisplay.imageUrl,
80
- "270",
81
- )}');`;
82
- },
83
79
  titleToDisplay(): string {
84
80
  if ((this.contentToDisplay as Podcast)?.podcastId) {
85
81
  return (this.contentToDisplay as Podcast).emission.name;
@@ -105,6 +101,32 @@ export default defineComponent({
105
101
  return null;
106
102
  },
107
103
  },
104
+ watch:{
105
+ contentToDisplay: {
106
+ deep: true,
107
+ immediate: true,
108
+ async handler() {
109
+ if(!this.contentToDisplay){
110
+ this.headerBackgroundImage = "";
111
+ this.needToBlur = false;
112
+ return;
113
+ }
114
+ const proxyUrl = this.useProxyImageUrl(this.contentToDisplay.imageUrl,"270", undefined, true);
115
+ try {
116
+ const result = await axios.get(proxyUrl);
117
+ this.headerBackgroundImage = `background-image: url('${result.data}');`;
118
+ if(result.data !== this.contentToDisplay.imageUrl){
119
+ this.needToBlur = false;
120
+ }else{
121
+ this.needToBlur = true;
122
+ }
123
+ } catch {
124
+ this.headerBackgroundImage = this.contentToDisplay.imageUrl ? `background-image: url('${this.contentToDisplay.imageUrl}');` : "";
125
+ this.needToBlur = true;
126
+ }
127
+ },
128
+ },
129
+ },
108
130
  mounted() {
109
131
  window.addEventListener("scroll", this.handleScroll);
110
132
  },
@@ -140,104 +162,72 @@ export default defineComponent({
140
162
  </script>
141
163
 
142
164
  <style lang="scss">
143
-
144
-
145
165
  .octopus-app {
146
- .top-bar-container {
147
- *:focus-visible {
148
- box-shadow: 0 0 10px 1px white !important;
149
- }
150
-
151
- background: var(--octopus-primary);
152
- background: linear-gradient(
153
- 90deg,
154
- var(--octopus-primary) 0%,
155
- var(--octopus-tertiary) 100%
156
- );
157
- width: 100%;
158
- height: 5rem;
159
- display: flex;
160
- flex-direction: column;
161
- transition: height 0.7s;
162
- box-shadow: 0 2px 15px 5px var(--octopus-shadow) !important;
163
-
164
- .page-element-bg {
165
- opacity: 0.5;
166
- filter: blur(8px);
167
- background-position: center;
166
+ --header-size: 5rem;
167
+ --header-additional-content-size: 22rem;
168
+ @media (width <= 650px) {
169
+ --header-size: 3.5rem;
170
+ }
171
+ @media (width <= 550px) {
172
+ --header-additional-content-size: 13rem;
173
+ }
174
+ .header-saooti-play{
175
+ z-index: 11;
176
+ position: sticky;
177
+ top: 0;
178
+ &.header-img-bg{
179
+ background-position: center -20vw;
168
180
  background-repeat: no-repeat;
169
181
  background-size: cover;
170
- width: 100%;
171
- position: absolute;
172
- transition: height 0.7s;
173
182
  }
174
-
175
- &.content-top-bar {
176
- height: 22rem;
177
- background: black;
178
-
179
- .page-element-bg {
180
- height: 22rem;
181
- }
182
- }
183
-
184
- &.content-top-bar.scrolled {
185
- height: 5rem;
186
-
187
- .page-element-bg {
188
- height: 5rem;
189
- }
183
+ &.header-color-bg{
184
+ background: var(--octopus-primary);
185
+ background: linear-gradient(
186
+ 90deg,
187
+ var(--octopus-primary) 0%,
188
+ var(--octopus-tertiary) 100%
189
+ );
190
190
  }
191
-
192
- &:not(.scrolled) {
193
- position: relative;
191
+ &.header-color-bg, &.scrolled{
192
+ box-shadow: 0 2px 15px 5px var(--octopus-shadow) !important;
194
193
  }
195
-
194
+ }
195
+ .header-content-bg{
196
+ background-position: center calc(calc(var(--header-size) * -1) - 20vw);
197
+ background-repeat: no-repeat;
198
+ background-size: cover;
199
+ width: 100%;
200
+ display: flex;
201
+ transition: height 0.7s;
202
+ height: calc(var(--header-additional-content-size) - var(--header-size));
196
203
  &.scrolled {
197
- z-index: 11;
198
- position: sticky;
199
- top: 0;
204
+ height: 0rem;
200
205
  }
201
-
202
- .top-bar-z-index {
203
- z-index: 1;
206
+ }
207
+ .header-additional-content{
208
+ display: flex;
209
+ flex-direction: column;
210
+ flex-grow: 1;
211
+ }
212
+ .header-additional-content, .header-opacity{
213
+ background: oklch(0 0 0 / 0.5);
214
+ }
215
+ .header-force-blur .header-additional-content, .header-force-blur .header-opacity{
216
+ backdrop-filter: blur(8px);
217
+ }
218
+ .header-content{
219
+ *:focus-visible {
220
+ box-shadow: 0 0 10px 1px white !important;
204
221
  }
205
-
206
222
  h1 {
207
223
  color: white !important;
208
224
  font-size: 1.8rem;
209
225
  margin: 2rem 5rem;
210
- }
211
-
212
- @media (width <= 650px) {
213
- height: 3.5rem;
214
-
215
- &.content-top-bar.scrolled {
216
- height: 3.5rem;
217
-
218
- .page-element-bg {
219
- height: 3.5rem;
220
- }
221
- }
222
- }
223
-
224
- @media (width <= 550px) {
225
- h1 {
226
+ @media (width <= 550px) {
226
227
  font-size: 1rem;
227
228
  margin: 1rem 0.5rem 0.5rem;
228
229
  }
229
-
230
- &.content-top-bar {
231
- height: 13rem;
232
-
233
- .page-element-bg {
234
- height: 13rem;
235
- }
236
- }
237
230
  }
238
-
239
-
240
-
241
231
  .admin-button:hover,
242
232
  .share-btn:hover {
243
233
  background: white;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="top-bar-grid" :class="{ scrolled: titleIsDisplayed }">
2
+ <div class="top-bar-grid header-content" :class="{ scrolled: titleIsDisplayed }">
3
3
  <router-link
4
4
  class="top-bar-logo d-flex align-items-center"
5
5
  :to="{
@@ -294,8 +294,7 @@ export default defineComponent({
294
294
  .top-bar-grid {
295
295
  display: grid;
296
296
  grid-template-columns: 1fr 5fr;
297
- margin-top: 0.5rem;
298
- padding: 0 1rem;
297
+ padding: 0.5rem 1rem 0 1rem;
299
298
 
300
299
  &.scrolled {
301
300
  grid-template-columns: 1fr 2fr 1fr;