Skip to content

Commit

Permalink
filter events
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Feb 13, 2024
1 parent 547c58d commit a5dea05
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 237 deletions.
237 changes: 141 additions & 96 deletions application/app.js

Large diffs are not rendered by default.

81 changes: 34 additions & 47 deletions application/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,20 @@
}

kbd {
border: 2px solid black;
box-shadow: 2px 2px black;
border: 2px solid rgb(12, 1, 2);
box-shadow: 2px 2px rgb(29, 0, 5);
font-size: 0.85em;
line-height: 0.85em;
display: inline-block;
font-weight: 600;
letter-spacing: 0.05em;
padding: 3px 5px;
white-space: nowrap;
}

#intro kbd {
border: 2px solid pink;
box-shadow: 2px 2px pink;
font-size: 0.85em;
line-height: 0.85em;
display: inline-block;
Expand Down Expand Up @@ -302,8 +314,8 @@ div#intro {
min-width: 100%;
height: 100%;
animation-name: intro;
animation-duration: 1.5s;
animation-delay: 2s;
animation-duration: 2s;
animation-delay: 6s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
Expand All @@ -312,13 +324,13 @@ div#intro #version {
position: absolute;
background: black;
z-index: 100000;
bottom: 20px;
bottom: 80px;
color: white;
text-align: center;
font-size: 0.8rem;
animation-name: intro_img;
font-size: 1.2rem;
animation-name: intro_img_2;
animation-duration: 2s;
animation-delay: 1s;
animation-delay: 6s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
Expand All @@ -332,7 +344,7 @@ div#intro img {
margin-left: -90px;
animation-name: intro_img;
animation-duration: 2s;
animation-delay: 1s;
animation-delay: 6s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
Expand All @@ -346,6 +358,15 @@ div#intro img {
}
}

@keyframes intro_img_2 {
from {
transform: translateX(0px);
}
to {
transform: translateX(450px);
}
}

@keyframes intro {
from {
transform: translateY(0px);
Expand Down Expand Up @@ -1130,48 +1151,14 @@ div#top-bar div#button-right {
text-align: right;
}

/*
SETTINGS
*/

div#top {
position: fixed;
top: 0;
}

div#settings {
display: none;
height: 92vh;
width: 100%;
padding: 0px 0 50px 0;
overflow: hidden;
position: absolute;
top: 0px;
z-index: 3;
background: rgb(231, 231, 231);
}

button span {
margin: 0 0 0 10px;
}

div#settings div#text {
margin: 0 0 20px 0;
}
div#settings h2 {
padding: 0 10px 0 10px;
}

div#settings label {
min-width: 80%;
height: 30px;
margin: 5px 5px 0 0;
}

div#time {
font-size: 0.8rem;
}

#options button {
margin-left: 5vw;
}

