Skip to content

Commit

Permalink
new product name and trashy-patch for the player due to elm/url#10
Browse files Browse the repository at this point in the history
  • Loading branch information
shamansir committed Mar 28, 2019
1 parent 1f790ab commit edcb838
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 26 deletions.
4 changes: 2 additions & 2 deletions dat.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"title": "Elmsfeuer",
"title": "Elmsfeuer, Radiant",
"description": "Generative Art from JetBrains"
}
}
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const exportZip_ = (app, exportedState) => {
JSZipUtils.getBinaryContent(
'./player.bundle.js', (err, playerBundle) => {
if (err) { throw err; }
console.log(playerBundle);

JSZipUtils.getBinaryContent(
'./index.player.html',
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions player.webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');

const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');

const config = {

// mode: 'development',
Expand All @@ -19,7 +21,8 @@ const config = {
test: /\.elm$/,
exclude: [ /elm-stuff/, /node_modules/, /build/ ],
use: {
loader: "elm-webpack-loader?verbose=true,optimize=true"
// loader: "elm-webpack-loader?optimize=true"
loader: "elm-webpack-loader"
}
},
{
Expand All @@ -31,7 +34,23 @@ const config = {

resolve: {
extensions: ['.js']
}
},

plugins: [
new ReplaceInFileWebpackPlugin([{
files: ['player.bundle.js'],
rules: [
{
search: /var e=n\.fragment/,
replace: 'var e=n?n.fragment:{}'
},
{
search: 'case 1:throw new Error("Browser.application programs cannot handle URLs like this:\\n\\n "+document.location.href+"\\n\\nWhat is the root? The root of your file system? Try looking at this program with `elm reactor` or some other server.");case 2:',
replace: 'case 2:'
}
]
}])
]

};

Expand Down
42 changes: 21 additions & 21 deletions src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ init flags url _ =

initialLayers : UiMode -> List ( LayerKind, String, LayerModel )
initialLayers mode =
-- [ ( Fss, "Lower Layer", FssModel FSS.init )
-- , ( Fss, "Mid Layer", FssModel FSS.init )
-- , ( Fss, "Top layer"
-- , let
-- fssModel = FSS.init
-- in
-- { fssModel
-- | renderMode = FSS.PartialLines
-- , shareMesh = True
-- } |> FssModel
-- )
-- , ( Cover, "Cover", NoModel )
-- , ( Vignette, Vignette.init )
[ ( Metaballs, "Metaballs", MetaballsModel Metaballs.init )
-- , ( Fluid, "Fluid", FluidModel Fluid.init )
[ ( Fss, "Lower Layer", FssModel FSS.init )
, ( Fss, "Mid Layer", FssModel FSS.init )
, ( Fss, "Top layer"
, let
fssModel = FSS.init
in
{ fssModel
| renderMode = FSS.PartialLines
, shareMesh = True
} |> FssModel
)
, ( Cover, "Cover", NoModel )
]
-- [ ( Metaballs, "Metaballs", MetaballsModel Metaballs.init )
-- [ ( Fluid, "Fluid", FluidModel Fluid.init )
-- ]
|> List.filter (\(kind, _, _) ->
case ( kind, mode ) of
( Cover, Ads ) -> False
Expand Down Expand Up @@ -225,10 +225,10 @@ update msg model =
)

BackToNow ->
( { model
( { model
| timeShift = 0.0
, now = model.now + model.timeShift
, paused = True
, paused = True
}
, Cmd.none
)
Expand Down Expand Up @@ -1077,10 +1077,10 @@ view model =
( w, h ) =
getRuleSize model.size |> Maybe.withDefault ( -1, -1 )
visible = w > 0 && h > 0
wrapHtml =
div
wrapHtml =
div
[ H.class "html-layers layers"
, Events.onClick TriggerPause
, Events.onClick TriggerPause
]
wrapEntities =
WebGL.toHtmlWith
Expand Down Expand Up @@ -1139,7 +1139,7 @@ view model =

document : Model -> Browser.Document Msg
document model =
{ title = "Elmsfeuer"
{ title = "Elmsfeuer, Radiant"
, body = [ view model ]
}

Expand Down
2 changes: 1 addition & 1 deletion src/Navigation.elm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ applyFragment fragment model =

fragmentToMessage : Fragment -> Msg
fragmentToMessage fragment =
case decodeFragment fragment of
Debug.log "fragmentToMessage" <| case decodeFragment fragment of
ModeAndSizeRule mode rule -> ChangeModeAndResize mode rule
SizeRule rule -> Resize rule
Mode mode -> ChangeMode mode
Expand Down

0 comments on commit edcb838

Please sign in to comment.