(New Full Course Guide) CSIS 310 Study Solution Guideline

(New Full Course Guide) CSIS 310 Study Solution Guideline

$63.99
Skip to product information
(New Full Course Guide) CSIS 310 Study Solution Guideline

(New Full Course Guide) CSIS 310 Study Solution Guideline

$63.99

CSIS 310 Mindtap Star Dust Stories

Star Dust Stories | Dr. Andrew Weiss of Thomas & Lee College maintains an astronomy page called Star Dust Stories. One of the tools of the amateur stargazer is a planisphere, which is a handheld device composed of two flat disks: one disk shows a map of the constellations, and the other disk contains a window corresponding to the part of the sky that is visible at a given time and date. When a user rotates the second disk to the current date and time, the constellations that appear in the window corresponding to the constellations currently visible in the nighttime sky. Dr. Weiss has asked for your help in writing a JavaScript program to display a planisphere showing the constellations visible at the current date and time. He has created 24 different sky chart image files, named sd_sky0.png through sd_sky23.png, that represent 24 different rotations of the nighttime sky. He has also created an image containing a transparent window through which a user can view a selected sky chart. A preview of the completed web page is shown in the figure below.

 

Instructions

 

This Case Problem contains interactive instructions that you can complete to ensure you’ve completed the instruction correctly.

 

After reading each instruction thoroughly, perform the requested change in the code editor to the right. You can use the Build Website button to refresh your website preview at any point and view a full-page version of your website by clicking the arrow in the top right corner of your website preview.

 

After you’ve completed an instruction, click the corresponding check box in your list of instructions. This will trigger simulated tests of your website to ensure that you successfully completed the instruction.

 

HTML File:

 

Document Setup

 

Go to the sd_map.html and sd_mapper.js files and enter your name and the date in the comment section of each file.

 

Script Element

 

Go to the sd_map.html file. Directly above the closing </head> tag, insert a script element that links the page to the sd_mapper.js file. Defer the loading of the script file until after the rest of the web page is loaded by the browser.

 

JavaScript File

 

Go to the sd_mapper.js file. At the top of the file insert a statement to apply your JavaScript code with strict usage.

 

Variable Declaration

 

Declare a variable named thisTime containing a Date object for February 3, 2018 at 3:15:28 AM.

 

Use the toLocaleString() method to save the text of the thisTime variable in the timeStr variable.

 

Change the inner HTML code of the page element with the ID “timestamp” to the value of the timeStr variable.

 

Sky Map Variable

 

Next, you will determine which sky map to show in the web page. First, create a variable named thisHour, using the getHours() method to extract the hour value from the thisTime variable.

 

Create a variable named thisMonth using the getMonth() method to extract the month number from the thisTime variable.

 

The number of the map to use with the given hour and month is calculated with the formula (2×month + hour) % 24 where month is the value of the thisMonth variable and hour is the value of the thisHour variable. Store the value of this formula in the mapNum variable.

 

Sky Map HTML

 

You will use JavaScript to write the HTML code for the inline element showing the sky image to use in the web page. Create a variable named imgStr that stores the following text string

<img src=’sd_skyMap.png’ />

where Map is the value of the mapNum variable. (Hint: Use the + operator to combine text strings together and be sure to include the single quote character within the text strings.)

 

For the page element with the ID planisphere, use the insertAdjacentHTML() to insert the value of the imgStr variable directly after the element’s opening tag.

 

Add descriptive comments to the file, documenting your work.

 

Verify

 

Go to the sd_map.html file and click the “Build Website” button. Verify that your planisphere map and date and time resemble that shown in the figure below.

 

Final Modifications

 

Return to the sd_mapper.js file in your editor. Modify the command that creates the thisTime variable so that it uses the current date and time, whatever that may be.

 

Build

 

Re-open the sd_map.html file and and click the “Build Website” button. Verify that it shows the current date and time along with the star map for the sky at that moment.

 

FILES:

 

sd_base.css:

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 4

 

   Case Problem 1

 

   Star Dust Stories Base Style Sheet

 

   Filename: sd_base.css

 

*/

 

/* Basic styles to be used with all devices and under all conditions */

 

address, article, aside, blockquote, body, cite, 

 

div, dl, dt, dd, em, figcaption, figure, footer, 

 

h1, h2, h3, h4, h5, h6, header, html, img, 

 

li, main, nav, nav a, ol, p, section, span, ul {

 

   margin: 0;

 

   padding: 0;

 

   border: 0;

 

   font-size: 100%;

 

   vertical-align: baseline;

 

   background: transparent;

 

   -webkit-box-sizing: border-box;

 

   -moz-box-sizing: border-box;

 

   box-sizing: border-box;  

 

}

 

/* Set the default page element styles */

 

body {

 

   margin: 0px;

 

   width: 100%;

 

}

 

body {

 

   font-family: Verdana, Geneva, sans-serif;

 

   font-size: 100%;

 

   font-weight: inherit;

 

   line-height: 1.2em;

 

   margin: 0px;

 

   padding: 0px;

 

   text-decoration: none;

 

   vertical-align: baseline;

 

}

 

ul, ol {

 

   list-style: none;

 

}

 

nav ul {

 

   list-style: none;

 

   list-style-image: none;

 

}

 

nav a {

 

   text-decoration: none;

 

}

 

Sd_layout.css:

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 4

 

   Case Problem 1

 

   Star Dust Stories Layout Styles

 

   Filename: sd_layout.css

 

*/

 

html {

 

   background: url(sd_back.png) 100%/cover fixed;

 

}

 

strong {

 

   font-weight: bold;

 

}

 

p a {

 

   text-decoration: underline;

 

}

 

body {

 

   background: url(sd_stars.png) rgb(51, 51, 51);

 

   color: rgb(231, 231, 231);

 

   float: none;

 

   margin: 0px auto;

 

   width: 90%;

 

   max-width: 1000px;

 

   min-width: 640px;

 

   margin-top: 30px;

 

}

 

header {

 

   width: 100%;

 

}

 

header nav.horizontal {

 

   width: 100%;

 

}

 

header nav.horizontal li {

 

   background-color: rgb(41, 41, 41);

 

   display: block;

 

   font-family: Tahoma, Geneva, sans-serif;

 

   float: left;

 

   width: 16.66%;

 

}

 

header nav.horizontal li a {

 

   color: white;

 

   display: block;

 

   font-size: 0.8em;

 

   height: 50px; 

 

   letter-spacing: 0.1em;   

 

   line-height: 50px; 

 

   text-align: center;     

 

   width: 100%;

 

}

 

header nav.horizontal li a:visited, header nav.horizontal li a:link {

 

  color: white;

 

}

 

/* Navigation List Styles */

 

body > header a {

 

   background-color: rgb(51, 51, 51);  

 

   border: 5px outset rgb(211, 211, 255);   

 

}

 

body > header:active, body > header a:hover {

 

   background-color: rgb(51, 51, 151);

 

}

 

header img {

 

   clear: left;

 

   display: block;

 

   margin: 5px auto;

 

}

 

/* section layout */

 

section#left {

 

   float: left;

 

   width: 50%;

 

}

 