@keyframes jump {
0% {
transform: translateY(0);
Expand Down
60 changes: 5 additions & 55 deletions application/assets/icons/intro.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 24 additions & 13 deletions application/assets/js/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,36 @@ export let load_ads = function () {
// Get a reference to the element you want to add the focus event listener to

//KaiOS ads

export let getManifest = function (callback) {
if (!navigator.mozApps) {
return false;
if (navigator.mozApps) {
let self = navigator.mozApps.getSelf();
self.onsuccess = function () {
callback(self.result);
};
self.onerror = function () {};
}

if ('b2g' in navigator) {
fetch('/manifest.webmanifest')
.then((r) => r.json())
.then((r) => callback(r.b2g_features));
}
let self = navigator.mozApps.getSelf();
self.onsuccess = function () {
callback(self.result);
};
self.onerror = function () {};
};

//KaiOs store true||false
export function manifest(a) {
self = a.origin;
document.getElementById('version').innerText =
'Version: ' + a.manifest.version;
if (a.installOrigin == 'app://kaios-plus.kaiostech.com') {
settings.ads = true;
} else {
if (navigator.mozApps) {
self = a.origin;
document.querySelector('#version kbd').innerText = a.manifest.version;
if (a.installOrigin == 'app://kaios-plus.kaiostech.com') {
settings.ads = true;
} else {
settings.ads = true;
}
}
if ('b2g' in navigator) {
document.querySelector('#version kbd').innerText = a.version;
settings.ads = true;
}
}
26 changes: 9 additions & 17 deletions application/assets/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ export let formatDT = (dt) => {
);
};

export async function sort_array(arr, itemKey, type, sortDirection = 'desc') {
export async function sort_array(
arr,
itemKey,
type,
sortDirection = 'desc',
value
) {
// Define a function for comparing dates
function compareDates(a, b) {
if (sortDirection === 'desc') {
Expand Down Expand Up @@ -103,22 +109,8 @@ export async function sort_array(arr, itemKey, type, sortDirection = 'desc') {

// Define a function for comparing dates in 'lastmod' case
function compareDateObjects(a, b) {
const dateA = new Date(
a['LAST-MODIFIED']['_time'].year,
a['LAST-MODIFIED']['_time'].month - 1,
a['LAST-MODIFIED']['_time'].day,
a['LAST-MODIFIED']['_time'].hour,
a['LAST-MODIFIED']['_time'].minute,
a['LAST-MODIFIED']['_time'].second
);
const dateB = new Date(
b['LAST-MODIFIED']['_time'].year,
b['LAST-MODIFIED']['_time'].month - 1,
b['LAST-MODIFIED']['_time'].day,
b['LAST-MODIFIED']['_time'].hour,
b['LAST-MODIFIED']['_time'].minute,
b['LAST-MODIFIED']['_time'].second
);
const dateA = new Date(b['modified']);
const dateB = new Date(a['modified']);

if (sortDirection === 'desc') {
return dateB - dateA; // Reverse order
Expand Down
2 changes: 1 addition & 1 deletion application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div id="side-toast"></div>
<div id="intro" class="width-100 height-100">
<img src="./assets/icons/intro.svg" />
<div class="width-100" id="version"></div>
<div class="width-100" id="version"><kbd>time is relativ</kbd></div>
<div>
<div></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.623",
"version": "2.2.627",
"name": "greg",
"id": "greg",
"categories": ["utilities"],
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],

"b2g_features": {
"version": "3.0.649",
"version": "3.0.650",
"id": "greg",
"subtitle": "easy to use calendar",
"core": true,
Expand Down
15 changes: 9 additions & 6 deletions application/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function parse_ics(
account_id,
isCaldav,
alarm,
notification,
callback,
store
) {
let jcalData;
Expand Down Expand Up @@ -182,20 +182,23 @@ function parse_ics(
time_start: timeStart,
time_end: timeEnd,
alarm: alarm || 'none',
etag: etag,
etag: etag || '',
url: url,
calendar_name: calendar_name,
id: account_id,
modified: ite.getFirstPropertyValue('last-modified').toString(),
};
});

//when importing data callback to store
let a = { parsed_data: imp };
if (store) {
a.raw_data = data;
}

if (store) {
a.notification = true;
//callback or not
if (callback) {
a.calback = true;
}

return a;
Expand Down Expand Up @@ -335,9 +338,9 @@ self.addEventListener('message', async (event) => {
event.data.t.etag,
event.data.t.url,
event.data.e,
true,
event.data.e == 'local-id' ? false : true,
false,
event.data.notification || false,
event.data.callback || false,
event.data.store || false
);

Expand Down
Binary file removed images/.xdp-.goutputstream-1ZR1Y1-jbKMTc
Binary file not shown.
Binary file removed images/.xdp-kaios-marketing-banner.jpg-LqkXmn
Binary file not shown.
Binary file removed images/kaios-marketing-banner.jpg
Binary file not shown.

0 comments on commit a5dea05

Please sign in to comment.