Restructure

This commit is contained in:
斟酌 鵬兄 2016-05-31 23:32:39 +08:00
parent a2c96cec64
commit 4cb79f9e85
19 changed files with 132 additions and 120 deletions

View File

@ -684,7 +684,7 @@
var stage = c_body.parentNode
BotanJS.addEventListener( "Responsive"
/** e @type {Astro.Blog.Events.Responsive} */
/** e @type {Astro.Starfall.Events.Responsive} */
, function( e ) {
e.data.ratio < 1
? stage.style.width = "100%"

View File

@ -1,2 +0,0 @@
// __namespace( "Astro.Blog.Element.Footer" );
// __import( "Astro.Common.Element.Footer" );

View File

@ -1 +0,0 @@
// __namespace( "Astro.Blog.Element.Header" );

View File

@ -1 +0,0 @@
// __namespace( "Astro.Blog.Element.Layer" );

View File

@ -1,63 +1,3 @@
html, body { height: 100%; }
html { background-color: #222; }
body {
background-color: #F0F0F0;
font-family: custom-sans,Helvetica,Arial,STHeiti,"Microsoft JhengHei","微軟正黑體";
}
pre { font-family: monospace; }
::selection {
color: white;
background: purple;
}
::-moz-selection {
color: white;
background: purple;
}
p { padding: 0.5em; }
a {
color: #333;
text-decoration: none;
}
sup { vertical-align: super; }
a:hover { text-decoration: underline; }
.clearfix {
clear: both;
padding: 0 !important;
margin: 0 !important;
}
.begin-wrapper {
position: relative;
min-height: 100%;
background-color: #EBEAEF;
overflow: hidden;
}
.mbody {
position: relative;
width: 100%;
}
.main-column {
width: 85%;
margin: 0 auto;
}
.right { text-align: right; }
.panel { padding: 0.5em 1.2em 1.2em 1.2em; }
/* transition properties */
div#header, div#mbody, div#contact, div#horizon {
-webkit-transition: all 500ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
@ -97,5 +37,3 @@ div#header, div#mbody, div#contact, div#horizon {
}
.cw { animation-name: spin; }
/* end transition properties */

View File

@ -5,14 +5,10 @@
var Cycle = __import( "System.Cycle" );
/** @type {System.Cycle.Trigger} */
var Trigger = __import( "System.Cycle.Trigger" );
/** @type {System.utils.IKey} */
var IKey = __import( "System.utils.IKey" );
/** @type {System.utils.DataKey} */
var DataKey = __import( "System.utils.DataKey" );
/** @type {Dandelion} */
var Dand = __import( "Dandelion" );
/** @type {Dandelion.IDOMObject} */
var IDOMObject = __import( "Dandelion.IDOMObject" );
/** @type {Dandelion.IDOMElement} */
var IDOMElement = __import( "Dandelion.IDOMElement" );
/** @type {Dandelion.Window} */
@ -29,49 +25,24 @@
// __import( "Dandelion.CSSReset" ); CSS_RESERVATION
// __import( "Dandelion.CSSAnimations" ); CSS_RESERVATION
// __import( "Astro.Blog.SharedStyle" ); CSS_RESERVATION
// __import( "Astro.Blog.Element.Layer" ); CSS_RESERVATION
// __import( "Astro.Starfall.Element.Layer" ); CSS_RESERVATION
/** @function {System.Net.getData} */
var getData = __import( "System.Net.getData" );
var main;
var header;
var main_h;
// menu and horizon
var horizon;
var contact;
var contaht_page;
var contact_page;
var collapse_panel;
var c_expand = false;
var savedPath;
var init = function ()
{
// Footer at bottom
var padder = Dand.wrap();
var begin_wrapper = Dand.id( "begin-wrapper" );
var content_wrapper = Dand.id( "mbody" );
var footer = Dand.tag( "footer" );
var fhorizon = Dand.id( "fhorizon" );
if( footer.length )
{
footer = footer[0];
var fheight = footer.scrollHeight || footer.offsetHeight;
var hheight = fhorizon.scrollHeight || fhorizon.offsetHeight;
padder.style.height = ( fheight + hheight ) + "px";
begin_wrapper.style.marginBottom = "-" + fheight + "px";
}
content_wrapper.appendChild( padder );
IDOMObject( window ).addEventListener( "Resize", responsify );
initTopButton();
navControl();
responsify( null, true );
initBackgroundParallax();
};
@ -81,7 +52,6 @@
// init params
header = Dand.id( "header" );
horizon = Dand.id( "horizon" );
main = Dand.id( "mbody" );
contact_page = Dand.id( "contact" );
collapse_panel = Dand.id( "collapse_panel" );
@ -149,24 +119,6 @@
}
};
/** @type {Dandelion.IDOMElement} */
var rspd_ratio = 0;
var responsify = function( e, override )
{
// Ratio changes would trigger content
var ratio = wsupp.clientWidth / wsupp.clientHeight;
// Swap only on ration changes from 1 < x OR x < 1
if( ( ratio < 1.2 && 1.2 < rspd_ratio ) || ( 1.2 < ratio && rspd_ratio < 1.2 ) || override )
{
rspd_ratio = ratio;
debug.Info( "Responsive Event: R = " + ratio );
BotanJS.dispatchEvent( new BotanEvent( "Responsive", { "ratio": ratio } ) );
}
};
/////// Menu
// Contact
var expandContact = function ()