section#right {

 

   float: left;

 

   width: 50%;

 

}

 

footer {

 

   clear: left;

 

   width: 100%;

 

}

 

/* left section */

 

section#left article {

 

   width: 95%;

 

   margin: 0px auto;

 

}

 

section#left article h1 {

 

   font-size: 34px;

 

   font-family: ‘Courier New’, courier, monospace;

 

   font-weight: bold;

 

   margin: 20px 0px 20px 20px;

 

}

 

section#left article p {

 

   margin: 0px 0px 20px 20px;

 

   font-family: Verdana, Geneva, sans-serif;

 

}

 

/* right section */

 

div#planisphere {

 

   position: relative;

 

   width: 100%;

 

}

 

div#planisphere img {

 

   display: block;

 

   position: absolute;

 

   top: 40px;

 

   left: 10%;

 

   width: 75%;

 

}

 

div#timeStamp {

 

   position: absolute;

 

   top: 5px;

 

   left: 30%;

 

}

 

/* footer styles */

 

footer {

 

   border-top: 2px solid rgb(171, 171, 171);  

 

   clear: left;    

 

   margin-top: 15px;

 

   background-color: rgb(71, 71, 71);

 

   text-align: right;

 

}

 

footer, footer span  a {

 

   color: rgb(231, 231, 231);

 

   font-size: 11px;

 

   padding: 10px;

 

}

 

Sd_map.html:

 

<!DOCTYPE html>

 

<html lang=”en”>

 

<head>

 

   <!–

 

    New Perspectives on HTML5 and CSS3, 7th Edition

 

    Tutorial 9

 

    Case Problem 1

 

    Planisphere Web Page

 

    Author: Andrew Weiss

 

    Date:   2018-03-1  

 

    Filename: sd_map.html

 

   –>

 

   <meta charset=”utf-8? />

 

   <title>Star Dust Stories: Using a Planisphere</title>

 

   <link href=”sd_base.css” rel=”stylesheet” />

 

   <link href=”sd_layout.css” rel=”stylesheet” />

 

   <script src=”sd_mapper.js” defer></script>

 

</head>

 

<body>

 

   <header>

 

      <nav class=”horizontal”>

 

         <ul>

 

            <li><a href=”#”>Home</a></li>

 

            <li><a href=”#”>Astronomers</a></li>

 

            <li><a href=”#”>Moons</a></li>

 

            <li><a href=”#”>Planets</a></li>

 

            <li><a href=”#”>Stars</a></li>

 

            <li><a href=”#”>Physics</a></li>

 

         </ul>

 

      </nav>

 

      <img src=”sd_logo.png” alt=”SkyWeb” />

 

   </header>

 

   <section id=”left”>

 

      <article>

 

         <h1>The Planisphere</h1>

 

         <p>A <strong>planisphere</strong> is a visual aid to astronomers and stargazers. 

 

            It consists of two disks: One displays all of the visible 

 

            constellations in the night sky, and the other covers the first 

 

            and contains a window that indicates the portion of the sky currently 

 

            visible. The second disk is then rotated to match the current date and 

 

            time. Planispheres come in a variety of sizes and types. The important 

 

            thing to remember is that you must have a planisphere that matches 

 

            the longitude of your stargazing location.

 

         </p>

 

         <p>On the right is an online planisphere. It consists of two images laid on

 

            top of one another. The top image is the viewing disk of the planisphere. The

 

            bottom image contains the sky map. This planisphere is 

 

            automatically rotated for you, displaying the current date and time 

 

            and visible constellations for observers at a longitude of 

 

            40<sup>°</sup> North. To use a planisphere, hold directly overhead with

 

            the arrow facing north as indicated on the viewing disk.</p>

 

      </article>

 

   </section>

 

   <section id=”right”>

 

      <div id=”planisphere”>   

 

         <img id=”mask” src=”sd_mask.png” alt=”” />      

 

         <div id=”timeStamp”>March 1, 2018 4:53 PM</div>

 

      </div> 

 

   </section>

 

   <footer>

 

      Star Dust Stories © 2018 English (US) <span><a href=”#”>About</a>

 

      <a href=”#”>Developers</a> <a href=”#”>Privacy</a> 

 

      <a href=”#”>Terms</a> <a href=”#”>Help</a></span>

 

   </footer>

 

</body>

 

</html>

 

Sd_mapper.js:

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 9

 

   Case Problem 1

 

   Planisphere Script

 

   Author: 

 

   Date:   

 

*/

 

Tasks:

 

Complete the Variable Declaration step described above.

 

Complete the Sky Map Variable step described above.

 

Complete the Sky Map HTML step described above.

 

 

 

 

 

CSIS 310 Star Dust Stories

 

You May Also Like:

CSIS 310 Mindtap ACGIP Conference Professor Darshan Banerjee

CSIS 310 Mindtap  Slate & Pencil Tutoring

CSIS 310 Mindtap Voter Web

 

 

CSIS 310 Mindtap Voter Web

VoterWeb Pam Carls is a manager for the website Voter Web, which compiles voting totals and statistics from local and national elections. Pam has the results of recent congressional elections from eight districts in Minnesota stored as multidimensional arrays in a JavaScript file. Pam wants you to create a script displaying these results and calculating the vote percentage for each candidate within each race.

 

A preview of the home page is shown above.

 

The style sheets and graphic files have already been created for you. Your job is to write the HTML markup.

 

Instructions

 

This Review Assignment contains interactive instructions that you can complete to ensure you’ve completed the instruction correctly.

 

After reading each instruction thoroughly, perform the requested change in the code editor to the right. You can use the Build Website button to refresh your website preview at any point and view a full-page version of your website by clicking the arrow in the top right corner of your website preview.

 

After you’ve completed an instruction, click the corresponding check box in your list of instructions. This will trigger simulated tests of your website to ensure that you successfully completed the instruction.

 

HTML File

 

Setup

 

Enter your name and the date in the comment section of vw_election.html and vw_results.js.

 

Link JS Files

 

Open the vw_election.html file. Directly above the closing </head> tag, insert script elements to link the page to the vw_congminn.js and vw_results.js files in that order. Defer the loading and running of both script files until after the page has loaded.

 

Election Report

 

Scroll down the file and, directly above the footer, insert an empty section element. You will write the HTML code of the election report in this element.

 

JS File

 

Open the vw_congminn.js file and study the contents. Note that the file contains the results of 8 congressional elections in Minnesota. The candidate information is stored in multidimensional arrays named candidate, party, and votes. Do not make any changes to this file.

 

Variables

 

Next, go to the vw_results.js file. Declare a variable named reportHTML containing the following HTML text

 

<h1> title </h1>

 

JS File Continued

 

Rows Function

 

Next, create the candidateRows() function. The purpose of this function is to write individual table rows for each candidate, showing the candidate’s name, party affiliation, vote total, and vote percentage. The candidateRows() function has two parameters named raceNum and totalVotes. Place the commands in the following steps within this function.

 

Declare a local variable named rowHTML that will contain the HTML code for the table row. Set the initial value of this variable to an empty text string.

