mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
wire dialog display
This commit is contained in:
parent
7549855071
commit
b671a19326
10 changed files with 72 additions and 46 deletions
|
@ -17,16 +17,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="comic" style="height: 300px; background-image: url(/img/tutorial/ch1pg1_2.png);background-size: 839px;">
|
<div class="nextPanel" style="display: none">
|
||||||
<div class="dialogue" style="left: 200px; top:30px;">
|
<div class="comic" style="height: 300px; background-image: url(/img/tutorial/ch1pg1_2.png);background-size: 839px;">
|
||||||
Welcome, [NAME]! You're about to embark on a very exciting challenge: creating your first website!
|
<div class="dialogue" style="left: 200px; top:30px;">
|
||||||
|
Welcome, [NAME]! You're about to embark on a very exciting challenge: creating your first website!
|
||||||
|
</div>
|
||||||
|
<div class="dialogue" style="left: 640px; top:20px;">
|
||||||
|
You've already made the first important step of starting this lesson, so here's a badge for your profile.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dialogue" style="left: 640px; top:20px;">
|
|
||||||
You've already made the first important step of starting this lesson, so here's a badge for your profile.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a href="./2">Next >></a>
|
<a href="/tutorial/html/2">Next >></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#checkButton').on('click', function(button) {
|
$('#checkButton').on('click', function(button) {
|
||||||
|
@ -38,7 +40,9 @@
|
||||||
alert("I need to know your name!")
|
alert("I need to know your name!")
|
||||||
else {
|
else {
|
||||||
sessionStorage.setItem('name', name)
|
sessionStorage.setItem('name', name)
|
||||||
window.location.href = '/tutorial/html/2'
|
var dialogueObj = $('.nextPanel .comic .dialogue')[0]
|
||||||
|
dialogueObj.innerHTML = dialogueObj.innerHTML.replace('[NAME]', name)
|
||||||
|
$('.nextPanel').css('display', 'block')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/3'
|
ok('Great, you did it!', '/tutorial/html/3')
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -39,11 +39,10 @@
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/4'
|
ok('Great, you did it!', '/tutorial/html/4')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="dialogue" style="left: 300px; top: 0px">
|
<div class="dialogue" style="left: 300px; top: 0px">
|
||||||
To make a paragraph, surround your text with the <strong><p></strong> tag. So it should look something like
|
To make a paragraph, surround your text with the <strong><p></strong> tag. So it should look something like
|
||||||
<strong><p>Hello!<p></strong>
|
<strong><p>Hello!</p></strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -16,11 +16,10 @@
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/5'
|
ok('Great, you did it!', '/tutorial/html/5')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -33,11 +33,10 @@ But this isn't!
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/6'
|
ok('Great, you did it!', '/tutorial/html/6')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,11 +29,10 @@
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/7'
|
ok('Great, you did it!', '/tutorial/html/7')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg7.png);">
|
<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg7.png);">
|
||||||
<div class="dialogue" style="left: 0">
|
<div class="dialogue" style="left: 0">
|
||||||
Now maybe your website needs a list. Here's how an unordered list looks:
|
Now maybe your website needs a list. Here's how an unordered list looks:
|
||||||
<ul>
|
<div style="text-align: left; font-weight: bold">
|
||||||
<li>websites</li>
|
<ul><br>
|
||||||
<li>yarn</li>
|
<li>websites</li>
|
||||||
<li>catnip</li>
|
<li>yarn</li>
|
||||||
</ul>
|
<li>catnip</li><br>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dialogue">
|
<div class="dialogue">
|
||||||
First, add a list to your page, but replace my favorite activities with your own!
|
First, add a list to your page, but replace my favorite activities with your own!
|
||||||
|
@ -18,11 +20,13 @@
|
||||||
<div class="welcome">
|
<div class="welcome">
|
||||||
<h4>Lists</h4>
|
<h4>Lists</h4>
|
||||||
<p>You can make an ordered (numbered) list like so:</p>
|
<p>You can make an ordered (numbered) list like so:</p>
|
||||||
<ol>
|
<div style="text-align: left; font-weight: bold">
|
||||||
<li>First item</li>
|
<ol><br>
|
||||||
<li>Second item</li>
|
<li>First item</li><br>
|
||||||
<li>Third item</li>
|
<li>Second item</li><br>
|
||||||
</ol>
|
<li>Third item</li><br>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -34,11 +38,10 @@
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/8'
|
ok('Great, you did it!', '/tutorial/html/8')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg8.png);">
|
<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg8.png);">
|
||||||
<div class="dialogue">
|
<div class="dialogue">
|
||||||
Now add a link to one of your list items. If nested properly, it should look something like this:
|
Now add a link to one of your list items. If nested properly, it should look something like this:
|
||||||
|
<br><strong><li><a href="http://yarn.com">Yarn</a></li></strong>
|
||||||
<li><a href="http://yarn.com">Yarn</a></li>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -29,11 +28,10 @@
|
||||||
var re = new XRegExp(match, 'gis')
|
var re = new XRegExp(match, 'gis')
|
||||||
|
|
||||||
if(html.match(re) === null) {
|
if(html.match(re) === null) {
|
||||||
alert("That's not right! Try again.")
|
notok("That's not right! Try again.")
|
||||||
} else {
|
} else {
|
||||||
alert('Great, you did it!')
|
|
||||||
sessionStorage.setItem('tutorialHtml', html)
|
sessionStorage.setItem('tutorialHtml', html)
|
||||||
window.location.href = '/tutorial/html/9'
|
ok('Great, you did it!', '/tutorial/html/9')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg9.png);">
|
<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg9.png);">
|
||||||
<div class="dialogue">
|
<div class="dialogue">
|
||||||
Good work! Everything you've written has been saved to index.html, which is the homepage people see when they visit your site.
|
Good work! Everything you've written has been saved to index.html, which is the first web page people see when they <a href="<%= current_site.uri %>">visit your site</a>.
|
||||||
</div>
|
</div>
|
||||||
<div class="dialogue" style="left: 280px;top: 140px">
|
<div class="dialogue" style="left: 280px;top: 140px">
|
||||||
You can find and edit index.html by visiting your Neocities dashboard.
|
You can find and edit index.html by visiting your <a href="/dashboard">Neocities dashboard</a>.
|
||||||
</div>
|
</div>
|
||||||
<div class="dialogue" style="left: 280px;top: 570px">
|
<div class="dialogue" style="left: 280px;top: 570px">
|
||||||
A cheat sheet of all the tags you've learned can be found in the tutorial section.
|
A cheat sheet of all the tags you've learned can be found in the tutorial section.
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</textarea>
|
</textarea>
|
||||||
<div class="error">
|
<div class="error" style="display: none; margin-top: 10px">
|
||||||
<i class="fa fa-exclamation-triangle"></i> Try again: make sure you change Hello World to something else.
|
<i class="fa fa-exclamation-triangle"></i> Try again: make sure you change Hello World to something else.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -42,6 +42,30 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var infoObj = $('.error')
|
||||||
|
|
||||||
|
function notok(msg) {
|
||||||
|
displayInfo('<i class="fa fa-exclamation-triangle"></i> ' + msg, {
|
||||||
|
background: '#93771B'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function ok(msg, path) {
|
||||||
|
displayInfo(msg, {
|
||||||
|
background: '#33CC33'
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
window.location.href = path
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayInfo(html, cssOpts) {
|
||||||
|
infoObj.fadeIn('slow')
|
||||||
|
infoObj.css(cssOpts)
|
||||||
|
infoObj.html(html)
|
||||||
|
}
|
||||||
|
|
||||||
$('.tutorial #submit').on('click', function() {
|
$('.tutorial #submit').on('click', function() {
|
||||||
var editor = $('#editor')
|
var editor = $('#editor')
|
||||||
var result = checkHomework(editor)
|
var result = checkHomework(editor)
|
||||||
|
@ -56,6 +80,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
$('.tutorial textarea').on('keypress keyup', function() {
|
$('.tutorial textarea').on('keypress keyup', function() {
|
||||||
|
$('.error').css('display', 'none')
|
||||||
refreshIframe()
|
refreshIframe()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue