This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget build(BuildContext context) { | |
return AnimatedBuilder( | |
animation: _controller, | |
builder: (context, child) { | |
return Container( | |
padding: EdgeInsets.all(24.0), | |
decoration: BoxDecoration(color: _colorAnim.value), | |
child: Text('Tween Sequence'), | |
); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _TweenSequenceBoxState extends State<TweenSequenceBox> | |
with SingleTickerProviderStateMixin { | |
AnimationController _controller; | |
Animation<Color> _colorAnim; | |
@override | |
void initState() { | |
super.initState(); | |
_controller = AnimationController( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Animatable<Color> bgColor = TweenSequence<Color>([ | |
TweenSequenceItem( | |
weight: 1.0, | |
tween: ColorTween(begin: Colors.red, end: Colors.blue), | |
), | |
TweenSequenceItem( | |
weight: 1.0, | |
tween: ColorTween(begin: Colors.blue, end: Colors.green), | |
), | |
TweenSequenceItem( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<input id="button_loader" type="button" value="Load stopwatch"> | |
</div> | |
<div id="stopwatch"> | |
<stopwatch></stopwatch> | |
</div> | |
<script> | |
let stopwatchBtn = document.getElementById('button_loader'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict | |
from django import template | |
register = template.Library() | |
@register.inclusion_tag('lazy_render_bundle.html', takes_context=False) | |
def lazy_render_bundle(bundle: Dict[str, str]) -> Dict[str, Dict[str, str]]: | |
return {'bundle': bundle} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function load_bundle_file(url, filetype) { | |
let fileref; | |
if (filetype === "js") { // build js script tag | |
fileref = document.createElement('script'); | |
fileref.setAttribute("type", "text/javascript"); | |
fileref.setAttribute("src", url); | |
} else if (filetype === "css") { // build css link tag | |
fileref = document.createElement("link"); | |
fileref.setAttribute("rel", "stylesheet"); | |
fileref.setAttribute("type", "text/css"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue/dist/vue.js"; | |
const Stopwatch = () => import( /* webpackChunkName: "chunk-stopwatch" */ "./components/Stopwatch.vue"); | |
Vue.config.productionTip = false; | |
new Vue({ | |
el: "#stopwatch", | |
components: {Stopwatch} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pages = { | |
"stopwatch": { | |
entry: "./src/stopwatch.js", | |
chunks: ["chunk-moment", "chunk-vendors"], | |
}, | |
[...] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.optimization.splitChunks({ | |
cacheGroups: { | |
moment: { | |
test: /[\\/]node_modules[\\/]moment/, | |
name: "chunk-moment", | |
chunks: "all", | |
priority: 5 | |
}, | |
vendor: { | |
test: /[\\/]node_modules[\\/]/, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.optimization.splitChunks({ | |
cacheGroups: { | |
vendor: { | |
test: /[\\/]node_modules[\\/]/, | |
name: "chunk-vendors", | |
chunks: "all", | |
priority: 1 | |
}, | |
}, | |
}); |