Create a for loop in which the counter variablej goes from 0 to 2 in steps of 1 unit. Within the for loop do the following:

Declare a variable named candidateName that retrieves the name of the current candidate and the current race. (Hint : Retrieve the candidate name from the multidimensional candidate array using the reference, candidate[raceNum][j].)

Declare a variable named candidateParty that retrieves the party affiliation of the current candidate in the current race from the multidimensional party array.

Declare a variable named candidateVotes that retrieves the votes cast for the current candidate in the current race from the multidimensional votes array.

Declare a variable named candidatePercent equal to the value returned by the calcPercent() function, calculating the percentage of votes received by the current candidate in the loop. Use candidateVotes as the first parameter value and totalVotes as the second parameter value.

Add the following HTML code to the value of the rowHTML variable

 

<tr>

<td> name ( party )</td>

<td> votes ( percent )</td>

</tr>

 

where name is the value of candidateName, party is the value of candidateParty, votes is the value of candidateVotes, and percent is the value of candidatePercent. Apply the toLocaleString() method to votes in order to display the vote total with a thousands separator. Apply the toFixed(1) method to percent in order to display percentage values to 1 decimal place.

 

Return the value of the rowHTML variable.

 

Task

 

Complete the Rows Function step described above.

 

HTML File Continued

 

Open vw_election.html Verify that the three candidate names, party affiliations, votes, and vote percentages are shown for each of the eight congressional races.

 

Bar Chart Function

 

Pam also wants the report to display the vote percentages as bar charts with the length of the bar corresponding to the percentage value. Return to the vw_results.js file. At the bottom of the file create a function named createBar() with one parameter named partyType. Add the commands described in the following steps to the function:

 

Declare a variable named barHTML and set its initial value to an empty text string.

Create a switch/case statement that tests the value of the partyType parameter.

If partyType equal “D” set barHTML equal to:

 

<td class= ‘ dem ‘ ></td>

 

If partyType equals “R” set barHTML equal to:

 

<td class= ‘ rep ‘ ></td>

 

Finally, if partyType equals “I” set barHTML to:

 

<td class= ‘ ind ‘ ></td>

 

Return the value of barHTML. Next, add these empty data cells to the race results table, with one cell for every percentage point cast for the candidate.

 

Bar Chart Creation

 

Scroll up to the candidateRows() function. Directly before the line that adds the HTML code </tr> to the value of the rowHTML variable, insert a for loop with a counter variable k that goes from 0 up to a value less than candidatePercent in increments of 1 unit. Each time through the loop call the createBar() function using candidateParty as the parameter value.

 

Task

 

Complete the Bar Chart Function step described above.

 

Wrapping Up

 

Verify

 

Add comments throughout the file with descriptive information about the variables and functions. Open vw_election.html and click the “Build Website” button. Verify that each election table shows a bar chart with different the length of bars representing each candidate’s vote percentage.

 

FILES:

 

vw_congminn.js

 

“use strict”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 10

 

   Case Problem 4

 

   Filename: vw_congminn.js 

 

   Variables:

 

   raceTitle

 

      Contains the title to be placed in the election results page

 

   race

 

      An array of race names

 

   candidate

 

      A multidimensional array showing the candidate names for each

 

      of the races

 

   party

 

      A multidimensional array showing the party afflilations for

 

      each candidate from each race

 

   votes

 

      A multidimensional array showing the votes for each 

 

      candidate from each race

 

*/

 

var raceTitle = “Minnesota Congressional Elections”;

 

var race = [“District 1”, “District 2”, “District 3”, “District 4”,

 

             “District 5”, “District 6”, “District 7”, “District 8”];

 

var candidate =

 

[

 

   [“Sanchez, Onita”, “Troutman, Rachel”, “Whitman, Gary”],

 

   [“Berk, Thomas”, “Chiang, Michael”, “Larson, Alicia”],

 

   [“Thomas, Howard”, “Olsen, Fred”, “Shapiro, Douglas”],

 

   [“Sweet, Alice”, “Grovener, Stewart”, “Reardin, Samuel”],

 

   [“Aitkens, Mary”, “Mundleberg, Linda”, “Ketrick, Rachel”],

 

   [“Nielsen, Kevin”, “Francis, Trevor”, “Inglessohn, Ray”],

 

   [“Pulaski, Stewart”, “Biersen, Nancy”, “Pope, Richard”],

 

   [“Venn, Michael”, “Ramirez, Juan”, “Zander, Audry”]

 

];

 

var party =

 

[

 

   [“D”, “R”, “I”],

 

   [“D”, “R”, “I”],

 

   [“D”, “R”, “I”],

 

   [“D”, “R”, “I”],

 

   [“D”, “R”, “I”],

 

   [“D”, “R”, “I”],

 

   [“D”, “R”, “I”],               

 

   [“D”, “R”, “I”]

 

 ];

 

 var votes = 

 

 [

 

   [193211, 142164, 22486],

 

   [164338, 193587, 42168],

 

   [159937, 222335, 23217],

 

   [216685, 123703, 21135],

 

   [262102, 100744, 27255],

 

   [174944, 179240, 11145],

 

   [197791, 114151, 15296],

 

   [191976, 161831, 4012],

 

 ];

 

vw_election.html:

 

<!DOCTYPE html>

 

<html lang=”en”>

 

<head>

 

   <!–

 

    New Perspectives on HTML5 and CSS3, 7th Edition

 

    Tutorial 10

 

    Case Problem 4

 

    VoterWeb Election Results

 

    Author: 

 

    Date:   

 

    Filename: vw_election.html

 

   –>

 

   <title>VoterWeb Election Results</title>

 

   <meta charset=”utf-8? />

 

   <link href=”vw_reset.css” rel=”stylesheet”  />

 

   <link href=”vw_styles.css” rel=”stylesheet”  />

 

</head>

 

