Skip to content

Commit

Permalink
Update 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MushStory committed Nov 19, 2022
1 parent 8c14ae7 commit 04c03d2
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 68 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<widget
id="com.artifriends.frontle"
version="1.0.0"
version="1.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontle-example-app",
"description": "The easiest multi-platform SPA framework",
"version": "1.0.0",
"version": "1.0.1",
"author": "Artifriends, Inc. <[email protected]>",
"contributors": [
"Yun HyeongJun <[email protected]>",
Expand Down Expand Up @@ -40,7 +40,7 @@
}
},
"dependencies": {
"@frontle/frontle-core": "^1.0.0",
"@frontle/frontle-core": "^1.0.1",
"jquery": "^3.6.1"
}
}
15 changes: 0 additions & 15 deletions www/version/@/app/demo/demo.css.js

This file was deleted.

11 changes: 0 additions & 11 deletions www/version/@/app/demo/demo.html.js

This file was deleted.

15 changes: 0 additions & 15 deletions www/version/@/app/demo/demo.js

This file was deleted.

14 changes: 6 additions & 8 deletions www/version/@/app/main/main.css.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
const mainCSS = () => {
const css = () => {
return /* css */ `
.mainLogo {
.logo {
position: absolute;
width: 30vw;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 25vw;
}
@media screen and (max-width: 640px) {
.mainLogo {
width: 45vw;
.logo {
width: 60vw;
}
}
`;
};

export default mainCSS;
export default { css };
24 changes: 17 additions & 7 deletions www/version/@/app/main/main.html.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import mainCSS from "./main.css.js";
import mainCss from "./main.css.js";
import { jquery } from "../../browser_modules/jquery/module.js"; // "frontle install jquery"
const $ = jquery;

const mainHTML = () => {
return /* html */ `
<style>${mainCSS()}</style>
<img src="@/assets/img/Logo1.svg" class="mainLogo" />
const render = () => {
document.getElementById("app").innerHTML = /* html */ `
<style>${mainCss.css()}</style>
<img class="logo" src="@/assets/img/Logo1.svg" />
`;
};

export default mainHTML;
// Changing the logo depending on whether the index is even or odd
const changeLogo = (isIndexEven) => {
const src = isIndexEven ? "@/assets/img/Logo1.svg" : "@/assets/img/Logo2.svg";
$(".logo").attr("src", src);
};

export default {
render,
changeLogo,
};
28 changes: 19 additions & 9 deletions www/version/@/app/main/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import { frontle } from "../../browser_modules/@frontle/frontle-core/index.js";
import mainHTML from "./main.html.js";
import mainHtml from "./main.html.js";

const main = (params) => {
// Add Page
document.getElementById("app").innerHTML = mainHTML();
const index = params.index || 0;
const isEvenNumber = index % 2 === 0;

// Go to demo page
setTimeout(() => {
frontle.util.pageMove("demo", {
testParams: "test1234",
});
}, 3000);
// Rendering
mainHtml.render();
mainHtml.changeLogo(isEvenNumber);

// Move the page and pass the "index" parameter
const timeout = setTimeout(() => {
frontle.util.pageMove("main", { index: index + 1 });
}, 5000);

// Clear setTimeout when back or forward buttons are pressed
const listener = () => {
clearTimeout(timeout);
return true; // Execute history.back or history.forward if listener returns true
};
frontle.event.back.addListener(listener);
frontle.event.forward.addListener(listener);
};

export default main;
Binary file modified www/version/@/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04c03d2

Please sign in to comment.