View File

@ -0,0 +1,2 @@
// __namespace( "Astro.Starfall.Element.Footer" );
// __import( "Astro.Common.Element.Footer" );

View File

@ -0,0 +1 @@
// __namespace( "Astro.Starfall.Element.Header" );

View File

@ -0,0 +1 @@
// __namespace( "Astro.Starfall.Element.Layer" );

View File

@ -0,0 +1,58 @@
html, body { height: 100%; }
html { background-color: #222; }
body {
background-color: #F0F0F0;
font-family: custom-sans,Helvetica,Arial,STHeiti,"Microsoft JhengHei","微軟正黑體";
}
pre { font-family: monospace; }
::selection {
color: white;
background: purple;
}
::-moz-selection {
color: white;
background: purple;
}
p { padding: 0.5em; }
a {
color: #333;
text-decoration: none;
}
sup { vertical-align: super; }
a:hover { text-decoration: underline; }
.clearfix {
clear: both;
padding: 0 !important;
margin: 0 !important;
}
.begin-wrapper {
position: relative;
min-height: 100%;
background-color: #EBEAEF;
overflow: hidden;
}
.mbody {
position: relative;
width: 100%;
}
.main-column {
width: 85%;
margin: 0 auto;
}
.right { text-align: right; }
.panel { padding: 0.5em 1.2em 1.2em 1.2em; }

View File

@ -0,0 +1,61 @@
(function(){
var ns = __namespace( "Astro.Starfall.Layout.MainFrame" );
/** @type {Dandelion} */
var Dand = __import( "Dandelion" );
/** @type {Dandelion.IDOMObject} */
var IDOMObject = __import( "Dandelion.IDOMObject" );
/** @type {Dandelion.Window} */
var wsupp = __import( "Dandelion.Window" );
/** @type {System.Debug} */
var debug = __import( "System.Debug" );
/** @type {Astro.Bootstrap} */
var Bootstrap = __import( "Astro.Bootstrap" );
// __import( "Astro.Starfall.Element.Layer" ); CSS_RESERVATION
var init = function ()
{
console.log( "HERE" );
// Footer at bottom
var padder = Dand.wrap();
var begin_wrapper = Dand.id( "begin-wrapper" );
var content_wrapper = Dand.id( "mbody" );
var footer = Dand.tag( "footer" );
var fhorizon = Dand.id( "fhorizon" );
if( footer.length )
{
footer = footer[0];
var fheight = footer.scrollHeight || footer.offsetHeight;
var hheight = fhorizon.scrollHeight || fhorizon.offsetHeight;
padder.style.height = ( fheight + hheight ) + "px";
begin_wrapper.style.marginBottom = "-" + fheight + "px";
}
content_wrapper.appendChild( padder );
IDOMObject( window ).addEventListener( "Resize", responsify );
responsify( null, true );
};
var rspd_ratio = 0;
var responsify = function( e, override )
{
// Ratio changes would trigger content
var ratio = wsupp.clientWidth / wsupp.clientHeight;
// Swap only on ration changes from 1 < x OR x < 1
if( ( ratio < 1.2 && 1.2 < rspd_ratio ) || ( 1.2 < ratio && rspd_ratio < 1.2 ) || override )
{
rspd_ratio = ratio;
debug.Info( "Responsive Event: R = " + ratio );
BotanJS.dispatchEvent( new BotanEvent( "Responsive", { "ratio": ratio } ) );
}
};
Bootstrap.regInit( init );
})();

View File

@ -1,5 +1,5 @@
(function(){
var ns = __namespace( "Astro.Blog.Layout.PureColumn" );
var ns = __namespace( "Astro.Starfall.Layout.PureColumn" );
/** @type {Astro.Bootstrap} */
var Bootstrap = __import( "Astro.Bootstrap" );

View File

@ -1,5 +1,5 @@
(function(){
var ns = __namespace( "Astro.Blog.Layout.TwoColumn" );
var ns = __namespace( "Astro.Starfall.Layout.TwoColumn" );
/** @type {Dandelion} */
var Dand = __import( "Dandelion" );
@ -12,7 +12,7 @@
if( rspd )
{
BotanJS.addEventListener( "Responsive"
/** e @type {Astro.Blog.Events.Responsive} */
/** e @type {Astro.Starfall.Events.Responsive} */
, function( e ) {
rspd.foreach(
document.ELEMENT_NODE

View File

@ -0,0 +1,3 @@
(function(){
var ns = __namespace( "Astro.Starfall.Layout" );
})();