<body>

 

   <header>   

 

      <img src=”vw_logo.png” alt=”Appalachian House” id=”logoImg” />  

 

      <nav class=”horizontal”>

 

         <ul>

 

            <li><a href=”#”>U.S. Congress</a></li>

 

            <li><a href=”#”>U.S. Senate</a></li>

 

            <li><a href=”#”>State Governors</a></li>

 

            <li><a href=”#”>Presidential</a></li>

 

            <li><a href=”#”>Timeline</a></li>

 

            <li><a href=”#”>Search</a></li>

 

         </ul>

 

      </nav>       

 

   </header>

 

   <nav class=”vertical”>

 

      <ul>

 

         <li><a href=”#”>Alabama</a></li>

 

         <li><a href=”#”>Alaska</a></li>

 

         <li><a href=”#”>Arizona</a></li>

 

         <li><a href=”#”>Arkansas</a></li>

 

         <li><a href=”#”>California</a></li>

 

         <li><a href=”#”>Colorado</a></li>

 

         <li><a href=”#”>Connecticut</a></li>

 

         <li><a href=”#”>Delaware</a></li>

 

         <li><a href=”#”>Florida</a></li>

 

         <li><a href=”#”>Georgia</a></li>

 

         <li><a href=”#”>Hawaii</a></li>

 

         <li><a href=”#”>Idaho</a></li>

 

         <li><a href=”#”>Illinois</a></li>

 

         <li><a href=”#”>Indiana</a></li>

 

         <li><a href=”#”>Iowa</a></li>

 

         <li><a href=”#”>Kansas</a></li>

 

         <li><a href=”#”>Kentucky</a></li>

 

         <li><a href=”#”>Louisiana</a></li>

 

         <li><a href=”#”>Maine</a></li>

 

         <li><a href=”#”>Maryland</a></li>

 

         <li><a href=”#”>Massachusetts</a></li>

 

         <li><a href=”#”>Michigan</a></li>

 

         <li><a href=”#”>Minnesota</a></li>

 

         <li><a href=”#”>Mississippi</a></li>

 

         <li><a href=”#”>Missouri</a></li>

 

         <li><a href=”#”>Montana</a></li>

 

         <li><a href=”#”>Nebraska</a></li>

 

         <li><a href=”#”>Nevada</a></li>

 

         <li><a href=”#”>New Hampshire</a></li>

 

         <li><a href=”#”>New Jersey</a></li>

 

         <li><a href=”#”>New Mexico</a></li>

 

         <li><a href=”#”>New York</a></li>

 

         <li><a href=”#”>North Carolina</a></li>

 

         <li><a href=”#”>North Dakota</a></li>

 

         <li><a href=”#”>Ohio</a></li>

 

         <li><a href=”#”>Oklahoma</a></li>

 

         <li><a href=”#”>Oregon</a></li>

 

         <li><a href=”#”>Pennsylvania</a></li>

 

         <li><a href=”#”>Rhode Island</a></li>

 

         <li><a href=”#”>South Carolina</a></li>

 

         <li><a href=”#”>South Dakota</a></li>

 

         <li><a href=”#”>Tennessee</a></li>

 

         <li><a href=”#”>Texas</a></li>

 

         <li><a href=”#”>Utah</a></li>

 

         <li><a href=”#”>Vermont</a></li>

 

         <li><a href=”#”>Virginia</a></li>

 

         <li><a href=”#”>Washington</a></li>

 

         <li><a href=”#”>West Virginia</a></li>

 

         <li><a href=”#”>Wisconsin</a></li>

 

         <li><a href=”#”>Wyoming</a></li>

 

       </ul>

 

    </nav>

 

   <footer>

 

      <p>VoterWeb © 2018 All Rights Reserved</p>

 

   </footer>

 

</body>

 

</html>

 

vw_reset.css:

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 10

 

   Case Problem 4

 

   VoterWeb Reset Style Sheet

 

   Filename: vw_reset.css

 

*/

 

/* Basic styles to be used with all devices and under all conditions */

 

article, aside, figcaption, figure,

 

footer, header, main, nav, section { 

 

   display: block;

 

}

 

address, article, aside, blockquote, body, cite, 

 

div, dl, dt, dd, em, figcaption, figure, footer, 

 

h1, h2, h3, h4, h5, h6, header, html, img, 

 

li, main, nav, nav a, ol, p, section, span, ul {

 

   margin: 0;

 

   padding: 0;

 

   border: 0;

 

   font-size: 100%;

 

   vertical-align: baseline;

 

   background: transparent;

 

   -webkit-box-sizing: border-box;

 

   -moz-box-sizing: border-box;

 

   box-sizing: border-box;  

 

}

 

/* Set the default page element styles */

 

body {

 

   line-height: 1.2em;

 

}

 

ul, ol {

 

   list-style: none;

 

}

 

nav ul {

 

   list-style: none;

 

   list-style-image: none;

 

}

 

nav a {

 

   text-decoration: none;

 

}

 

vw_results.js:

 

“use strict”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 10

 

   Case Problem 4

 

   Author: 

 

   Date:   

 

   Filename: vw_results.js

 

   Functions:

 

   The calcSum() function is a callback function used to

 

   calculte the total value from items within an array

 

   The calcPercent(value, sum) function calculates the percentage given

 

   a value and a sum

 

   The createBar(partyType, percent) function writes a different

 

   table data table based on the candidates party affilication.

 

*/

 

/* Callback Function to calculate an array sum */

 

function calcSum(value) {

 

   totalVotes += value;

 

}

 

/* Function to calculate a percentage */

 

function calcPercent(value, sum) {

 

   return (100*value/sum);

 

}

 

vw_styles.css:

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 10

 

   Case Problem 4

 

   VoterWeb General Style Sheet

 

   Filename: vw_styles.css

 

*/

 

/* HTML and Body Styles */

 

html {

 

   background: white;

 

   font-family: Verdana, Geneva, sans-serif;

 

   font-size: 12px;

 

}

 

body {

 

   background: #f2e6ca;

 

   max-width: 1200px;

 

   min-width: 420px;

 

   margin: 0px auto;

 

   border: 1px solid rgb(221, 221, 221);

 

   display: -webkit-flex;

 

   display: flex;

 

   -webkit-flex-flow: row wrap;

 

   flex-flow: row wrap;   

 

}

 

/* Header Styles */

 

body > header {

 

   width: 100%;   

 

}

 

img#logoImg {

 

   display: block;

 

   width: 100%;

 

}

 

/* Horizontal Navigation Styles */

 

nav.horizontal ul {

 

   display: -webkit-flex;

 

   display: flex;

 

   -webkit-flex-flow: row nowrap;

 

   flex-flow: row nowrap;

 

   -webkit-justify-content: center;

 

   justify-content: center;

 

   -webkit-align-items: center;

 

   align-items: center;

 

   background-color: rgb(51, 51, 51);

 

   height: 40px;

 

}

 

nav.horizontal ul li {

 

   -webkit-flex: 1 1 0px;

 

   flex: 1 1 0px;   

 

   margin: 10px;

 

}

 

nav.horizontal ul li a {

 

   color: rgb(211, 211, 255);

 

   display: block;

 

   font-size: 1.2em;

 

   text-align: center;

 

   padding: 50% 0%;

 

}

 

nav.horizontal ul li a:hover, nav.horizontal ul li a:active {

 

   color: rgb(255, 211, 211);

 

   text-shadow: 0px 0px 2px white, 0px 0px 8px white;

 

}

 

/* Vertical Navigation Styles */

 

nav.vertical {

 

   background: linear-gradient(to bottom right, rgb(151, 0, 51), rgb(51, 0, 151));

 

   padding-top: 10px;

 

   padding-left: 20px;

 

   padding-bottom: 10px;

 

   -webkit-flex: 0 0 300px;

 

   flex: 0 0 300px;

 

}

 

nav.vertical ul {

 

   -moz-column-width: 120px;

 

   -webkit-column-width: 120px;   

 

   column-width: 120px;

 

   -moz-column-gap: 10px;

 

   -webkit-column-gap: 10px;

 

    column-gap: 10px; 

 

}

 

nav.vertical ul li {

 

   line-height: 1.8em;

 

   font-size: 1.2em;

 

}

 

nav.vertical ul li a {

 

   color: rgb(211, 211, 211);

 

}

 

nav.vertical ul li a:hover {

 

   text-decoration: underline;

 

}

 

