Skip to content

Commit

Permalink
KaiOS 3
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Dec 25, 2023
1 parent 0c661ef commit b19945a
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 130 deletions.
43 changes: 43 additions & 0 deletions application/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,46 @@ main img#image {
height: 100%;
width: 100%;
}

.loading-spinner {
display: none;
position: fixed;
width: 80px;
height: 80px;
top: 50%;
left: 50%;
margin-left: -40px;
margin-top: -40px;

z-index: 5000000;
}
.loading-spinner div {
box-sizing: border-box;
display: block;
position: absolute;
width: 64px;
height: 64px;
margin: 8px;
border: 8px solid rgb(126, 11, 11);
border-radius: 50%;
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
border-color: rgb(238, 27, 27) transparent transparent transparent;
}
.loading-spinner div:nth-child(1) {
animation-delay: -0.45s;
}
.loading-spinner div:nth-child(2) {
animation-delay: -0.3s;
}
.loading-spinner div:nth-child(3) {
animation-delay: -0.15s;
}

@keyframes lds-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
Binary file removed application/assets/icons/icon-112-112-png
Binary file not shown.
Binary file added application/assets/icons/icon-112-112.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 71 additions & 37 deletions application/assets/icons/icon-112-112.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed application/assets/icons/icon-56-56-png
Binary file not shown.
Binary file added application/assets/icons/icon-56-56.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 40 additions & 23 deletions application/assets/icons/icon-56-56.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 5 additions & 53 deletions application/assets/js/mozactivity.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
const mozactivity = (() => {
let share_position = function () {
let a =
"https://www.openstreetmap.org/?mlat=" +
mainmarker.current_lat +
"&mlon=" +
mainmarker.current_lng +
"#map=13/" +
mainmarker.current_lat +
"/" +
mainmarker.current_lng +
"&layers=T";
try {
let activity = new MozActivity({
name: "share",
data: {
type: "url",
url: a,
},
});

activity.onsuccess = function () {
console.log("successfully shared");
};

activity.onerror = function () {
console.log("The activity encounter en error: " + this.error);
};
} catch (e) {}

try {
let activity = new WebActivity("share", { type: "url", url: a });
activity.start().then(
(rv) => {
console.log("Results passed back from activity handler:");
console.log(rv);
},
(err) => {
console.log(err);
}
);
} catch (e) {}
};

const photo = function () {
try {
let activity = new MozActivity({
Expand Down Expand Up @@ -126,7 +83,7 @@ const mozactivity = (() => {
});

pick.onsuccess = function (e) {
callback(pick);
callback(pick, "k2");
};

pick.onerror = function () {
Expand All @@ -137,9 +94,8 @@ const mozactivity = (() => {
console.log(e);
}

try {
let pick = new WebActivity({
name: "pick",
if ("b2g" in navigator) {
let pick = new WebActivity("pick", {
data: {
type: ["image/png", "image/jpg", "image/jpeg"],
},
Expand All @@ -148,23 +104,19 @@ const mozactivity = (() => {
pick.start().then(
(rv) => {
general.blocker = false;
callback(pick);

console.log("Results passed back from activity handler:");
console.log(rv);
callback(rv, "k3");
},
(err) => {
general.blocker = false;

console.log(err);
}
);
} catch (e) {}
}
};

return {
photo,
share_position,
openSettings,
pickGallery,
};
Expand Down
6 changes: 6 additions & 0 deletions application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

<div id="toast" class="width-100"></div>
<div id="side-toast"></div>
<div class="loading-spinner">
<div></div>
<div></div>
<div></div>
<div></div>
</div>


<div id="bottom-bar">
Expand Down
Loading

0 comments on commit b19945a

Please sign in to comment.