Cours web
Semaine 1: Introduction et HTML de base
Introduction à la création de site web
- Qu'est-ce qu'un site web?
- Pourquoi créer un site web?
- Qu'est-ce que le HTML, le CSS et le Javascript?
import { useEffect } from "react" | |
export function useDetectAppleDevice() { | |
const isMac = /(Mac|iPhone|iPod|iPad)/i.test(navigator.userAgent) | |
useEffect(() => { | |
if (isMac) { | |
document.documentElement.classList.add("apple-device") | |
} | |
}, [isMac]) |
import { useEffect, useRef } from 'react' | |
function usePrevious<T>(value: T): T { | |
const ref = useRef(value) | |
useEffect(() => { | |
ref.current = value | |
}, [value]) | |
return ref.current |
jest | |
.useFakeTimers({ now: currentDate, advanceTimers: true }) | |
.setSystemTime(currentDate) |
import { Children, FunctionComponent, ReactNode } from "react"; | |
export interface Props { | |
children: ReactNode; | |
reverse: boolean; | |
} | |
const ChildrenReversable: FunctionComponent<Props> = ({ children, reverse }) => { | |
const componentChildren = !reverse | |
? children |
import { ApolloServer } from '@apollo/server' | |
import { startStandaloneServer } from '@apollo/server/standalone' | |
// The GraphQL schema | |
const typeDefs = `#graphql | |
type Query { | |
hello: String | |
} | |
` |
jest.mock('fs') | |
import fs from 'fs' | |
const mockedFs = fs as jest.Mocked<typeof fs> | |
describe('fetch', () => { | |
describe('file exists', () => { | |
beforeEach(() => { | |
mockedFs.existsSync.mockImplementation(() => true) |
name: Merged | |
on: | |
pull_request: | |
branches: [main] | |
types: | |
- closed | |
jobs: | |
is_merged: |
<!DOCTYPE html"> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link href="css/style.css" rel="stylesheet" type="text/css" /> | |
<title>Exercice Sommatif 2</title> | |
</head> | |
<body> |
var int = setInterval(function() { | |
var yourName = "Polle" | |
var button = document.querySelector('#app > div.view.bg-background.bg-center.col-start-2 > div.grid.gap-2 > div > button') | |
if(button.disabled === false) { | |
clearInterval(int) | |
button.click() | |
window.focus() | |
setTimeout(function() { |