/* Section Styles */

 

section {

 

   -webkit-flex: 1 1 500px;

 

   flex: 1 1 500px;

 

   padding-left: 30px;

 

   padding-bottom: 10px;

 

}

 

section >  h1 {

 

   font-size: 3em;

 

   letter-spacing: 0.12em;

 

   line-height: 1.4em;

 

   font-weight: normal;

 

   color: rgb(42, 57, 144);

 

   font-family:Cambria, “Hoefler Text”, “Liberation Serif”, Times, “Times New Roman”, serif;

 

   text-shadow: rgb(51, 51, 51) 3px 3px 10px;

 

   margin: 10px 0px 20px 0px;

 

}

 

/* Voter Table Styles */

 

section table {

 

   margin: 10px 0px 5px 0px;

 

   border-collapse: collapse;

 

}

 

section table caption {

 

   font-family: Cambria, “Hoefler Text”, “Liberation Serif”, Times, “Times New Roman”, serif;

 

   color: rgb(42, 57, 144);

 

   font-size: 1.9em;

 

   text-align: left;

 

   font-weight: bold;

 

   letter-spacing: 0.08em;

 

   margin-bottom: 10px;

 

}

 

section table th, section table td {

 

   text-align: left;

 

}

 

section table tr:first-of-type th:last-of-type {

 

   text-align: right;

 

}

 

th {border-bottom: 1px solid black;}

 

section table tr td:first-of-type {

 

   width: 150px;

 

}

 

section table tr td:nth-of-type(2) {

 

   width: 150px;

 

   text-align: right;

 

   padding-right: 7px;

 

}

 

td.dem, td.rep, td.ind {

 

   width: 2px;

 

}

 

td.dem {background-color: rgba(0, 0, 255, 0.5);}

 

td.rep {background-color: rgba(255, 0, 0, 0.5);}

 

td.ind {background-color: rgba(0, 255, 0, 0.5);}

 

/* Footer Styles */

 

footer {

 

   width: 100%;

 

}

 

footer p {

 

   color: rgb(211, 211, 255);

 

   font-size: 0.9em;

 

   text-align: center;

 

   background-color: rgb(51, 51, 51);

 

   margin: 0px;

 

   padding: 10px 0px;

 

}

 

Tasks

 

Complete the Variables step described above.

 

Complete the For Loop step described above.

 

Complete the Rows Function step described above.

 

Complete the Bar Chart Function step described above.

 

 

 

 

 

CSIS 310 Voter Web

 

You May Also Like:

CSIS 310 Mindtap ACGIP Conference Professor Darshan Banerjee

CSIS 310 Mindtap  Slate & Pencil Tutoring

CSIS 310 Mindtap Star Dust Stories

 

 

CSIS 310 Mindtap Slate & Pencil Tutoring

Karen Cooke manages the website for Slate & Pencil Tutoring, an online tutoring service for high school and college students. Karen is overseeing the redesign of the website and has hired you to work on the layout of the site’s home page.

 

The image above shows a preview of the company’s home page that you’ll create.

 

The style sheets and graphic files have already been created for you. Your job is to write the HTML markup.

 

Instructions

 

This Case Problem contains interactive instructions that you can complete to ensure you’ve completed the instruction correctly.

 

After reading each instruction thoroughly, perform the requested change in the code editor to the right. You can use the Build Website button to refresh your website preview at any point and view a full-page version of your website by clicking the arrow in the top right corner of your website preview.

 

After you’ve completed an instruction, click the corresponding check box in your list of instructions. This will trigger simulated tests of your website to ensure that you successfully completed the instruction.

 

Document Setup

 

Adding Links

 

Enter your name and the date in the comment section of both sp_home.html and sp_layout.css

 

Go to the sp_home.html file. Within the document head, create links to the sp_base.css, sp_styles.css, and sp_layout.css style sheet files. Study the content and structure of the file.

 

 

CSS Styles

 

Body Styles

 

Go to the sp_layout.css file and then to the Window and Body Styles section. Create a style rule for the html element that sets the height of the browser window at 100%.

 

Create a style rule for the page body that sets the width to 95% of the browser window ranging from 640 pixels up to 960 pixels. Horizontally center the page body within the browser window. Finally, Karen wants to ensure that the height of the page body is always at least as high as the browser window itself. Set the minimum height of the browser window to 100%.

 

Create a style rule to apply the Border Box model to all header, ul, nav, li, and a elements in the document.

 

Row & Page Header Styles

 

Go to the Row Styles section. Karen has placed all elements that should be treated as grid rows in the row class. For every element of the row class, create a style rule that expands the element to cover any floating content within the element. (Hint: Use the technique shown in the tutorial that employs the after pseudo-element.)

 

Go to the Page Header Styles section. In this section, you will create styles for the content of the body header. Create a style rule for the logo image within the body header that displays the image as a block with a width of 70% of the header, floated on the left margin.

 

The header also contains a navigation list that Karen wants to display vertically. Create a style rule for the nav element within the body header that:

 

floats the navigation list on the left,

sets the size of the left and right padding to 2%,

sets the width of the navigation list to 30% of the width of the header.

 

The hypertext links in the navigation list should be displayed as blocks. Create a style rule for every a element in the header navigation list that displays the element as a block with a width of 100%.

 

Horizontal Navigation List Styles

 

Go to the Horizontal Navigation List Styles section. Karen has added a second navigation list that she wants to display horizontally. For all list items within the horizontal navigation list, create a style rule that displays the items as blocks with a width of 12.5% floated on the left margin.

 

HR Styles

 

Go to the HR Styles section. The hr element is used to display a horizontal divider between sections of the page. Add a style rule that sets the width of the hr element to 50%.

 

Footer Styles

 

Go to the Footer Styles section and create a style rule that displays the footer only when both margins are clear of floating objects.

 

Topics Styles

 

Go to the Topics Styles section. This section sets the styles for a list of four topics describing what the company is offering. Karen wants this list to also be displayed horizontally on the page. For list items within the ul element with the id topics, create a style rule to:

 

display the items as blocks with a width of 20%,

float the items on the left margin,

set the size of the left margin space to 0% and the right margin space to 1.5%.

 

Karen wants the topics list to be well away from the left and right edges of the page body. In the same section, create a rule that sets the size of the left margin of the first item in the topics list to 7.75% and sets the right margin of the last item to 7.75%.

 

In the same section, create a rule that displays the image within each list item in the topics list as a block with a width of 50% and centered within the list item block.

(Hint: Set the left and right margins to auto.)

 

Comment Styles

 

Go to the Customer Comment Styles section. In this section, you will create style rules for the customer comments displayed near the bottom of the page. For the ul element with the id comments, create a style rule that sets the width to 75% and centers the element by setting the top/bottom margin to 40 pixels and the left/right margin to auto.

 

Karen wants the list items to appear in two columns on the page. In the same section, create a style rule for every list item in the comments list that:

 

displays the item as a block with a width of 50% floated on the left and

sets the size of the bottom margin to 30 pixels.

 

