ITS290F Human Computer Interaction

news2025/2/1 19:12:43

ITS290F Human Computer Interaction & User Experience Design

Lab 1. Introduction to CodePen

What you’ll learn in this lab:

• Understanding CodePen

• Creating a front-end page

• Using Google form to submit your lab work

CodePen is a cloud-based integrated development environment (IDE) for writing and sharing front-end code. It would be useful for us to try out our code in certain lab practices. 

1. Sign up CodePen  

Sign up a CodePen free account

1. Visit http://codepen.io .

2. Sign up with email or your preferred methods, as shown in Figure 1. 

3. Check your mailbox to activate your account, if applicable.

4. Login CodePen with your login credentials.

FIGURE 1

CodePen sign up page.

2. Understanding the CodePen Editor

Figure 2 shows the user interface of the CodePen Editor. It consists of 3 editor panels for HTML, CSS and JS that you can edit your code and scripts, and a live preview panel that shows the resulting webpage of your code. 

FIGURE 2

CodePen Editor.

TRY IT YOURSELF

Taking an Editor Tour

CodePen provides an online tutorial for you to get familiar with the user interface of the CodePen editor:

1. Go to https://codepen.io/pen/tour/welcome/start .

2. Follow the instructions and try it out.

3. Lab Exercises

On your own, spend time becoming familiar with the CodePen interface. For this part, practice creating a Pen and attempting to finish the exercises.

You need to answer the follow-up questions and submit your answers (see submission section).

Exercise 1

Create buttons that change the color of an HTML paragraph.

1. Create a new Pen.

2. Put the following code into the HTML window

<p id='hello'>Hello, World!</p>

<button onclick=changeColor('red')>Red</button>

3. Put the following code into the JS window

function changeColor(color) {

 document.getElementById('hello').style.color=color;

}

4. Save and try clicking the “Red” button.

5. Add two buttons for changing color of “Hello, World” to green and blue.

6. Save and try clicking the new buttons.

Follow-up Questions

Q1. How many buttons you see on the screen?

Q2. A function is called when you click on the button. What is the name of the function?

Q3. The function uses a reference ID to lookup for the HTML <p> element. What is the ID?

Exercise 2

Learn reading JS reference from w3schools and create buttons that change the font style and weight of an HTML paragraph.

1. Continue to work on the code of Exercise 1. Add two buttons for changing the font style of “Hello, World” with Normal and Italic styles.

2. Create a new JS function with a parameter called changeFontStyle(style) .

