Skip to content

Commit 666ab75

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # my-app/public/index.html # my-app/src/index.css # package.json # webpack-dev-server-demo/app/main.js
2 parents 0736e7f + 444421c commit 666ab75

File tree

28 files changed

+1715
-10
lines changed

28 files changed

+1715
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ jspm_packages
3737
.node_repl_history
3838

3939
tmp
40-
!created-logfile-score.log
40+
!created-logfile-score.log
41+
.idea

closure/a.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Created by google on 16-10-27.
3+
*/
4+
5+
'use strict';
6+
7+
let test=function () {
8+
console.log(1111);
9+
}
10+
11+
12+
exports.test=test;

closure/b.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Created by google on 16-10-27.
3+
*/
4+
5+
'use strict';
6+
7+
8+
let test=function () {
9+
console.log(1111);
10+
}
11+
12+
13+
module.exports={
14+
test:test
15+
}

closure/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Created by google on 16-10-27.
3+
*/
4+
5+
'use strict';
6+
7+
let a;
8+
9+
function test(temp) {
10+
a = temp;
11+
setInterval(function () {
12+
console.log(a);
13+
},1000)
14+
}
15+
16+
17+
exports.test = test;

closure/main.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Created by google on 16-10-27.
3+
*/
4+
5+
'use strict';
6+
7+
let aaa=require('./a').test;
8+
9+
let bb=require('./b');
10+
11+
12+
aaa();
13+
// console.log(22);
14+

coffee/a.coffee

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
resizePages = (target, animate = true) -> # TODO: use target to target specific DOMs to transform - teng
2+
logger.log "[FRESH] Resize pages"
3+
4+
smallScreen = DeviceHelper.isSmallScreen
5+
header = $('#header-container')
6+
headerSpacer = $('#header-spacer')
7+
8+
# header.after headerSpacer # Important for v4 - header spacer must be moved out of header-container
9+
10+
# Account for nav logo height on first page
11+
if navAnimation()
12+
hh = header.height() - 0
13+
headerSpacer.show().css('height', hh)
14+
logoHeight = $('#header-container .logo').height()
15+
$('a.section-anchor').css('top',-hh+logoHeight+20)
16+
$('a.section-anchor').first().css('top',-hh)
17+
###
18+
if spacer.length == 0
19+
spacer = $('<div class="spacer"></div>').prependTo( $('li.slide .container').first() )
20+
hh = header.height() - 20
21+
###
22+
else
23+
headerSpacer.hide()
24+
25+
# BG editor on first slide
26+
# fixBgEditor()
27+
28+
height = $(window).height()
29+
# if smallScreen
30+
# height = if h < 640 then 640 else h
31+
32+
# Resize first section to fill the height of the screen
33+
logger.log "[FRESH]: Resizing sections"
34+
$('.s-title-section, li.slide:first-child .s-cta-section, li.slide:first-child .s-slider-section').each (i, el) ->
35+
t = $(this); c = t.find('.container').first()
36+
if t.hasClass 'no-resize' # This might appear here from containBackgroundImages
37+
this.style.paddingTop = ''
38+
this.style.paddingBottom = ''
39+
else
40+
# Reset inline padding in order to calculate original padding from stylesheet
41+
inlinePaddingTop = this.style.paddingTop
42+
inlinePaddingBottom = this.style.paddingBottom
43+
this.style.paddingTop = ''
44+
this.style.paddingBottom = ''
45+
# Ignore if the original (aka natural) padding is >100
46+
origPaddingTop = Math.min(100, parseInt(t.css('padding-top'), 10))
47+
origPaddingBottom = Math.min(100, parseInt(t.css('padding-bottom'), 10))
48+
this.style.paddingTop = inlinePaddingTop
49+
this.style.paddingBottom = inlinePaddingBottom
50+
51+
# Fix slogan slide for first slide
52+
sectionHeight = height
53+
if i == 0 && t.closest('li.slide').is(':first-child')
54+
if smallScreen() then sectionHeight -= header.outerHeight()
55+
else if header.is(':visible') then sectionHeight -= header.height()
56+
else
57+
if header.is(':visible') then sectionHeight -= (header.height() - getLogoHeight())
58+
59+
# HACKY: defer it because somehow DOM is not ready
60+
window.setTimeout ->
61+
return if t.hasClass 'no-resize' # This might appear here from containBackgroundImages in the delay time
62+
63+
64+
if $(el).is('.s-slider-section')
65+
current = $(el).find('.iosslider').data('current')
66+
currentSlideHeight = $(el).find('.iosslider').find('.inner').get(current).outerHeight()
67+
if currentSlideHeight < sectionHeight
68+
$(el).find('.iosslider').height(sectionHeight).css('min-height', sectionHeight+"px")
69+
return
70+
71+
currentHeight = t.outerHeight()
72+
# Disable adjustment if on mobile and resize is small
73+
return if Math.abs(currentHeight - sectionHeight) < 64 && DeviceHelper.isSmallScreen()
74+
# Adjust section height
75+
pad = (sectionHeight-c.outerHeight(false)) * 0.5
76+
ptop = Math.max (Math.min 450, Math.floor(pad)), origPaddingTop
77+
pbottom = Math.max (Math.min 450, Math.ceil(pad)), origPaddingBottom
78+
newStyles =
79+
'padding-top': ptop
80+
'padding-bottom': pbottom
81+
if animate # e.g. on load, on resize
82+
t.stop().animate newStyles, 100
83+
else # e.g. on switch page before fade
84+
t.css newStyles