Every customer comment is accompanied by an image of the student. Karen wants these images displayed to the left of the comment. Create a style rule to display the image within each comment list item as a block with a width of 20%, floated on the left, and with a left/right margin of 5%.

 

Create a style rule for every paragraph nested within a customer list item that floats the paragraph on the left margin with a width of 70%.

 

Verify

 

Open the sp_home.html file and click the green Build Website button at the bottom of the window. Verify that the layout and design styles resembles the finished website shown in the Introduction step.

 

FILES

sp_base.css

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 3

 

   Case Problem 1

 

   Base Style Sheet for the Slate & Pencil Website

 

   Filename: sp_base.css

 

*/

 

article, aside, figcaption, figure,

 

footer, header, main, nav, section { 

 

   display: block;

 

}

 

address, article, aside, blockquote, body, cite, 

 

div, dl, dt, dd, em, figcaption, figure, footer, 

 

h1, h2, h3, h4, h5, h6, header, html, img, 

 

li, main, nav, ol, p, section, span, ul {

 

   margin: 0;

 

   padding: 0;

 

   border: 0;

 

   font-size: 100%;

 

   vertical-align: baseline;

 

   background: transparent; 

 

}

 

nav ul {

 

   list-style: none;

 

   list-style-image: none;

 

}

 

nav a {

 

   text-decoration: none;

 

}

 

body {

 

   line-height: 1;

 

}

 

sp_home.html

 

<!DOCTYPE html>

 

<html>

 

<head>

 

   <!–

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 3

 

   Case Problem 1

 

   Slate & Pencil Home Page

 

   Author: 

 

   Date:   

 

   Filename: sp_home.html

 

   –>

 

   <meta charset=”utf-8? />

 

   <title>Slate & Pencil Tutoring</title>

 

</head>

 

<body>

 

   <header class=”row”>

 

      <img src=”sp_logo.png” alt=”Slate & Pencil Tutoring” />

 

      <nav>

 

         <ul>

 

            <li><a href=”#”>Home</a></li>

 

            <li><a href=”#”>Our Tutors</a></li>

 

            <li><a href=”#”>Pricing</a></li>

 

            <li><a href=”#”>Testimonials</a></li>

 

            <li><a href=”#”>Your Account</a></li>

 

            <li><a href=”#”>Chat Online</a></li>

 

         </ul>

 

      </nav>

 

   </header>

 

   <nav class=”horizontal”>

 

      <ul class=”row”>

 

         <li><a href=”#”>Math</a></li>

 

         <li><a href=”#”>Science</a></li>

 

         <li><a href=”#”>English</a></li>

 

         <li><a href=”#”>Languages</a></li>

 

         <li><a href=”#”>History</a></li>

 

         <li><a href=”#”>Sociology</a></li>

 

         <li><a href=”#”>Art</a></li>

 

         <li><a href=”#”>Other</a></li>

 

      </ul>

 

   </nav>

 

   <ul id=”topics” class=”row”>

 

      <li><img src=”sp_topic1.png” alt=”” />

 

           <p>Our tutors have advanced degrees, supplemented with real-world 

 

            experience to help you meet your education goals.</p>

 

      </li>

 

      <li><img src=”sp_topic2.png” alt=”” />

 

           <p>Every session is just you and your instructor and

 

            there is always someone online to help you. 24/7.</p>

 

      </li>

 

      <li><img src=”sp_topic3.png” alt=”” />

 

          <p>We cover it all: From from Biochemistry to

 

            Beethoven. We can also help you prep for the ACT, SAT, and AP

 

            exams.</p>

 

      </li>

 

      <li><img src=”sp_topic4.png” alt=”” />

 

          <p>We keep our prices low. Sign up for one-time assistance or enroll 

 

            for a full semester at greatly reduced rates.</p>

 

      </li>

 

   </ul>

 

   <hr />

 

   <ul id=”comments”>

 

      <li><img src=”sp_student1.png” alt=”” />

 

          <p>“Thanks to <em>Slate & Pencil</em> I passed AP Calculus 

 

            with a 5.”<br />

 

            <br />

 

            — Kevin, 12th Grade, Utah</p>

 

      </li>

 

      <li><img src=”sp_student2.png” alt=”” />

 

          <p>“I use <em>Slate & Pencil</em> all of the time to 

 

            supplement my lectures and course notes.”<br />

 

            <br />

 

            — Paul, 12th Grade, Texas</p>

 

      </li>

 

      <li><img src=”sp_student3.png” alt=”” />

 

          <p>“I’m making the honor roll for the first time thanks to 

 

            your wonderful service and help!”<br />

 

            <br />

 

            — Lisa, 11th Grade, Florida</p>

 

      </li>

 

      <li><img src=”sp_student4.png” alt=”” />

 

          <p>“Geometry is a breeze after working online with your great

 

            tutors and review materials.”<br />

 

            <br />

 

            — Karen, 9th Grade, Nebraska</p>

 

      </li>

 

      <li><img src=”sp_student5.png” alt=”” />

 

          <p>“I’ve seen a great improvement in my use of study time and 

 

            I retain more than ever before.”<br />

 

            <br />

 

            — Gianna, 10th Grade, Vermont</p>

 

      </li>

 

      <li><img src=”sp_student6.png” alt=”” />

 

          <p>“After using <em>Slate & Pencil</em>, my SAT and ACT 

 

            scores went through the roof!!!”<br />

 

            <br />

 

            — Todd, 11th Grade, Illinois</p>

 

      </li>

 

   </ul>

 

   <footer>

 

      Slate & Pencil Tutoring; © 2017 All Rights Reserved

 

   </footer>

 

</body>

 

</html>

 

sp_layout.css

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 3

 

   Case Problem 1

 

   Layout styles for Slate and Pencil Tutoring

 

   Author: 

 

   Date:   

 

   Filename: sp_layout.css

 

*/

 

/* Window and Body Styles */

 

/* Row Styles */

 

/* Page Header Styles */

 

/* Horizontal Navigation List Styles */

 

/* Topics Styles */

 

/* HR Styles */

 

/* Customer Comment Styles */

 

/* Footer Styles */

 

sp_logo.png

 

sp_student1.png

 

sp_student2.png

 

sp_student3.png

 

sp_student4.png

 

sp_student5.png

 

sp_student6.png

 

sp_styles.css

 

@charset “utf-8”;

 

/*

 

   New Perspectives on HTML5 and CSS3, 7th Edition

 

   Tutorial 3

 

   Case Problem 1

 

   Typographical styles for Slate and Pencil Tutoring

 

   Filename: sp_styles.css

 

*/

 

/* Window and Body Styles */

 

html {

 

   background-color: rgb(230, 182, 144);

 

}

 

body {

 

   background-color: rgb(250, 238, 218);

 

   font-family: Verdana, Geneva, Arial, sans-serif; 

 

}

 

/* Page Header Styles */

 

body > header {

 

   background-color: rgb(61, 138, 216);

 

}

 

body > header > nav a {

 

   font-size: 1em;

 

   margin: 0.4em 0;

 

   padding: 5px;

 

}

 

body > header > nav a:link, body > header > nav:visited {

 

   color: rgb(250, 238, 218);

 

}

 