3. Study the fontStyle property of JS on w3schools JSreference(https://www.w3schools.com/jsref/prop_style_fontstyle.asp) and complete the function.

4. Associate the new function with the corresponding parameters to the onClick event of the new buttons. Save and try clicking the new buttons.

5. Add three buttons for changing the font size of “Hello, World” with size “x-large”, “250%”, and “100px”. The outcome of the page should look like the follows:

6. Create a new JS function with a parameter called changeFontSize(size) . 

7. Study the fontSize property of JS on w3schools JS reference /prop_sand complete the function.

8. Associate the new function with the corresponding parameters to the onClick event of the new buttons. Save and try clicking the new buttons.

Follow-up Questions

Q4. On the page, which font size property value produces largest font size?

Q5. Submit your solution HTML code of Exercise 2. The first line is given to you.

<p id='hello'>Hello, World!</p>

...

Q6. Submit your solution JS code of Exercise 2. The first function is given to you.

function changeColor(color) {

 document.getElementById('hello').style.color=color;

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2289421.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【详细教程】如何在Mac部署Deepseek R1?

DeepSeek是目前最火的国产大模型&#xff0c;官方App用户太多服务经常出现卡顿&#xff0c;部署一个本地DeepSeek R1可以方便使用。 1.系统最低要求 macOS 11 Big Sur 或更新 2.下载ollama https://ollama.com/ 3.安装DeepSeek R1 打开终端 运行命令 ollama run deepseek-…

DeepSeek能下围棋吗?(续)

休息了一下&#xff0c;接着琢磨围棋&#xff0c;其实前面一篇里的规则有个漏洞的&#xff0c;就是邻居关系定义有问题&#xff0c;先回顾一下游戏规则&#xff1a; 游戏规则 定义&#xff1a; 1.数字对&#xff0c;是指两个1到9之间的整数组成的有序集合。可与记为(m,n)&…

【产品经理学习案例——AI翻译棒出海业务】

前言&#xff1a; 本文主要讲述了硬件产品在出海过程中&#xff0c;翻译质量、翻译速度和本地化落地策略是硬件产品规划需要考虑的核心因素。针对不同国家&#xff0c;需要优化翻译质量和算法&#xff0c;关注市场需求和文化差异&#xff0c;以便更好地满足当地用户的需求。同…

被裁与人生的意义--春节随想

还有两个月就要被迫离开工作了十多年的公司了&#xff0c;不过有幸安安稳稳的过了一个春节&#xff0c;很知足! 我是最后一批要离开的&#xff0c;一百多号同事都没“活到”蛇年。看着一批批仁人志士被“秋后斩首”&#xff0c;马上轮到我们十来个&#xff0c;个中滋味很难言清…

4-图像梯度计算

文章目录 4.图像梯度计算(1)Sobel算子(2)梯度计算方法(3)Scharr与Laplacian算子4.图像梯度计算 (1)Sobel算子 图像梯度-Sobel算子 Sobel算子是一种经典的图像边缘检测算子,广泛应用于图像处理和计算机视觉领域。以下是关于Sobel算子的详细介绍: 基本原理 Sobel算子…

【算法设计与分析】实验5:贪心算法—装载及背包问题

目录 一、实验目的 二、实验环境 三、实验内容 四、核心代码 五、记录与处理 六、思考与总结 七、完整报告和成果文件提取链接 一、实验目的 掌握贪心算法求解问题的思想&#xff1b;针对不同问题&#xff0c;会利用贪心算法进行问题建模、求解以及时间复杂度分析&#x…

MySQL为什么默认引擎是InnoDB ?

大家好&#xff0c;我是锋哥。今天分享关于【MySQL为什么默认引擎是InnoDB &#xff1f;】面试题。希望对大家有帮助&#xff1b; MySQL为什么默认引擎是InnoDB &#xff1f; 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 MySQL 默认引擎是 InnoDB&#xff0c;主要…

【AIGC专栏】AI在自然语言中的应用场景

ChatGPT出来以后&#xff0c;突然间整个世界都非常的为之一惊。很多人大喊AI即将读懂人类&#xff0c;虽然这是一句夸大其词的话&#xff0c;但是经过未来几十年的迭代&#xff0c;ChatGPT会变成什么样我们还真的很难说。在当前生成式内容来说&#xff0c;ChatGPT毫无疑问在当前…

docker安装nacos2.2.4详解(含:nacos容器启动参数、环境变量、常见问题整理)

一、镜像下载 1、在线下载 在一台能连外网的linux上执行docker镜像拉取命令 docker pull nacos:2.2.4 2、离线包下载 两种方式&#xff1a; 方式一&#xff1a; -&#xff09;在一台能连外网的linux上安装docker执行第一步的命令下载镜像 -&#xff09;导出 # 导出镜像到…

使用 postman 测试思源笔记接口

思源笔记 API 权鉴 官方文档-中文&#xff1a;https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md 权鉴相关介绍截图&#xff1a; 对应的xxx&#xff0c;在软件中查看 如上图&#xff1a;在每次发送 API 请求时&#xff0c;需要在 Header 中添加 以下键值对&a…

51单片机开发——I2C通信接口

I2C是微电子通信控制领域广泛采用的一种总线标准。 起始和停止信号&#xff1a; void iic_start(void) {IIC_SDA1;//如果把该条语句放在SCL后面&#xff0c;第二次读写会出现问题delay_10us(1);IIC_SCL1;delay_10us(1);IIC_SDA0; //当SCL为高电平时&#xff0c;SDA由高变为低d…

【网络】3.HTTP(讲解HTTP协议和写HTTP服务)

目录 1 认识URL1.1 URI的格式 2 HTTP协议2.1 请求报文2.2 响应报文 3 模拟HTTP3.1 Socket.hpp3.2 HttpServer.hpp3.2.1 start()3.2.2 ThreadRun()3.2.3 HandlerHttp&#xff08;&#xff09; 总结 1 认识URL 什么是URI&#xff1f; URI 是 Uniform Resource Identifier的缩写&…

优雅管理Python2 and python3

python2 和 python3&#xff0c; 由于没有像其他软件的向下兼容&#xff0c;必须同时安装Python2 和Python3 &#xff0c;介绍在linux和windows下优雅管理。 一、linux中安装Python2和Python3 linux 中用conda 创建虚拟环境&#xff0c;来管理不同版版工具 由于主流使用Python3…

Python从0到100(八十六):神经网络-ShuffleNet通道混合轻量级网络的深入介绍

前言&#xff1a; 零基础学Python&#xff1a;Python从0到100最新最全教程。 想做这件事情很久了&#xff0c;这次我更新了自己所写过的所有博客&#xff0c;汇集成了Python从0到100&#xff0c;共一百节课&#xff0c;帮助大家一个月时间里从零基础到学习Python基础语法、Pyth…

大模型本地化部署(Ollama + Open-WebUI)

文章目录 环境准备下载Ollama模型下载下载Open-WebUI 本地化部署的Web图形化界面本地模型联网查询安装 Docker安装 SearXNG本地模型联网查询 环境准备 下载Ollama 下载地址&#xff1a;Ollama网址 安装完成后&#xff0c;命令行里执行命令 ollama -v查看是否安装成功。安装成…

【Linux系统】进程间通信:共享内存

认识共享内存 通过 一些系统调用&#xff0c;在物理内存中开辟一块空间&#xff0c;然后将该空间的起始地址&#xff0c;通过页表映射到两个进程的虚拟地址空间的共享区中&#xff0c;这样不就共享了一块空间吗&#xff01;&#xff01;&#xff01; 这种技术就是共享内存&am…

渗透测试之WAF组合条件绕过方式手法详解以及SQL注入参数污染绕过

目录 组合绕过waf ​先看一些语句 绕过方式 我给出的注入语句是&#xff1a; 这里要注意的几点是&#xff1a; 组合绕过方式 完整过狗注入语句集合 http请求分块传输方法 其它方式绕过 http参数污染绕过waf 面试题:如何参数污染绕过waf 可以通过http参数污染绕过wa…

oracl:多表查询>>表连接[内连接,外连接,交叉连接,自连接,自然连接,等值连接和不等值连接]

SQL&#xff08;Structured Query Language&#xff0c;结构化查询语言&#xff09;是一种用于管理和操作关系数据库的标准编程语言。 sql分类: 数据查询语言&#xff08;DQL - Data Query Language&#xff09; 查询的关键词 select 多表查询>>表连接 表连接: 把2个…

ARIMA详细介绍

ARIMA&#xff08;AutoRegressive Integrated Moving Average&#xff0c;自回归积分滑动平均模型&#xff09;是一种用于时间序列分析和预测的统计模型。它结合了自回归&#xff08;AR&#xff09;、差分&#xff08;I&#xff09;和移动平均&#xff08;MA&#xff09;三种方…

飞致云开源社区月度动态报告(2025年1月)

自2023年6月起&#xff0c;中国领先的开源软件公司飞致云以月度为单位发布《飞致云开源社区月度动态报告》&#xff0c;旨在向广大社区用户同步飞致云旗下系列开源软件的发展情况&#xff0c;以及当月主要的产品新版本发布、社区运营成果等相关信息。 飞致云开源运营数据概览&…