Code Monkey home page Code Monkey logo

framework7-cli-template-singleview's Introduction

Framework7 CLI Single View Template

This is the base and default Single View template for Framework7 CLI

Install & Run

Make sure you have Cordova and Framework7 CLI installed globally (may require "sudo"):

$ npm install cordova -g
$ npm install framework7-cli -g

Create Framework7 App using Framework7 CLI:

$ f7 create myapp com.example.myapp MyApp

Go to created app folder:

$ cd hello

And add required target platforms (iOS and/or Android):

$ f7 platfrom add ios
$ f7 platfrom add android

Use f7 serve command to run the app locally (in browser). App will be hosted at http://localhost:8000/www/ios/ (for iOS platform) and http://localhost:8000/www/android/ (for Android platform):

$ f7 serve

To build the app:

$ f7 build

Conditional Rendering

This app/template comes with Cordova hook that may differentiate HTML output for different platforms. It could be very handy in case you need to use different layout (HTML structure) for different platforms (according to Framework7 spec). So you may use the following conditions in your project's html files:

<!-- f7-if-ios -->
<p>This content will be rendered only for iOS platform</p>
<!-- f7-endif-ios -->

<!-- f7-if-android -->
<p>This content will be rendered only for Android platform</p>
<!-- f7-endif-android -->

You can use it in any place of HTML files, even in HEAD section to use different stylesheets:

<head>
    ...
    <!-- @f7-if-ios -->
    <link rel="stylesheet" href="css/framework7-icons.css">
    <link rel="stylesheet" href="css/framework7.ios.min.css">
    <link rel="stylesheet" href="css/framework7.ios.colors.min.css">
    <!-- @f7-endif-ios -->

    <!-- @f7-if-android -->
    <link rel="stylesheet" href="css/material-icons.css">
    <link rel="stylesheet" href="css/framework7.material.min.css">
    <link rel="stylesheet" href="css/framework7.material.colors.min.css">
    <!-- @f7-endif-android -->
</head>

Or inside of attribures:

<div class="view <!-- @f7-if-ios -->navbar-through<!-- @f7-endif-ios --> <!-- @f7-if-android -->navbar-fixed<!-- @f7-endif-android -->">
    ...
</div>

framework7-cli-template-singleview's People

Contributors

nolimits4web avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

uiforks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.