body > header > nav a:hover, body > header > nav:active {

 

   background-color: rgba(0, 0, 0, 0.2);

 

}

 

/* Horizontal Navigation List Styles */

 

nav.horizontal ul li {

 

   background-color: rgb(18, 31, 102);  

 

   font-size: 0.9em;

 

   padding: 10px 0;

 

   text-align: center;     

 

}

 

nav.horizontal a:link, nav.horizontal a:visited {

 

   color: rgb(250, 238, 218);

 

}

 

nav.horizontal a:hover, nav.horizontal a:active {

 

   color: rgb(255, 255, 64);

 

}

 

/* Topics Styles */

 

   ul#topics {

 

   margin-top: 20px;

 

   margin-bottom: 20px;

 

}

 

ul#topics li p {

 

   color: rgb(95, 114, 232);

 

   font-size: 0.8em;

 

}

 

/* Customer Comment Styles */

 

ul#comments li p {

 

   font-size: 0.9em;

 

   color: rgb(121, 121, 121);

 

   line-height: 1.2em;

 

}

 

/* Footer Styles */

 

footer {

 

   color: rgb(186, 186, 156);

 

   background-color: rgb(44, 91, 169);

 

   font-size: 0.9em;

 

   padding: 10px 0px;

 

   text-align: center;

 

}

 

sp_topic1.png

 

sp_topic2.png

 

sp_topic3.png

 

sp_topic4.png

 

Tasks:

 

Complete the Adding Links step described above.

Complete the Body Styles step described above.

Complete the Row & Page Header Styles step described above.

Complete the Horizontal Navigation List Styles step described above.

Complete the HR Styles step described above.

Complete the Footer Styles step described above.

Complete the Topics Styles step described above.

Complete the Comments Styles step described above.

Conduct final test of the completed webpage.

 

 

 

 

 

CSIS 310 Slate Pencil Tutoring

 

You May Also Like:

CSIS 310 Mindtap ACGIP Conference Professor Darshan Banerjee

CSIS 310 Mindtap Voter Web

CSIS 310 Mindtap Star Dust Stories

 

 

CSIS 310 Mindtap ACGIP Conference Professor Darshan Banerjee

ACGIP Conference Professor Darshan Banerjee is the project coordinator for the annual conference of the Association of Computer Graphics and Image Processing (ACGIP), which takes place this year in Sante Fe, New Mexico. Darshan has asked you to work on the conference’s website, starting with the registration form for conference attendees. The initial form will collect contact information for people attending the conference. The figure below shows a preview of the form you will create for Darshan.

 

Professor Banerjee has already written the HTML code for the page and the styles for the form elements. He wants you to write the HTML code for the web form and the CSS validation styles.

 

Instructions

This Case Problem contains interactive instructions that you can complete to ensure you’ve completed the instruction correctly.

After reading each instruction thoroughly, perform the requested change in the code editor to the right. You can use the Build Website button to refresh your website preview at any point and view a full-page version of your website by clicking the arrow in the top right corner of your website preview.

 

Linking CSS Files

Open the cg_register.html and cg_validate.css file and enter your name and the date in the comment section of each file.

Open to the cg_register.html file and add a link to the cg_forms.css and cg_validate.css style sheet files to the document head.

 

Script & Form Elements

Add a script element to the document head that loads the cg_script.js file.

Scroll down to the section element and insert a web form element that employs the action at http://www.example.com/cg/register via the post method.

Add the labels and input boxes shown previously in the figure in the Introduction step and described in the figure below. Place the input boxes directly after the labels and associate each label with its input box control. You do not need to enclose the label and input elements with div elements.

 

Data List

Create a data list named titleList containing the suggestions: Mr., Mrs., Ms., Prof., Dr., Assist. Prof., and Assoc. Prof. Apply the titleList data list to the titleBox control.

 

Regex

Apply the regular expression pattern ^\d{10}$|^(\(\d{3}\)\s*)?\d{3}[\s-]?\d{4}$ to the phoneNumber field. Apply the regular expression pattern ^acgip\-\d{6}$ to the acgipID field. (Note: You can copy the regular expression code for the phoneNumber field from the cg_regex.txt file.)

 

Selection List

Add the Registration Category label associated with the regList control. Add a selection list with the ID regList that stores values in the registerType field. Populate the selection list with the option text: “ACGIP Member ($695)”, “Non-Member ($795)”, “Student ($310)”, “Poster ($95)”, and “Guest ($35)”. Make the corresponding option values equal to “member”, “nonmember”, “student”, “poster”, and “guest”.

Return to the cg_validate.css file to create styles for validating data entry.

 

Validation Style Rule

Within the Validation Style section, add the following style rules:

Display all input, select, and textarea elements that have the focus with a background color of rgb(245, 245, 140).

When the fnBox, lnBox, addBox, mailBox, phoneBox, and idBox controls have the focus and are valid, change the background color to rgb(220, 255, 220) and display the cg_valid.png image with no tiling in the right side of the background contained within the box.

When the fnBox, lnBox, addBox, mailBox, phoneBox, and idBox controls have the focus and are not valid, change the background color to rgb(255, 232, 232) and display the image cg_invalid.png with no tiling in the right side of the background contained within the box.

 

Verify

Open the cg_register.html file and click the “Build Website”. Verify that the content and layout of the form resemble that shown in the figure below.

Verify that you must enter all required field values in the proper format for the form to be submitted successfully. Confirm that the browser performs inline validation on the firstName, lastName, address, email, phoneNumber, and acgipID fields.

cg_back.png

 

cg_base.css

@charset “utf-8?;

 

/*

New Perspectives on HTML5 and CSS3, 7th Edition

Tutorial 7

Case Problem 1

 

ACGIP Base Style Sheet

 

Filename: cg_base.css

 

*/

 

/* Basic styles to be used with all devices and under all conditions */

 

article, aside, figcaption, figure,

footer, header, main, nav, section {

display: block;

}

 

address, article, aside, blockquote, body, cite,

div, dl, dt, dd, em, figcaption, figure, footer,

h1, h2, h3, h4, h5, h6, header, html, img,

li, main, nav, nav a, ol, p, section, span, ul,

table, tr, td, th, col, colgroup {

margin: 0;

padding: 0;

border: 0;

font-size: 100%;

background: transparent;

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;

}

 

/* Set the default page element styles */

 

body {

line-height: 1.2em;

}

 

ul, ol {

list-style: none;

}

 

nav ul {

list-style: none;

list-style-image: none;

}

 

nav a {

text-decoration: none;

}

 

cg_forms.css

/*

New Perspectives on HTML and CSS, 7th Edition

Tutorial 7

Case Problem 1

 

ACGIP Registration Form Style Sheet

 

Filename: cg_forms.css

 

*/

 

/* Form Layout Styles */

 

label {

display: block;

float: left;

clear: left;

margin: 5px;

width: 200px;

}

 

input, select, textarea {

display: block;

float: left;

margin: 5px 0px;

width: 200px;

}

 

textarea {

height: 100px;

}

 

form p {

clear: left;

text-align: center;

padding-top: 40px;

}

 

