Skip to content

Commit

Permalink
feature: All samples are live
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Oct 23, 2018
1 parent f9a3d4c commit 6fdfbae
Show file tree
Hide file tree
Showing 118 changed files with 330 additions and 185 deletions.
37 changes: 30 additions & 7 deletions README.md
@@ -1,11 +1,34 @@
# Material4Dart - Basic Components
> Basic components like MaterialButton, MaterialCheckbox and so on
## Examples
> [GitHub](https://github.com/MikeMitterer/m4d_components)
## Reminder
[m4d_accordion.example.mikemitterer.at](http://m4d_accordion.example.mikemitterer.at)
[m4d_animation.example.mikemitterer.at](http://m4d_animation.example.mikemitterer.at)
[m4d_badge.example.mikemitterer.at](http://m4d_badge.example.mikemitterer.at)
[m4d_button.example.mikemitterer.at](http://m4d_button.example.mikemitterer.at)
[m4d_checkbox.example.mikemitterer.at](http://m4d_checkbox.example.mikemitterer.at)
[m4d_datatable.example.mikemitterer.at](http://m4d_datatable.example.mikemitterer.at)
[m4d_footer.example.mikemitterer.at](http://m4d_footer.example.mikemitterer.at)
[m4d_grid.example.mikemitterer.at](http://m4d_grid.example.mikemitterer.at)
[m4d_icontoggle.example.mikemitterer.at](http://m4d_icontoggle.example.mikemitterer.at)
[m4d_lablefield.example.mikemitterer.at](http://m4d_lablefield.example.mikemitterer.at)
[m4d_layout.example.mikemitterer.at](http://m4d_layout.example.mikemitterer.at)
[m4d_list.example.mikemitterer.at](http://m4d_list.example.mikemitterer.at)
[m4d_menu.example.mikemitterer.at](http://m4d_menu.example.mikemitterer.at)
[m4d_navpills.example.mikemitterer.at](http://m4d_navpills.example.mikemitterer.at)
[m4d_palette.example.mikemitterer.at](http://m4d_palette.example.mikemitterer.at)
[m4d_progress.example.mikemitterer.at](http://m4d_progress.example.mikemitterer.at)
[m4d_radio.example.mikemitterer.at](http://m4d_radio.example.mikemitterer.at)
[m4d_shadow.example.mikemitterer.at](http://m4d_shadow.example.mikemitterer.at)
[m4d_slider.example.mikemitterer.at](http://m4d_slider.example.mikemitterer.at)
[m4d_spinner.example.mikemitterer.at](http://m4d_spinner.example.mikemitterer.at)
[m4d_switch.example.mikemitterer.at](http://m4d_switch.example.mikemitterer.at)
[m4d_tabs.example.mikemitterer.at](http://m4d_tabs.example.mikemitterer.at)
[m4d_textfield.example.mikemitterer.at](http://m4d_textfield.example.mikemitterer.at)
[m4d_tooltip.example.mikemitterer.at](http://m4d_tooltip.example.mikemitterer.at)
[m4d_typography.example.mikemitterer.at](http://m4d_typography.example.mikemitterer.at)

# 1 - Erstellen der index.html und von pubspec.yaml
/deploy-samples.sh -x m4d_navpills --force && ./deploy-samples.sh -g m4d_navpills --force

# 2 - In demo.scss _app.scss einfügen

# 3 - main.dart updaten

git s
24 changes: 24 additions & 0 deletions REMINDER.md
@@ -0,0 +1,24 @@
## Reminder for scripts used for this package

# 1 - Erstellen der index.html und von pubspec.yaml
/deploy-samples.sh -x m4d_navpills --force && ./deploy-samples.sh -g m4d_navpills --force

# 2 - In demo.scss _app.scss einfügen

# 3 - main.dart updaten

### Batch-processing .rsync

# Holt die jeweilige Zeile aus dem .rsync für das Sample
find samples/ -name ".rsync" | xargs awk 'FNR==4' | cut -d ' ' -f 5-
find samples/ -name ".rsync" | xargs awk 'FNR==5' | cut -d ' ' -f 5-
find samples/ -name ".rsync" | xargs awk 'FNR==9' | cut -d ' ' -f 5-
...

### Show all URL for all the .rsyncs

# List URLs
find samples/ -name ".rsync" | xargs awk 'FNR==14' | cut -d ' ' -f 5- | sed -e "s/.*http:\/\/\([^/]*\)\/.*/http:\/\/\1/"

# Gen Links for README
find samples/ -name ".rsync" | xargs awk 'FNR==14' | cut -d ' ' -f 5- | sed -e "s/.*http:\/\/\([^/]*\)\/.*/\[\1\]\(http:\/\/\1\)/"
16 changes: 11 additions & 5 deletions deploy-samples.sh
Expand Up @@ -65,13 +65,19 @@ fi
usage() {
echo
echo "Usage: ${APPNAME} [ options ]"
echo
echo -e "\t-l | --list [example_name] Lists all examples from '${YELLOW}${EXAMPLE_FOLDER}'${NC}-folder"
echo -e "\t-x | --prepare [example_name] Prepare sample"
echo
echo -e "\t- Init ------------------------------------------------------------------------------"
echo -e "\t-x | --prepare [example_name] Prepare sample (calls 'prep-script')"
echo -e "\t-g | --generate [example_name] [--force] Generates rsync-Config"
echo
echo -e "\t- Day2Day ---------------------------------------------------------------------------"
echo -e "\t-u | --update [example_name] Updates the sample"
echo -e "\t-d | --deploy [example_name] [--release] Creates 'deploy'-dir for Dart"
echo -e "\t-p | --publish [example_name] [--force] Publish samples to AWS/S3 (only on day ${PUBLISH_ONLY_ON_DAY})"
echo -e "\t use --force to ignore Monday as publishing day"
echo -e "\t-g | --generate [example_name] [--force] Generates rsync-Config"
echo -e "\t use --force to ignore"
echo -e "\t Monday as publishing day"
}

CMDLINE=${1:-}
Expand All @@ -88,7 +94,7 @@ case "${CMDLINE}" in
;;

-x|prepare|-prepare|--prepare)
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "--force" ]; then
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "" ]; then
prepareSamples "${EXAMPLE_FOLDER}/${OPTION1}"
else
prepareSamples "${EXAMPLES[@]}"
Expand All @@ -104,7 +110,7 @@ case "${CMDLINE}" in
;;

-d|deploy|-deploy|--deploy)
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "" ]; then
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "--release" ]; then
deploySamples "${EXAMPLE_FOLDER}/${OPTION1}"
else
deploySamples "${EXAMPLES[@]}"
Expand Down
57 changes: 3 additions & 54 deletions pubspec.yaml
@@ -1,5 +1,5 @@
name: m4d_components
description: Material Design Lite for Dart
description: Material Design 4 Dart - Basic components
version: 2.2.2
author: Mike Mitterer <office@mikemitterer.at>
homepage: http://www.material-design-lite.pub
Expand All @@ -8,71 +8,20 @@ environment:
sdk: ">=2.0.0 <3.0.0"

dependencies:
#intl: ^0.15.0
validate: ^1.0.0

#platform_detect: "^1.3.0"
#browser_detect: ^1.0.0

logging: '>=0.11.3 <1.0.0'
console_log_handler: ^1.0.0

# route_hierarchical: ^0.7.0
# angel_route: ^2.0.0

#m4d_router: ^0.2.0
# path: /Volumes/Daten/DevLocal/DevDart/m4d/m4d_router

#reflected_mustache: ^1.0.0
# path: /Volumes/Daten/DevLocal/DevDart/reflected_mustache

#mustache: # ^0.2.0
# path: /Volumes/Daten/DevLocal/DevDart/mustache
# git: git://github.com/xxgreg/mustache

#dnd: ^1.0.0
# path: /Volumes/Daten/DevLocal/DevDart/dart-dnd

#dryice: ^2.0.0
# path: /Volumes/Daten/DevLocal/DevDart/dryice


path: ^1.4.0

#l10n: ^2.0.0
# path: /Volumes/Daten/DevLocal/DevDart/L10N4Dart

m4d_core:
path: /Volumes/Daten/DevLocal/DevDart/m4d/m4d_core
m4d_core: '>=0.1.0 <1.0.0'
# path: /Volumes/Daten/DevLocal/DevDart/m4d/m4d_core

#dependency_overrides:
# build_runner: ^0.9.1
# build_config: ^0.3.0
# front_end: ^0.1.2

dev_dependencies:
test: any

build_runner: any
build_test: any
build_web_compilers: any

args: any
# material_icons: any
grinder: any
mdl_grinder:
# git: https://github.com/MikeMitterer/dart-mdl-grinder
path: /Volumes/Daten/DevLocal/DevDart/MaterialGrinder

#transformers:
## - di
# - mdl
#
# - $dart2js:
# commandLineOptions: [--enable-experimental-mirrors]

#web:
# compiler:
# debug: dartdevc


14 changes: 14 additions & 0 deletions samples/_scripts/.prep.default.kts
Expand Up @@ -71,3 +71,17 @@ properties["sample.html.template"]?.apply {
} ?: run {
logger.debug("$SAMPLE_NAME has no default.index.html! ")
}

properties["sample.appstyle"]?.apply {

// default.app.scss
val filename = this.toString()

cpyFile(File(filename),
File(File(SCRIPTPATH,"web"), "_app.scss"), emptyMap<String,String>())

logger.info("_app.scss updated for $SAMPLE_NAME! ")

} ?: run {
logger.debug("$SAMPLE_NAME has it's own _app.scss! ")
}
95 changes: 95 additions & 0 deletions samples/_templates/default.app.scss
@@ -0,0 +1,95 @@
html, body {
margin: 0;
padding: 0;
}

h1, h2 {
font-family: 'Roboto','Helvetica','Arial',sans-serif;
font-weight: 400;
}

h2 {
font-size: 24px;
line-height: 1.35;

margin-top: 0.66em;
margin-bottom: 0.66em;
}


.ribbon {
width: 100%;
height: 30vh;
}

.demo-page > .mdl-layout__container > .mdl-layout > * {
flex-shrink: 0;
}

.demo-page > .mdl-layout__container > .mdl-layout > main.mdl-layout__content.mdl-layout__content {
margin-top: -25vh;
}

/*header.mdl-layout__header {*/
/*display: flex !important;*/
/*}*/

.container {
max-width: 1600px;
width: 100%;
margin: 0 auto;
}

.content {
border-radius: 2px;
padding: 24px;
}

.mdl-layout__content .demo-section { min-height: 500px; }

.mdl-mini-footer {
padding-top: 12px;
padding-bottom: 12px;
font-size: 12px;
}

#view-source {
position: fixed;
display: block;
right: 0;
bottom: 37px;
margin-right: 40px;
z-index: 900;
}

.sitegen-link, .mm-link { margin-bottom: 0; }
.is-small-screen .sitegen-link .additional-info { display: none; }
.mm-link { font-size: 12px; }

/*
Solves bug in grid...
*/

@media (max-width: 479px) {
.mdl-grid {
padding: 0;
}
}

@media (max-width: 640px) {
.mm-link {
display: none;
}
}

@media (max-width: 839px) and (min-width: 480px) {
.mdl-grid {
padding: 0;
}
}

@media (max-width: 850px) {
#view-source {
bottom: 29px;
}
}
2 changes: 1 addition & 1 deletion samples/m4d_accordion/.prep.config.properties
Expand Up @@ -5,4 +5,4 @@ pubspec.template=../_templates/pubspec.tmpl.yaml
sample.html.template=../_templates/default.index.html
sample.content=.sitegen/html/_content/index.html


sample.appstyle=../_templates/default.app.scss
2 changes: 1 addition & 1 deletion samples/m4d_accordion/.rsync
Expand Up @@ -6,7 +6,7 @@
# - sudo mkdir -p ~/website/data/example/m4d_accordion
# - sudo chown ubuntu:ubuntu ~/website/data/example/m4d_accordion
# - sudo chmod 775 ~/website/data/example/m4d_accordion
# - echo 'm4d_accordion' > ~/website/data/example/raspi4_cam/index.html
# - echo 'm4d_accordion' > ~/website/data/example/m4d_accordion/index.html
# - ls -lad ~/website/data/example/m4d_accordion
# - cd ~/website && docker-compose restart
#
Expand Down
8 changes: 1 addition & 7 deletions samples/m4d_accordion/pubspec.yaml
Expand Up @@ -8,15 +8,12 @@ environment:
sdk: ">=2.0.0 <3.0.0"

dependencies:
#intl: ^0.15.0
#args: any
validate: ^1.0.0
#browser_detect: ^1.0.0

logging: '>=0.11.3 <1.0.0'
console_log_handler: ^1.0.0
# git: git@github.com:MikeMitterer/dart-console_log_handler.git
# path: /Volumes/Daten/DevLocal/DevDart/ConsoleLogHandler
# path: /Volumes/Daten/DevLocal/DevDart/ConsoleLogHandler

m4d_components:
# '>=2.1.0 <3.0.0'
Expand All @@ -25,9 +22,6 @@ dependencies:
# ref: v2.2
path: ../..

#reflected_mustache:
# path: /Volumes/Daten/DevLocal/DevDart/reflected_mustache

dev_dependencies:
build_runner: any
build_web_compilers: any
Expand Down
1 change: 1 addition & 0 deletions samples/m4d_accordion/web/_app.scss
Expand Up @@ -50,6 +50,7 @@ h2 {
.mdl-mini-footer {
padding-top: 12px;
padding-bottom: 12px;
font-size: 12px;
}

#view-source {
Expand Down
6 changes: 4 additions & 2 deletions samples/m4d_accordion/web/index.html
Expand Up @@ -205,8 +205,10 @@ <h5 class="mdl-accordion--header">Header</h5>
</main>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer--left-section">
<p class="sitegen-link">Page was generated with <a href="https://pub.dartlang.org/packages/sitegen" target="_blank">SiteGen.</a>
<span class="additional-info">The static site generator for Dart.</span></p>
<div>Sample for pub-package:
<a href="https://pub.dartlang.org/packages/m4d_components" target="_blank">m4d_components</a>
<span class="published">/ published: <span class="pubdate">2018-10-23 / 18:25:04</span></span>
</div>
</div>
<div class="mdl-mini-footer--right-section">
<p class="mm-link">Brought to you by:
Expand Down
2 changes: 2 additions & 0 deletions samples/m4d_animation/.prep.config.properties
Expand Up @@ -5,3 +5,5 @@ pubspec.template=../_templates/pubspec.tmpl.yaml
sample.html.template=../_templates/default.index.html
sample.content=.sitegen/html/_content/index.html

sample.appstyle=../_templates/default.app.scss

2 changes: 1 addition & 1 deletion samples/m4d_animation/.rsync
Expand Up @@ -6,7 +6,7 @@
# - sudo mkdir -p ~/website/data/example/m4d_animation
# - sudo chown ubuntu:ubuntu ~/website/data/example/m4d_animation
# - sudo chmod 775 ~/website/data/example/m4d_animation
# - echo 'm4d_animation' > ~/website/data/example/raspi4_cam/index.html
# - echo 'm4d_animation' > ~/website/data/example/m4d_animation/index.html
# - ls -lad ~/website/data/example/m4d_animation
# - cd ~/website && docker-compose restart
#
Expand Down

0 comments on commit 6fdfbae

Please sign in to comment.