coffee/a.js

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/index.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
body{
22
color:red;
3-
}
3+
}
4+
5+
6+
.transition {
7+
width: 100px;
8+
height: 100px;
9+
background-color: #222222;
10+
transition: height 1.5s;
11+
}
12+
13+
.button1{
14+
width: 40px;
15+
height: 50px;
16+
}
17+

css/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
<meta charset="UTF-8">
55
<title>Title</title>
66
<link rel="stylesheet" type="text/css" href="index.css">
7+
<script src="//staticfile.qnssl.com/jquery/2.0.3/jquery.min.js"></script>
78

89

910
</head>
1011
<body>
11-
111
12+
<div class="transition"></div>
13+
<button class="button1"/>
1214
</body>
1315

1416
<script src="index.js"></script>

css/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@
33
*/
44

55

6-
console.log('load index.js');
6+
7+
8+
$( ".button1" ).click(function() {
9+
10+
$('.transition').height(200)
11+
12+
});

my-app/public/index.html

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,81 @@
1313
-->
1414
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
1515
<title>React App</title>
16+
<script src="//staticfile.qnssl.com/jquery/2.0.3/jquery.min.js"></script>
17+
18+
<style>
19+
20+
21+
@media only screen and (max-width: 727px){
22+
23+
body h1{
24+
color:red;
25+
}
26+
27+
}
28+
29+
</style>
1630
</head>
1731
<body>
18-
<!--<h1>My First CSS Example</h1>-->
19-
<!--<p>This is a paragraph.</p>-->
20-
<!--<p class="center">This is testing selctor</p>-->
21-
<div id="root"></div>
32+
<h1 style="height: 100px">我是h1</h1>
33+
<h2 style="height: 800px">我是h2</h2>
34+
<div class="browser-error-dialog s-edit-modal" style="display: block; position: fixed ; top: auto;overflow: hidden;background-color: rgb(231, 233, 235); width: 70%; left: 15%;
35+
bottom: 30px; text-align: center;height: 85px;"><p style="padding: 30px; font-size: 140%;"><strong>.<a href="/learnstrikingly" target="_blank">Learn More.</a></strong></p></div>
36+
37+
<!--
38+
This HTML file is a template.
39+
If you open it directly in the browser, you will see an empty page.
40+
41+
You can add webfonts, meta tags, or analytics to this file.
42+
The build step will place the bundled scripts into the <body> tag.
43+
44+
To begin the development, run `npm start`.
45+
To create a production bundle, use `npm run build`.
46+
-->
2247
</body>
2348
<script>
2449

50+
function getScrollTop() {
51+
var scrollTop=0;
52+
if(document.documentElement&&document.documentElement.scrollTop){
53+
// Fix: for xp ie6 only
54+
scrollTop=document.documentElement.scrollTop;
55+
}else if(document.body){
56+
scrollTop=document.body.scrollTop;
57+
}
58+
return scrollTop;
59+
}
60+
61+
62+
$('.browser-error-dialog').css('position','absolute');
63+
64+
var browser_error_dialog_bottom=parseInt($('.browser-error-dialog').css('bottom'));
65+
var scrollTop,timer;
66+
document.title=('--'+$(window).scrollTop()+"--"+$(document).height());
67+
68+
var flag=false;
69+
$(window).scroll(function () {
70+
// if(flag){
71+
// return;
72+
// }
73+
document.title=('--'+$(window).scrollTop()+"--"+$(document).height());
74+
window.clearTimeout(timer);
75+
76+
//
77+
timer=window.setTimeout(function () {
78+
flag=true;
79+
scrollTop=$(window).scrollTop();
80+
// $('.browser-error-dialog').css('bottom',browser_error_dialog_bottom-scrollTop);
81+
//http://stackoverflow.com/questions/2986353/jquery-animate-bottom-problem
82+
$('.browser-error-dialog').stop()
83+
.animate({bottom:browser_error_dialog_bottom-scrollTop},'slow',function () {
84+
document.title=('--'+$(window).scrollTop()+"--"+$(document).height());
85+
});
86+
window.clearTimeout(timer);
87+
88+
},150);
89+
});
90+
91+
2592
</script>
2693
</html>

my-app/src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ body{
55

66
h1{
77
color:white;
8+
h1{
9+
color:red;
10+
background: grey;
811
text-align: center;
912
}
1013

0 commit comments

Comments
 (0)