input[type=’submit’] {

background-color: rgb(144, 170, 144);

color: rgb(245,245,165);

border-radius: 20px;

float: none;

display: inline;

font-size: 1.1em;

height: 30px;

width: 150px;

}

 

cg_invalid.png

 

cg_logo.png

 

cg_regex.txt

New Perspectives on HTML and CSS, 7th Edition

Regular Expression Patterns

Tutorial 7

Case Problem 1

=============================================

 

Phone Number Regular Expression

^\d{10}$|^(\(\d{3}\)\s*)?\d{3}[\s-]?\d{4}$

 

cg_register.html

 

</html lang=”en”>

 

</link href=”cg_styles.css” rel=”stylesheet” ></link href=”cg_base.css” rel=”stylesheet” ></meta name=”viewport” content=”width=device-width, initial-scale=1? ></meta charset=”utf-8? >

 

      

</img src=”cg_logo.png” alt=”computer graphics and image processing” id=”logoimg” >

home page</a href=”#”>

keynote address</a href=”#”>

speakers</a href=”#”>

general session

abstracts</a href=”#”>

programs</a href=”#”>

workshops</a href=”#”>

committees

executive session</a href=”#”>

advisory council</a href=”#”>

travel info

accommodations</a href=”#”>

banquet</a href=”#”>

family attractions</a href=”#”>

registration

ACGIP home page

tour Sante Fe</a href=”#”>

links</a href=”#”>

</a href=”#”></li class=”newgroup”></a href=”#”></li class=”newgroup”></a href=”#”></li class=”newgroup”></a href=”#”></li class=”newgroup”></a href=”#”></li class=”newgroup”>

Conference Registration Form

 

Required Item (*)

 

ACGIP Member ($695)

Eligible to attend all sessions and banquet

Non-Member ($795)

Eligible to attend all sessions and banquet

Student ($310)

Eligible to attend all sessions. Proof of

student status required</a href=”#”>

Poster ($95)

Eligible to attend display hall and vendor stations

Guest ($35)

Eligible to attend banquet only

      Association of Computer Graphics and Image Processing

 

cg_script.js

/*

New Perspectives on HTML and CSS, 7th Edition

Tutorial 7

Case Problem 1

 

Filename: cg_script.js

 

Purpose: The purpose of this program is to verify that the form

passes an initial validation test.

 

When the form is submitted, the onsubmit event handler

verifies that the form data is complete and valid.

An alert box is displayed notifying the user.

 

The event function returns a value of false so that the

student does not have to continually retype test values

in the survey form.

 

*/

 

window.onload = init;

 

function init() {

document.forms[0].onsubmit = function() {

if (this.checkValidity()) alert(“Data passes initial validation tests”);

return false;

}

 

}

 

cg_styles.css

@charset “utf-8”;

 

/*

New Perspectives on HTML and CSS, 7th Edition

Tutorial 7

Case Problem 1

 

ACGIP General Style Sheet

 

Filename: cg_styles.css

 

*/

 

/* HTML and Body styles */

 

html {

background: rgb(51, 51, 51) url(cg_back.png);

font-family: Verdana, Geneva, sans-serif;

height: 100%;

}

 

body {

background-color: white;

box-shadow: black 20px 0px 40px,  black -20px 0px 40px;

border-left: 3px solid black;

border-right: 3px solid black;

display: -webkit-flex;

display: flex;

-webkit-flex-flow: row wrap;

flex-flow: row wrap;

margin: 0px auto;

min-width: 320px;

max-width: 1020px;

width: 100%;

}

 

/* Header styles */

 

header {

width: 100%;

}

 

header img#logoimg {

display: block;

width: 100%;

}

 

/* Navigation Styles */

 

nav {

width: 100%;

}

 

nav ul {

background: linear-gradient(to bottom, black, rgb(44, 70, 44));

 

-moz-column-width: 200px;

-webkit-column-width: 200px;

column-width: 200px;

 

-moz-column-gap: 25px;

-webkit-column-gap: 25px;

column-gap: 25px;

 

padding: 25px;

}

 

nav ul li.newgroup {

margin-top: 15px;

}

 

nav ul li a {

color: white;

text-decoration: none;

font-size: 0.9em;

}

 

nav a:hover {

color: rgb(191, 231, 191);

text-decoration: underline;

}

 

/* Section Styles */

 

section {

background: rgb(245,245,165);

-webkit-flex: 2 1 421px;

flex: 2 1 421px;

padding: 10px 20px 20px 40px;

}

 

section h1 {

font-family: Segoe, “Segoe UI”, “DejaVu Sans”, “Trebuchet MS”, Verdana, sans-serif;

font-size: 1.8em;

margin: 20px 0px 5px;

color: rgb(83, 183, 51);

}

 

section > p {

margin-bottom: 20px;

padding-bottom: 9px;

border-bottom: 3px solid rgb(83, 183, 51);

}

 

/* Aside Styles */

 

aside {

background: rgb(144, 170, 144);

color: white;

-webkit-flex: 1 2 220px;

flex: 1 2 220px ;

padding: 25px;

}

 

dt {

font-size: 1em;

border-bottom: 1px solid white;

font-weight: bold;

}

 

dd {

margin-bottom: 25px;

}

 

dl a {

color: gold;

}

 

/* Footer styles */

 

footer {

color: white;

background: rgb(44, 70, 44);

height: 70px;

padding-top: 20px;

text-align: center;

font-size: 0.9em;

width: 100%;

}

 

/* ===============================

Mobile Styles: 0px to 640px

===============================

*/

@media only screen and (max-width: 640px) {

 

section h1 {

font-size: 1.5em;

}

 

section p {

font-size: 0.9em;

}

 

nav {

-webkit-order: 99;

order: 99;

}

 

footer {

-webkit-order: 100;

order: 100;

}

}

 

/* =============================================

Tablet and Desktop Styles: greater than 640px

=============================================

*/

@media only screen and (min-width: 641px) {

 

}

 

cg_valid.png

 

cg_validate.css

/*

New Perspectives on HTML and CSS, 7th Edition

Tutorial 7

Case Problem 1

 

ACGIP Registration Validation Style Sheet

Author:

Date:

 

Filename: cg_validate.css

 

*/

 

/* Validation Styles */

 

Tasks:

 

Complete the Script & Form Elements

Complete the Data List step

Complete the Regex

Complete the Selection List

Complete the Submit Button

 

 

 

 

 

CSIS 310

 

You May Also Like:

CSIS 310 Mindtap  Slate & Pencil Tutoring

CSIS 310 Mindtap Voter Web

CSIS 310 Mindtap Star Dust Stories

Made with care

Great value

Elegant design

Quality materials

Details

This product is crafted with quality materials to ensure durability and performance. Designed with your convenience in mind, it seamlessly fits into your everyday life.

Shipping & Returns

We strive to process and ship all orders in a timely manner, working diligently to ensure that your items are on their way to you as soon as possible.

We are committed to ensuring a positive shopping experience for all our customers. If for any reason you wish to return an item, we invite you to reach out to our team for assistance, and we will evaluate every return request with care and consideration.

Play video